|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directmemory.memory.MemoryManagerServiceImpl<V>
public class MemoryManagerServiceImpl<V>
| Field Summary | |
|---|---|
protected AllocationPolicy |
allocationPolicy
|
protected static org.slf4j.Logger |
logger
|
protected static long |
NEVER_EXPIRES
|
protected AtomicLong |
used
|
| Constructor Summary | |
|---|---|
MemoryManagerServiceImpl()
|
|
MemoryManagerServiceImpl(AllocationPolicy allocationPolicy,
boolean returnNullWhenFull)
|
|
MemoryManagerServiceImpl(boolean returnNullWhenFull)
|
|
| Method Summary | ||
|---|---|---|
|
allocate(Class<T> type,
int size,
long expiresIn,
long expires)
Deprecated. |
|
long |
capacity()
|
|
void |
clear()
|
|
long |
collectExpired()
|
|
void |
collectLFU()
|
|
protected long |
free(Iterable<Pointer<V>> pointers)
|
|
void |
free(Pointer<V> pointer)
|
|
protected ByteBufferAllocator |
getAllocator(int allocatorIndex)
|
|
protected List<ByteBufferAllocator> |
getAllocators()
|
|
protected ByteBufferAllocator |
getCurrentAllocator()
|
|
Set<Pointer<V>> |
getPointers()
|
|
void |
init(int numberOfBuffers,
int size)
Initialize the internal structure. |
|
protected ByteBufferAllocator |
instanciateByteBufferAllocator(int allocatorNumber,
int size)
|
|
protected Pointer<V> |
instanciatePointer(ByteBuffer buffer,
int allocatorIndex,
long expiresIn,
long expires)
|
|
byte[] |
retrieve(Pointer<V> pointer)
|
|
protected boolean |
returnsNullWhenFull()
|
|
Pointer<V> |
store(byte[] payload)
Same function as MemoryManagerService.store(byte[]), but add an relative expiration delta in milliseconds |
|
Pointer<V> |
store(byte[] payload,
int expiresIn)
Store function family. |
|
Pointer<V> |
update(Pointer<V> pointer,
byte[] payload)
Update value of a {@link Pointer |
|
long |
used()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final long NEVER_EXPIRES
protected static org.slf4j.Logger logger
protected final AtomicLong used
protected final AllocationPolicy allocationPolicy
| Constructor Detail |
|---|
public MemoryManagerServiceImpl()
public MemoryManagerServiceImpl(boolean returnNullWhenFull)
public MemoryManagerServiceImpl(AllocationPolicy allocationPolicy,
boolean returnNullWhenFull)
| Method Detail |
|---|
public void init(int numberOfBuffers,
int size)
MemoryManagerService
init in interface MemoryManagerService<V>numberOfBuffers - : number of internal bucketsize - : size in B of internal buckets
protected ByteBufferAllocator instanciateByteBufferAllocator(int allocatorNumber,
int size)
protected ByteBufferAllocator getAllocator(int allocatorIndex)
protected ByteBufferAllocator getCurrentAllocator()
public Pointer<V> store(byte[] payload,
int expiresIn)
MemoryManagerService
store in interface MemoryManagerService<V>payload - : the data to store
public Pointer<V> store(byte[] payload)
MemoryManagerServiceMemoryManagerService.store(byte[]), but add an relative expiration delta in milliseconds
store in interface MemoryManagerService<V>payload - : the data to store
public Pointer<V> update(Pointer<V> pointer,
byte[] payload)
MemoryManagerService
update in interface MemoryManagerService<V>public byte[] retrieve(Pointer<V> pointer)
retrieve in interface MemoryManagerService<V>public void free(Pointer<V> pointer)
free in interface MemoryManagerService<V>public void clear()
clear in interface MemoryManagerService<V>public long capacity()
capacity in interface MemoryManagerService<V>public long used()
used in interface MemoryManagerService<V>public long collectExpired()
collectExpired in interface MemoryManagerService<V>public void collectLFU()
collectLFU in interface MemoryManagerService<V>protected long free(Iterable<Pointer<V>> pointers)
protected List<ByteBufferAllocator> getAllocators()
@Deprecated
public <T extends V> Pointer<V> allocate(Class<T> type,
int size,
long expiresIn,
long expires)
allocate in interface MemoryManagerService<V>
protected Pointer<V> instanciatePointer(ByteBuffer buffer,
int allocatorIndex,
long expiresIn,
long expires)
protected boolean returnsNullWhenFull()
public Set<Pointer<V>> getPointers()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||