Class BufferCompressor
- java.lang.Object
-
- org.apache.flink.runtime.io.network.buffer.BufferCompressor
-
-
Constructor Summary
Constructors Constructor Description BufferCompressor(int bufferSize, NettyShuffleEnvironmentOptions.CompressionCodec factoryName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Buffer
compressToIntermediateBuffer(Buffer buffer)
Compresses the givenBuffer
usingBlockCompressor
.Buffer
compressToOriginalBuffer(Buffer buffer)
The difference between this method andcompressToIntermediateBuffer(Buffer)
is that this method will copy the compressed data back to the inputBuffer
starting from offset 0.
-
-
-
Constructor Detail
-
BufferCompressor
public BufferCompressor(int bufferSize, NettyShuffleEnvironmentOptions.CompressionCodec factoryName)
-
-
Method Detail
-
compressToIntermediateBuffer
public Buffer compressToIntermediateBuffer(Buffer buffer)
Compresses the givenBuffer
usingBlockCompressor
. The compressed data will be stored in the intermediate buffer of thisBufferCompressor
and returned to the caller. The caller must guarantee that the returnedBuffer
has been freed when calling the method next time.Notes that the compression will always start from offset 0 to the size of the input
Buffer
.
-
compressToOriginalBuffer
public Buffer compressToOriginalBuffer(Buffer buffer)
The difference between this method andcompressToIntermediateBuffer(Buffer)
is that this method will copy the compressed data back to the inputBuffer
starting from offset 0.The caller must guarantee that the input
Buffer
is writable.
-
-