Class CompositeBuffer

java.lang.Object
org.apache.flink.runtime.io.network.buffer.AbstractCompositeBuffer
org.apache.flink.runtime.io.network.buffer.CompositeBuffer
All Implemented Interfaces:
Buffer

public class CompositeBuffer extends AbstractCompositeBuffer
An implementation of Buffer which contains multiple partial buffers for network data communication.

This class used for that all partial buffers are derived from the same initial write buffer due to the potential fragmentation during the read process.

  • Constructor Details

    • CompositeBuffer

      public CompositeBuffer(Buffer.DataType dataType, int length, boolean isCompressed)
    • CompositeBuffer

      public CompositeBuffer(BufferHeader header)
  • Method Details

    • asByteBuf

      public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf asByteBuf()
      Returns:
      self as ByteBuf implementation.
    • getFullBufferData

      public Buffer getFullBufferData(org.apache.flink.core.memory.MemorySegment segment)
      Returns the full buffer data in one piece of MemorySegment. If there is multiple partial buffers, the partial data will be copied to the given target MemorySegment.
    • addPartialBuffer

      public void addPartialBuffer(Buffer buffer)
      Specified by:
      addPartialBuffer in class AbstractCompositeBuffer