Class GValueReductionStrategy
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.GValueReductionStrategy
-
- All Implemented Interfaces:
Serializable,Comparable<Class<? extends TraversalStrategy>>,TraversalStrategy<TraversalStrategy.OptimizationStrategy>,TraversalStrategy.OptimizationStrategy
public final class GValueReductionStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
Converts placeholder steps that holdGValueobjects to their concrete implementations. While not an optimization in and of itself, theGValuefunctionality in general, provides a mechanism for traversal optimization so falls in this category. In addition, converting to concrete steps at this stage also allows provider optimization strategies to execute on concrete steps, rather than step interfaces. Concrete steps are much easier to reason about and keep strategy application simple for the vast majority of providers. Providers hoping to do more advanced optimizations that requireGValueobjects to be present for their strategies will need to removeGValueReductionStrategyand offer their own mechanism for converting step placeholders to concrete steps.ProviderGValueReductionStrategyis a base class for helping with this need.- See Also:
- Serialized Form
-
-
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.Set<Class<? extends TraversalStrategy.OptimizationStrategy>>applyPost()No TinkerPop optimization strategy should be applied following this one.static GValueReductionStrategyinstance()-
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
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 GValueReductionStrategy instance()
-
applyPost
public Set<Class<? extends TraversalStrategy.OptimizationStrategy>> applyPost()
No TinkerPop optimization strategy should be applied following this one. The default implementation addsGValueReductionStrategyitself so retaining that implementation would create a circular reference so returning an empty list here removes that dependency.- Specified by:
applyPostin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>- Specified by:
applyPostin interfaceTraversalStrategy.OptimizationStrategy- Returns:
- the set of strategies that must be executed post this one
-
-