Class AllocationManager.BufferLedger

The reference manager that binds an allocator manager to a particular BaseAllocator. Also
responsible for creating
a set of ArrowBufs that share a common fate and set of reference counts.
As with AllocationManager, the only reason this is public is due to ArrowBuf being in io
.netty.buffer package.

getLedgerForAllocator

Returns the ledger associated with a particular BufferAllocator. If the BufferAllocator
doesn't currently have a
ledger associated with this AllocationManager, a new one is created. This is placed on
BufferLedger rather than
AllocationManager directly because ArrowBufs don't have access to AllocationManager and
they are the ones
responsible for exposing the ability to associate multiple allocators with a particular
piece of underlying
memory. Note that this will increment the reference count of this ledger by one to ensure
the ledger isn't
destroyed before use.

newArrowBuf

Create a new ArrowBuf associated with this AllocationManager and memory.

Parameters:

offset - The offset in bytes to start this new ArrowBuf.

length - The length in bytes that this ArrowBuf will provide access to.

manager - An optional BufferManager argument that can be used to manage expansion of
this ArrowBuf

Returns:

A new ArrowBuf that shares references with all ArrowBufs associated with this
BufferLedger

getSize

public int getSize()

What is the total size (in bytes) of memory underlying this ledger.

Returns:

Size in bytes

getAccountedSize

public int getAccountedSize()

How much memory is accounted for by this ledger. This is either getSize() if this is the
owning ledger for the
memory or zero in the case that this is not the owning ledger associated with this memory.