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)
Add a particular script engine for the executor to instantiate.
|
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)
Set of the names of plugins that should be enabled for the engine.
|
GremlinExecutor.Builder |
engineSettings(Map<String,org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.EngineSettings> settings)
Replaces any settings provided by
engineSettings(java.util.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 |
promoteBindings(Predicate<Map.Entry<String,Object>> promoteBinding)
Deprecated.
|
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)
A set of maven coordinates for dependencies to be applied for the script engine instances.
|
public GremlinExecutor.Builder addEngineSettings(String engineName, List<String> imports, List<String> staticImports, List<String> scripts, Map<String,Object> config)
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 ScriptEngine@Deprecated public GremlinExecutor.Builder promoteBindings(Predicate<Map.Entry<String,Object>> promoteBinding)
public GremlinExecutor.Builder globalBindings(Bindings bindings)
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.public GremlinExecutor.Builder engineSettings(Map<String,org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.EngineSettings> settings)
engineSettings(java.util.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.public GremlinExecutor.Builder use(List<List<String>> use)
public GremlinExecutor.Builder enabledPlugins(Set<String> enabledPlugins)
public GremlinExecutor create()
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.