Class InlineFilterStrategy
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy
-
- All Implemented Interfaces:
Serializable,Comparable<Class<? extends TraversalStrategy>>,TraversalStrategy<TraversalStrategy.OptimizationStrategy>,TraversalStrategy.OptimizationStrategy
public final class InlineFilterStrategy extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy> implements TraversalStrategy.OptimizationStrategy
This strategy analyzes filter-steps with child traversals that themselves are pure filters. If the child traversals are pure filters then the wrapping parent filter is not needed and thus, the children can be "inlined." Normalizing pure filters with inlining reduces the number of variations of a filter that a graph provider may need to reason about when writing their own strategies. As a result, this strategy helps increase the likelihood that a provider's filtering optimization will succeed at re-writing the traversal.- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Serialized Form
- Example:
__.outE().hasLabel(eq("knows").or(eq("created"))).inV() // is replaced by __.outE("knows", "created").inV() __.filter(has("name","marko")) // is replaced by __.has("name","marko") __.and(has("name"),has("age")) // is replaced by __.has("name").has("age") __.and(filter(has("name","marko").has("age")),hasNot("blah")) // is replaced by __.has("name","marko").has("age").hasNot("blah") __.match(as('a').has(key,value),...) // is replaced by __.as('a').has(key,value).match(...)
-
-
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()TheGValueReductionStrategyshould be the last TinkerPop optimnization strategy applied.Set<Class<? extends TraversalStrategy.OptimizationStrategy>>applyPrior()The set of strategies that must be executed before this strategy is executed.static InlineFilterStrategyinstance()-
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
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>
-
applyPost
public Set<Class<? extends TraversalStrategy.OptimizationStrategy>> applyPost()
Description copied from interface:TraversalStrategy.OptimizationStrategyTheGValueReductionStrategyshould be the last TinkerPop optimnization strategy applied. Adding it here ensures will help to enforce that more globally. Implementations overriding this method should have a good reason to ignore this.- Specified by:
applyPostin interfaceTraversalStrategy<TraversalStrategy.OptimizationStrategy>- Specified by:
applyPostin interfaceTraversalStrategy.OptimizationStrategy- Returns:
- the set of strategies that must be executed post this one
-
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.
-
instance
public static InlineFilterStrategy instance()
-
-