Class ScriptTraversal<S,E>
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal<S,E>
-
- org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal<S,E>
-
- All Implemented Interfaces:
Serializable
,AutoCloseable
,Cloneable
,Iterator<E>
,Traversal<S,E>
,Traversal.Admin<S,E>
public final class ScriptTraversal<S,E> extends DefaultTraversal<S,E>
ScriptTraversal encapsulates aScriptEngine
and a script which is compiled into aTraversal
atTraversal.Admin.applyStrategies()
. This is useful for serializing traversals as the compilation can happen on the remote end where the traversal will ultimately be processed.- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Traversal
Traversal.Admin<S,E>, Traversal.Exceptions, Traversal.Symbols
-
-
Field Summary
-
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal
bytecode, closed, g, generator, graph, locked, parent, requirements, sideEffects, steps, strategies, unmodifiableSteps
-
-
Constructor Summary
Constructors Constructor Description ScriptTraversal(TraversalSource traversalSource, String scriptEngine, String script, Object... bindings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyStrategies()
Apply the registeredTraversalStrategies
to the traversal.-
Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal
addStart, addStarts, addStep, asAdmin, clone, equals, getBytecode, getEndStep, getGraph, getParent, getSideEffects, getStartStep, getSteps, getStrategies, getTraversalSource, getTraverserGenerator, getTraverserRequirements, hashCode, hasNext, isClosed, isLocked, lock, next, nextTraverser, notifyClose, removeStep, reset, setGraph, setLocked, setParent, setSideEffects, setStrategies, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Traversal
close, explain, fill, forEachRemaining, forEachRemaining, iterate, next, none, profile, promise, toBulkSet, toList, toSet, toStream, tryNext
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin
addStep, equals, getTraverserSetSupplier, isRoot, removeStep
-
-
-
-
Constructor Detail
-
ScriptTraversal
public ScriptTraversal(TraversalSource traversalSource, String scriptEngine, String script, Object... bindings)
-
-
Method Detail
-
applyStrategies
public void applyStrategies() throws IllegalStateException
Description copied from interface:Traversal.Admin
Apply the registeredTraversalStrategies
to the traversal. Once the strategies are applied, the traversal is "locked" and can no longer have steps added to it. The order of operations for strategy applications should be: globally id steps, apply each strategy in turn to root traversal, then recursively to nested traversals.- Specified by:
applyStrategies
in interfaceTraversal.Admin<S,E>
- Overrides:
applyStrategies
in classDefaultTraversal<S,E>
- Throws:
IllegalStateException
- if theTraversalStrategies
have already been applied
-
-