use of com.alibaba.maxgraph.compiler.logical.VertexIdManager in project GraphScope by alibaba.
the class TokenTreeNode method buildLogicalQueryPlan.
@Override
public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {
TreeNodeLabelManager labelManager = contextManager.getTreeNodeLabelManager();
VertexIdManager vertexIdManager = contextManager.getVertexIdManager();
Message.Value.Builder argumentBuilder = Message.Value.newBuilder();
switch(token) {
case id:
{
argumentBuilder.addIntValueList(TreeConstants.ID_INDEX);
break;
}
case label:
{
argumentBuilder.addIntValueList(TreeConstants.LABEL_INDEX);
break;
}
case key:
{
argumentBuilder.addIntValueList(TreeConstants.KEY_INDEX);
break;
}
case value:
{
argumentBuilder.addIntValueList(TreeConstants.VALUE_INDEX);
break;
}
}
ProcessorFunction processorFunction = new ProcessorFunction(QueryFlowOuterClass.OperatorType.PROP_VALUE, argumentBuilder);
return parseSingleUnaryVertex(vertexIdManager, labelManager, processorFunction, contextManager);
}
use of com.alibaba.maxgraph.compiler.logical.VertexIdManager in project GraphScope by alibaba.
the class TraversalMapTreeNode method buildLogicalQueryPlan.
@Override
public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {
TreeNodeLabelManager labelManager = contextManager.getTreeNodeLabelManager();
VertexIdManager vertexIdManager = contextManager.getVertexIdManager();
LogicalSubQueryPlan logicalSubQueryPlan = new LogicalSubQueryPlan(contextManager);
LogicalVertex delegateSourceVertex = getInputNode().getOutputVertex();
logicalSubQueryPlan.addLogicalVertex(delegateSourceVertex);
TreeNode currTraversalNode = TreeNodeUtils.buildSingleOutputNode(traversalNode, schema);
LogicalSubQueryPlan traversalPlan = TreeNodeUtils.buildQueryPlanWithSource(currTraversalNode, labelManager, contextManager, vertexIdManager, delegateSourceVertex);
logicalSubQueryPlan.mergeLogicalQueryPlan(traversalPlan);
LogicalVertex outputVertex = logicalSubQueryPlan.getOutputVertex();
addUsedLabelAndRequirement(outputVertex, labelManager);
setFinishVertex(outputVertex, labelManager);
return logicalSubQueryPlan;
}
use of com.alibaba.maxgraph.compiler.logical.VertexIdManager in project GraphScope by alibaba.
the class OrderLocalTreeNode method buildLogicalQueryPlan.
@Override
public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {
TreeNodeLabelManager labelManager = contextManager.getTreeNodeLabelManager();
VertexIdManager vertexIdManager = contextManager.getVertexIdManager();
Message.OrderComparatorList.Builder comparatorList = Message.OrderComparatorList.newBuilder();
orderTreeNodeList.forEach(v -> {
comparatorList.addOrderComparator(Message.OrderComparator.newBuilder().setPropId(getPropLabelId(v.getLeft(), labelManager.getLabelIndexList())).setOrderType(Message.OrderType.valueOf(StringUtils.upperCase(v.getRight().name()))));
});
ProcessorFunction processorFunction = new ProcessorFunction(QueryFlowOuterClass.OperatorType.ORDER_LOCAL, Message.Value.newBuilder().setPayload(comparatorList.build().toByteString()));
return parseSingleUnaryVertex(vertexIdManager, labelManager, processorFunction, contextManager);
}
use of com.alibaba.maxgraph.compiler.logical.VertexIdManager in project GraphScope by alibaba.
the class PageRankTreeNode method buildLogicalQueryPlan.
@Override
public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {
TreeNodeLabelManager labelManager = contextManager.getTreeNodeLabelManager();
VertexIdManager vertexIdManager = contextManager.getVertexIdManager();
ProcessorFunction processorFunction = new ProcessorFunction(OperatorType.PROGRAM_GRAPH_PAGERANK, createOperatorArgument());
return parseSingleUnaryVertex(vertexIdManager, labelManager, processorFunction, contextManager);
}
use of com.alibaba.maxgraph.compiler.logical.VertexIdManager in project GraphScope by alibaba.
the class PageRankVertexProgramTreeNode method buildLogicalQueryPlan.
@Override
public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {
TreeNodeLabelManager labelManager = contextManager.getTreeNodeLabelManager();
VertexIdManager vertexIdManager = contextManager.getVertexIdManager();
ProcessorFunction processorFunction = new ProcessorFunction(QueryFlowOuterClass.OperatorType.PROGRAM_GRAPH_PAGERANK, createOperatorArgument());
return parseSingleUnaryVertex(vertexIdManager, labelManager, processorFunction, contextManager);
}
Aggregations