[ 
https://issues.apache.org/jira/browse/TINKERPOP3-679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009220#comment-15009220
 ] 

ASF GitHub Bot commented on TINKERPOP3-679:
-------------------------------------------

GitHub user okram opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/145

    TINKERPOP3-679: Debuggable Traversal

    https://issues.apache.org/jira/browse/TINKERPOP3-679
    
    We now have a pretty-print `TraversalExplanation` object that can be 
created for any `Traversal` via `Traversal.explain()`. An example is below:
    
    ```
    gremlin> g.V().outE().identity().inV().count().is(gt(5))
    ==>6
    gremlin> g.V().outE().identity().inV().count().is(gt(5)).explain()
    ==>Traversal Explanation
    
=================================================================================================================================================
    Original Traversal                 [GraphStep([],vertex), 
VertexStep(OUT,edge), IdentityStep, EdgeVertexStep(IN), CountGlobalStep, 
IsStep(gt(5))]
    
    ConnectiveStrategy           [D]   [GraphStep([],vertex), 
VertexStep(OUT,edge), IdentityStep, EdgeVertexStep(IN), CountGlobalStep, 
IsStep(gt(5))]
    IdentityRemovalStrategy      [O]   [GraphStep([],vertex), 
VertexStep(OUT,edge), EdgeVertexStep(IN), CountGlobalStep, IsStep(gt(5))]
    IncidentToAdjacentStrategy   [O]   [GraphStep([],vertex), 
VertexStep(OUT,vertex), CountGlobalStep, IsStep(gt(5))]
    AdjacentToIncidentStrategy   [O]   [GraphStep([],vertex), 
VertexStep(OUT,edge), CountGlobalStep, IsStep(gt(5))]
    FilterRankingStrategy        [O]   [GraphStep([],vertex), 
VertexStep(OUT,edge), CountGlobalStep, IsStep(gt(5))]
    MatchPredicateStrategy       [O]   [GraphStep([],vertex), 
VertexStep(OUT,edge), CountGlobalStep, IsStep(gt(5))]
    RangeByIsCountStrategy       [O]   [GraphStep([],vertex), 
VertexStep(OUT,edge), RangeGlobalStep(0,6), CountGlobalStep, IsStep(gt(5))]
    TinkerGraphStepStrategy      [P]   [TinkerGraphStep([],vertex), 
VertexStep(OUT,edge), RangeGlobalStep(0,6), CountGlobalStep, IsStep(gt(5))]
    ProfileStrategy              [F]   [TinkerGraphStep([],vertex), 
VertexStep(OUT,edge), RangeGlobalStep(0,6), CountGlobalStep, IsStep(gt(5))]
    EngineDependentStrategy      [F]   [TinkerGraphStep([],vertex), 
VertexStep(OUT,edge), RangeGlobalStep(0,6), CountGlobalStep, IsStep(gt(5))]
    StandardVerificationStrategy [V]   [TinkerGraphStep([],vertex), 
VertexStep(OUT,edge), RangeGlobalStep(0,6), CountGlobalStep, IsStep(gt(5))]
    ComputerVerificationStrategy [V]   [TinkerGraphStep([],vertex), 
VertexStep(OUT,edge), RangeGlobalStep(0,6), CountGlobalStep, IsStep(gt(5))]
    
    Final Traversal                    [TinkerGraphStep([],vertex), 
VertexStep(OUT,edge), RangeGlobalStep(0,6), CountGlobalStep, IsStep(gt(5))]
    gremlin>
    ```
    
    I did a `--dryRun` on the docs and things look good. I did a `mvn clean 
install` and all is golden. When this is merged, I will deploy SNAPSHOT 
documentation and brag about it on gremlin-users@.
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP3-679

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/145.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #145
    
----
commit 87069b28f47a221f0d84efd675f431c144b13c32
Author: Marko A. Rodriguez <[email protected]>
Date:   2015-11-17T18:34:42Z

    Fixed TINKERPOP3-679. There is now Traversal.explain() which returns a 
TraversalExplanation that has a pretty-print toString() as well as accessor 
methods for programmatic introspection. Added ExplainTest (dont want to get too 
crazy here or else provider strategies may cause problems). Added ExplainStep 
to the docs and made it so both ProfileStep and ExplainStep sections reference 
each other. Fixed a minor bug in IncidentToAdacentStrategy and 
AdjacentToIndicentStrategy which was relaized when playing around with 
explain(). Tada.

----


> Debuggable Traversal
> --------------------
>
>                 Key: TINKERPOP3-679
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-679
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.2-incubating
>            Reporter: stephen mallette
>
> I'd like to be able to put a {{Traversal}} into "debug mode".  
> {{TraversalStrategy}} application is a bit too mysterious, making it hard to 
> figure out why a {{Traversal}} is failing.  In a recent debug session, the 
> problem was only sorted out after we looked at the order in which strategies 
> were applied and even then it was a bit tricky to really understand what was 
> happening.
> If the {{Traversal}} were in this "debug mode" it could give us insight into 
> that strategy application process which would mean at least the following:
> * Display the order in which strategies were applied
> * For each strategy applied, display the {{toString()}} of the {{Traversal}} 
> at that stage.
> A developer could then logically see what's in the magic and recognize that 
> strategy 7 is ovewriting what strategy 2 is doing or that strategy 4 is 
> executing before strategy 3 somehow.  
> Not sure what the best way is to implement this.  A straightforward solution 
> with an environment variable check and println in {{applyStrategies}} seemed 
> too "cheap" though kinda nice because very little would change and that 
> output would come as part of the standard {{Traversal}} execution.  Other 
> (better) ways?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to