public static final class GremlinExecutor.Builder extends Object
Modifier and Type | Method and Description |
---|---|
GremlinExecutor.Builder |
addPlugins(String engineName,
Map<String,Map<String,Object>> plugins)
Add a configuration for a
GremlinPlugin to the executor. |
GremlinExecutor.Builder |
afterFailure(BiConsumer<Bindings,Throwable> afterFailure)
A
Consumer to execute in the event of failure. |
GremlinExecutor.Builder |
afterSuccess(Consumer<Bindings> afterSuccess)
A
Consumer to execute just after successful script evaluation. |
GremlinExecutor.Builder |
afterTimeout(Consumer<Bindings> afterTimeout)
A
Consumer to execute if the script times out. |
GremlinExecutor.Builder |
beforeEval(Consumer<Bindings> beforeEval)
A
Consumer to execute just before the script evaluation. |
GremlinExecutor |
create() |
GremlinExecutor.Builder |
evaluationTimeout(long evaluationTimeout)
Amount of time an evaluation has before it times out.
|
GremlinExecutor.Builder |
executorService(ExecutorService executorService)
The thread pool used to evaluate scripts.
|
GremlinExecutor.Builder |
globalBindings(Bindings bindings)
Bindings to apply to every script evaluated.
|
GremlinExecutor.Builder |
scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
The thread pool used to schedule timeouts on scripts.
|
GremlinExecutor.Builder |
scriptEvaluationTimeout(long scriptEvaluationTimeout)
Deprecated.
As of release 3.3.9, replaced by
evaluationTimeout . |
public GremlinExecutor.Builder addPlugins(String engineName, Map<String,Map<String,Object>> plugins)
GremlinPlugin
to the executor. The key is the fully qualified class name
of the GremlinPlugin
instance and the value is a map of configuration values. In that map, the key
is the name of a builder method on the GremlinPlugin
and the value is some argument to pass to that
method.public GremlinExecutor.Builder globalBindings(Bindings bindings)
Bindings
object
will be copied into a newly created ConcurrentBindings
object
at the call of this method.@Deprecated public GremlinExecutor.Builder scriptEvaluationTimeout(long scriptEvaluationTimeout)
evaluationTimeout
.GremlinExecutor.eval(java.lang.String)
).scriptEvaluationTimeout
- Time in milliseconds that an evaluation is allowed to run and its
results potentially transformed. Set to zero to have no timeout set.public GremlinExecutor.Builder evaluationTimeout(long evaluationTimeout)
GremlinExecutor.eval(java.lang.String)
).evaluationTimeout
- Time in milliseconds that an evaluation is allowed to run and its
results potentially transformed. Set to zero to have no timeout set.public GremlinExecutor.Builder executorService(ExecutorService executorService)
public GremlinExecutor.Builder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
public GremlinExecutor.Builder beforeEval(Consumer<Bindings> beforeEval)
Consumer
to execute just before the script evaluation.public GremlinExecutor.Builder afterSuccess(Consumer<Bindings> afterSuccess)
Consumer
to execute just after successful script evaluation. Note that success will be called
after evaluation of the script in the engine and after the results have passed through transformation
(if a transform function is passed to the GremlinExecutor.eval(java.lang.String)
.public GremlinExecutor.Builder afterTimeout(Consumer<Bindings> afterTimeout)
Consumer
to execute if the script times out.public GremlinExecutor.Builder afterFailure(BiConsumer<Bindings,Throwable> afterFailure)
Consumer
to execute in the event of failure.public GremlinExecutor create()
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.