Class RepeatUnrollStrategy
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RepeatUnrollStrategy
- All Implemented Interfaces:
Serializable,Comparable<Class<? extends TraversalStrategy>>,TraversalStrategy<TraversalStrategy.OptimizationStrategy>,TraversalStrategy.OptimizationStrategy
public final class RepeatUnrollStrategy
extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
implements TraversalStrategy.OptimizationStrategy
RepeatUnrollStrategy is an OLTP-only strategy that unrolls any RepeatStep if it uses a constant
number of loops (times(x)) and doesn't emit intermittent elements. The strategy only applies to repeat
traversals that contain exclusively safe, stateless steps from the allowed set:
Steps that are not in this allowed set will prevent the strategy from being applied. This allowed set of steps is
intentionally conservative as there have been unintentional traversal semantics changes in the past when allowing a
large variety of steps (especially barriers). Only steps that can be safely executed outside the repeat (and not
modify semantics of the traversal) should be included. The allowed set can be expanded in future versions as
additional steps are verified to be safe.
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Example:
__.repeat(out()).times(2) // is replaced by __.out().barrier(2500).out().barrier(2500)
-
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 RepeatUnrollStrategyinstance()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
-