public abstract class AbstractOpProcessor extends Object implements OpProcessor
OpProcessor implementation that processes an Iterator of results in a generalized way while
ensuring that graph transactions are properly managed.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
manageTransactions
When set to
true, transactions are always managed otherwise they can be overridden by the request. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOpProcessor(boolean manageTransactions) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
attemptCommit(RequestMessage msg,
GraphManager graphManager,
boolean strict) |
protected static void |
attemptRollback(RequestMessage msg,
GraphManager graphManager,
boolean strict) |
protected Map<String,Object> |
generateMetaData(ChannelHandlerContext ctx,
RequestMessage msg,
ResponseStatusCode code,
Iterator itty)
Generates meta-data to put on a
ResponseMessage. |
protected void |
handleIterator(Context context,
Iterator itty)
Provides a generic way of iterating a result set back to the client.
|
protected void |
handleIterator(ResponseHandlerContext rhc,
Iterator itty)
Deprecated.
As of release 3.3.8, not replaced.
|
protected boolean |
isForceFlushed(ChannelHandlerContext ctx,
RequestMessage msg,
Iterator itty)
Determines if a
Frame should be force flushed outside of the resultIterationBatchSize and the
termination of the iterator. |
protected void |
iterateComplete(ChannelHandlerContext ctx,
RequestMessage msg,
Iterator itty)
Called when iteration within
handleIterator(Context, Iterator) is on its final pass and the final
frame is about to be sent back to the client. |
protected static Frame |
makeFrame(ChannelHandlerContext ctx,
RequestMessage msg,
MessageSerializer serializer,
boolean useBinary,
List<Object> aggregate,
ResponseStatusCode code)
Deprecated.
As of release 3.2.2, replaced by
#makeFrame(Context, RequestMessage, MessageSerializer, boolean, List, ResponseStatusCode, Map). |
protected static Frame |
makeFrame(ChannelHandlerContext ctx,
RequestMessage msg,
MessageSerializer serializer,
boolean useBinary,
List<Object> aggregate,
ResponseStatusCode code,
Map<String,Object> responseMetaData)
Deprecated.
As of release 3.3.8, replaced by
#makeFrame(Context, RequestMessage, MessageSerializer, boolean, List, ResponseStatusCode, Map). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, init, selectcloseprotected final boolean manageTransactions
true, transactions are always managed otherwise they can be overridden by the request.@Deprecated protected void handleIterator(ResponseHandlerContext rhc, Iterator itty) throws TimeoutException, InterruptedException
handleIterator(Context, Iterator) that is suitable for use in situations when multiple
threads may produce final response messages concurrently.TimeoutExceptionInterruptedExceptionprotected void handleIterator(Context context, Iterator itty) throws TimeoutException, InterruptedException
Settings.serializedResponseTimeout configuration and break the serialization process if
it begins to take too long to do so, throwing a TimeoutException in such
cases.context - The Gremlin Server Context which enforces that only a single final response is
sent to the client.itty - The result to iteratorTimeoutException - if the time taken to serialize the entire result set exceeds the allowable time.InterruptedExceptionprotected void iterateComplete(ChannelHandlerContext ctx,
RequestMessage msg,
Iterator itty)
handleIterator(Context, Iterator) is on its final pass and the final
frame is about to be sent back to the client. This method only gets called on successful iteration of the
entire result.protected boolean isForceFlushed(ChannelHandlerContext ctx,
RequestMessage msg,
Iterator itty)
Frame should be force flushed outside of the resultIterationBatchSize and the
termination of the iterator. By default this method return false.itty - a reference to the current Iterator of results - it is not meant to be forwarded in
this methodprotected Map<String,Object> generateMetaData(ChannelHandlerContext ctx, RequestMessage msg, ResponseStatusCode code, Iterator itty)
ResponseMessage.itty - a reference to the current Iterator of results - it is not meant to be forwarded in
this method@Deprecated protected static Frame makeFrame(ChannelHandlerContext ctx, RequestMessage msg, MessageSerializer serializer, boolean useBinary, List<Object> aggregate, ResponseStatusCode code) throws Exception
#makeFrame(Context, RequestMessage, MessageSerializer, boolean, List, ResponseStatusCode, Map).Exception@Deprecated protected static Frame makeFrame(ChannelHandlerContext ctx, RequestMessage msg, MessageSerializer serializer, boolean useBinary, List<Object> aggregate, ResponseStatusCode code, Map<String,Object> responseMetaData) throws Exception
#makeFrame(Context, RequestMessage, MessageSerializer, boolean, List, ResponseStatusCode, Map).Exceptionprotected static void attemptCommit(RequestMessage msg, GraphManager graphManager, boolean strict)
protected static void attemptRollback(RequestMessage msg, GraphManager graphManager, boolean strict)
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.