Package com.linkedin.venice.router.api
Class VeniceResponseDecompressor
java.lang.Object
com.linkedin.venice.router.api.VeniceResponseDecompressor
This class is used to handle all the decompression related logic in Router, and it will be used in
VeniceResponseAggregator
for regular requests and VeniceDispatcher
for streaming requests.-
Constructor Summary
ConstructorDescriptionVeniceResponseDecompressor
(boolean decompressOnClient, RouterStats<AggRouterHttpRequestStats> routerStats, BasicFullHttpRequest request, String storeName, int version, CompressorFactory compressorFactory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canPassThroughResponse
(CompressionStrategy responseCompression) decompressMultiGetContent
(CompressionStrategy compressionStrategy, io.netty.buffer.ByteBuf content) Decompressing multi-get response in router side is a bit of overhead.decompressSingleGetContent
(CompressionStrategy compressionStrategy, io.netty.buffer.ByteBuf content) static CompressionStrategy
getCompressionStrategy
(String compressionHeader) Pair<io.netty.buffer.ByteBuf,
CompressionStrategy> processMultiGetResponseForStreaming
(CompressionStrategy responseCompression, io.netty.buffer.ByteBuf content)
-
Constructor Details
-
VeniceResponseDecompressor
public VeniceResponseDecompressor(boolean decompressOnClient, RouterStats<AggRouterHttpRequestStats> routerStats, BasicFullHttpRequest request, String storeName, int version, CompressorFactory compressorFactory)
-
-
Method Details
-
getCompressionStrategy
-
canPassThroughResponse
-
decompressSingleGetContent
public ContentDecompressResult decompressSingleGetContent(CompressionStrategy compressionStrategy, io.netty.buffer.ByteBuf content) -
decompressMultiGetContent
public ContentDecompressResult decompressMultiGetContent(CompressionStrategy compressionStrategy, io.netty.buffer.ByteBuf content) Decompressing multi-get response in router side is a bit of overhead. Since records could be concatenated within one response, we need to deserialize the records; decompress the records and then serialize them back. -
processMultiGetResponseForStreaming
public Pair<io.netty.buffer.ByteBuf,CompressionStrategy> processMultiGetResponseForStreaming(CompressionStrategy responseCompression, io.netty.buffer.ByteBuf content)
-