[
https://issues.apache.org/jira/browse/TINKERPOP-1781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16163224#comment-16163224
]
Marko A. Rodriguez commented on TINKERPOP-1781:
-----------------------------------------------
There is no good general solution to this problem given that compilation will
yield steps that don't have a correlate bytecode representation. For instance,
{{ProviderOptimizationStrategy}} compilation stage.
> 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.3.0, 3.2.6
> 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)