Package org.apache.cassandra.io.compress
Class DeflateCompressor
java.lang.Object
org.apache.cassandra.io.compress.DeflateCompressor
- All Implemented Interfaces:
ICompressor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.io.compress.ICompressor
ICompressor.Uses -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcompress(ByteBuffer input, ByteBuffer output) Compression for ByteBuffers.intcompressArray(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) voidcompressBuffer(ByteBuffer input, ByteBuffer output) static DeflateCompressorstatic byte[]intinitialCompressedBufferLength(int sourceLen) Returns the preferred (most efficient) buffer type for this compressor.Hints to Cassandra which uses this compressor is recommended for.booleansupports(BufferType bufferType) Checks if the given buffer would be supported by the compressor.intuncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) intuncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) voiduncompress(ByteBuffer input, ByteBuffer output) Decompression for DirectByteBuffers.voiduncompressBuffer(ByteBuffer input, ByteBuffer output)
-
Field Details
-
instance
-
-
Method Details
-
getThreadLocalScratchBuffer
public static byte[] getThreadLocalScratchBuffer() -
create
-
supportedOptions
- Specified by:
supportedOptionsin interfaceICompressor
-
initialCompressedBufferLength
public int initialCompressedBufferLength(int sourceLen) - Specified by:
initialCompressedBufferLengthin interfaceICompressor
-
compress
Description copied from interface:ICompressorCompression for ByteBuffers. The data between input.position() and input.limit() is compressed and placed into output starting from output.position(). Positions in both buffers are moved to reflect the bytes read and written. Limits are not changed.- Specified by:
compressin interfaceICompressor
-
compressArray
public int compressArray(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) -
compressBuffer
-
uncompress
Description copied from interface:ICompressorDecompression for DirectByteBuffers. The data between input.position() and input.limit() is uncompressed and placed into output starting from output.position(). Positions in both buffers are moved to reflect the bytes read and written. Limits are not changed.- Specified by:
uncompressin interfaceICompressor- Throws:
IOException
-
uncompressBuffer
- Throws:
IOException
-
uncompress
public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws IOException - Specified by:
uncompressin interfaceICompressor- Throws:
IOException
-
uncompress
public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) throws IOException - Throws:
IOException
-
supports
Description copied from interface:ICompressorChecks if the given buffer would be supported by the compressor. If a type is supported, the compressor must be able to use it in combination with all other supported types. Direct and memory-mapped buffers must be supported by all compressors.- Specified by:
supportsin interfaceICompressor
-
preferredBufferType
Description copied from interface:ICompressorReturns the preferred (most efficient) buffer type for this compressor.- Specified by:
preferredBufferTypein interfaceICompressor
-
recommendedUses
Description copied from interface:ICompressorHints to Cassandra which uses this compressor is recommended for. For example a compression algorithm which gets good compression ratio may trade off too much compression speed to be useful in certain compression heavy use cases such as flushes or mutation hints. Note that Cassandra may ignore these recommendations, it is not a strict contract.- Specified by:
recommendedUsesin interfaceICompressor
-