Class AirBlockCompressor
- java.lang.Object
-
- org.apache.flink.runtime.io.compression.AirBlockCompressor
-
- All Implemented Interfaces:
BlockCompressor
public class AirBlockCompressor extends Object implements BlockCompressor
Flink compressor that wrapsCompressor
.
-
-
Constructor Summary
Constructors Constructor Description AirBlockCompressor(io.airlift.compress.Compressor internalCompressor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compress(byte[] src, int srcOff, int srcLen, byte[] dst, int dstOff)
Compress data read from src, and write the compressed data to dst.int
compress(ByteBuffer src, int srcOff, int srcLen, ByteBuffer dst, int dstOff)
Compress source data read from (Buffer.position()
+srcOff
), and write the compressed data to dst.int
getMaxCompressedSize(int srcSize)
Get the max compressed size for a given original size.
-
-
-
Method Detail
-
getMaxCompressedSize
public int getMaxCompressedSize(int srcSize)
Description copied from interface:BlockCompressor
Get the max compressed size for a given original size.- Specified by:
getMaxCompressedSize
in interfaceBlockCompressor
-
compress
public int compress(ByteBuffer src, int srcOff, int srcLen, ByteBuffer dst, int dstOff) throws BufferCompressionException
Description copied from interface:BlockCompressor
Compress source data read from (Buffer.position()
+srcOff
), and write the compressed data to dst.- Specified by:
compress
in interfaceBlockCompressor
- Parameters:
src
- Uncompressed data to read fromsrcOff
- The start offset of uncompressed datasrcLen
- The length of data which want to be compresseddst
- The target to write compressed datadstOff
- The start offset to write the compressed data- Returns:
- Length of compressed data
- Throws:
BufferCompressionException
- if exception thrown when compressing
-
compress
public int compress(byte[] src, int srcOff, int srcLen, byte[] dst, int dstOff) throws BufferCompressionException
Description copied from interface:BlockCompressor
Compress data read from src, and write the compressed data to dst.- Specified by:
compress
in interfaceBlockCompressor
- Parameters:
src
- Uncompressed data to read fromsrcOff
- The start offset of uncompressed datasrcLen
- The length of data which want to be compresseddst
- The target to write compressed datadstOff
- The start offset to write the compressed data- Returns:
- Length of compressed data
- Throws:
BufferCompressionException
- if exception thrown when compressing
-
-