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 aTraversaland, 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<?,?>>>strategyTraversalsprotected Traversal.Admin<?,?>traversal
-
Constructor Summary
Constructors Modifier Constructor Description protectedTraversalExplanation()TraversalExplanation(Traversal.Admin<?,?> traversal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableExplanationasImmutable()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 originalTraversalused to create this explanation.protected StringgetOriginalTraversalAsString()List<org.javatuples.Pair<TraversalStrategy,Traversal.Admin<?,?>>>getStrategyTraversals()Get the list ofTraversalStrategyapplications.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 ofTraversalStrategyapplications. For strategy, the resultant mutatedTraversalis provided.- Returns:
- the list of strategy/traversal pairs
-
getOriginalTraversal
public Traversal.Admin<?,?> getOriginalTraversal()
Get the originalTraversalused to create this explanation.- Returns:
- the original traversal
-
asImmutable
public ImmutableExplanation asImmutable()
-
getStrategyTraversalsAsString
protected Stream<String> getStrategyTraversalsAsString()
- Specified by:
getStrategyTraversalsAsStringin classAbstractExplanation
-
getOriginalTraversalAsString
protected String getOriginalTraversalAsString()
- Specified by:
getOriginalTraversalAsStringin classAbstractExplanation
-
getIntermediates
protected Stream<org.javatuples.Triplet<String,String,String>> getIntermediates()
Description copied from class:AbstractExplanationFirst string is the traversal strategy, the second is the category and the third is the traversal representation at that point.- Specified by:
getIntermediatesin classAbstractExplanation
-
-