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 inherited from class com.linkedin.alpini.router.ScatterGatherRequestHandler
_timeoutProcessor, LOG, NOP
-
Constructor Summary
ConstructorDescriptionScatterGatherRequestHandler4
(ScatterGatherHelper<H, P, K, R, BasicFullHttpRequest, io.netty.handler.codec.http.FullHttpResponse, io.netty.handler.codec.http.HttpResponseStatus> scatterGatherHelper, TimeoutProcessor timeoutProcessor, 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, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionprotected io.netty.handler.codec.http.HttpResponseStatus
protected io.netty.handler.codec.http.FullHttpResponse
buildErrorResponse
(BasicFullHttpRequest request, io.netty.handler.codec.http.HttpResponseStatus status, String contentMessage, Throwable ex) protected io.netty.handler.codec.http.FullHttpResponse
buildResponse
(BasicFullHttpRequest request, Metrics metrics, List<io.netty.handler.codec.http.FullHttpResponse> gatheredResponses) protected Executor
executor
(io.netty.channel.ChannelHandlerContext ctx) protected io.netty.handler.codec.http.HttpResponseStatus
protected 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
protected boolean
isRequestRetriable
(P path, R role, io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus) protected boolean
isSuccessStatus
(io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus) protected boolean
isTooLongFrameException
(Throwable cause) protected io.netty.handler.codec.http.HttpResponseStatus
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
protected void
setKeepAlive
(io.netty.handler.codec.http.FullHttpResponse response, boolean keepAlive) protected io.netty.handler.codec.http.HttpResponseStatus
statusOf
(int code) protected Runnable
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
-
Field Details
-
X_STACKTRACE
public static final io.netty.util.AsciiString X_STACKTRACE
-
-
Constructor Details
-
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 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 Executor executor) Deprecated.
-
-
Method Details
-
retainRequest
- 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
- 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
- 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
- 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>>
-
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>>
-
getReasonPhrase
- 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
- 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 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
- 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, String contentMessage, 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>>
-