CollectingBarrierStep bug
Anyone ever notice this bug in the CollectingBarrierStep?
Offending line https://github.com/apache/tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java#L81
The problem here is that if you had an input of X + Y elements where X is your collecting barrier size and Y is some number greater than 0, if the first X elements in the barrier have no results output in the barrier and the latter Y elements in the barrier do have some result, the barrier will only be called on the first X elements and will not execute a second time.
GitHub
tinkerpop/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/p...
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
Solution:Jump to solution
Overriding this function seems to fix
```
@Override
public Traverser.Admin<Vertex> processNextStart() {...
2 Replies
found out that is not actual the offending line. Not sure what is but the statement about barrier not executing the next section is still true
actual issue seems to stem from AbstractStep
@Override
public boolean hasNext() {
if (EmptyTraverser.instance() != this.nextEnd)
return true;
else {
try {
while (true) {
if (Thread.interrupted()) throw new TraversalInterruptedException();
this.nextEnd = this.processNextStart();
if (this.nextEnd.bulk() > 0)
return true;
else
this.nextEnd = EmptyTraverser.instance();
}
} catch (final NoSuchElementException e) {
return false;
}
}
}
the no such element exception is producing from the collecting barrier
Solution
Overriding this function seems to fix