Package com.linkedin.venice.router.api
Class VeniceResponseAggregator
java.lang.Object
com.linkedin.venice.router.api.VeniceResponseAggregator
- All Implemented Interfaces:
ResponseAggregatorFactory<BasicFullHttpRequest,
io.netty.handler.codec.http.FullHttpResponse>
public class VeniceResponseAggregator
extends Object
implements ResponseAggregatorFactory<BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse>
VeniceResponseAggregator
aggregates the sub-responses returned by storage node for a multi-get request.-
Field Summary
Modifier and TypeFieldDescriptionstatic final Map<CharSequence,
String> static final Map<CharSequence,
String> -
Constructor Summary
ConstructorDescriptionVeniceResponseAggregator
(RouterStats<AggRouterHttpRequestStats> routerStats, Optional<MetaStoreShadowReader> metaStoreShadowReaderOptional) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.handler.codec.http.FullHttpResponse
buildResponse
(BasicFullHttpRequest request, Metrics metrics, List<io.netty.handler.codec.http.FullHttpResponse> gatheredResponses) void
initHelixGroupSelector
(HelixGroupSelector helixGroupSelector) protected io.netty.handler.codec.http.FullHttpResponse
processComputeResponses
(List<io.netty.handler.codec.http.FullHttpResponse> responses, String storeName, Optional<Map<CharSequence, String>> optionalHeaders) protected io.netty.handler.codec.http.FullHttpResponse
processMultiGetResponses
(List<io.netty.handler.codec.http.FullHttpResponse> responses, String storeName, int version, Optional<Map<CharSequence, String>> optionalHeaders) 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 BasicFullHttpRequest request, Metrics metrics, @Nonnull List<io.netty.handler.codec.http.FullHttpResponse> gatheredResponses) - Specified by:
buildResponse
in interfaceResponseAggregatorFactory<BasicFullHttpRequest,
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, Optional<Map<CharSequence, String>> optionalHeaders) 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.
-