Resolution: Won't Fix
Here is a half-baked solution to the "local star graph"-problem in Gremlin OLAP.
A Traverser not only maintains a pointer to its current object, but also to its "local traversal spawn object." For instance:
The Traverser going into the where() step will, lets say, be at v. Thus:
Traverser.get() == v Traverser.spawn() == v Traverser.stepId() == "out('knows')"-stepId
At the next step, the Traverser[v] hits up the out("knows") step. This will trigger a message pass. Lets say v-
Traverser.get() == v Traverser.spawn() == v Traverser.stepId() == "has('name','bob')"-stepId
At this point, the Traverser[v] is shoved into has("name","bob") and lets say that v is "bob." What is the next step? There is none because its at the end of the local traversal. So, TraverserExecutor looks up step.getTraversal().getTraversalParent() and executes the local where()-step with a behavior of "v went into , and v came out." Thus, a "simulated local traversal" is "v --> v" and where()-step simply says "ah, v, then let me emit v". This yields a Traverser of:
Traverser.get() == v Traverser.spawn() == null Traverser.stepId() == values('name')-stepId
The Traverser is sent back to v to solve the values('name')-step function.
This notion of a "simulated local traversal" is that the where()-step local traversal can be "wrapped" on the fly by TraverserExecutor such that:
out('knows').has('name','bob') --> directMap(v,v)
So this is doable for a single local traversal. What about parallel local traversals like and(a,b,c). In this situation, a, b, and c must all come back before and() is complete. I think it might work something like this:
Traverser.get() == v Traverser.spawn() == v Traverser.sessionId() == uuid:123-456-789(3)
In this way, before the spawn is "released" by and(), three uuid:123-456-789 session ids must be returned with Traverser.get() != null. If that happens, the and() released v to the next step.
Note that in this model all the state is in the Traverser. There is no step state required. Given that Traversers are stored at the local vertex during iterations, looking up a Traverser by sessionId can be just as easy as looking it up by Traverser.get(). In this way, a placeholder Traverser exists at the and()-ing vertex waiting for its sessionId to complete.
.......................... a little sketchy and involved. But I think with some more mulling we can come up with a simple "ah, that is just a that which makes this just that and I can delete the entire codebase because there never was a problem to begin with. I can die yielding no intent. Finally."
- relates to
TINKERPOP-940 Convert LocalTraversals to MatchSteps in OLAP and Solve the StarGraph Problem