Package com.linkedin.alpini.router
Class ScatterGatherRequestHandler4<H,P extends ResourcePath<K>,K,R>
- java.lang.Object
-
- com.linkedin.alpini.router.ScatterGatherRequestHandler<H,P,K,R>
-
- com.linkedin.alpini.router.ScatterGatherRequestHandlerImpl<H,P,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
- com.linkedin.alpini.router.ScatterGatherRequestHandler4<H,P,K,R>
-
- All Implemented Interfaces:
AsyncFullHttpRequestHandler.RequestHandler
public class ScatterGatherRequestHandler4<H,P extends ResourcePath<K>,K,R> extends ScatterGatherRequestHandlerImpl<H,P,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>> implements AsyncFullHttpRequestHandler.RequestHandler
-
-
Field Summary
Fields Modifier and Type Field Description static io.netty.util.AsciiString
X_STACKTRACE
-
Fields inherited from class com.linkedin.alpini.router.ScatterGatherRequestHandler
_timeoutProcessor, LOG, NOP
-
-
Constructor Summary
Constructors Constructor Description ScatterGatherRequestHandler4(ScatterGatherHelper<H,P,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus> scatterGatherHelper, TimeoutProcessor timeoutProcessor, java.util.concurrent.Executor executor)
Deprecated.ScatterGatherRequestHandler4(ScatterGatherHelper<H,P,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus> scatterGatherHelper, RouterTimeoutProcessor timeoutProcessor, java.util.concurrent.Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.netty.handler.codec.http.HttpResponseStatus
badRequest()
protected io.netty.handler.codec.http.FullHttpResponse
buildErrorResponse(BasicFullHttpRequest request, io.netty.handler.codec.http.HttpResponseStatus status, java.lang.String contentMessage, java.lang.Throwable ex)
protected io.netty.handler.codec.http.FullHttpResponse
buildResponse(BasicFullHttpRequest request, Metrics metrics, java.util.List<io.netty.handler.codec.http.FullHttpResponse> gatheredResponses)
protected java.util.concurrent.Executor
executor(io.netty.channel.ChannelHandlerContext ctx)
protected io.netty.handler.codec.http.HttpResponseStatus
gatewayTimeout()
protected java.lang.String
getReasonPhrase(io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
protected int
getResponseCode(io.netty.handler.codec.http.FullHttpResponse response)
protected Headers
getResponseHeaders(io.netty.handler.codec.http.FullHttpResponse response)
protected int
getResponseReadable(io.netty.handler.codec.http.FullHttpResponse response)
AsyncFuture<io.netty.handler.codec.http.FullHttpResponse>
handler(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest request)
protected boolean
hasErrorInStorageNodeResponse(io.netty.handler.codec.http.FullHttpResponse response)
protected io.netty.handler.codec.http.HttpResponseStatus
internalServerError()
protected boolean
isRequestRetriable(P path, R role, io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
protected boolean
isServiceUnavailable(io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
protected boolean
isSuccessStatus(io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
protected boolean
isTooLongFrameException(java.lang.Throwable cause)
protected io.netty.handler.codec.http.HttpResponseStatus
multiStatus()
protected boolean
releaseRequest(BasicFullHttpRequest request)
protected boolean
releaseResponse(io.netty.handler.codec.http.FullHttpResponse response)
protected BasicFullHttpRequest
retainRequest(BasicFullHttpRequest request)
protected io.netty.handler.codec.http.HttpResponseStatus
serviceUnavailable()
protected void
setKeepAlive(io.netty.handler.codec.http.FullHttpResponse response, boolean keepAlive)
protected io.netty.handler.codec.http.HttpResponseStatus
statusOf(int code)
protected java.lang.Runnable
timeout(io.netty.channel.ChannelHandlerContext ctx, java.lang.Runnable task)
protected io.netty.handler.codec.http.HttpResponseStatus
tooManyRequests()
-
Methods inherited from class com.linkedin.alpini.router.ScatterGatherRequestHandlerImpl
appendError, appendErrorForEveryKey, appendErrorsForOfflinePartitions, buildExceptionResponse, dispatch, getScatterGatherHelper, handler, incrementTotalRetries, incrementTotalRetriesError, incrementTotalRetriesWinner, isLastAttempt, prepareRequest, prepareRetry, setMetric, timeout, timeout, unwrapCompletion
-
Methods inherited from class com.linkedin.alpini.router.ScatterGatherRequestHandler
make, make
-
-
-
-
Constructor Detail
-
ScatterGatherRequestHandler4
public ScatterGatherRequestHandler4(@Nonnull ScatterGatherHelper<H,P,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus> scatterGatherHelper, @Nonnull RouterTimeoutProcessor timeoutProcessor, @Nonnull java.util.concurrent.Executor executor)
-
ScatterGatherRequestHandler4
@Deprecated public ScatterGatherRequestHandler4(@Nonnull ScatterGatherHelper<H,P,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus> scatterGatherHelper, @Nonnull TimeoutProcessor timeoutProcessor, @Nonnull java.util.concurrent.Executor executor)
Deprecated.
-
-
Method Detail
-
retainRequest
@Nonnull protected BasicFullHttpRequest retainRequest(@Nonnull BasicFullHttpRequest request)
- Overrides:
retainRequest
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
releaseRequest
protected boolean releaseRequest(BasicFullHttpRequest request)
- Overrides:
releaseRequest
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
releaseResponse
protected boolean releaseResponse(io.netty.handler.codec.http.FullHttpResponse response)
- Overrides:
releaseResponse
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
handler
@Nonnull public AsyncFuture<io.netty.handler.codec.http.FullHttpResponse> handler(@Nonnull io.netty.channel.ChannelHandlerContext ctx, @Nonnull io.netty.handler.codec.http.FullHttpRequest request)
- Specified by:
handler
in interfaceAsyncFullHttpRequestHandler.RequestHandler
-
timeout
protected java.lang.Runnable timeout(io.netty.channel.ChannelHandlerContext ctx, java.lang.Runnable task)
- Specified by:
timeout
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
executor
protected java.util.concurrent.Executor executor(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
executor
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
statusOf
protected io.netty.handler.codec.http.HttpResponseStatus statusOf(int code)
- Specified by:
statusOf
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
multiStatus
protected io.netty.handler.codec.http.HttpResponseStatus multiStatus()
- Specified by:
multiStatus
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
badRequest
protected io.netty.handler.codec.http.HttpResponseStatus badRequest()
- Specified by:
badRequest
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
gatewayTimeout
protected io.netty.handler.codec.http.HttpResponseStatus gatewayTimeout()
- Specified by:
gatewayTimeout
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
tooManyRequests
protected io.netty.handler.codec.http.HttpResponseStatus tooManyRequests()
- Specified by:
tooManyRequests
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
serviceUnavailable
protected io.netty.handler.codec.http.HttpResponseStatus serviceUnavailable()
- Specified by:
serviceUnavailable
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
internalServerError
protected io.netty.handler.codec.http.HttpResponseStatus internalServerError()
- Specified by:
internalServerError
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
isSuccessStatus
protected boolean isSuccessStatus(io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
- Specified by:
isSuccessStatus
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
isRequestRetriable
protected boolean isRequestRetriable(@Nonnull P path, @Nonnull R role, io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
- Specified by:
isRequestRetriable
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
isServiceUnavailable
protected boolean isServiceUnavailable(io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
- Specified by:
isServiceUnavailable
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
getReasonPhrase
protected java.lang.String getReasonPhrase(io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus)
- Specified by:
getReasonPhrase
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
getResponseCode
protected int getResponseCode(io.netty.handler.codec.http.FullHttpResponse response)
- Specified by:
getResponseCode
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
getResponseReadable
protected int getResponseReadable(io.netty.handler.codec.http.FullHttpResponse response)
- Specified by:
getResponseReadable
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
hasErrorInStorageNodeResponse
protected boolean hasErrorInStorageNodeResponse(io.netty.handler.codec.http.FullHttpResponse response)
- Specified by:
hasErrorInStorageNodeResponse
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
getResponseHeaders
protected Headers getResponseHeaders(io.netty.handler.codec.http.FullHttpResponse response)
- Specified by:
getResponseHeaders
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
setKeepAlive
protected void setKeepAlive(io.netty.handler.codec.http.FullHttpResponse response, boolean keepAlive)
- Specified by:
setKeepAlive
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
buildResponse
@Nonnull protected io.netty.handler.codec.http.FullHttpResponse buildResponse(@Nonnull BasicFullHttpRequest request, Metrics metrics, @Nonnull java.util.List<io.netty.handler.codec.http.FullHttpResponse> gatheredResponses)
- Specified by:
buildResponse
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
isTooLongFrameException
protected boolean isTooLongFrameException(java.lang.Throwable cause)
- Specified by:
isTooLongFrameException
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
buildErrorResponse
@Nonnull protected io.netty.handler.codec.http.FullHttpResponse buildErrorResponse(@Nonnull BasicFullHttpRequest request, @Nonnull io.netty.handler.codec.http.HttpResponseStatus status, java.lang.String contentMessage, java.lang.Throwable ex)
- Specified by:
buildErrorResponse
in classScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,io.netty.channel.ChannelHandlerContext,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus,ScatterGatherHelper<H,P extends ResourcePath<K>,K,R,BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse,io.netty.handler.codec.http.HttpResponseStatus>>
-
-