public class NetworkBuffer extends org.apache.flink.shaded.netty4.io.netty.buffer.AbstractReferenceCountedByteBuf implements Buffer
MemorySegment instances.
NOTE: before using this buffer in the netty stack, a buffer allocator must be
set via setAllocator(ByteBufAllocator)!
Buffer.DataType| 构造器和说明 |
|---|
NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler)
Creates a new buffer instance backed by the given memorySegment with 0 for
the readerIndex and writerIndex.
|
NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler,
Buffer.DataType dataType)
Creates a new buffer instance backed by the given memorySegment with 0 for
the readerIndex and writerIndex.
|
NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler,
Buffer.DataType dataType,
boolean isCompressed,
int size)
Creates a new buffer instance backed by the given memorySegment with 0 for
the readerIndex and size as writerIndex.
|
NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler,
Buffer.DataType dataType,
int size)
Creates a new buffer instance backed by the given memorySegment with 0 for
the readerIndex and size as writerIndex.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected byte |
_getByte(int index) |
protected int |
_getInt(int index) |
protected int |
_getIntLE(int index) |
protected long |
_getLong(int index) |
protected long |
_getLongLE(int index) |
protected short |
_getShort(int index) |
protected short |
_getShortLE(int index) |
protected int |
_getUnsignedMedium(int index) |
protected int |
_getUnsignedMediumLE(int index) |
protected void |
_setByte(int index,
int value) |
protected void |
_setInt(int index,
int value) |
protected void |
_setIntLE(int index,
int value) |
protected void |
_setLong(int index,
long value) |
protected void |
_setLongLE(int index,
long value) |
protected void |
_setMedium(int index,
int value) |
protected void |
_setMediumLE(int index,
int value) |
protected void |
_setShort(int index,
int value) |
protected void |
_setShortLE(int index,
int value) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator |
alloc() |
byte[] |
array() |
int |
arrayOffset() |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
asByteBuf() |
int |
capacity() |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
capacity(int newCapacity) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
copy(int index,
int length) |
protected void |
deallocate() |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
getBytes(int index,
byte[] dst,
int dstIndex,
int length) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
getBytes(int index,
ByteBuffer dst) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
getBytes(int index,
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf dst,
int dstIndex,
int length) |
int |
getBytes(int index,
FileChannel out,
long position,
int length) |
int |
getBytes(int index,
GatheringByteChannel out,
int length) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
getBytes(int index,
OutputStream out,
int length) |
Buffer.DataType |
getDataType()
Gets the type of data this buffer represents.
|
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 |
hasArray() |
boolean |
hasMemoryAddress() |
ByteBuffer |
internalNioBuffer(int index,
int length) |
boolean |
isBuffer()
Returns whether this buffer represents a buffer or an event.
|
boolean |
isCompressed() |
boolean |
isDirect() |
boolean |
isRecycled()
Returns whether this buffer has been recycled or not.
|
long |
memoryAddress() |
ByteBuffer |
nioBuffer(int index,
int length) |
int |
nioBufferCount() |
ByteBuffer[] |
nioBuffers(int index,
int length) |
ByteOrder |
order() |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
readBytes(int length) |
ReadOnlySlicedNetworkBuffer |
readOnlySlice()
Returns a read-only slice of this buffer's readable bytes, i.e. between
Buffer.getReaderIndex() and Buffer.getSize(). |
ReadOnlySlicedNetworkBuffer |
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.
|
NetworkBuffer |
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.
|
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
setBytes(int index,
byte[] src,
int srcIndex,
int length) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
setBytes(int index,
ByteBuffer src) |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
setBytes(int index,
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf src,
int srcIndex,
int length) |
int |
setBytes(int index,
FileChannel in,
long position,
int length) |
int |
setBytes(int index,
InputStream in,
int length) |
int |
setBytes(int index,
ScatteringByteChannel in,
int length) |
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.
|
String |
toString() |
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf |
unwrap() |
refCnt, release, release, resetRefCnt, retain, retain, setRefCnt, touch, touchadjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getInt, getIntLE, getLong, getLongLE, getMedium, getMediumLE, getShort, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setByte, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE, setZero, skipBytes, slice, slice, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE, writeZerogetDoubleLE, getFloatLE, isContiguous, maxFastWritableBytes, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLEreadableBytes, refCnt, toDebugStringpublic NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler)
memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)recycler - will be called to recycle this buffer once the reference count is 0public NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler,
Buffer.DataType dataType)
memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)recycler - will be called to recycle this buffer once the reference count is 0dataType - the DataType this buffer representspublic NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler,
Buffer.DataType dataType,
int size)
memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)recycler - will be called to recycle this buffer once the reference count is 0dataType - the DataType this buffer representssize - current size of data in the buffer, i.e. the writer index to setpublic NetworkBuffer(org.apache.flink.core.memory.MemorySegment memorySegment,
BufferRecycler recycler,
Buffer.DataType dataType,
boolean isCompressed,
int size)
memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)recycler - will be called to recycle this buffer once the reference count is 0dataType - the DataType this buffer representssize - current size of data in the buffer, i.e. the writer index to setisCompressed - whether the buffer is compressed or notpublic boolean isBuffer()
Bufferpublic 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 void recycleBuffer()
BufferrecycleBuffer 在接口中 BufferBuffer.retainBuffer()public boolean isRecycled()
BufferisRecycled 在接口中 Bufferpublic NetworkBuffer retainBuffer()
BufferretainBuffer 在接口中 BufferBuffer.recycleBuffer()public ReadOnlySlicedNetworkBuffer 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 ReadOnlySlicedNetworkBuffer 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 sliceprotected void deallocate()
deallocate 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractReferenceCountedByteBufprotected byte _getByte(int index)
_getByte 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected short _getShort(int index)
_getShort 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected short _getShortLE(int index)
_getShortLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected int _getUnsignedMedium(int index)
_getUnsignedMedium 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected int _getUnsignedMediumLE(int index)
_getUnsignedMediumLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected int _getInt(int index)
_getInt 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected int _getIntLE(int index)
_getIntLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected long _getLong(int index)
_getLong 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected long _getLongLE(int index)
_getLongLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setByte(int index,
int value)
_setByte 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setShort(int index,
int value)
_setShort 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setShortLE(int index,
int value)
_setShortLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setMedium(int index,
int value)
_setMedium 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setMediumLE(int index,
int value)
_setMediumLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setInt(int index,
int value)
_setInt 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setIntLE(int index,
int value)
_setIntLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setLong(int index,
long value)
_setLong 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufprotected void _setLongLE(int index,
long value)
_setLongLE 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufpublic int capacity()
capacity 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic 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)
throws IndexOutOfBoundsException
BuffersetReaderIndex 在接口中 BufferIndexOutOfBoundsException - if the index is less than 0 or greater than Buffer.getSize()public int getSize()
BufferThis is where writable bytes start in the backing memory segment.
public void setSize(int writerIndex)
Bufferpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf capacity(int newCapacity)
capacity 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic ByteOrder order()
order 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf unwrap()
unwrap 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic boolean isDirect()
isDirect 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes(int index,
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf dst,
int dstIndex,
int length)
getBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes(int index,
byte[] dst,
int dstIndex,
int length)
getBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes(int index,
ByteBuffer dst)
getBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes(int index,
OutputStream out,
int length)
throws IOException
getBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufIOExceptionpublic int getBytes(int index,
GatheringByteChannel out,
int length)
throws IOException
getBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufIOExceptionpublic int getBytes(int index,
FileChannel out,
long position,
int length)
throws IOException
getBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufIOExceptionpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes(int index,
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf src,
int srcIndex,
int length)
setBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes(int index,
byte[] src,
int srcIndex,
int length)
setBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes(int index,
ByteBuffer src)
setBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic int setBytes(int index,
InputStream in,
int length)
throws IOException
setBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufIOExceptionpublic int setBytes(int index,
ScatteringByteChannel in,
int length)
throws IOException
setBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufIOExceptionpublic int setBytes(int index,
FileChannel in,
long position,
int length)
throws IOException
setBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufIOExceptionpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator alloc()
alloc 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic 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 copy(int index,
int length)
copy 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf readBytes(int length)
readBytes 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufpublic int nioBufferCount()
nioBufferCount 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic 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 ByteBuffer nioBuffer(int index, int length)
nioBuffer 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic ByteBuffer internalNioBuffer(int index, int length)
internalNioBuffer 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic ByteBuffer[] nioBuffers(int index, int length)
nioBuffers 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic boolean hasArray()
hasArray 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic byte[] array()
array 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic int arrayOffset()
arrayOffset 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic boolean hasMemoryAddress()
hasMemoryAddress 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic long memoryAddress()
memoryAddress 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufpublic String toString()
toString 在类中 org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBufpublic org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf asByteBuf()
public boolean isCompressed()
isCompressed 在接口中 Bufferpublic void setCompressed(boolean isCompressed)
BuffersetCompressed 在接口中 Bufferpublic Buffer.DataType getDataType()
BuffergetDataType 在接口中 Bufferpublic void setDataType(Buffer.DataType dataType)
BuffersetDataType 在接口中 BufferCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.