[
https://issues.apache.org/jira/browse/TINKERPOP3-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14721131#comment-14721131
]
Ran Magen commented on TINKERPOP3-702:
--------------------------------------
So I tweaked the ForceFeedStep a bit, to get past the infinite-loop:
{code:java}
public class ForceFeedStep extends AbstractStep {
public ForceFeedStep(Traversal.Admin traversal) {
super(traversal);
}
@Override
public Traverser next() {
while(starts.hasNext()) {
this.getNextStep().addStart(this.starts.next());
}
return EmptyTraverser.instance();
}
@Override
public boolean hasNext() {
return starts.hasNext();
}
@Override
protected Traverser processNextStart() throws NoSuchElementException {
return null;
}
}
{code}
Then I run this query:
{{code:java}}
GraphTraversal.Admin<Vertex, Vertex> traversal = g.V().asAdmin();
traversal.addStep(new ForceFeedStep(traversal)).repeat(out()).times(1);
{{code}}
A few problems:
1. The {{RepeatStep.starts}} now has {{EmptyTraverser}} as the first traverser,
with all the other traversers following it (progress!).
2. {{RepeatStep.standardAlgorithm}} still pushes one traverser at a time to
{{RepeatEndStep}}.
3. Same thing happens in {{CoalesceStep.flatMap}}.
> Buffer input to inner traversals
> --------------------------------
>
> Key: TINKERPOP3-702
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-702
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Reporter: Ran Magen
> Assignee: Marko A. Rodriguez
> Fix For: 3.0.0-incubating
>
>
> In elastic-gremlin we implement an optimized VertexStep. Part of its job is
> to batch/buffer/bulk different traversers and query them together in-order to
> minizmize the number of queries.
> You can see the implementation here:
> https://github.com/rmagen/elastic-gremlin/blob/master/src/main/java/org/elasticgremlin/process/optimize/ElasticVertexStep.java#L36
> This works great in regular traversals, the "starts" iterator returns as many
> traversers as the previous step gave out.
> But when the step is in an innerTraversal (e.g.
> g.V().repeat(__.out()).times(8)), the "starts" iterator only returns one
> traverser, and will return the next traverser only in the next call to
> processNextStart. Thus, there is no way to run a bulk query.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)