Class GremlinExecutor.Builder
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.Builder
-
- Enclosing class:
- GremlinExecutor
public static final class GremlinExecutor.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GremlinExecutor.BuilderaddPlugins(String engineName, Map<String,Map<String,Object>> plugins)Add a configuration for aGremlinPluginto the executor.GremlinExecutor.BuilderafterFailure(BiConsumer<Bindings,Throwable> afterFailure)AConsumerto execute in the event of failure.GremlinExecutor.BuilderafterSuccess(Consumer<Bindings> afterSuccess)AConsumerto execute just after successful script evaluation.GremlinExecutor.BuilderafterTimeout(BiConsumer<Bindings,Throwable> afterTimeout)ABiConsumerto execute if the script times out.GremlinExecutor.BuilderafterTimeout(Consumer<Bindings> afterTimeout)Deprecated.As of release 3.6.2, replaced byafterTimeout(BiConsumer).GremlinExecutor.BuilderbeforeEval(Consumer<Bindings> beforeEval)AConsumerto execute just before the script evaluation.GremlinExecutorcreate()GremlinExecutor.BuilderevaluationTimeout(long evaluationTimeout)Amount of time an evaluation has before it times out.GremlinExecutor.BuilderexecutorService(ExecutorService executorService)The thread pool used to evaluate scripts.GremlinExecutor.BuilderglobalBindings(Bindings bindings)Bindings to apply to every script evaluated.GremlinExecutor.BuilderscheduledExecutorService(ScheduledExecutorService scheduledExecutorService)The thread pool used to schedule timeouts on scripts.
-
-
-
Method Detail
-
addPlugins
public GremlinExecutor.Builder addPlugins(String engineName, Map<String,Map<String,Object>> plugins)
Add a configuration for aGremlinPluginto the executor. The key is the fully qualified class name of theGremlinPlugininstance and the value is a map of configuration values. In that map, the key is the name of a builder method on theGremlinPluginand the value is some argument to pass to that method.
-
globalBindings
public GremlinExecutor.Builder globalBindings(Bindings bindings)
Bindings to apply to every script evaluated. Note that the entries of the suppliedBindingsobject will be copied into a newly createdConcurrentBindingsobject at the call of this method.
-
evaluationTimeout
public GremlinExecutor.Builder evaluationTimeout(long evaluationTimeout)
Amount of time an evaluation has before it times out. Note that the time required covers both evaluation as well as any time needed for a post result transformation (if the transformation function is supplied to theGremlinExecutor.eval(java.lang.String)).- Parameters:
evaluationTimeout- Time in milliseconds that an evaluation is allowed to run and its results potentially transformed. Set to zero to have no timeout set.
-
executorService
public GremlinExecutor.Builder executorService(ExecutorService executorService)
The thread pool used to evaluate scripts.
-
scheduledExecutorService
public GremlinExecutor.Builder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
The thread pool used to schedule timeouts on scripts.
-
beforeEval
public GremlinExecutor.Builder beforeEval(Consumer<Bindings> beforeEval)
AConsumerto execute just before the script evaluation.
-
afterSuccess
public GremlinExecutor.Builder afterSuccess(Consumer<Bindings> afterSuccess)
AConsumerto 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 theGremlinExecutor.eval(java.lang.String).
-
afterTimeout
@Deprecated public GremlinExecutor.Builder afterTimeout(Consumer<Bindings> afterTimeout)
Deprecated.As of release 3.6.2, replaced byafterTimeout(BiConsumer).
-
afterTimeout
public GremlinExecutor.Builder afterTimeout(BiConsumer<Bindings,Throwable> afterTimeout)
ABiConsumerto execute if the script times out.
-
afterFailure
public GremlinExecutor.Builder afterFailure(BiConsumer<Bindings,Throwable> afterFailure)
AConsumerto execute in the event of failure.
-
create
public GremlinExecutor create()
-
-