本文整理匯總了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);
}