public abstract class AllocationManager extends Object
Manages the relationship between one or more allocators and a particular UDLE. Ensures that one allocator owns the memory that multiple allocators may be referencing. Manages a BufferLedger between each of its associated allocators.
The only reason that this isn't package private is we're forced to put ArrowBuf in Netty's package which need access to these objects or methods.
Threading: AllocationManager manages thread-safety internally. Operations within the context of a single BufferLedger are lockless in nature and can be leveraged by multiple threads. Operations that cross the context of two ledgers will acquire a lock on the AllocationManager instance. Important note, there is one AllocationManager per UnsafeDirectLittleEndian buffer allocation. As such, there will be thousands of these in a typical query. The contention of acquiring a lock on AllocationManager should be very low.
Modifier and Type | Class and Description |
---|---|
static interface |
AllocationManager.Factory
A factory interface for creating
AllocationManager . |
Modifier | Constructor and Description |
---|---|
protected |
AllocationManager(BufferAllocator accountingAllocator) |
Modifier and Type | Method and Description |
---|---|
abstract long |
getSize()
Return the size of underlying chunk of memory managed by this Allocation Manager.
|
protected abstract long |
memoryAddress()
Return the absolute memory address pointing to the fist byte of underlying memory chunk.
|
protected abstract void |
release0()
Release the underlying memory chunk.
|
protected AllocationManager(BufferAllocator accountingAllocator)
public abstract long getSize()
The underlying memory chunk managed can be different from the original requested size.
protected abstract long memoryAddress()
protected abstract void release0()
Copyright © 2022 The Apache Software Foundation. All rights reserved.