Package org.apache.parquet.hadoop.codec
Class SnappyCompressor
- java.lang.Object
-
- org.apache.parquet.hadoop.codec.NonBlockedCompressor
-
- org.apache.parquet.hadoop.codec.SnappyCompressor
-
- All Implemented Interfaces:
org.apache.hadoop.io.compress.Compressor
public class SnappyCompressor extends NonBlockedCompressor
-
-
Constructor Summary
Constructors Constructor Description SnappyCompressor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcompress(ByteBuffer uncompressed, ByteBuffer compressed)Compress the content in the given input buffer.protected intmaxCompressedLength(int byteSize)Get the maximum byte size needed for compressing data of the given byte size.-
Methods inherited from class org.apache.parquet.hadoop.codec.NonBlockedCompressor
compress, end, finish, finished, getBytesRead, getBytesWritten, needsInput, reinit, reset, setDictionary, setInput
-
-
-
-
Method Detail
-
maxCompressedLength
protected int maxCompressedLength(int byteSize)
Description copied from class:NonBlockedCompressorGet the maximum byte size needed for compressing data of the given byte size.- Specified by:
maxCompressedLengthin classNonBlockedCompressor- 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:NonBlockedCompressorCompress 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:
compressin classNonBlockedCompressor- Parameters:
uncompressed- buffer[pos() ... limit()) containing the input datacompressed- output of the compressed data. Uses range [pos()..].- Returns:
- byte size of the compressed data.
- Throws:
IOException
-
-