Class BufferCompressor
java.lang.Object
org.apache.flink.runtime.io.network.buffer.BufferCompressor
Compressor for
Buffer.-
Constructor Summary
ConstructorsConstructorDescriptionBufferCompressor(int bufferSize, org.apache.flink.configuration.NettyShuffleEnvironmentOptions.CompressionCodec factoryName) -
Method Summary
Modifier and TypeMethodDescriptioncompressToIntermediateBuffer(Buffer buffer) Compresses the givenBufferusingBlockCompressor.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.
-
Constructor Details
-
BufferCompressor
public BufferCompressor(int bufferSize, org.apache.flink.configuration.NettyShuffleEnvironmentOptions.CompressionCodec factoryName)
-
-
Method Details
-
compressToIntermediateBuffer
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
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.
-