Package com.linkedin.venice.router.api
Class VeniceResponseAggregator
java.lang.Object
com.linkedin.venice.router.api.VeniceResponseAggregator
- All Implemented Interfaces:
ResponseAggregatorFactory<BasicHttpRequest,io.netty.handler.codec.http.FullHttpResponse>
public class VeniceResponseAggregator
extends Object
implements ResponseAggregatorFactory<BasicHttpRequest,io.netty.handler.codec.http.FullHttpResponse>
VeniceResponseAggregator aggregates the sub-responses returned by storage node for a multi-get request.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<CharSequence,String> static final Map<CharSequence,String> -
Constructor Summary
ConstructorsConstructorDescriptionVeniceResponseAggregator(RouterStats<AggRouterHttpRequestStats> routerStats, Optional<MetaStoreShadowReader> metaStoreShadowReaderOptional) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.handler.codec.http.FullHttpResponsebuildResponse(BasicHttpRequest request, Metrics metrics, List<io.netty.handler.codec.http.FullHttpResponse> gatheredResponses) voidinitHelixGroupSelector(HelixGroupSelector helixGroupSelector) protected io.netty.handler.codec.http.FullHttpResponseprocessComputeResponses(List<io.netty.handler.codec.http.FullHttpResponse> responses, String storeName, String clientComputeHeader) protected io.netty.handler.codec.http.FullHttpResponseprocessMultiGetResponses(List<io.netty.handler.codec.http.FullHttpResponse> responses, String storeName, int version, String clientComputeHeader) If a part of a multi-get request fails, the entire request should fail from the client's perspective.withComputeTardyThreshold(long timeout, TimeUnit unit) withMultiGetTardyThreshold(long timeout, TimeUnit unit) withSingleGetTardyThreshold(long timeout, TimeUnit unit)
-
Field Details
-
MULTI_GET_VALID_HEADER_MAP
-
COMPUTE_VALID_HEADER_MAP
-
-
Constructor Details
-
VeniceResponseAggregator
public VeniceResponseAggregator(RouterStats<AggRouterHttpRequestStats> routerStats, Optional<MetaStoreShadowReader> metaStoreShadowReaderOptional)
-
-
Method Details
-
withSingleGetTardyThreshold
-
withMultiGetTardyThreshold
-
withComputeTardyThreshold
-
initHelixGroupSelector
-
buildResponse
@Nonnull public io.netty.handler.codec.http.FullHttpResponse buildResponse(@Nonnull BasicHttpRequest request, Metrics metrics, @Nonnull List<io.netty.handler.codec.http.FullHttpResponse> gatheredResponses) - Specified by:
buildResponsein interfaceResponseAggregatorFactory<BasicHttpRequest,io.netty.handler.codec.http.FullHttpResponse>
-
processComputeResponses
-
processMultiGetResponses
protected io.netty.handler.codec.http.FullHttpResponse processMultiGetResponses(List<io.netty.handler.codec.http.FullHttpResponse> responses, String storeName, int version, String clientComputeHeader) If a part of a multi-get request fails, the entire request should fail from the client's perspective.- Parameters:
responses- Subset of responses from the SN to be concatenated to form the response to the client (guaranteed not empty).- Returns:
- The concatenated response that should be sent to the client along with some content-related headers.
-