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
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.
-
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
ConstructorsConstructorDescriptionCompositeBuffer(Buffer.DataType dataType, int length, boolean isCompressed) CompositeBuffer(BufferHeader header) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPartialBuffer(Buffer buffer) org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufgetFullBufferData(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, setSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.io.network.buffer.Buffer
toDebugString
-
Constructor Details
-
CompositeBuffer
-
CompositeBuffer
-
-
Method Details
-
asByteBuf
public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf asByteBuf()- Returns:
- self as ByteBuf implementation.
-
getFullBufferData
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
- Specified by:
addPartialBufferin classAbstractCompositeBuffer
-