Package org.apache.cassandra.io.compress
Class NoopCompressor
java.lang.Object
org.apache.cassandra.io.compress.NoopCompressor
- All Implemented Interfaces:
ICompressor
A Compressor which doesn't actually compress any data. This is useful for either non-compressible data
(typically already compressed or encrypted) that you still want block checksums for or for fast writing.
Some relevant tickets:
- CASSANDRA-12682: Non compressed SSTables can silently corrupt data
- CASSANDRA-9264: Non compressed SSTables are written without checksums
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.io.compress.ICompressor
ICompressor.Uses -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompress(ByteBuffer input, ByteBuffer output) Compression for ByteBuffers.static NoopCompressorintinitialCompressedBufferLength(int chunkLength) Returns the preferred (most efficient) buffer type for this compressor.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) voiduncompress(ByteBuffer input, ByteBuffer output) Decompression for DirectByteBuffers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.io.compress.ICompressor
recommendedUses
-
Constructor Details
-
NoopCompressor
public NoopCompressor()
-
-
Method Details
-
create
-
initialCompressedBufferLength
public int initialCompressedBufferLength(int chunkLength) - Specified by:
initialCompressedBufferLengthin interfaceICompressor
-
uncompress
public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws IOException - Specified by:
uncompressin interfaceICompressor- Throws:
IOException
-
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- Throws:
IOException
-
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
-
preferredBufferType
Description copied from interface:ICompressorReturns the preferred (most efficient) buffer type for this compressor.- Specified by:
preferredBufferTypein interfaceICompressor
-
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
-
supportedOptions
- Specified by:
supportedOptionsin interfaceICompressor
-