Class SnappyCompressor

  • All Implemented Interfaces:
    org.apache.hadoop.io.compress.Compressor

    public class SnappyCompressor
    extends NonBlockedCompressor
    • Constructor Detail

      • SnappyCompressor

        public SnappyCompressor()
    • Method Detail

      • maxCompressedLength

        protected int maxCompressedLength​(int byteSize)
        Description copied from class: NonBlockedCompressor
        Get the maximum byte size needed for compressing data of the given byte size.
        Specified by:
        maxCompressedLength in class NonBlockedCompressor
        Parameters:
        byteSize - byte size of the data to compress
        Returns:
        maximum byte size of the compressed data
      • compress

        protected int compress​(ByteBuffer uncompressed,
                               ByteBuffer compressed)
                        throws IOException
        Description copied from class: NonBlockedCompressor
        Compress the content in the given input buffer. After the compression, you can retrieve the compressed data from the output buffer [pos() ... limit()) (compressed data size = limit() - pos() = remaining())
        Specified by:
        compress in class NonBlockedCompressor
        Parameters:
        uncompressed - buffer[pos() ... limit()) containing the input data
        compressed - output of the compressed data. Uses range [pos()..].
        Returns:
        byte size of the compressed data.
        Throws:
        IOException