Buffer.DataType| 构造器和说明 |
|---|
CompositeBuffer(Buffer.DataType dataType,
int length,
boolean isCompressed) |
CompositeBuffer(BufferHeader header) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addPartialBuffer(Buffer buffer) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
asByteBuf() |
Buffer.DataType |
getDataType()
Gets the type of data this buffer represents.
|
Buffer |
getFullBufferData(org.apache.flink.core.memory.MemorySegment segment)
Returns the full buffer data in one piece of
MemorySegment. |
int |
getMaxCapacity()
Returns the maximum size of the buffer, i.e. the capacity of the underlying
MemorySegment. |
org.apache.flink.core.memory.MemorySegment |
getMemorySegment()
Returns the underlying memory segment.
|
int |
getMemorySegmentOffset()
This method will be removed in the future.
|
ByteBuffer |
getNioBuffer(int index,
int length)
Gets a new
ByteBuffer instance wrapping this buffer's bytes. |
ByteBuffer |
getNioBufferReadable()
Gets a new
ByteBuffer instance wrapping this buffer's readable bytes, i.e. between
Buffer.getReaderIndex() and Buffer.getSize(). |
int |
getReaderIndex()
Returns the reader index of this buffer.
|
BufferRecycler |
getRecycler()
Gets the buffer's recycler.
|
int |
getSize()
Returns the size of the written data, i.e. the writer index, of this buffer.
|
boolean |
isBuffer()
Returns whether this buffer represents a buffer or an event.
|
boolean |
isCompressed() |
boolean |
isRecycled()
Returns whether this buffer has been recycled or not.
|
int |
missingLength() |
int |
numPartialBuffers() |
int |
readableBytes()
Returns the number of readable bytes (same as
Buffer.getSize() - Buffer.getReaderIndex()). |
Buffer |
readOnlySlice()
Returns a read-only slice of this buffer's readable bytes, i.e. between
Buffer.getReaderIndex() and Buffer.getSize(). |
Buffer |
readOnlySlice(int index,
int length)
Returns a read-only slice of this buffer.
|
void |
recycleBuffer()
Releases this buffer once, i.e. reduces the reference count and recycles the buffer if the
reference count reaches 0.
|
int |
refCnt()
The current reference counter.
|
Buffer |
retainBuffer()
Retains this buffer for further use, increasing the reference counter by 1.
|
void |
setAllocator(org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator allocator)
Sets the buffer allocator for use in netty.
|
void |
setCompressed(boolean isCompressed)
Tags the buffer as compressed or uncompressed.
|
void |
setDataType(Buffer.DataType dataType)
Sets the type of data this buffer represents.
|
void |
setReaderIndex(int readerIndex)
Sets the reader index of this buffer.
|
void |
setSize(int writerIndex)
Sets the size of the written data, i.e. the writer index, of this buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoDebugStringpublic CompositeBuffer(Buffer.DataType dataType, int length, boolean isCompressed)
public CompositeBuffer(BufferHeader header)
public boolean isBuffer()
Bufferpublic void recycleBuffer()
BufferrecycleBuffer 在接口中 BufferBuffer.retainBuffer()public Buffer retainBuffer()
BufferretainBuffer 在接口中 BufferBuffer.recycleBuffer()public int getSize()
BufferThis is where writable bytes start in the backing memory segment.
public int readableBytes()
BufferBuffer.getSize() - Buffer.getReaderIndex()).readableBytes 在接口中 Bufferpublic void setAllocator(org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator allocator)
BuffersetAllocator 在接口中 Bufferallocator - netty buffer allocatorpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf asByteBuf()
public boolean isCompressed()
isCompressed 在接口中 Bufferpublic Buffer.DataType getDataType()
BuffergetDataType 在接口中 Bufferpublic int numPartialBuffers()
public Buffer getFullBufferData(org.apache.flink.core.memory.MemorySegment segment)
MemorySegment. If there is multiple
partial buffers, the partial data will be copied to the given target MemorySegment.public void addPartialBuffer(Buffer buffer)
public int missingLength()
public org.apache.flink.core.memory.MemorySegment getMemorySegment()
BufferBuffer.getMemorySegmentOffset().
This method will be removed in the future. For writing use BufferBuilder.
getMemorySegment 在接口中 Bufferpublic int getMemorySegmentOffset()
BufferBufferBuilder.getMemorySegmentOffset 在接口中 BufferBuffer's data start in the underlying
memory segment.public BufferRecycler getRecycler()
BuffergetRecycler 在接口中 Bufferpublic boolean isRecycled()
BufferisRecycled 在接口中 Bufferpublic Buffer readOnlySlice()
BufferBuffer.getReaderIndex() and Buffer.getSize().
Reader and writer indices as well as markers are not shared. Reference counters are shared
but the slice is not retained automatically.
readOnlySlice 在接口中 Bufferpublic Buffer readOnlySlice(int index, int length)
BufferReader and writer indices as well as markers are not shared. Reference counters are shared
but the slice is not retained automatically.
readOnlySlice 在接口中 Bufferindex - the index to start fromlength - the length of the slicepublic int getMaxCapacity()
BufferMemorySegment.getMaxCapacity 在接口中 Bufferpublic int getReaderIndex()
BufferThis is where readable (unconsumed) bytes start in the backing memory segment.
getReaderIndex 在接口中 BufferMemorySegment
(inclusive))public void setReaderIndex(int readerIndex)
BuffersetReaderIndex 在接口中 Bufferpublic void setSize(int writerIndex)
Bufferpublic ByteBuffer getNioBufferReadable()
BufferByteBuffer instance wrapping this buffer's readable bytes, i.e. between
Buffer.getReaderIndex() and Buffer.getSize().
Please note that neither index is updated by the returned buffer.
getNioBufferReadable 在接口中 Bufferpublic ByteBuffer getNioBuffer(int index, int length)
BufferByteBuffer instance wrapping this buffer's bytes.
Please note that neither read nor write index are updated by the returned buffer.
getNioBuffer 在接口中 BufferBuffer.getNioBufferReadable()public void setCompressed(boolean isCompressed)
BuffersetCompressed 在接口中 Bufferpublic void setDataType(Buffer.DataType dataType)
BuffersetDataType 在接口中 Bufferpublic int refCnt()
BufferBuffer.retainBuffer() and decreased with Buffer.recycleBuffer().Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.