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);
});
}
Aggregations