Given https://issues.apache.org/jira/browse/TINKERPOP-1444
and
https://lists.apache.org/thread.html/b5ac4d4b51ccaefdab0005f7d70501bae74aaeb2e1313fbb50b76ccd@%3Cdev.tinkerpop.apache.org%3E
I believe that makes the following section under withRemote false wrt to
caching a parameterized traversal and being able to reuse it with different
params. Should this be removed or updated?
Finally, Gremlin Bytecode supports the encoding of bindings which allow
GremlinServer to cache traversals that will be reused over and over again
save that some parameterization may change. Thus, instead of translating,
compiling, and then executing each submitted bytecode, it is possible to
simply execute. To express bindings in Gremlin-Java and Gremlin-Groovy, use
Bindings.
gremlin> cluster = Cluster.open('conf/remote-objects.yaml')
==>localhost/127.0.0.1:8182
gremlin> b = Bindings.instance()
==>bindings[main]
gremlin> g =
EmptyGraph.instance().traversal().withRemote(DriverRemoteConnection.using(cluster,
"g"))
==>graphtraversalsource[emptygraph[empty], standard]
gremlin> g.V(b.of('id',1)).out('created').values('name')
==>lop
gremlin> g.V(b.of('id',4)).out('created').values('name')
==>ripple
==>lop
gremlin> g.V(b.of('id',4)).out('created').values('name').getBytecode()
==>[[], [V(binding[id=4]), out(created), values(name)]]
gremlin>
g.V(b.of('id',4)).out('created').values('name').getBytecode().getBindings()
==>id=4
gremlin> cluster.close()
==>null
Both traversals are abstractly defined as
g.V(id).out('created').values('name') and thus, the first submission can be
cached for faster evaluation on the next submission.
Robert Dale