Package com.linkedin.alpini.router
Class ScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,CHC,BHS extends BasicRequest,HR,HRS extends io.netty.handler.codec.http.HttpResponseStatus,SCATTER_GATHER_HELPER extends ScatterGatherHelper<H,P,K,R,BHS,HR,HRS>>              
java.lang.Object
com.linkedin.alpini.router.ScatterGatherRequestHandler<H,P,K,R>
   
com.linkedin.alpini.router.ScatterGatherRequestHandlerImpl<H,P,K,R,CHC,BHS,HR,HRS,SCATTER_GATHER_HELPER>        
- Direct Known Subclasses:
 ScatterGatherRequestHandler4
public abstract class ScatterGatherRequestHandlerImpl<H,P extends ResourcePath<K>,K,R,CHC,BHS extends BasicRequest,HR,HRS extends io.netty.handler.codec.http.HttpResponseStatus,SCATTER_GATHER_HELPER extends ScatterGatherHelper<H,P,K,R,BHS,HR,HRS>>              
extends ScatterGatherRequestHandler<H,P,K,R>   
- 
Field Summary
Fields inherited from class com.linkedin.alpini.router.ScatterGatherRequestHandler
_timeoutProcessor, LOG, NOP - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScatterGatherRequestHandlerImpl(SCATTER_GATHER_HELPER scatterGatherHelper, TimeoutProcessor timeoutProcessor) protectedScatterGatherRequestHandlerImpl(SCATTER_GATHER_HELPER scatterGatherHelper, RouterTimeoutProcessor timeoutProcessor)  - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected CompletionStage<?>appendErrorForEveryKey(BHS request, List<HR> responses, HRS status, String contentMessage, Throwable ex, ResourcePathParser<P, K> pathParser, ScatterGatherRequest<H, K> part, P basePath) protected voidappendErrorsForOfflinePartitions(BHS request, Scatter<H, P, K> scatter, List<AsyncFuture<List<HR>>> responseFutures) protected abstract HRSprotected abstract HRbuildErrorResponse(BHS request, HRS status, String contentMessage, Throwable ex) protected HRbuildExceptionResponse(BHS request, Throwable cause) protected abstract HRbuildResponse(BHS request, Metrics metrics, List<HR> gatheredResponses) protected final voiddispatch(Scatter<H, P, K> scatter, ScatterGatherRequest<H, K> part, P path, BHS request, AsyncPromise<H> hostSelected, AsyncPromise<List<HR>> responseFuture, AsyncPromise<HRS> retryFuture, AsyncFuture<Void> timeoutFuture, Executor contextExecutor) protected abstract Executorprotected abstract HRSprotected abstract StringgetReasonPhrase(HRS status) protected abstract intgetResponseCode(HR response) protected abstract HeadersgetResponseHeaders(HR response) protected abstract intgetResponseReadable(HR response) final SCATTER_GATHER_HELPERprotected AsyncFuture<HR>protected abstract booleanhasErrorInStorageNodeResponse(HR response) protected voidprotected voidprotected voidprotected abstract HRSprotected booleanisLastAttempt(HRS status) protected abstract booleanisRequestRetriable(P path, R role, HRS status) protected abstract booleanisSuccessStatus(HRS status) protected abstract booleanisTooLongFrameException(Throwable cause) protected abstract HRSprotected BHSprepareRequest(BHS value) protected AsyncFutureListener<HRS>prepareRetry(AsyncFuture<H> hostFuture, P path, BHS requestRef, R role, AsyncPromise<List<HR>> responseFuture, AsyncFuture<Void> timeoutFuture, Executor contextExecutor, HostHealthMonitor<H> hostHealthMonitor, ScatterGatherStats.Delta stats, Metrics m) protected booleanreleaseRequest(BHS value) protected booleanreleaseResponse(HR value) protected BHSretainRequest(BHS value) protected abstract HRSprotected abstract voidsetKeepAlive(HR response, boolean keepAlive) static voidsetMetric(Metrics metric, MetricNames metricName, long value) protected abstract HRSstatusOf(int code) protected abstract Runnableprotected Runnabletimeout(CHC ctx, String msg, AsyncPromise<Void> timeoutFuture) protected <T> Runnabletimeout(CHC ctx, String msg, AsyncPromise<T> timeoutFuture, T value) protected static ThrowableMethods inherited from class com.linkedin.alpini.router.ScatterGatherRequestHandler
make, make 
- 
Constructor Details
- 
ScatterGatherRequestHandlerImpl
protected ScatterGatherRequestHandlerImpl(@Nonnull SCATTER_GATHER_HELPER scatterGatherHelper, @Nonnull TimeoutProcessor timeoutProcessor)  - 
ScatterGatherRequestHandlerImpl
protected ScatterGatherRequestHandlerImpl(@Nonnull SCATTER_GATHER_HELPER scatterGatherHelper, @Nonnull RouterTimeoutProcessor timeoutProcessor)  
 - 
 - 
