public final class EarlyLimitStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
RangeGlobalStep
s that can be moved further left in the traversal and thus be applied
earlier. It will also try to merge multiple RangeGlobalStep
s into one.
If the logical consequence of one or multiple RangeGlobalStep
s is an empty result, the strategy will remove
as many steps as possible and add a NoneStep
instead.__.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().none() __.outE().limit(5).valueMap().range(5, 10).cap("a") // becomes __.outE().none().cap("a")
TraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategy
STRATEGY
Modifier and Type | Method and Description |
---|---|
void |
apply(Traversal.Admin<?,?> traversal) |
static EarlyLimitStrategy |
instance() |
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, getTraversalCategory
applyPost, applyPrior, getConfiguration
public void apply(Traversal.Admin<?,?> traversal)
apply
in interface TraversalStrategy<TraversalStrategy.OptimizationStrategy>
public static EarlyLimitStrategy instance()
Copyright © 2013–2021 Apache Software Foundation. All rights reserved.