Class SnappyCompressor

java.lang.Object
org.apache.cassandra.io.compress.SnappyCompressor
All Implemented Interfaces:
ICompressor

public class SnappyCompressor extends Object implements ICompressor
  • Field Details

  • Constructor Details

    • SnappyCompressor

      public SnappyCompressor()
  • Method Details

    • create

      public static SnappyCompressor create(Map<String,String> compressionOptions)
    • isAvailable

      public static boolean isAvailable()
    • supportedOptions

      public Set<String> supportedOptions()
      Specified by:
      supportedOptions in interface ICompressor
    • initialCompressedBufferLength

      public int initialCompressedBufferLength(int chunkLength)
      Specified by:
      initialCompressedBufferLength in interface ICompressor
    • compress

      public void compress(ByteBuffer input, ByteBuffer output) throws IOException
      Description copied from interface: ICompressor
      Compression 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:
      compress in interface ICompressor
      Throws:
      IOException
    • uncompress

      public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws IOException
      Specified by:
      uncompress in interface ICompressor
      Throws:
      IOException
    • uncompress

      public void uncompress(ByteBuffer input, ByteBuffer output) throws IOException
      Description copied from interface: ICompressor
      Decompression 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:
      uncompress in interface ICompressor
      Throws:
      IOException
    • preferredBufferType

      public BufferType preferredBufferType()
      Description copied from interface: ICompressor
      Returns the preferred (most efficient) buffer type for this compressor.
      Specified by:
      preferredBufferType in interface ICompressor
    • supports

      public boolean supports(BufferType bufferType)
      Description copied from interface: ICompressor
      Checks 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:
      supports in interface ICompressor