本文整理汇总了Java中com.taobao.tddl.optimizer.core.ast.DMLNode类的典型用法代码示例。如果您正苦于以下问题:Java DMLNode类的具体用法?Java DMLNode怎么用?Java DMLNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DMLNode类属于com.taobao.tddl.optimizer.core.ast包,在下文中一共展示了DMLNode类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildExistSequenceVal
import com.taobao.tddl.optimizer.core.ast.DMLNode; //导入依赖的package包/类
protected void buildExistSequenceVal() {
// 如果子节点中有一个是聚合查询,则传递到父节点
for (ASTNode sub : this.getNode().getChildren()) {
if (sub instanceof QueryTreeNode) {
if (((QueryTreeNode) sub).isExistSequenceVal()) {
setExistSequenceVal();
return;
}
} else if (sub instanceof DMLNode) {
if (((DMLNode) sub).isExistSequenceVal()) {
setExistSequenceVal();
return;
}
}
}
}
示例2: shard
import com.taobao.tddl.optimizer.core.ast.DMLNode; //导入依赖的package包/类
public static ASTNode shard(ASTNode dne, Map<Integer, ParameterContext> parameterSettings,
Map<String, Object> extraCmd) throws QueryException {
if (dne instanceof DMLNode) {
if (dne instanceof InsertNode) {
return shardInsert((InsertNode) dne, parameterSettings, extraCmd);
}
if (dne instanceof UpdateNode) {
return shardUpdate((UpdateNode) dne, parameterSettings, extraCmd);
}
if (dne instanceof DeleteNode) {
return shardDelete((DeleteNode) dne, parameterSettings, extraCmd);
}
if (dne instanceof PutNode) {
return shardPut((PutNode) dne, parameterSettings, extraCmd);
}
}
if (dne instanceof QueryTreeNode) {
return shardQuery((QueryTreeNode) dne, parameterSettings, extraCmd);
}
return dne;
}
示例3: setExecuteOn
import com.taobao.tddl.optimizer.core.ast.DMLNode; //导入依赖的package包/类
/**
* 递归设置executeOn
*/
private static void setExecuteOn(DMLNode dne, String dataNode) {
QueryTreeNode qtn = dne.getNode();
if (qtn != null) {
setExecuteOn(qtn, dataNode);
}
qtn = dne.getSelectNode();
if (qtn != null) {
setExecuteOn(qtn, dataNode);
}
}
示例4: opitmize
import com.taobao.tddl.optimizer.core.ast.DMLNode; //导入依赖的package包/类
public static ASTNode opitmize(ASTNode node, Parameters parameters, Map<String, Object> extraCmd)
throws OptimizerException {
if (node instanceof DMLNode) {
findDML((DMLNode) node, parameters);
} else {
findQuery((QueryTreeNode) node, parameters);
}
return node;
}
示例5: assignmentSubquery
import com.taobao.tddl.optimizer.core.ast.DMLNode; //导入依赖的package包/类
@Override
public IFunction assignmentSubquery(ASTNode node, Map<Long, Object> subquerySettings, Map<String, Object> extraCmd)
throws OptimizerException {
if (node instanceof QueryTreeNode) {
return SubQueryPreProcessor.assignmentSubqueryOnFilter((QueryTreeNode) node, subquerySettings);
} else if (node instanceof DMLNode) {
return SubQueryPreProcessor.assignmentSubqueryOnFilter(((DMLNode) node).getNode(), subquerySettings);
}
return null;
}
示例6: shard
import com.taobao.tddl.optimizer.core.ast.DMLNode; //导入依赖的package包/类
public static ASTNode shard(ASTNode dne, Parameters parameterSettings, Map<String, Object> extraCmd) {
try {
// 针对非batch,绑定变量后,优化语法树
if (parameterSettings == null || parameterSettings != null && !parameterSettings.isBatch()) {
dne.assignment(parameterSettings);// null也要做一次,可能存在nextval
// 绑定变量后,再做一次
if (dne instanceof DMLNode) {
((DMLNode) dne).setNode((TableNode) FilterPreProcessor.optimize(((DMLNode) dne).getNode(),
false,
extraCmd));
} else if (dne instanceof QueryTreeNode) {
dne = FilterPreProcessor.optimize(((QueryTreeNode) dne), false, extraCmd);
}
}
if (dne instanceof LoadDataNode) {
return shardLoad((LoadDataNode) dne, parameterSettings, extraCmd);
}
if (dne instanceof DMLNode) {
if (dne instanceof InsertNode) {
return shardInsert((InsertNode) dne, parameterSettings, extraCmd);
}
if (dne instanceof UpdateNode) {
return shardUpdate((UpdateNode) dne, parameterSettings, extraCmd);
}
if (dne instanceof DeleteNode) {
return shardDelete((DeleteNode) dne, parameterSettings, extraCmd);
}
if (dne instanceof PutNode) {
return shardPut((PutNode) dne, parameterSettings, extraCmd);
}
} else if (dne instanceof QueryTreeNode) {
return shardQuery((QueryTreeNode) dne, parameterSettings, extraCmd, true);
}
} catch (EmptyResultFilterException e) {
e.setAstNode(dne);
throw e;
}
return dne;
}
示例7: shard
import com.taobao.tddl.optimizer.core.ast.DMLNode; //导入依赖的package包/类
private ASTNode shard(DMLNode qtn) {
return DataNodeChooser.shard(qtn, null, null);
}