Class FilterRankingStrategy
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<Class<? extends TraversalStrategy>>
,TraversalStrategy<TraversalStrategy.OptimizationStrategy>
,TraversalStrategy.OptimizationStrategy
public final class FilterRankingStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
FilterRankingStrategy
reorders filter- and order-steps according to their rank. Step ranks are defined within the strategy and indicate when it is reasonable for a step to move in front of another. It will also do its best to push step labels as far "right" as possible in order to keep traversers as small and bulkable as possible prior to the absolute need for path-labeling.- Author:
- Daniel Kuppitz (http://gremlin.guru), Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Serialized Form
- Example:
__.order().dedup() // is replaced by __.dedup().order() __.dedup().filter(out()).has("value", 0) // is replaced by __.has("value", 0).filter(out()).dedup()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
TraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategy
-
-
Field Summary
-
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
STRATEGY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Traversal.Admin<?,?> traversal)
Set<Class<? extends TraversalStrategy.OptimizationStrategy>>
applyPrior()
The set of strategies that must be executed before this strategy is executed.static List<org.javatuples.Pair<TraversalParent,List<Step<?,?>>>>
collectStepsOfAssignableClassRecursivelyFromDepthGroupedByParent(Traversal.Admin<?,?> traversal)
Get steps of the specified class throughout the traversal and grouping them based on the traversal parent collecting them in a fashion that orders them from the deepest steps firststatic Map<TraversalParent,org.javatuples.Pair<Boolean,Set<String>>>
getTraversalParentCache(List<org.javatuples.Pair<TraversalParent,List<Step<?,?>>>> traversalParentsStepsCollection)
static FilterRankingStrategy
instance()
-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
applyPost, getConfiguration
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.OptimizationStrategy
compareTo, getTraversalCategory
-
-
-
-
Method Detail
-
apply
public void apply(Traversal.Admin<?,?> traversal)
- Specified by:
apply
in interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
getTraversalParentCache
public static Map<TraversalParent,org.javatuples.Pair<Boolean,Set<String>>> getTraversalParentCache(List<org.javatuples.Pair<TraversalParent,List<Step<?,?>>>> traversalParentsStepsCollection)
-
applyPrior
public Set<Class<? extends TraversalStrategy.OptimizationStrategy>> applyPrior()
Description copied from interface:TraversalStrategy
The set of strategies that must be executed before this strategy is executed. If there are no ordering requirements, the default implementation returns an empty set.- Specified by:
applyPrior
in interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
- Returns:
- the set of strategies that must be executed prior to this one.
-
instance
public static FilterRankingStrategy instance()
-
collectStepsOfAssignableClassRecursivelyFromDepthGroupedByParent
public static List<org.javatuples.Pair<TraversalParent,List<Step<?,?>>>> collectStepsOfAssignableClassRecursivelyFromDepthGroupedByParent(Traversal.Admin<?,?> traversal)
Get steps of the specified class throughout the traversal and grouping them based on the traversal parent collecting them in a fashion that orders them from the deepest steps first
-
-