public interface ReferenceManager
In order to integrate with the core BufferAllocator
implementation, the allocation itself should
be represented by an AllocationManager
, though this is not required by the API.
Modifier and Type | Field and Description |
---|---|
static ReferenceManager |
NO_OP |
static String |
NO_OP_ERROR_MESSAGE |
Modifier and Type | Method and Description |
---|---|
ArrowBuf |
deriveBuffer(ArrowBuf sourceBuffer,
long index,
long length)
Derive a new ArrowBuf from a given source ArrowBuf.
|
long |
getAccountedSize()
Get the total accounted size (in bytes).
|
BufferAllocator |
getAllocator()
Get the buffer allocator associated with this reference manager.
|
int |
getRefCount()
Return the reference count.
|
long |
getSize()
Total size (in bytes) of memory underlying this reference manager.
|
boolean |
release()
Decrement this reference manager's reference count by 1 for the associated underlying
memory.
|
boolean |
release(int decrement)
Decrement this reference manager's reference count for the associated underlying
memory.
|
void |
retain()
Increment this reference manager's reference count by 1 for the associated underlying
memory.
|
ArrowBuf |
retain(ArrowBuf srcBuffer,
BufferAllocator targetAllocator)
Create a new ArrowBuf that is associated with an alternative allocator for the purposes of
memory ownership and accounting.
|
void |
retain(int increment)
Increment this reference manager's reference count by a given amount for the
associated underlying memory.
|
OwnershipTransferResult |
transferOwnership(ArrowBuf sourceBuffer,
BufferAllocator targetAllocator)
Duplicate the memory accounting ownership of the backing allocation of the given ArrowBuf in another allocator.
|
static final String NO_OP_ERROR_MESSAGE
static final ReferenceManager NO_OP
int getRefCount()
boolean release()
boolean release(int decrement)
decrement
- the count to decrease the reference count byvoid retain()
void retain(int increment)
increment
- the count to increase the reference count byArrowBuf retain(ArrowBuf srcBuffer, BufferAllocator targetAllocator)
The underlying allocation (AllocationManager
) will not be copied.
srcBuffer
- source ArrowBuftargetAllocator
- The target allocator to create an association with.ArrowBuf deriveBuffer(ArrowBuf sourceBuffer, long index, long length)
sourceBuffer
- source ArrowBufindex
- index (relative to source ArrowBuf) new ArrowBuf should be derived fromlength
- length (bytes) of data in underlying memory that derived buffer will
have access to in underlying memoryOwnershipTransferResult transferOwnership(ArrowBuf sourceBuffer, BufferAllocator targetAllocator)
AllocationManager
s) as the given ArrowBuf.sourceBuffer
- source ArrowBuftargetAllocator
- The target allocator to create an association withOwnershipTransferResult
with info on transfer result and new bufferBufferAllocator getAllocator()
long getSize()
long getAccountedSize()
Copyright © 2023 The Apache Software Foundation. All rights reserved.