public class RootAllocator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseAllocator.Verbosity
Enum for logging verbosity.
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
static String |
DEBUG_ALLOCATOR |
static int |
DEBUG_LOG_LENGTH |
static org.apache.arrow.memory.BaseAllocator.Config |
DEFAULT_CONFIG |
protected org.apache.arrow.memory.Accountant |
parent
The parent allocator.
|
protected long |
reservation
The amount of memory reserved for this allocator.
|
| Constructor and Description |
|---|
RootAllocator() |
RootAllocator(AllocationListener listener,
long limit) |
RootAllocator(AllocationListener listener,
long limit,
RoundingPolicy roundingPolicy)
Constructor.
|
RootAllocator(org.apache.arrow.memory.BaseAllocator.Config config) |
RootAllocator(long limit) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertOpen()
Asserts (using java assertions) that the provided allocator is currently open.
|
ArrowBuf |
buffer(long initialRequestSize)
Allocate a new or reused buffer of the provided size.
|
ArrowBuf |
buffer(long initialRequestSize,
BufferManager manager)
Allocate a new or reused buffer of the provided size.
|
void |
close()
Close this Accountant.
|
static ImmutableConfig.Builder |
configBuilder()
Returns a builder class for configuring BaseAllocator's options.
|
static org.apache.arrow.memory.BaseAllocator.Config |
defaultConfig()
Returns a default
Config instance. |
boolean |
forceAllocate(long size)
Increase the accounting.
|
long |
getAllocatedMemory()
Return the current amount of allocated memory that this Accountant is managing accounting
for.
|
Collection<BufferAllocator> |
getChildAllocators()
Returns the set of child allocators.
|
ArrowBuf |
getEmpty()
Get a reference to the empty buffer associated with this allocator.
|
long |
getHeadroom() |
long |
getInitReservation()
Return the initial reservation.
|
long |
getLimit()
Return the current limit of this Accountant.
|
AllocationListener |
getListener()
Returns the allocation listener used by this allocator.
|
String |
getName()
Return the name of the accountant.
|
org.apache.arrow.memory.BaseAllocator |
getParentAllocator()
Returns the parent allocator.
|
long |
getPeakMemoryAllocation()
The peak memory allocated by this Accountant.
|
BufferAllocator |
getRoot()
Get the root allocator of this allocator.
|
RoundingPolicy |
getRoundingPolicy()
Gets the rounding policy of the allocator.
|
static boolean |
isDebug() |
boolean |
isOverLimit() |
BufferAllocator |
newChildAllocator(String name,
AllocationListener listener,
long initReservation,
long maxAllocation)
Create a new child allocator.
|
BufferAllocator |
newChildAllocator(String name,
long initReservation,
long maxAllocation)
Create a new child allocator.
|
AllocationReservation |
newReservation()
Create an allocation reservation.
|
void |
releaseBytes(long size) |
void |
setLimit(long newLimit)
Set the maximum amount of memory that can be allocated in the this Accountant before failing
an allocation.
|
String |
toString() |
String |
toVerboseString()
Provide a verbose string of the current allocator state.
|
void |
verify()
Verify the accounting state of the allocation system.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforceAllocate, getAllocatedMemory, getHeadroom, getInitReservation, getLimit, getPeakMemoryAllocation, isOverLimit, releaseBytes, setLimitpublic static final String DEBUG_ALLOCATOR
public static final int DEBUG_LOG_LENGTH
public static final boolean DEBUG
public static final org.apache.arrow.memory.BaseAllocator.Config DEFAULT_CONFIG
protected final org.apache.arrow.memory.Accountant parent
protected final long reservation
public RootAllocator()
public RootAllocator(long limit)
public RootAllocator(AllocationListener listener, long limit)
public RootAllocator(AllocationListener listener, long limit, RoundingPolicy roundingPolicy)
listener - the allocation listenerlimit - max allocation size in bytesroundingPolicy - the policy for rounding the buffer sizepublic RootAllocator(org.apache.arrow.memory.BaseAllocator.Config config)
public void verify()
public AllocationListener getListener()
BufferAllocatorgetListener in interface BufferAllocatorAllocationListener instance. Or AllocationListener.NOOP by default if no listener
is configured when this allocator was created.public org.apache.arrow.memory.BaseAllocator getParentAllocator()
BufferAllocatorgetParentAllocator in interface BufferAllocatorpublic Collection<BufferAllocator> getChildAllocators()
BufferAllocatorgetChildAllocators in interface BufferAllocatorpublic static boolean isDebug()
public void assertOpen()
BufferAllocatorassertOpen in interface BufferAllocatorpublic String getName()
getName in interface BufferAllocatorpublic ArrowBuf getEmpty()
BufferAllocatorgetEmpty in interface BufferAllocatorpublic ArrowBuf buffer(long initialRequestSize)
BufferAllocatorbuffer in interface BufferAllocatorinitialRequestSize - The size in bytes.public ArrowBuf buffer(long initialRequestSize, BufferManager manager)
BufferAllocatorbuffer in interface BufferAllocatorinitialRequestSize - The size in bytes.manager - A buffer manager to manage reallocation.public BufferAllocator getRoot()
BufferAllocatorgetRoot in interface BufferAllocatorpublic BufferAllocator newChildAllocator(String name, long initReservation, long maxAllocation)
BufferAllocatornewChildAllocator in interface BufferAllocatorname - the name of the allocator.initReservation - the initial space reservation (obtained from this allocator)maxAllocation - maximum amount of space the new allocator can allocatepublic BufferAllocator newChildAllocator(String name, AllocationListener listener, long initReservation, long maxAllocation)
BufferAllocatornewChildAllocator in interface BufferAllocatorname - the name of the allocator.listener - allocation listener for the newly created childinitReservation - the initial space reservation (obtained from this allocator)maxAllocation - maximum amount of space the new allocator can allocatepublic AllocationReservation newReservation()
BufferAllocatornewReservation in interface BufferAllocatorAllocationReservationpublic void close()
close in interface AutoCloseableclose in interface BufferAllocatorpublic String toVerboseString()
toVerboseString in interface BufferAllocatorpublic static org.apache.arrow.memory.BaseAllocator.Config defaultConfig()
Config instance.ImmutableConfig.Builderpublic static ImmutableConfig.Builder configBuilder()
public RoundingPolicy getRoundingPolicy()
BufferAllocatorgetRoundingPolicy in interface BufferAllocatorpublic boolean forceAllocate(long size)
size - to increasepublic void releaseBytes(long size)
public boolean isOverLimit()
public long getLimit()
public long getInitReservation()
public void setLimit(long newLimit)
newLimit - The limit in bytes.public long getAllocatedMemory()
public long getPeakMemoryAllocation()
public long getHeadroom()
Copyright © 2022 The Apache Software Foundation. All rights reserved.