Search in sources :

Example 1 with AllocationExecutionNode

use of org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AllocationExecutionNode in project legend-engine by finos.

the class ExecutionNodeExecutor method visit.

@Override
public Result visit(MultiResultSequenceExecutionNode multiResultSequenceExecutionNode) {
    Map<String, Result> subResults = Maps.mutable.empty();
    Result last = null;
    for (ExecutionNode n : multiResultSequenceExecutionNode.executionNodes()) {
        last = n.accept(new ExecutionNodeExecutor(this.profiles, this.executionState));
        if (n instanceof AllocationExecutionNode) {
            subResults.put(((AllocationExecutionNode) n).varName, last);
        }
        if (last instanceof ErrorResult) {
            return last;
        }
    }
    if (last != null) {
        subResults.put("@LAST", last);
    }
    return new MultiResult(subResults);
}
Also used : MultiResult(org.finos.legend.engine.plan.execution.result.MultiResult) AllocationExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AllocationExecutionNode) InMemoryCrossStoreGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.InMemoryCrossStoreGraphFetchExecutionNode) ErrorExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ErrorExecutionNode) StoreStreamReadingExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.StoreStreamReadingExecutionNode) ExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ExecutionNode) AllocationExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AllocationExecutionNode) ConstantExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ConstantExecutionNode) InMemoryRootGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.InMemoryRootGraphFetchExecutionNode) FreeMarkerConditionalExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.FreeMarkerConditionalExecutionNode) MultiResultSequenceExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.MultiResultSequenceExecutionNode) AggregationAwareExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AggregationAwareExecutionNode) GraphFetchM2MExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.GraphFetchM2MExecutionNode) PureExpressionPlatformExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.PureExpressionPlatformExecutionNode) GraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.GraphFetchExecutionNode) SequenceExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.SequenceExecutionNode) InMemoryPropertyGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.InMemoryPropertyGraphFetchExecutionNode) GlobalGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.GlobalGraphFetchExecutionNode) LocalGraphFetchExecutionNode(org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.LocalGraphFetchExecutionNode) ErrorResult(org.finos.legend.engine.plan.execution.result.ErrorResult) ConstantResult(org.finos.legend.engine.plan.execution.result.ConstantResult) GraphFetchResult(org.finos.legend.engine.plan.execution.result.graphFetch.GraphFetchResult) StreamingObjectResult(org.finos.legend.engine.plan.execution.result.object.StreamingObjectResult) ErrorResult(org.finos.legend.engine.plan.execution.result.ErrorResult) Result(org.finos.legend.engine.plan.execution.result.Result) MultiResult(org.finos.legend.engine.plan.execution.result.MultiResult)

Aggregations

ConstantResult (org.finos.legend.engine.plan.execution.result.ConstantResult)1 ErrorResult (org.finos.legend.engine.plan.execution.result.ErrorResult)1 MultiResult (org.finos.legend.engine.plan.execution.result.MultiResult)1 Result (org.finos.legend.engine.plan.execution.result.Result)1 GraphFetchResult (org.finos.legend.engine.plan.execution.result.graphFetch.GraphFetchResult)1 StreamingObjectResult (org.finos.legend.engine.plan.execution.result.object.StreamingObjectResult)1 AggregationAwareExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AggregationAwareExecutionNode)1 AllocationExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.AllocationExecutionNode)1 ConstantExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ConstantExecutionNode)1 ErrorExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ErrorExecutionNode)1 ExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ExecutionNode)1 FreeMarkerConditionalExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.FreeMarkerConditionalExecutionNode)1 GraphFetchM2MExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.GraphFetchM2MExecutionNode)1 MultiResultSequenceExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.MultiResultSequenceExecutionNode)1 PureExpressionPlatformExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.PureExpressionPlatformExecutionNode)1 SequenceExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.SequenceExecutionNode)1 GlobalGraphFetchExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.GlobalGraphFetchExecutionNode)1 GraphFetchExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.GraphFetchExecutionNode)1 LocalGraphFetchExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.LocalGraphFetchExecutionNode)1 InMemoryCrossStoreGraphFetchExecutionNode (org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.graphFetch.store.inMemory.InMemoryCrossStoreGraphFetchExecutionNode)1