Class SeedStrategy
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>
-
- org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SeedStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<Class<? extends TraversalStrategy>>
,TraversalStrategy<TraversalStrategy.DecorationStrategy>
,TraversalStrategy.DecorationStrategy
public class SeedStrategy extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy> implements TraversalStrategy.DecorationStrategy
A strategy that resets the specifiedseed
value forSeedable
steps, which in turn will produce deterministic results from those steps. It is important to note that when using this strategy that it only guarantees deterministic results from a step but not from an entire traversal. For example, if a graph does no guarantee iteration order forg.V()
then repeated runs ofg.V().coin(0.5)
with this strategy will return the same number of results but not necessarily the same ones. The same problem can occur in OLAP-based traversals where iteration order is not explicitly guaranteed. The only way to ensure completely deterministic results in that sense is to apply some form oforder()
in these cases- 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
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID_SEED
-
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy
STRATEGY
-
-
Constructor Summary
Constructors Constructor Description SeedStrategy(long seed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Traversal.Admin<?,?> traversal)
static SeedStrategy
create(org.apache.commons.configuration2.Configuration configuration)
org.apache.commons.configuration2.Configuration
getConfiguration()
Get the configuration representation of this strategy.long
getSeed()
-
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, applyPrior
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.DecorationStrategy
compareTo, getTraversalCategory
-
-
-
-
Field Detail
-
ID_SEED
public static final String ID_SEED
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSeed
public long getSeed()
-
apply
public void apply(Traversal.Admin<?,?> traversal)
- Specified by:
apply
in interfaceTraversalStrategy<TraversalStrategy.DecorationStrategy>
-
create
public static SeedStrategy create(org.apache.commons.configuration2.Configuration configuration)
-
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.DecorationStrategy>
- Returns:
- the configuration used to create this strategy
-
-