Hello,
Gremlin OLAP is coming along nicely. I made some good headway this morning. In particular, counter propagation is fully functional for propagating gremlins through to vertices, edges, and properties. You can see the code here:
Its actually quite simple:
1. A counter Map<Object,Long> maintains how many gremlins are at each local object (i.e. vertex, edge, or properties of the vertex).
- The CounterMap is an unfortunate consequence of GraphComputer semantics -- you getXXX() from the previous BSP cycle and you setXXX() to the next BSP cycle.
- As such, you can not use the object property/annotation as a memory system during the life of the vertex program's iteration.
- This may come back to bite us when we move to implement sideEffect steps in Gremlin OLAP.
2. Receive all messages to this particular vertex (where, again, a vertex serves as a message hub for its properties, edges, and edge properties).
3. For each element that has gremlins at it, put it into the current pipe of the GremlinPipeline, iterate the pipe, and the output (end of the Pipe) has messages with counters propagated to it.
4. Update the properties and annotations of respective objects.
Again, what is nice (so far :) is that this is only 150 lines of code. The behavior is identical to Gremlin/Faunus save that we are using the Pipes from Gremlin OLTP and thus, no double-creation of the Gremlin language.
What needs to happen next:
1. We need to be able to support non-graph object objects. E.g. out('knows').value('name') (the String value).
- Right now this throws an exception as we can't "count" things that don't have properties or annotations.
2. We need to be able to support paths. E.g. out('knows').path.
- This is related to 1 but also necessary for teleportation-steps and will be "easy" as a GremlinMessage will be able to hold either a Path or a Long counter. (again, just like Faunus).
- There needs to be more work on Gremlin OLTP around Derrick Wiebe's (Pacer) contributions on turning on and off paths automagically via Pipeline introspection.
- Currently in Gremlin3 OLTP paths are always computed.
Once we have 1 & 2 above, we need to start thinking about how loop() works. With the new Gremlin architecture using Holder<> where the Pipe no longer has state, I believe this should fall out naturally.
Finally, you can see how this is all trigger via my "System.out.println()"-based TestCase.
Once we get 1 & 2 completed, we will move to having real test cases.
Enjoy!,
Marko.