Class ProductiveByStrategy
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.ProductiveByStrategy
-
- All Implemented Interfaces:
Serializable,Comparable<Class<? extends TraversalStrategy>>,TraversalStrategy<TraversalStrategy.OptimizationStrategy>,TraversalStrategy.OptimizationStrategy
public class ProductiveByStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
Takes an argument ofby()and wraps itCoalesceStepso that the result is either the initialTraversalargument ornull. In this way, theby()is always "productive". This strategy is an "optimization" but it is perhaps more of a "decoration", but it should followByModulatorOptimizationStrategywhich features optimizations relevant to this one.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProductiveByStrategy.Builder-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
TraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static StringPRODUCTIVE_KEYS-
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
STRATEGY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Traversal.Admin<?,?> traversal)Set<Class<? extends TraversalStrategy.OptimizationStrategy>>applyPrior()The set of strategies that must be executed before this strategy is executed.static ProductiveByStrategy.Builderbuild()static ProductiveByStrategycreate(org.apache.commons.configuration2.Configuration configuration)org.apache.commons.configuration2.ConfigurationgetConfiguration()Get the configuration representation of this strategy.static ProductiveByStrategyinstance()Gets the standard configuration of this strategy that will apply it for all conditions.-
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
applyPost
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.OptimizationStrategy
compareTo, getTraversalCategory
-
-
-
-
Field Detail
-
PRODUCTIVE_KEYS
public static final String PRODUCTIVE_KEYS
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static ProductiveByStrategy create(org.apache.commons.configuration2.Configuration configuration)
-
instance
public static ProductiveByStrategy instance()
Gets the standard configuration of this strategy that will apply it for all conditions. It is this version of the strategy that is added as standard. Note that it may be helpful to configure a custom instance using thebuild()method in cases where there is certainty that aby()will be productive as it will reduce the complexity of the traversal and perhaps improve the execution of other optimizations.
-
applyPrior
public Set<Class<? extends TraversalStrategy.OptimizationStrategy>> applyPrior()
Description copied from interface:TraversalStrategyThe set of strategies that must be executed before this strategy is executed. If there are no ordering requirements, the default implementation returns an empty set.- Specified by:
applyPriorin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>- Returns:
- the set of strategies that must be executed prior to this one.
-
apply
public void apply(Traversal.Admin<?,?> traversal)
- Specified by:
applyin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
getConfiguration
public org.apache.commons.configuration2.Configuration getConfiguration()
Description copied from interface:TraversalStrategyGet the configuration representation of this strategy. This is useful for converting a strategy into a serialized form.- Specified by:
getConfigurationin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>- Returns:
- the configuration used to create this strategy
-
build
public static ProductiveByStrategy.Builder build()
-
-