public final class BuddyAllocator extends Object implements EvictionAwareAllocator, BuddyAllocatorMXBean
Allocator.AllocatorOutOfMemoryException
Constructor and Description |
---|
BuddyAllocator(boolean isDirectVal,
boolean isMappedVal,
int minAllocVal,
int maxAllocVal,
int arenaCount,
long maxSizeVal,
String mapPath,
MemoryManager memoryManager,
LlapDaemonCacheMetrics metrics) |
BuddyAllocator(boolean isDirectVal,
int minAllocVal,
int maxAllocVal,
int arenaCount,
long maxSizeVal,
MemoryManager memoryManager,
LlapDaemonCacheMetrics metrics) |
BuddyAllocator(org.apache.hadoop.conf.Configuration conf,
MemoryManager mm,
LlapDaemonCacheMetrics metrics) |
Modifier and Type | Method and Description |
---|---|
void |
allocateMultiple(MemoryBuffer[] dest,
int size)
Allocates multiple buffers of a given size.
|
MemoryBuffer |
createUnallocated()
Creates an unallocated memory buffer object.
|
void |
deallocate(MemoryBuffer buffer)
Deallocates a memory buffer.
|
void |
deallocateEvicted(MemoryBuffer buffer) |
String |
debugDump() |
int |
getArenaSize()
Gets the arena size.
|
boolean |
getIsDirect()
Gets if bytebuffers are allocated directly offheap.
|
int |
getMaxAllocation()
Maximum allocation size supported by this allocator.
|
long |
getMaxCacheSize()
Gets the maximum cache size.
|
int |
getMinAllocation()
Gets minimum allocation size of allocator.
|
boolean |
isDirectAlloc()
Whether the allocator uses direct buffers.
|
public BuddyAllocator(org.apache.hadoop.conf.Configuration conf, MemoryManager mm, LlapDaemonCacheMetrics metrics)
public BuddyAllocator(boolean isDirectVal, int minAllocVal, int maxAllocVal, int arenaCount, long maxSizeVal, MemoryManager memoryManager, LlapDaemonCacheMetrics metrics)
public BuddyAllocator(boolean isDirectVal, boolean isMappedVal, int minAllocVal, int maxAllocVal, int arenaCount, long maxSizeVal, String mapPath, MemoryManager memoryManager, LlapDaemonCacheMetrics metrics)
public void allocateMultiple(MemoryBuffer[] dest, int size) throws Allocator.AllocatorOutOfMemoryException
Allocator
allocateMultiple
in interface Allocator
dest
- Array where buffers are placed. Objects are reused if already there
(see createUnallocated), created otherwise.size
- Allocation size.Allocator.AllocatorOutOfMemoryException
- Cannot allocate.public void deallocate(MemoryBuffer buffer)
Allocator
deallocate
in interface Allocator
public void deallocateEvicted(MemoryBuffer buffer)
deallocateEvicted
in interface EvictionAwareAllocator
public boolean isDirectAlloc()
Allocator
isDirectAlloc
in interface Allocator
public String debugDump()
public boolean getIsDirect()
BuddyAllocatorMXBean
getIsDirect
in interface BuddyAllocatorMXBean
public int getMinAllocation()
BuddyAllocatorMXBean
getMinAllocation
in interface BuddyAllocatorMXBean
public int getMaxAllocation()
Allocator
getMaxAllocation
in interface Allocator
getMaxAllocation
in interface BuddyAllocatorMXBean
public int getArenaSize()
BuddyAllocatorMXBean
getArenaSize
in interface BuddyAllocatorMXBean
public long getMaxCacheSize()
BuddyAllocatorMXBean
getMaxCacheSize
in interface BuddyAllocatorMXBean
public MemoryBuffer createUnallocated()
Allocator
createUnallocated
in interface Allocator
Copyright © 2016 The Apache Software Foundation. All rights reserved.