Search in sources :

Example 1 with CoalesceStep

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

the class UniGraphCoalesceStepStrategy method apply.

@Override
public void apply(Traversal.Admin<?, ?> traversal) {
    Graph graph = traversal.getGraph().get();
    if (!(graph instanceof UniGraph)) {
        return;
    }
    UniGraph uniGraph = (UniGraph) graph;
    TraversalHelper.getStepsOfClass(CoalesceStep.class, traversal).forEach(coalesceStep -> {
        UniGraphCoalesceStep uniGraphCoalesceStep = new UniGraphCoalesceStep(coalesceStep.getTraversal(), uniGraph, coalesceStep.getLocalChildren());
        TraversalHelper.replaceStep(coalesceStep, uniGraphCoalesceStep, traversal);
    });
}
Also used : UniGraph(org.unipop.structure.UniGraph) UniGraphCoalesceStep(org.unipop.process.coalesce.UniGraphCoalesceStep) Graph(org.apache.tinkerpop.gremlin.structure.Graph) UniGraph(org.unipop.structure.UniGraph) UniGraphCoalesceStep(org.unipop.process.coalesce.UniGraphCoalesceStep) CoalesceStep(org.apache.tinkerpop.gremlin.process.traversal.step.map.CoalesceStep)

Aggregations

CoalesceStep (org.apache.tinkerpop.gremlin.process.traversal.step.map.CoalesceStep)1 Graph (org.apache.tinkerpop.gremlin.structure.Graph)1 UniGraphCoalesceStep (org.unipop.process.coalesce.UniGraphCoalesceStep)1 UniGraph (org.unipop.structure.UniGraph)1