public abstract class BaseAllocator extends Object implements BufferAllocator
| 修飾子とタイプ | クラスと説明 |
|---|---|
class |
BaseAllocator.Reservation |
static class |
BaseAllocator.Verbosity |
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static boolean |
DEBUG |
static String |
DEBUG_ALLOCATOR |
static int |
DEBUG_LOG_LENGTH |
protected org.apache.arrow.memory.Accountant |
parent
The parent allocator
|
protected long |
reservation
The amount of memory reserved for this allocator.
|
| 修飾子 | コンストラクタと説明 |
|---|---|
protected |
BaseAllocator(BaseAllocator parentAllocator,
AllocationListener listener,
String name,
long initReservation,
long maxAllocation)
Initialize an allocator
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
assertOpen()
Asserts (using java assertions) that the provided allocator is currently open.
|
ArrowBuf |
buffer(int initialRequestSize)
Allocate a new or reused buffer of the provided size.
|
ArrowBuf |
buffer(int initialRequestSize,
BufferManager manager)
Allocate a new or reused buffer of the provided size.
|
void |
close()
Close this Accountant.
|
long |
getAllocatedMemory()
Return the current amount of allocated memory that this Accountant is managing accounting
for.
|
ArrowByteBufAllocator |
getAsByteBufAllocator()
Returns the allocator this allocator falls back to when it needs more memory.
|
ArrowBuf |
getEmpty()
Get a reference to the empty buffer associated with this allocator.
|
long |
getHeadroom() |
long |
getLimit()
Return the current limit of this Accountant.
|
String |
getName()
Return the name of this allocator.
|
long |
getPeakMemoryAllocation()
The peak memory allocated by this Accountant.
|
static StringBuilder |
indent(StringBuilder sb,
int indent) |
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.
|
static int |
nextPowerOfTwo(int val)
Rounds up the provided value to the nearest power of two.
|
static long |
nextPowerOfTwo(long val)
Rounds up the provided value to the nearest power of two.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAllocatedMemory, getHeadroom, getLimit, getPeakMemoryAllocation, isOverLimit, setLimitpublic static final int DEBUG_LOG_LENGTH
public static final boolean DEBUG
protected final org.apache.arrow.memory.Accountant parent
protected final long reservation
protected BaseAllocator(BaseAllocator parentAllocator, AllocationListener listener, String name, long initReservation, long maxAllocation) throws OutOfMemoryException
parentAllocator - parent allocator. null if defining a root allocatorlistener - listener callback. Must be non-null -- use
AllocationListener.NOOP if no listener desiredname - name of this allocatorinitReservation - initial reservation. Cannot be modified after constructionmaxAllocation - limit. Allocations past the limit fail. Can be modified after
constructionOutOfMemoryExceptionpublic static int nextPowerOfTwo(int val)
val - An integer value.public static long nextPowerOfTwo(long val)
val - A long value.public static StringBuilder indent(StringBuilder sb, int indent)
public static boolean isDebug()
public void assertOpen()
BufferAllocatorassertOpen インタフェース内 BufferAllocatorpublic String getName()
BufferAllocatorgetName インタフェース内 BufferAllocatorpublic ArrowBuf getEmpty()
BufferAllocatorgetEmpty インタフェース内 BufferAllocatorpublic ArrowBuf buffer(int initialRequestSize)
BufferAllocatorbuffer インタフェース内 BufferAllocatorinitialRequestSize - The size in bytes.public ArrowBuf buffer(int initialRequestSize, BufferManager manager)
BufferAllocatorbuffer インタフェース内 BufferAllocatorinitialRequestSize - The size in bytes.manager - A buffer manager to manage reallocation.public ArrowByteBufAllocator getAsByteBufAllocator()
BufferAllocatorgetAsByteBufAllocator インタフェース内 BufferAllocatorpublic BufferAllocator newChildAllocator(String name, long initReservation, long maxAllocation)
BufferAllocatornewChildAllocator インタフェース内 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 インタフェース内 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 インタフェース内 BufferAllocatorAllocationReservationpublic void close()
close インタフェース内 AutoCloseableclose インタフェース内 BufferAllocatorpublic String toVerboseString()
toVerboseString インタフェース内 BufferAllocatorpublic void releaseBytes(long size)
public boolean isOverLimit()
public long getLimit()
public void setLimit(long newLimit)
newLimit - The limit in bytes.public long getAllocatedMemory()
public long getPeakMemoryAllocation()
public long getHeadroom()
Copyright © 2018 The Apache Software Foundation. All rights reserved.