Package org.apache.druid.segment.data
Class CompressionStrategy.ZstdCompressor
- java.lang.Object
-
- org.apache.druid.segment.data.CompressionStrategy.Compressor
-
- org.apache.druid.segment.data.CompressionStrategy.ZstdCompressor
-
- Enclosing class:
- CompressionStrategy
public static class CompressionStrategy.ZstdCompressor extends CompressionStrategy.Compressor
-
-
Constructor Summary
Constructors Constructor Description ZstdCompressor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferallocateInBuffer(int inputSize, Closer closer)Allocates a buffer that should be passed toCompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer)method as input buffer.ByteBufferallocateOutBuffer(int inputSize, Closer closer)Allocates a buffer that should be passed toCompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer)method as output buffer.ByteBuffercompress(ByteBuffer in, ByteBuffer out)Returns a ByteBuffer with compressed contents of in between it's position and limit.
-
-
-
Method Detail
-
allocateInBuffer
public ByteBuffer allocateInBuffer(int inputSize, Closer closer)
Description copied from class:CompressionStrategy.CompressorAllocates a buffer that should be passed toCompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer)method as input buffer. Different Compressors require (or work more efficiently with) different kinds of buffers.If the allocated buffer is a direct buffer, it should be registered to be freed with the given Closer.
- Overrides:
allocateInBufferin classCompressionStrategy.Compressor
-
allocateOutBuffer
public ByteBuffer allocateOutBuffer(int inputSize, Closer closer)
Description copied from class:CompressionStrategy.CompressorAllocates a buffer that should be passed toCompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer)method as output buffer. Different Compressors require (or work more efficiently with) different kinds of buffers.Allocates a buffer that is always enough to compress a byte sequence of the given size.
If the allocated buffer is a direct buffer, it should be registered to be freed with the given Closer.
- Specified by:
allocateOutBufferin classCompressionStrategy.Compressor
-
compress
public ByteBuffer compress(ByteBuffer in, ByteBuffer out)
Description copied from class:CompressionStrategy.CompressorReturns a ByteBuffer with compressed contents of in between it's position and limit. It may be the provided out ByteBuffer, or the in ByteBuffer, depending on the implementation.out's position and limit are not respected and could be discarded.Contents of
inbetween it's position and limit are compressed. It's contents, position and limit shouldn't be changed in compress() method.- Specified by:
compressin classCompressionStrategy.Compressor
-
-