Class BufferCompressor
- java.lang.Object
-
- org.apache.flink.runtime.io.network.buffer.BufferCompressor
-
-
Constructor Summary
Constructors Constructor Description BufferCompressor(int bufferSize, org.apache.flink.configuration.NettyShuffleEnvironmentOptions.CompressionCodec factoryName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuffercompressToIntermediateBuffer(Buffer buffer)Compresses the givenBufferusingBlockCompressor.BuffercompressToOriginalBuffer(Buffer buffer)The difference between this method andcompressToIntermediateBuffer(Buffer)is that this method will copy the compressed data back to the inputBufferstarting from offset 0.
-
-
-
Method Detail
-
compressToIntermediateBuffer
public Buffer compressToIntermediateBuffer(Buffer buffer)
Compresses the givenBufferusingBlockCompressor. The compressed data will be stored in the intermediate buffer of thisBufferCompressorand returned to the caller. The caller must guarantee that the returnedBufferhas 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 inputBufferstarting from offset 0.The caller must guarantee that the input
Bufferis writable.
-
-