Ted Wilmes created TINKERPOP-1781:
-------------------------------------

             Summary: Traversal admin addStep does not update bytecode
                 Key: TINKERPOP-1781
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1781
             Project: TinkerPop
          Issue Type: Improvement
          Components: process
    Affects Versions: 3.2.6, 3.3.0
            Reporter: Ted Wilmes


Right now bytecode is constructed at traversal construction time and is not 
updated post-construction when traversal rewriting happens via strategies. This 
works fine in most cases because the traversal is locked post-strategy 
application and will be executed, not serialized out for execution somewhere 
else. 

There are issues when trying to apply client side, pre-serialization traversal 
rewriting (a kind of client-side traversal strategy outside of the usual 
strategy flow). Since a direct call to {{addStep}} circumvents the bytecode 
construction, the bytecode diverges from the rewritten traversal.

{code}
gremlin> traversal = g.V().out();null
==>null
gremlin> traversal.getSteps()
==>GraphStep(vertex,[])
==>VertexStep(OUT,vertex)
gremlin> traversal.getBytecode()
==>[[], [V(), out()]]
gremlin> TraversalHelper.insertAfterStep(new CountGlobalStep(traversal), 
traversal.getSteps()[1], traversal.asAdmin())
==>null
gremlin> traversal.getSteps()
==>GraphStep(vertex,[])
==>VertexStep(OUT,vertex)
==>CountGlobalStep
gremlin> traversal.getBytecode()
==>[[], [V(), out()]]
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to