use of com.alibaba.maxgraph.compiler.tree.TreeBuilder in project GraphScope by alibaba.
the class LogicalPlanOptimizer method build.
/**
* Build dfs traversal to query flow
*
* @param dfsTraversal The given dfs traversal
* @return The result query flow
*/
public QueryFlowManager build(DfsTraversal dfsTraversal) {
TreeBuilder treeBuilder = TreeBuilder.newTreeBuilder(schema, optimizeConfig, this.lambdaEnableFlag);
treeBuilder.setDisableBarrierOptimizer(true);
TreeManager treeManager = dfsTraversal.buildDfsTree(treeBuilder, schema);
if (this.globalPullGraphFlag) {
treeManager.getQueryConfig().addProperty(CompilerConstant.QUERY_GRAPH_PULL_ENABLE, true);
}
LogicalQueryPlan logicalQueryPlan = LogicalPlanBuilder.newBuilder().build(treeManager);
logicalQueryPlan = logicalQueryPlan.chainOptimize();
QueryFlowBuilder queryFlowBuilder = new QueryFlowBuilder();
QueryFlowManager queryFlowManager = queryFlowBuilder.prepareQueryFlow(logicalQueryPlan, snapshotId);
queryFlowManager.validQueryFlow();
return queryFlowManager;
}
use of com.alibaba.maxgraph.compiler.tree.TreeBuilder in project GraphScope by alibaba.
the class LogicalPlanOptimizer method build.
public QueryFlowManager build(GraphTraversal traversal) {
TreeBuilder treeBuilder = TreeBuilder.newTreeBuilder(schema, optimizeConfig, lambdaEnableFlag);
TreeManager treeManager = treeBuilder.build(traversal);
if (this.globalPullGraphFlag) {
treeManager.getQueryConfig().addProperty(CompilerConstant.QUERY_GRAPH_PULL_ENABLE, true);
}
treeManager.optimizeTree();
LogicalQueryPlan logicalQueryPlan = LogicalPlanBuilder.newBuilder().build(treeManager);
logicalQueryPlan = logicalQueryPlan.chainOptimize();
QueryFlowBuilder queryFlowBuilder = new QueryFlowBuilder();
QueryFlowManager queryFlowManager = queryFlowBuilder.prepareQueryFlow(logicalQueryPlan, snapshotId);
queryFlowManager.validQueryFlow();
return queryFlowManager;
}
use of com.alibaba.maxgraph.compiler.tree.TreeBuilder in project GraphScope by alibaba.
the class MixedOpProcessor method buildCostPathList.
private List<String> buildCostPathList(GraphTraversal traversal) {
TreeBuilder treeBuilder = TreeBuilder.newTreeBuilder(this.schemaFetcher.getSchemaSnapshotPair().getLeft(), new OptimizeConfig(), true);
TreeManager treeManager = treeBuilder.build(traversal);
treeManager.optimizeTree();
CostModelManager costModelManager = treeManager.optimizeCostModel();
List<CostPath> pathList = costModelManager.getPathList();
if (pathList == null || pathList.isEmpty()) {
return Lists.newArrayList();
}
return pathList.stream().map(CostPath::toString).collect(Collectors.toList());
}
Aggregations