public final class ArrowBuf extends io.netty.buffer.AbstractByteBuf implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
class |
ArrowBuf.TransferResult
The outcome of a Transfer.
|
| Constructor and Description |
|---|
ArrowBuf(AtomicInteger refCnt,
AllocationManager.BufferLedger ledger,
UnsafeDirectLittleEndian byteBuf,
BufferManager manager,
ArrowByteBufAllocator alloc,
int offset,
int length,
boolean isEmpty) |
| Modifier and Type | Method and Description |
|---|---|
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) |
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) |
ArrowByteBufAllocator |
alloc() |
byte[] |
array() |
int |
arrayOffset() |
static String |
bufferState(io.netty.buffer.ByteBuf buf) |
int |
capacity() |
ArrowBuf |
capacity(int newCapacity) |
void |
checkBytes(int start,
int end)
Allows a function to determine whether not reading a particular string of bytes is valid.
|
void |
close() |
io.netty.buffer.ByteBuf |
copy() |
io.netty.buffer.ByteBuf |
copy(int index,
int length) |
ArrowBuf |
duplicate() |
boolean |
equals(Object obj) |
int |
getActualMemoryConsumed()
Return that is Accounted for by this buffer (and its potentially shared siblings within the
context of the
associated allocator).
|
byte |
getByte(int index) |
ArrowBuf |
getBytes(int index,
byte[] dst,
int dstIndex,
int length) |
ArrowBuf |
getBytes(int index,
ByteBuffer dst) |
ArrowBuf |
getBytes(int index,
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) |
ArrowBuf |
getBytes(int index,
OutputStream out,
int length) |
char |
getChar(int index) |
double |
getDouble(int index) |
float |
getFloat(int index) |
long |
getId()
Get the integer id assigned to this ArrowBuf for debugging purposes.
|
int |
getInt(int index) |
int |
getIntLE(int index)
Gets a 32-bit integer at the specified absolute
index in
this buffer in Big Endian Byte Order. |
long |
getLong(int index) |
long |
getLongLE(int index)
Gets a 64-bit long integer at the specified absolute
index in
this buffer in Big Endian Byte Order. |
int |
getPossibleMemoryConsumed()
Returns the possible memory consumed by this ArrowBuf in the worse case scenario.
|
short |
getShort(int index) |
short |
getShortLE(int index)
Gets a 16-bit short integer at the specified absolute
index in
this buffer in Big Endian Byte Order. |
long |
getUnsignedInt(int index) |
int |
getUnsignedMedium(int index)
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer. |
int |
getUnsignedMediumLE(int index)
Gets an unsigned 24-bit medium integer at the specified absolute
index in
this buffer in Big Endian Byte Order. |
int |
getUnsignedShort(int index) |
boolean |
hasArray() |
int |
hashCode() |
boolean |
hasMemoryAddress() |
ByteBuffer |
internalNioBuffer(int index,
int length) |
boolean |
isDirect() |
long |
memoryAddress() |
ByteBuffer |
nioBuffer() |
ByteBuffer |
nioBuffer(int index,
int length) |
int |
nioBufferCount() |
ByteBuffer[] |
nioBuffers() |
ByteBuffer[] |
nioBuffers(int index,
int length) |
ByteOrder |
order() |
ArrowBuf |
order(ByteOrder endianness) |
void |
print(StringBuilder sb,
int indent,
BaseAllocator.Verbosity verbosity) |
io.netty.buffer.ByteBuf |
readBytes(int length) |
ArrowBuf |
readerIndex(int readerIndex) |
io.netty.buffer.ByteBuf |
readSlice(int length) |
ArrowBuf |
reallocIfNeeded(int size) |
int |
refCnt() |
boolean |
release() |
boolean |
release(int decrement)
Release the provided number of reference counts.
|
ArrowBuf |
retain() |
ArrowBuf |
retain(BufferAllocator target)
Create a new ArrowBuf that is associated with an alternative allocator for the purposes of
memory ownership and
accounting.
|
ArrowBuf |
retain(int increment) |
void |
setByte(int index,
byte b) |
ArrowBuf |
setByte(int index,
int value) |
ArrowBuf |
setBytes(int index,
byte[] src,
int srcIndex,
int length) |
ArrowBuf |
setBytes(int index,
ByteBuffer src) |
ArrowBuf |
setBytes(int index,
ByteBuffer src,
int srcIndex,
int length) |
ArrowBuf |
setBytes(int index,
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) |
ArrowBuf |
setChar(int index,
int value) |
ArrowBuf |
setDouble(int index,
double value) |
ArrowBuf |
setFloat(int index,
float value) |
ArrowBuf |
setInt(int index,
int value) |
io.netty.buffer.ByteBuf |
setIntLE(int index,
int value)
Sets the specified 32-bit integer at the specified absolute
index
in this buffer with Big Endian byte order. |
ArrowBuf |
setLong(int index,
long value) |
io.netty.buffer.ByteBuf |
setLongLE(int index,
long value)
Sets the specified 64-bit long integer at the specified absolute
index
in this buffer with Big Endian byte order. |
io.netty.buffer.ByteBuf |
setMedium(int index,
int value)
Sets the specified 24-bit medium integer at the specified absolute
index in this buffer. |
io.netty.buffer.ByteBuf |
setMediumLE(int index,
int value)
Sets the specified 24-bit medium integer at the specified absolute
index
in this buffer with Big Endian byte order. |
ArrowBuf |
setShort(int index,
int value) |
io.netty.buffer.ByteBuf |
setShortLE(int index,
int value)
Sets the specified 16-bit short integer at the specified absolute
index
in this buffer with Big Endian byte order. |
ArrowBuf |
slice() |
ArrowBuf |
slice(int index,
int length) |
String |
toHexString(int start,
int length)
Return the buffer's byte contents in the form of a hex dump.
|
String |
toString() |
String |
toString(Charset charset) |
String |
toString(int index,
int length,
Charset charset) |
io.netty.buffer.ByteBuf |
touch() |
io.netty.buffer.ByteBuf |
touch(Object hint) |
String |
toVerboseString() |
ArrowBuf.TransferResult |
transferOwnership(BufferAllocator target)
Transfer the memory accounting ownership of this ArrowBuf to another allocator.
|
io.netty.buffer.ByteBuf |
unwrap() |
void |
writeByteUnsafe(byte b) |
ArrowBuf |
writeChar(int value) |
ArrowBuf |
writeDouble(double value) |
ArrowBuf |
writeFloat(float value) |
ArrowBuf |
writeInt(int value) |
ArrowBuf |
writeLong(long value) |
ArrowBuf |
writerIndex(int writerIndex) |
ArrowBuf |
writeShort(int value) |
adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, discardReadBytes, discardSomeReadBytes, ensureAccessible, ensureWritable, ensureWritable, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getCharSequence, getMedium, getMediumLE, getUnsignedByte, getUnsignedIntLE, getUnsignedShortLE, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setBytes, setBytes, setBytes, setCharSequence, setIndex, setZero, skipBytes, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeCharSequence, writeIntLE, writeLongLE, writeMedium, writeMediumLE, writerIndex, writeShortLE, writeZeropublic ArrowBuf(AtomicInteger refCnt, AllocationManager.BufferLedger ledger, UnsafeDirectLittleEndian byteBuf, BufferManager manager, ArrowByteBufAllocator alloc, int offset, int length, boolean isEmpty)
public static String bufferState(io.netty.buffer.ByteBuf buf)
public ArrowBuf reallocIfNeeded(int size)
public int refCnt()
refCnt in interface io.netty.util.ReferenceCountedpublic void checkBytes(int start,
int end)
Will throw an exception if the memory is not readable for some reason. Only doesn't something in the case that AssertionUtil.BOUNDS_CHECKING_ENABLED is true.
start - The starting position of the bytes to be read.end - The exclusive endpoint of the bytes to be read.public ArrowBuf retain(BufferAllocator target)
This operation has no impact on the reference count of this ArrowBuf. The newly created ArrowBuf with either have a reference count of 1 (in the case that this is the first time this memory is being associated with the new allocator) or the current value of the reference count + 1 for the other AllocationManager/BufferLedger combination in the case that the provided allocator already had an association to this underlying memory.
target - The target allocator to create an association with.public ArrowBuf.TransferResult transferOwnership(BufferAllocator target)
This operation has no impact on the reference count of this ArrowBuf. The newly created ArrowBuf with either have a reference count of 1 (in the case that this is the first time this memory is being associated with the new allocator) or the current value of the reference count for the other AllocationManager/BufferLedger combination in the case that the provided allocator already had an association to this underlying memory.
Transfers will always succeed, even if that puts the other allocator into an overlimit situation. This is possible due to the fact that the original owning allocator may have allocated this memory out of a local reservation whereas the target allocator may need to allocate new memory from a parent or RootAllocator. This operation is done in a mostly-lockless but consistent manner. As such, the overlimit==true situation could occur slightly prematurely to an actual overlimit==true condition. This is simply conservative behavior which means we may return overlimit slightly sooner than is necessary.
target - The allocator to transfer ownership to.public boolean release()
release in interface io.netty.util.ReferenceCountedpublic boolean release(int decrement)
release in interface io.netty.util.ReferenceCountedpublic int capacity()
capacity in class io.netty.buffer.ByteBufpublic ArrowBuf capacity(int newCapacity)
capacity in class io.netty.buffer.ByteBufpublic ArrowByteBufAllocator alloc()
alloc in class io.netty.buffer.ByteBufpublic ByteOrder order()
order in class io.netty.buffer.ByteBufpublic ArrowBuf order(ByteOrder endianness)
order in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf unwrap()
unwrap in class io.netty.buffer.ByteBufpublic boolean isDirect()
isDirect in class io.netty.buffer.ByteBufpublic io.netty.buffer.ByteBuf readBytes(int length)
readBytes in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf readSlice(int length)
readSlice in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf copy()
copy in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf copy(int index,
int length)
copy in class io.netty.buffer.ByteBufpublic ArrowBuf slice()
slice in class io.netty.buffer.AbstractByteBufpublic ArrowBuf slice(int index, int length)
slice in class io.netty.buffer.AbstractByteBufpublic ArrowBuf duplicate()
duplicate in class io.netty.buffer.AbstractByteBufpublic int nioBufferCount()
nioBufferCount in class io.netty.buffer.ByteBufpublic ByteBuffer nioBuffer()
nioBuffer in class io.netty.buffer.AbstractByteBufpublic ByteBuffer nioBuffer(int index, int length)
nioBuffer in class io.netty.buffer.ByteBufpublic ByteBuffer internalNioBuffer(int index, int length)
internalNioBuffer in class io.netty.buffer.ByteBufpublic ByteBuffer[] nioBuffers()
nioBuffers in class io.netty.buffer.AbstractByteBufpublic ByteBuffer[] nioBuffers(int index, int length)
nioBuffers in class io.netty.buffer.ByteBufpublic boolean hasArray()
hasArray in class io.netty.buffer.ByteBufpublic byte[] array()
array in class io.netty.buffer.ByteBufpublic int arrayOffset()
arrayOffset in class io.netty.buffer.ByteBufpublic boolean hasMemoryAddress()
hasMemoryAddress in class io.netty.buffer.ByteBufpublic long memoryAddress()
memoryAddress in class io.netty.buffer.ByteBufpublic String toString()
toString in class io.netty.buffer.AbstractByteBufpublic String toString(Charset charset)
toString in class io.netty.buffer.AbstractByteBufpublic String toString(int index, int length, Charset charset)
toString in class io.netty.buffer.AbstractByteBufpublic int hashCode()
hashCode in class io.netty.buffer.AbstractByteBufpublic boolean equals(Object obj)
equals in class io.netty.buffer.AbstractByteBufpublic ArrowBuf retain(int increment)
retain in interface io.netty.util.ReferenceCountedretain in class io.netty.buffer.ByteBufpublic ArrowBuf retain()
retain in interface io.netty.util.ReferenceCountedretain in class io.netty.buffer.ByteBufpublic io.netty.buffer.ByteBuf touch()
touch in interface io.netty.util.ReferenceCountedtouch in class io.netty.buffer.ByteBufpublic io.netty.buffer.ByteBuf touch(Object hint)
touch in interface io.netty.util.ReferenceCountedtouch in class io.netty.buffer.ByteBufpublic long getLong(int index)
getLong in class io.netty.buffer.AbstractByteBufpublic float getFloat(int index)
getFloat in class io.netty.buffer.AbstractByteBufpublic long getLongLE(int index)
index in
this buffer in Big Endian Byte Order.getLongLE in class io.netty.buffer.AbstractByteBufpublic double getDouble(int index)
getDouble in class io.netty.buffer.AbstractByteBufpublic char getChar(int index)
getChar in class io.netty.buffer.AbstractByteBufpublic long getUnsignedInt(int index)
getUnsignedInt in class io.netty.buffer.AbstractByteBufpublic int getInt(int index)
getInt in class io.netty.buffer.AbstractByteBufpublic int getIntLE(int index)
index in
this buffer in Big Endian Byte Order.getIntLE in class io.netty.buffer.AbstractByteBufpublic int getUnsignedShort(int index)
getUnsignedShort in class io.netty.buffer.AbstractByteBufpublic short getShort(int index)
getShort in class io.netty.buffer.AbstractByteBufpublic short getShortLE(int index)
index in
this buffer in Big Endian Byte Order.getShortLE in class io.netty.buffer.AbstractByteBufpublic int getUnsignedMedium(int index)
index in this buffer.getUnsignedMedium in class io.netty.buffer.AbstractByteBufpublic int getUnsignedMediumLE(int index)
index in
this buffer in Big Endian Byte Order.getUnsignedMediumLE in class io.netty.buffer.AbstractByteBufpublic ArrowBuf setShort(int index, int value)
setShort in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf setShortLE(int index,
int value)
index
in this buffer with Big Endian byte order.setShortLE in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf setMedium(int index,
int value)
index in this buffer.setMedium in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf setMediumLE(int index,
int value)
index
in this buffer with Big Endian byte order.setMediumLE in class io.netty.buffer.AbstractByteBufpublic ArrowBuf setInt(int index, int value)
setInt in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf setIntLE(int index,
int value)
index
in this buffer with Big Endian byte order.setIntLE in class io.netty.buffer.AbstractByteBufpublic ArrowBuf setLong(int index, long value)
setLong in class io.netty.buffer.AbstractByteBufpublic io.netty.buffer.ByteBuf setLongLE(int index,
long value)
index
in this buffer with Big Endian byte order.setLongLE in class io.netty.buffer.AbstractByteBufpublic ArrowBuf setChar(int index, int value)
setChar in class io.netty.buffer.AbstractByteBufpublic ArrowBuf setFloat(int index, float value)
setFloat in class io.netty.buffer.AbstractByteBufpublic ArrowBuf setDouble(int index, double value)
setDouble in class io.netty.buffer.AbstractByteBufpublic ArrowBuf writeShort(int value)
writeShort in class io.netty.buffer.AbstractByteBufpublic ArrowBuf writeInt(int value)
writeInt in class io.netty.buffer.AbstractByteBufpublic ArrowBuf writeLong(long value)
writeLong in class io.netty.buffer.AbstractByteBufpublic ArrowBuf writeChar(int value)
writeChar in class io.netty.buffer.AbstractByteBufpublic ArrowBuf writeFloat(float value)
writeFloat in class io.netty.buffer.AbstractByteBufpublic ArrowBuf writeDouble(double value)
writeDouble in class io.netty.buffer.AbstractByteBufpublic ArrowBuf getBytes(int index, byte[] dst, int dstIndex, int length)
getBytes in class io.netty.buffer.ByteBufpublic ArrowBuf getBytes(int index, ByteBuffer dst)
getBytes in class io.netty.buffer.ByteBufpublic ArrowBuf setByte(int index, int value)
setByte in class io.netty.buffer.AbstractByteBufpublic void setByte(int index,
byte b)
public void writeByteUnsafe(byte b)
protected byte _getByte(int index)
_getByte in class io.netty.buffer.AbstractByteBufprotected short _getShort(int index)
_getShort in class io.netty.buffer.AbstractByteBufprotected short _getShortLE(int index)
_getShortLE in class io.netty.buffer.AbstractByteBuf#getShortLE(int)}protected int _getInt(int index)
_getInt in class io.netty.buffer.AbstractByteBufprotected int _getIntLE(int index)
_getIntLE in class io.netty.buffer.AbstractByteBuf#getIntLE(int)}protected int _getUnsignedMedium(int index)
_getUnsignedMedium in class io.netty.buffer.AbstractByteBuf#getUnsignedMedium(int)}protected int _getUnsignedMediumLE(int index)
_getUnsignedMediumLE in class io.netty.buffer.AbstractByteBuf#getUnsignedMediumLE(int)}protected long _getLong(int index)
_getLong in class io.netty.buffer.AbstractByteBufprotected long _getLongLE(int index)
_getLongLE in class io.netty.buffer.AbstractByteBuf#getLongLE(int)}protected void _setByte(int index,
int value)
_setByte in class io.netty.buffer.AbstractByteBufprotected void _setShort(int index,
int value)
_setShort in class io.netty.buffer.AbstractByteBufprotected void _setShortLE(int index,
int value)
_setShortLE in class io.netty.buffer.AbstractByteBuf#setShortLE(int, int)}protected void _setMedium(int index,
int value)
_setMedium in class io.netty.buffer.AbstractByteBufprotected void _setMediumLE(int index,
int value)
_setMediumLE in class io.netty.buffer.AbstractByteBuf#setMediumLE(int, int)}protected void _setInt(int index,
int value)
_setInt in class io.netty.buffer.AbstractByteBufprotected void _setIntLE(int index,
int value)
_setIntLE in class io.netty.buffer.AbstractByteBuf#setIntLE(int, int)}protected void _setLong(int index,
long value)
_setLong in class io.netty.buffer.AbstractByteBufpublic void _setLongLE(int index,
long value)
_setLongLE in class io.netty.buffer.AbstractByteBuf#setLongLE(int, long)}public ArrowBuf getBytes(int index, io.netty.buffer.ByteBuf dst, int dstIndex, int length)
getBytes in class io.netty.buffer.ByteBufpublic ArrowBuf getBytes(int index, OutputStream out, int length) throws IOException
getBytes in class io.netty.buffer.ByteBufIOExceptionpublic int getBytes(int index,
GatheringByteChannel out,
int length)
throws IOException
getBytes in class io.netty.buffer.ByteBufIOExceptionpublic int getBytes(int index,
FileChannel out,
long position,
int length)
throws IOException
getBytes in class io.netty.buffer.ByteBufIOExceptionpublic ArrowBuf setBytes(int index, io.netty.buffer.ByteBuf src, int srcIndex, int length)
setBytes in class io.netty.buffer.ByteBufpublic ArrowBuf setBytes(int index, ByteBuffer src, int srcIndex, int length)
public ArrowBuf setBytes(int index, byte[] src, int srcIndex, int length)
setBytes in class io.netty.buffer.ByteBufpublic ArrowBuf setBytes(int index, ByteBuffer src)
setBytes in class io.netty.buffer.ByteBufpublic int setBytes(int index,
InputStream in,
int length)
throws IOException
setBytes in class io.netty.buffer.ByteBufIOExceptionpublic int setBytes(int index,
ScatteringByteChannel in,
int length)
throws IOException
setBytes in class io.netty.buffer.ByteBufIOExceptionpublic int setBytes(int index,
FileChannel in,
long position,
int length)
throws IOException
setBytes in class io.netty.buffer.ByteBufIOExceptionpublic byte getByte(int index)
getByte in class io.netty.buffer.AbstractByteBufpublic void close()
close in interface AutoCloseablepublic int getPossibleMemoryConsumed()
public int getActualMemoryConsumed()
public String toHexString(int start, int length)
start - the starting byte indexlength - how many bytes to logpublic long getId()
public String toVerboseString()
public void print(StringBuilder sb, int indent, BaseAllocator.Verbosity verbosity)
public ArrowBuf readerIndex(int readerIndex)
readerIndex in class io.netty.buffer.AbstractByteBufpublic ArrowBuf writerIndex(int writerIndex)
writerIndex in class io.netty.buffer.AbstractByteBufCopyright © 2017 The Apache Software Foundation. All rights reserved.