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.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---