Search in sources :

Example 1 with EmptyStep

use of org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep in project unipop by unipop-graph.

the class UniGraphPropertiesStrategy method getAllPropertyFetchersOf.

private List<PropertyFetcher> getAllPropertyFetchersOf(Step step, Traversal.Admin<?, ?> traversal) {
    List<PropertyFetcher> propertyFetchers = new ArrayList<>();
    Step previous = step.getPreviousStep();
    while (!(previous instanceof EmptyStep)) {
        if (previous instanceof PropertyFetcher)
            propertyFetchers.add((PropertyFetcher) previous);
        if (previous instanceof TraversalParent) {
            ((TraversalParent) previous).getLocalChildren().forEach(t -> t.getSteps().stream().filter(s -> s instanceof PropertyFetcher).map(p -> ((PropertyFetcher) p)).forEach(propertyFetchers::add));
            ((TraversalParent) previous).getGlobalChildren().forEach(t -> t.getSteps().stream().filter(s -> s instanceof PropertyFetcher).map(p -> ((PropertyFetcher) p)).forEach(propertyFetchers::add));
        }
        previous = previous.getPreviousStep();
    }
    return propertyFetchers;
}
Also used : EmptyStep(org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep) java.util(java.util) EdgeStepsStrategy(org.unipop.process.edge.EdgeStepsStrategy) UniGraphStepStrategy(org.unipop.process.graph.UniGraphStepStrategy) SideEffectStep(org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep) UniGraphEdgeOtherVertexStep(org.unipop.process.edge.UniGraphEdgeOtherVertexStep) ElementValueTraversal(org.apache.tinkerpop.gremlin.process.traversal.lambda.ElementValueTraversal) TraversalParent(org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent) UniGraphEdgeVertexStep(org.unipop.process.edge.UniGraphEdgeVertexStep) P(org.apache.tinkerpop.gremlin.process.traversal.P) DefaultGraphTraversal(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal) org.apache.tinkerpop.gremlin.process.traversal.step.map(org.apache.tinkerpop.gremlin.process.traversal.step.map) TraversalHelper(org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper) HasContainer(org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer) org.apache.tinkerpop.gremlin.process.traversal.step.filter(org.apache.tinkerpop.gremlin.process.traversal.step.filter) UniGraphVertexStepStrategy(org.unipop.process.vertex.UniGraphVertexStepStrategy) TraversalStrategy(org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy) UniGraphRepeatStepStrategy(org.unipop.process.repeat.UniGraphRepeatStepStrategy) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Step(org.apache.tinkerpop.gremlin.process.traversal.Step) ReducingBarrierStep(org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep) TreeSideEffectStep(org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeSideEffectStep) Stream(java.util.stream.Stream) LocalStep(org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep) AbstractTraversalStrategy(org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy) Traversal(org.apache.tinkerpop.gremlin.process.traversal.Traversal) UniGraphWhereTraversalStep(org.unipop.process.where.UniGraphWhereTraversalStep) UniGraphRepeatStep(org.unipop.process.repeat.UniGraphRepeatStep) TraversalParent(org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent) EmptyStep(org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep) EmptyStep(org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep) SideEffectStep(org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep) UniGraphEdgeOtherVertexStep(org.unipop.process.edge.UniGraphEdgeOtherVertexStep) UniGraphEdgeVertexStep(org.unipop.process.edge.UniGraphEdgeVertexStep) Step(org.apache.tinkerpop.gremlin.process.traversal.Step) ReducingBarrierStep(org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep) TreeSideEffectStep(org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeSideEffectStep) LocalStep(org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep) UniGraphWhereTraversalStep(org.unipop.process.where.UniGraphWhereTraversalStep) UniGraphRepeatStep(org.unipop.process.repeat.UniGraphRepeatStep)

Aggregations

Sets (com.google.common.collect.Sets)1 java.util (java.util)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 P (org.apache.tinkerpop.gremlin.process.traversal.P)1 Step (org.apache.tinkerpop.gremlin.process.traversal.Step)1 Traversal (org.apache.tinkerpop.gremlin.process.traversal.Traversal)1 TraversalStrategy (org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy)1 DefaultGraphTraversal (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal)1 ElementValueTraversal (org.apache.tinkerpop.gremlin.process.traversal.lambda.ElementValueTraversal)1 TraversalParent (org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent)1 LocalStep (org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep)1 org.apache.tinkerpop.gremlin.process.traversal.step.filter (org.apache.tinkerpop.gremlin.process.traversal.step.filter)1 org.apache.tinkerpop.gremlin.process.traversal.step.map (org.apache.tinkerpop.gremlin.process.traversal.step.map)1 SideEffectStep (org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep)1 TreeSideEffectStep (org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeSideEffectStep)1 EmptyStep (org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep)1 HasContainer (org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer)1 ReducingBarrierStep (org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep)1 AbstractTraversalStrategy (org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy)1