Package com.linkedin.venice.router.api
Class VeniceResponseDecompressor
- java.lang.Object
-
- com.linkedin.venice.router.api.VeniceResponseDecompressor
-
public class VeniceResponseDecompressor extends java.lang.Object
This class is used to handle all the decompression related logic in Router, and it will be used inVeniceResponseAggregator
for regular requests andVeniceDispatcher
for streaming requests.
-
-
Constructor Summary
Constructors Constructor Description VeniceResponseDecompressor(boolean decompressOnClient, RouterStats<AggRouterHttpRequestStats> routerStats, BasicFullHttpRequest request, java.lang.String storeName, int version, CompressorFactory compressorFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canPassThroughResponse(CompressionStrategy responseCompression)
ContentDecompressResult
decompressMultiGetContent(CompressionStrategy compressionStrategy, io.netty.buffer.ByteBuf content)
Decompressing multi-get response in router side is a bit of overhead.ContentDecompressResult
decompressSingleGetContent(CompressionStrategy compressionStrategy, io.netty.buffer.ByteBuf content)
static CompressionStrategy
getCompressionStrategy(java.lang.String compressionHeader)
Pair<io.netty.buffer.ByteBuf,CompressionStrategy>
processMultiGetResponseForStreaming(CompressionStrategy responseCompression, io.netty.buffer.ByteBuf content)
-
-
-
Constructor Detail
-
VeniceResponseDecompressor
public VeniceResponseDecompressor(boolean decompressOnClient, RouterStats<AggRouterHttpRequestStats> routerStats, BasicFullHttpRequest request, java.lang.String storeName, int version, CompressorFactory compressorFactory)
-
-
Method Detail
-
getCompressionStrategy
public static CompressionStrategy getCompressionStrategy(java.lang.String compressionHeader)
-
canPassThroughResponse
public boolean canPassThroughResponse(CompressionStrategy responseCompression)
-
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)
-
-