本文整理汇总了Java中com.taobao.tddl.optimizer.core.plan.query.IQuery.getDataNode方法的典型用法代码示例。如果您正苦于以下问题:Java IQuery.getDataNode方法的具体用法?Java IQuery.getDataNode怎么用?Java IQuery.getDataNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.optimizer.core.plan.query.IQuery
的用法示例。
在下文中一共展示了IQuery.getDataNode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canComposeOneSql
import com.taobao.tddl.optimizer.core.plan.query.IQuery; //导入方法依赖的package包/类
protected boolean canComposeOneSql(IDataNodeExecutor executor) {
if (executor instanceof IQuery) {
IQuery iq = (IQuery) executor;
IQueryTree iqc = iq.getSubQuery();
if (iqc == null) {
return true;
}
String groupNode1 = iq.getDataNode();
String groupNode2 = iqc.getDataNode();
if (TStringUtil.equals(groupNode1, groupNode2)) {
return isConsistent(iqc, groupNode1);
} else {
return false;
}
} else {
return true;
}
}
示例2: buildTableAndMeta
import com.taobao.tddl.optimizer.core.plan.query.IQuery; //导入方法依赖的package包/类
protected void buildTableAndMeta(IQuery query, TableAndIndex tableAndIndex, ExecutionContext executionContext)
throws TddlException {
String indexName = query.getIndexName();
String groupDataNode = query.getDataNode();
nestBuildTableAndSchema(groupDataNode, tableAndIndex, executionContext, indexName, query.getTableName(), true);
}
示例3: isCondensable
import com.taobao.tddl.optimizer.core.plan.query.IQuery; //导入方法依赖的package包/类
private boolean isCondensable(IDataNodeExecutor executor, String lastGroupNode) {
if (executor instanceof IQuery) {
IQuery iq = (IQuery) executor;
IQueryTree iqc = iq.getSubQuery();
if (iqc == null) {
return true;
}
String groupNode1 = lastGroupNode;
if (groupNode1 == null) {
groupNode1 = iq.getDataNode();
}
String groupNode2 = iqc.getDataNode();
if (TStringUtil.equals(groupNode1, groupNode2)) {
return isCondensable(iqc, groupNode1);
} else {
return false;
}
} else if (executor instanceof IJoin) {
IJoin ijoin = (IJoin) executor;
String leftNode = ijoin.getLeftNode().getDataNode();
String rightNode = ijoin.getRightNode().getDataNode();
if (leftNode == null || rightNode == null) {
return false;
} else if (!leftNode.equals(rightNode)) {
return false;
}
if (ijoin.getLeftNode() instanceof IMerge || ijoin.getRightNode() instanceof IMerge) {
return false;
}
boolean leftJoin = true;
boolean rightJoin = true;
if (ijoin.getLeftNode() instanceof IJoin) {
leftJoin = isCondensable(ijoin.getLeftNode(), leftNode);
}
if (ijoin.getRightNode() instanceof IJoin) {
rightJoin = isCondensable(ijoin.getRightNode(), rightNode);
}
return leftJoin & rightJoin;
} else if (executor instanceof IPut) {
// 目前put操作一定是单库的
return true;
} else {
return false;
}
}
示例4: buildTableAndMeta
import com.taobao.tddl.optimizer.core.plan.query.IQuery; //导入方法依赖的package包/类
protected void buildTableAndMeta(IQuery query, ExecutionContext executionContext) throws TddlException {
String indexName = query.getIndexName();
String groupDataNode = query.getDataNode();
nestBuildTableAndSchema(groupDataNode, executionContext, indexName, query.getTableName(), true);
}
示例5: buildTableAndMetaLogicalIndex
import com.taobao.tddl.optimizer.core.plan.query.IQuery; //导入方法依赖的package包/类
/**
* 取逻辑indexKey,而非实际index
*
* @param query
* @param executionContext
* @throws Exception
*/
protected void buildTableAndMetaLogicalIndex(IQuery query, TableAndIndex tableAndIndex,
ExecutionContext executionContext) throws TddlException {
String indexName = query.getIndexName();
String groupDataNode = query.getDataNode();
nestBuildTableAndSchema(groupDataNode, tableAndIndex, executionContext, indexName, query.getTableName(), true);
}
示例6: buildTableAndMetaLogicalIndex
import com.taobao.tddl.optimizer.core.plan.query.IQuery; //导入方法依赖的package包/类
/**
* 取逻辑indexKey,而非实际index
*
* @param query
* @param executionContext
* @throws Exception
*/
protected void buildTableAndMetaLogicalIndex(IQuery query, ExecutionContext executionContext) throws TddlException {
String indexName = query.getIndexName();
String groupDataNode = query.getDataNode();
nestBuildTableAndSchema(groupDataNode, executionContext, indexName, query.getTableName(), true);
}