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 for
RangeGlobalSteps that can be moved further left in the traversal and thus be applied
earlier. It will also try to merge multiple RangeGlobalSteps into one.
If the logical consequence of one or multiple RangeGlobalSteps is an empty result, the strategy will remove
as many steps as possible and add a DiscardStep instead.- Author:
- Daniel Kuppitz (http://gremlin.guru)
- See Also:
- 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
Modifier and TypeMethodDescriptionvoidapply(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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
applyPrior, getConfigurationMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.OptimizationStrategy
applyPost, compareTo, getTraversalCategory
-
Method Details
-
apply
Description copied from interface:TraversalStrategyThe transformation the strategy applies to the traversal.- Specified by:
applyin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
instance
-