Class EarlyLimitStrategy
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.EarlyLimitStrategy
-
- All Implemented Interfaces:
Serializable,Comparable<Class<? extends TraversalStrategy>>,TraversalStrategy<TraversalStrategy.OptimizationStrategy>,TraversalStrategy.OptimizationStrategy
public final class EarlyLimitStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
This strategy looks forRangeGlobalSteps that can be moved further left in the traversal and thus be applied earlier. It will also try to merge multipleRangeGlobalSteps into one. If the logical consequence of one or multipleRangeGlobalSteps is an empty result, the strategy will remove as many steps as possible and add aDiscardStepinstead.- Author:
- Daniel Kuppitz (http://gremlin.guru)
- See Also:
- Serialized Form
- Example:
__.out().valueMap().limit(5) // becomes __.out().limit(5).valueMap() __.outE().range(2, 10).valueMap().limit(5) // becomes __.outE().range(2, 7).valueMap() __.outE().limit(5).valueMap().range(2, -1) // becomes __.outE().range(2, 5).valueMap() __.outE().limit(5).valueMap().range(5, 10) // becomes __.outE().discard() __.outE().limit(5).valueMap().range(5, 10).cap("a") // becomes __.outE().discard().cap("a")
-
-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Traversal.Admin<?,?> traversal)The transformation the strategy applies to the traversal.static EarlyLimitStrategyinstance()-
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
applyPrior, getConfiguration
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.OptimizationStrategy
applyPost, compareTo, getTraversalCategory
-
-
-
-
Method Detail
-
apply
public void apply(Traversal.Admin<?,?> traversal)
Description copied from interface:TraversalStrategyThe transformation the strategy applies to the traversal.- Specified by:
applyin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
instance
public static EarlyLimitStrategy instance()
-
-