[
https://issues.apache.org/jira/browse/TINKERPOP3-331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15007312#comment-15007312
]
Marko A. Rodriguez commented on TINKERPOP3-331:
-----------------------------------------------
Well, not just what a particular {{Step}} needs, but what that step needs + all
subsequent steps --- thus, the determination is at the sub-traversal level. We
would have a method like this:
{code}
TraversalHelper.getRequirementsFrom(Step step)
{code}
This will get the requirements for {{step}} and all subsequent {{steps}} via
{{Step.getNextStep()}}. It will have to be smart about {{TraversalParents}} of
course as well. Then we would insert a {{ConvertTraverserStep}} at appropriate
locations and thus, the user is blind to the conversion.
In terms of performance, {{TraverserConvertedStrategy}} would be an {{n *
(n-1)}} operation. Ouch............as for every step you get its step
requirements, etc. etc. I think a nice "quick and dirty" to give us the most
bang for our buck would be to simply do this ONLY for steps AFTER a step that
requires {{PATHS}} as this is where we will get the most savings. (i.e. the
original example that kicked off this ticket). Moreover, I would work backwards
from the end step to the start step as anything PRIOR to a {{PATHS}}-step must
use {{PATHS}}. So, this strategy can actually operate pretty quickly.
> TraverserConverterStep (proposal)
> ---------------------------------
>
> Key: TINKERPOP3-331
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-331
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.0.2-incubating
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
>
> Different {{Traverser}} implementations have different memory requirements
> and "bulkability." Once the memory of a {{Traverser}} is no longer needed,
> then it should be converted to a simpler form.
> {code}
> g.V.as('x').out.jump('x',3).simplePath.out('knows').age.groupCount
> |______________________________________||_________________________|
> PathTraverser SimpleTraverser
> {code}
> A {{TraverserConverterStrategy}} should insert a {{TraverserConverterStep}}
> after {{simplePath()}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)