public abstract class AbstractEvalOpProcessor extends AbstractOpProcessor
OpProcessor implementation that helps with operations that deal
with script evaluation functions.| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractEvalOpProcessor.BindingSupplier |
| Modifier and Type | Field and Description |
|---|---|
static Timer |
evalOpTimer |
protected static Set<String> |
INVALID_BINDINGS_KEYS
This may or may not be the full set of invalid binding keys.
|
protected static Pattern |
validBindingName
Deprecated.
As of release 3.1.2-incubating, not replaced. This
Pattern is not used internally.
Deprecated rather than just removing as it's possible that someone else might be using it when developing
custom OpProcessor implementations. |
manageTransactions| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEvalOpProcessor(boolean manageTransactions) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
evalOpInternal(Context context,
Supplier<GremlinExecutor> gremlinExecutorSupplier,
AbstractEvalOpProcessor.BindingSupplier bindingsSupplier)
A generalized implementation of the "eval" operation.
|
abstract ThrowingConsumer<Context> |
getEvalOp()
Provides an operation for evaluating a Gremlin script.
|
ThrowingConsumer<Context> |
select(Context ctx)
Given the context (which contains the RequestMessage), return back a Consumer function that will be
executed with the context.
|
abstract Optional<ThrowingConsumer<Context>> |
selectOther(RequestMessage requestMessage)
A sub-class may have additional "ops" that it will service.
|
protected Optional<ThrowingConsumer<Context>> |
validateEvalMessage(RequestMessage message) |
attemptCommit, attemptRollback, generateMetaData, handleIterator, isForceFlushed, iterateComplete, makeFrame, makeFrameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, initclosepublic static final Timer evalOpTimer
@Deprecated protected static final Pattern validBindingName
Pattern is not used internally.
Deprecated rather than just removing as it's possible that someone else might be using it when developing
custom OpProcessor implementations.protected static final Set<String> INVALID_BINDINGS_KEYS
toUpperCase() on the accessor values of T solves an issue where the ScriptEngine
ignores private scope on T and imports static fields.protected AbstractEvalOpProcessor(boolean manageTransactions)
public abstract ThrowingConsumer<Context> getEvalOp()
public abstract Optional<ThrowingConsumer<Context>> selectOther(RequestMessage requestMessage) throws OpProcessorException
select(Context) that are not
handled will be passed to this method to see if the sub-class can service the requested op code.OpProcessorExceptionpublic ThrowingConsumer<Context> select(Context ctx) throws OpProcessorException
OpProcessorOpProcessorExceptionprotected Optional<ThrowingConsumer<Context>> validateEvalMessage(RequestMessage message) throws OpProcessorException
OpProcessorExceptionprotected void evalOpInternal(Context context, Supplier<GremlinExecutor> gremlinExecutorSupplier, AbstractEvalOpProcessor.BindingSupplier bindingsSupplier) throws OpProcessorException
ResponseMessage objects down the Netty pipeline. It also handles script timeouts,
iteration timeouts, metrics and building bindings. Note that result iteration is delegated to the
AbstractOpProcessor.handleIterator(org.apache.tinkerpop.gremlin.server.Context, java.util.Iterator) method, so those extending this class could override that method for better control
over result iteration.context - The current Gremlin Server ContextgremlinExecutorSupplier - A function that returns the GremlinExecutor to use in executing the
script evaluation.bindingsSupplier - A function that returns the Bindings to provide to the
GremlinExecutor.eval(java.lang.String) method.OpProcessorExceptionCopyright © 2013–2016 Apache Software Foundation. All rights reserved.