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 Details

  • Constructor Details

  • Method Details

    • withSingleGetTardyThreshold

      public VeniceResponseAggregator withSingleGetTardyThreshold(long timeout, TimeUnit unit)
    • withMultiGetTardyThreshold

      public VeniceResponseAggregator withMultiGetTardyThreshold(long timeout, TimeUnit unit)
    • withComputeTardyThreshold

      public VeniceResponseAggregator withComputeTardyThreshold(long timeout, TimeUnit unit)
    • initHelixGroupSelector

      public void initHelixGroupSelector(HelixGroupSelector helixGroupSelector)
    • 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 interface ResponseAggregatorFactory<BasicFullHttpRequest,io.netty.handler.codec.http.FullHttpResponse>
    • processComputeResponses

      protected io.netty.handler.codec.http.FullHttpResponse processComputeResponses(List<io.netty.handler.codec.http.FullHttpResponse> responses, String storeName, Optional<Map<CharSequence,String>> optionalHeaders)
    • 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.