Class TraversalExplanation
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.util.AbstractExplanation
-
- org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ImmutableExplanation
public class TraversalExplanation extends AbstractExplanation implements Serializable
A TraversalExplanation takes aTraversal
and, for each registeredTraversalStrategy
, it creates a mapping reflecting how each strategy alters the traversal. This is useful for understanding how each traversal strategy mutates the traversal. This is useful in debugging and analysis of traversal compilation. TheAbstractExplanation.toString()
has a pretty-print representation that is useful in the Gremlin Console.- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<org.javatuples.Pair<TraversalStrategy,Traversal.Admin<?,?>>>
strategyTraversals
protected Traversal.Admin<?,?>
traversal
-
Constructor Summary
Constructors Modifier Constructor Description protected
TraversalExplanation()
TraversalExplanation(Traversal.Admin<?,?> traversal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableExplanation
asImmutable()
protected Stream<org.javatuples.Triplet<String,String,String>>
getIntermediates()
First string is the traversal strategy, the second is the category and the third is the traversal representation at that point.Traversal.Admin<?,?>
getOriginalTraversal()
Get the originalTraversal
used to create this explanation.protected String
getOriginalTraversalAsString()
List<org.javatuples.Pair<TraversalStrategy,Traversal.Admin<?,?>>>
getStrategyTraversals()
Get the list ofTraversalStrategy
applications.protected Stream<String>
getStrategyTraversalsAsString()
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.AbstractExplanation
getTraversalStepsAsString, prettyPrint, prettyPrint, spacing, toString
-
-
-
-
Field Detail
-
traversal
protected Traversal.Admin<?,?> traversal
-
strategyTraversals
protected List<org.javatuples.Pair<TraversalStrategy,Traversal.Admin<?,?>>> strategyTraversals
-
-
Constructor Detail
-
TraversalExplanation
protected TraversalExplanation()
-
TraversalExplanation
public TraversalExplanation(Traversal.Admin<?,?> traversal)
-
-
Method Detail
-
getStrategyTraversals
public List<org.javatuples.Pair<TraversalStrategy,Traversal.Admin<?,?>>> getStrategyTraversals()
Get the list ofTraversalStrategy
applications. For strategy, the resultant mutatedTraversal
is provided.- Returns:
- the list of strategy/traversal pairs
-
getOriginalTraversal
public Traversal.Admin<?,?> getOriginalTraversal()
Get the originalTraversal
used to create this explanation.- Returns:
- the original traversal
-
asImmutable
public ImmutableExplanation asImmutable()
-
getStrategyTraversalsAsString
protected Stream<String> getStrategyTraversalsAsString()
- Specified by:
getStrategyTraversalsAsString
in classAbstractExplanation
-
getOriginalTraversalAsString
protected String getOriginalTraversalAsString()
- Specified by:
getOriginalTraversalAsString
in classAbstractExplanation
-
getIntermediates
protected Stream<org.javatuples.Triplet<String,String,String>> getIntermediates()
Description copied from class:AbstractExplanation
First string is the traversal strategy, the second is the category and the third is the traversal representation at that point.- Specified by:
getIntermediates
in classAbstractExplanation
-
-