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 ofBufferwhich 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.buffer.Buffer
Buffer.DataType
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.io.network.buffer.AbstractCompositeBuffer
allocator, currentLength, dataType, isCompressed, length, partialBuffers
-
-
Constructor Summary
Constructors Constructor Description CompositeBuffer(Buffer.DataType dataType, int length, boolean isCompressed)CompositeBuffer(BufferHeader header)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPartialBuffer(Buffer buffer)org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufasByteBuf()BuffergetFullBufferData(org.apache.flink.core.memory.MemorySegment segment)Returns the full buffer data in one piece ofMemorySegment.-
Methods inherited from class org.apache.flink.runtime.io.network.buffer.AbstractCompositeBuffer
getDataType, getMaxCapacity, getMemorySegment, getMemorySegmentOffset, getNioBuffer, getNioBufferReadable, getPartialBuffers, getReaderIndex, getRecycler, getSize, isBuffer, isCompressed, isRecycled, missingLength, readableBytes, readOnlySlice, readOnlySlice, recycleBuffer, refCnt, retainBuffer, setAllocator, setCompressed, setDataType, setReaderIndex, setRecycler, setSize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.io.network.buffer.Buffer
toDebugString
-
-
-
-
Constructor Detail
-
CompositeBuffer
public CompositeBuffer(Buffer.DataType dataType, int length, boolean isCompressed)
-
CompositeBuffer
public CompositeBuffer(BufferHeader header)
-
-
Method Detail
-
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 ofMemorySegment. If there is multiple partial buffers, the partial data will be copied to the given targetMemorySegment.
-
addPartialBuffer
public void addPartialBuffer(Buffer buffer)
- Specified by:
addPartialBufferin classAbstractCompositeBuffer
-
-