public static final class GremlinExecutor.Builder extends Object
Modifier and Type | Method and Description |
---|---|
GremlinExecutor.Builder |
addEngineSettings(String engineName,
List<String> imports,
List<String> staticImports,
List<String> scripts,
Map<String,Object> config)
Deprecated.
As of release 3.2.4, replaced by
addPlugins(String, Map) . |
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 |
enabledPlugins(Set<String> enabledPlugins)
Deprecated.
As of release 3.2.4, replaced by
addPlugins(String, Map) though behavior is not quite
the same. |
GremlinExecutor.Builder |
engineSettings(Map<String,org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.EngineSettings> settings)
Deprecated.
As of release 3.2.4, replaced by
addPlugins(String, Map) . |
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)
Amount of time a script has before it times out.
|
GremlinExecutor.Builder |
use(List<List<String>> use)
Deprecated.
As of release 3.2.4, not replaced.
|
@Deprecated public GremlinExecutor.Builder addEngineSettings(String engineName, List<String> imports, List<String> staticImports, List<String> scripts, Map<String,Object> config)
addPlugins(String, Map)
.engineName
- The name of the engine as defined by the engine itself.imports
- A list of imports for the engine.staticImports
- A list of static imports for the engine.scripts
- A list of scripts to execute in the engine to initialize it.config
- Custom configuration map for the ScriptEnginepublic 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.public GremlinExecutor.Builder scriptEvaluationTimeout(long scriptEvaluationTimeout)
GremlinExecutor.eval(java.lang.String)
).scriptEvaluationTimeout
- Time in milliseconds that a script is allowed to run and its
results potentially transformed. Set to zero to have no timeout set.@Deprecated public GremlinExecutor.Builder engineSettings(Map<String,org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.EngineSettings> settings)
addPlugins(String, Map)
.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.@Deprecated public GremlinExecutor.Builder use(List<List<String>> use)
@Deprecated public GremlinExecutor.Builder enabledPlugins(Set<String> enabledPlugins)
addPlugins(String, Map)
though behavior is not quite
the same.public GremlinExecutor create()
Copyright © 2013–2017 Apache Software Foundation. All rights reserved.