Class BufferDecompressor

java.lang.Object
org.apache.flink.runtime.io.network.buffer.BufferDecompressor

public class BufferDecompressor extends Object
Decompressor for compressed Buffer.
  • Constructor Details

    • BufferDecompressor

      public BufferDecompressor(int bufferSize, org.apache.flink.configuration.NettyShuffleEnvironmentOptions.CompressionCodec factoryName)
  • Method Details

    • decompressToIntermediateBuffer

      public Buffer decompressToIntermediateBuffer(Buffer buffer)
      Decompresses the given Buffer using BlockDecompressor. The decompressed data will be stored in the intermediate buffer of this BufferDecompressor and returned to the caller. The caller must guarantee that the returned Buffer has been freed when calling the method next time.

      Notes that the decompression will always start from offset 0 to the size of the input Buffer.

    • decompressToOriginalBuffer

      @VisibleForTesting public Buffer decompressToOriginalBuffer(Buffer buffer)
      The difference between this method and decompressToIntermediateBuffer(Buffer) is that this method copies the decompressed data to the input Buffer starting from offset 0.

      The caller must guarantee that the input Buffer is writable and there's enough space left.