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 itCoalesceStep
so that the result is either the initialTraversal
argument ornull
. In this way, theby()
is always "productive". This strategy is an "optimization" but it is perhaps more of a "decoration", but it should followByModulatorOptimizationStrategy
which features optimizations relevant to this one.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProductiveByStrategy.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 String
PRODUCTIVE_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 void
apply(Traversal.Admin<?,?> traversal)
Set<Class<? extends TraversalStrategy.OptimizationStrategy>>
applyPrior()
The set of strategies that must be executed before this strategy is executed.static ProductiveByStrategy.Builder
build()
static ProductiveByStrategy
create(org.apache.commons.configuration2.Configuration configuration)
org.apache.commons.configuration2.Configuration
getConfiguration()
Get the configuration representation of this strategy.static ProductiveByStrategy
instance()
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:TraversalStrategy
The 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:
applyPrior
in 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:
apply
in interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
getConfiguration
public org.apache.commons.configuration2.Configuration getConfiguration()
Description copied from interface:TraversalStrategy
Get the configuration representation of this strategy. This is useful for converting a strategy into a serialized form.- Specified by:
getConfiguration
in interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>
- Returns:
- the configuration used to create this strategy
-
build
public static ProductiveByStrategy.Builder build()
-
-