Method Details
- 
getScatterGatherHelper
- Specified by:
 getScatterGatherHelperin classScatterGatherRequestHandler<H,P extends ResourcePath<K>, K, R> 
 - 
setMetric
 - 
timeout
 - 
timeout
 - 
timeout
 - 
executor
 - 
handler
- Throws:
 Exception
 - 
unwrapCompletion
 - 
statusOf
 - 
multiStatus
 - 
badRequest
 - 
gatewayTimeout
 - 
internalServerError
 - 
isSuccessStatus
 - 
isRequestRetriable
 - 
getReasonPhrase
 - 
prepareRequest
 - 
retainRequest
 - 
releaseRequest
 - 
releaseResponse
 - 
isLastAttempt
 - 
prepareRetry
@Nonnull protected AsyncFutureListener<HRS> prepareRetry(@Nonnull AsyncFuture<H> hostFuture, @Nonnull P path, @Nonnull BHS requestRef, @Nonnull R role, @Nonnull AsyncPromise<List<HR>> responseFuture, @Nonnull AsyncFuture<Void> timeoutFuture, @Nonnull Executor contextExecutor, @Nonnull HostHealthMonitor<H> hostHealthMonitor, @Nonnull ScatterGatherStats.Delta stats, Metrics m)  - 
incrementTotalRetries
 - 
incrementTotalRetriesError
 - 
incrementTotalRetriesWinner
 - 
getResponseCode
 - 
getResponseReadable
 - 
hasErrorInStorageNodeResponse
 - 
getResponseHeaders
 - 
setKeepAlive
 - 
buildResponse
 - 
appendErrorsForOfflinePartitions
 - 
appendErrorForEveryKey
protected CompletionStage<?> appendErrorForEveryKey(@Nonnull BHS request, @Nonnull List<HR> responses, @Nonnull HRS status, String contentMessage, Throwable ex, @Nonnull ResourcePathParser<P, K> pathParser, @Nonnull ScatterGatherRequest<H, K> part, @Nonnull P basePath)  - 
appendError
 - 
isTooLongFrameException
- Specified by:
 isTooLongFrameExceptionin classScatterGatherRequestHandler<H,P extends ResourcePath<K>, K, R> 
 - 
buildExceptionResponse
 - 
buildErrorResponse
 - 
dispatch
protected final void dispatch(@Nonnull Scatter<H, P, K> scatter, @Nonnull ScatterGatherRequest<H, K> part, @Nonnull P path, @Nonnull BHS request, @Nonnull AsyncPromise<H> hostSelected, @Nonnull AsyncPromise<List<HR>> responseFuture, @Nonnull AsyncPromise<HRS> retryFuture, @Nonnull AsyncFuture<Void> timeoutFuture, @Nonnull Executor contextExecutor)  
 -