|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directmemory.memory.RoundRobinAllocationPolicy
public class RoundRobinAllocationPolicy
Round Robin allocation policy. An internal counter is incremented (modulo the size of the buffer), so each calls to
#getActiveBuffer(OffHeapMemoryBuffer, int) will increment the counter and return the buffer at the index of
the counter.
| Constructor Summary | |
|---|---|
RoundRobinAllocationPolicy()
|
|
| Method Summary | |
|---|---|
ByteBufferAllocator |
getActiveAllocator(ByteBufferAllocator previousAllocator,
int allocationNumber)
Returns the ByteBufferAllocator to use to allocate. |
void |
init(List<ByteBufferAllocator> allocators)
Initialization function. |
void |
reset()
Reset internal state |
void |
setMaxAllocations(int maxAllocations)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoundRobinAllocationPolicy()
| Method Detail |
|---|
public void setMaxAllocations(int maxAllocations)
public void init(List<ByteBufferAllocator> allocators)
AllocationPolicy
init in interface AllocationPolicy
public ByteBufferAllocator getActiveAllocator(ByteBufferAllocator previousAllocator,
int allocationNumber)
AllocationPolicyByteBufferAllocator to use to allocate.
getActiveAllocator in interface AllocationPolicypreviousAllocator - : the previously used ByteBufferAllocator, or null if it's the first allocationallocationNumber - : the number of time the allocation has already failed.
ByteBufferAllocator to use, or null if allocation has failed.public void reset()
AllocationPolicy
reset in interface AllocationPolicy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||