Class Context
java.lang.Object
org.apache.tinkerpop.gremlin.server.Context
The context of Gremlin Server within which a particular request is made.
- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Constructor Summary
ConstructorsConstructorDescriptionContext(RequestMessage requestMessage, io.netty.channel.ChannelHandlerContext ctx, Settings settings, GraphManager graphManager, GremlinExecutor gremlinExecutor, ScheduledExecutorService scheduledExecutorService) -
Method Summary
Modifier and TypeMethodDescriptionintThe batch size resolved for the request, parsed to a positiveint.booleanWhether results should be bulked for the request (see the precedence note in the constructor).io.netty.channel.ChannelHandlerContextGets the Netty context.Gets the set ofGraphobjects configured in Gremlin Server.Gets the executor chosen to evaluate incoming Gremlin scripts based on the request.The language resolved for the request (see the precedence note in the constructor).Gets the current request to Gremlin Server.longThe timeout in milliseconds for the request.Gets the current configuration of Gremlin Server.voidhandleDetachment(List<Object> aggregate) booleanReturnstrueif this request's operation was interrupted by its transaction's absolute lifetime cap, in which case the resulting interrupt should be reported as a transaction timeout rather than an evaluation timeout.booleanReturnstrueif this request is a transaction begin control command.booleanReturnstrueif this request is a transaction commit control command.booleanReturnstrueif this request is a transaction rollback control command.voidsetClosedByLifetimeCap(boolean closedByLifetimeCap) Marks this request's operation as having been interrupted because its transaction hit its absolute lifetime cap.voidsetParameters(Map<String, Object> parameters) voidsetTimeoutExecutor(ScheduledFuture<?> timeoutExecutor) voidsetTransactionId(String transactionId)
-
Constructor Details
-
Context
public Context(RequestMessage requestMessage, io.netty.channel.ChannelHandlerContext ctx, Settings settings, GraphManager graphManager, GremlinExecutor gremlinExecutor, ScheduledExecutorService scheduledExecutorService)
-
-
Method Details
-
setTimeoutExecutor
-
getTimeoutExecutor
-
getRequestTimeout
public long getRequestTimeout()The timeout in milliseconds for the request. Resolved in the constructor (see the precedence note there). -
getMaterializeProperties
-
getLanguage
The language resolved for the request (see the precedence note in the constructor). -
getBatchSize
The batch size resolved for the request, parsed to a positiveint. Parsing happens here (rather than in theContextconstructor) so that an invalid value - non-numeric, non-positive, or greater thanInteger.MAX_VALUE- is surfaced as a bad request viaProcessingExceptionrather than an uncaught error. Callers must be on a path that turns aProcessingExceptioninto a response (i.e. before the200 OKis committed).- Throws:
ProcessingException
-
getBulkResults
public boolean getBulkResults()Whether results should be bulked for the request (see the precedence note in the constructor). -
getScheduledExecutorService
-
getTransactionId
-
isTransactionBegin
public boolean isTransactionBegin()Returnstrueif this request is a transaction begin control command. -
isTransactionCommit
public boolean isTransactionCommit()Returnstrueif this request is a transaction commit control command. -
isTransactionRollback
public boolean isTransactionRollback()Returnstrueif this request is a transaction rollback control command. -
setTransactionId
-
setClosedByLifetimeCap
public void setClosedByLifetimeCap(boolean closedByLifetimeCap) Marks this request's operation as having been interrupted because its transaction hit its absolute lifetime cap. Set by the transaction's lifetime cap before it interrupts the operation. -
isClosedByLifetimeCap
public boolean isClosedByLifetimeCap()Returnstrueif this request's operation was interrupted by its transaction's absolute lifetime cap, in which case the resulting interrupt should be reported as a transaction timeout rather than an evaluation timeout. -
getParameters
-
setParameters
-
getRequestMessage
Gets the current request to Gremlin Server. -
getChannelHandlerContext
public io.netty.channel.ChannelHandlerContext getChannelHandlerContext()Gets the Netty context. -
getSettings
Gets the current configuration of Gremlin Server. -
getGraphManager
Gets the set ofGraphobjects configured in Gremlin Server. -
getGremlinExecutor
Gets the executor chosen to evaluate incoming Gremlin scripts based on the request. -
handleDetachment
-