Class GremlinExecutor.Builder
java.lang.Object
org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.Builder
- Enclosing class:
- GremlinExecutor
-
Method Summary
Modifier and TypeMethodDescriptionAdd a configuration for aGremlinPluginto the executor.afterFailure(BiConsumer<Bindings, Throwable> afterFailure) AConsumerto execute in the event of failure.afterSuccess(Consumer<Bindings> afterSuccess) AConsumerto execute just after successful script evaluation.afterTimeout(BiConsumer<Bindings, Throwable> afterTimeout) ABiConsumerto execute if the script times out.afterTimeout(Consumer<Bindings> afterTimeout) Deprecated.allowedEngineNames(Set<String> allowedEngineNames) Set the allowed engine names for theGremlinScriptEngineManager.beforeEval(Consumer<Bindings> beforeEval) AConsumerto execute just before the script evaluation.create()executorService(ExecutorService executorService) The thread pool used to evaluate scripts.globalBindings(Bindings bindings) Bindings to apply to every script evaluated.scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) The thread pool used to schedule timeouts on scripts.timeoutMillis(long timeoutMillis) Amount of time an evaluation has before it times out.
-
Method Details
-
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. -
allowedEngineNames
Set the allowed engine names for theGremlinScriptEngineManager. Only engines whose names appear in this set will be returned byGremlinScriptEngineManager.getEngineByName(String). Passnullto allow all SPI-discovered engines (the default). -
globalBindings
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. -
timeoutMillis
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:
timeoutMillis- Time in milliseconds that an evaluation is allowed to run and its results potentially transformed. Set to zero to have no timeout set.
-
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
AConsumerto execute just before the script evaluation. -
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.As of release 3.6.2, replaced byafterTimeout(BiConsumer). -
afterTimeout
ABiConsumerto execute if the script times out. -
afterFailure
AConsumerto execute in the event of failure. -
create
-
afterTimeout(BiConsumer).