public final class ScriptTraversal<S,E> extends DefaultTraversal<S,E>
ScriptEngine
and a script which is compiled into a Traversal
at Admin#applyStrategies()
.
This is useful for serializing traversals as the compilation can happen on the remote end where the traversal will ultimately be processed.Traversal.Admin<S,E>, Traversal.Exceptions, Traversal.Symbols
bytecode, generator, graph, locked, parent, requirements, sideEffects, steps, strategies, unmodifiableSteps
Constructor and Description |
---|
ScriptTraversal(TraversalSource traversalSource,
String scriptEngine,
String script,
Object... bindings) |
Modifier and Type | Method and Description |
---|---|
void |
applyStrategies()
Apply the registered
TraversalStrategies to the traversal. |
addStart, addStarts, addStep, asAdmin, clone, equals, getBytecode, getEndStep, getGraph, getParent, getSideEffects, getStartStep, getSteps, getStrategies, getTraverserGenerator, getTraverserRequirements, hashCode, hasNext, isLocked, next, nextTraverser, removeStep, reset, setGraph, setParent, setSideEffects, setStrategies, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
addStep, equals, removeStep
public ScriptTraversal(TraversalSource traversalSource, String scriptEngine, String script, Object... bindings)
public void applyStrategies() throws IllegalStateException
Traversal.Admin
TraversalStrategies
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 strategies to root traversal, then to nested traversals.applyStrategies
in interface Traversal.Admin<S,E>
applyStrategies
in class DefaultTraversal<S,E>
IllegalStateException
- if the TraversalStrategies
have already been appliedCopyright © 2013–2020 Apache Software Foundation. All rights reserved.