org.apache.tinkerpop.gremlin.groovy.engine

## 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
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### addPlugins

          public GremlinExecutor.Builder addPlugins(String engineName,
                                                    Map<String,Map<String,Object>> plugins)

      Add a configuration for a `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.

    - #### globalBindings

          public GremlinExecutor.Builder globalBindings(Bindings bindings)

      Bindings to apply to every script evaluated. Note that the entries of the supplied `Bindings` object will be copied into a newly created `ConcurrentBindings` object 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 the `GremlinExecutor.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)

      A `Consumer` to execute just before the script evaluation.

    - #### afterSuccess

          public GremlinExecutor.Builder afterSuccess(Consumer<Bindings> afterSuccess)

      A `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)`.

    - #### afterTimeout

          public GremlinExecutor.Builder afterTimeout(Consumer<Bindings> afterTimeout)

      A `Consumer` to execute if the script times out.

    - #### afterFailure

          public GremlinExecutor.Builder afterFailure(BiConsumer<Bindings,Throwable> afterFailure)

      A `Consumer` to execute in the event of failure.

    - #### create

          public GremlinExecutor create()

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.