2015/07/26 - Apache DirectMemory has been retired.

For more information, please explore the Attic.

public interface

MemoryManagerService

implements Closeable
org.apache.directmemory.memory.MemoryManagerService<V>
Known Indirect Subclasses

Summary

Public Methods
abstract <T extends V> Pointer<V> allocate(Class<T> type, int size, long expiresIn, long expires)
abstract long capacity()
abstract void clear()
abstract long collectExpired()
abstract void collectLFU()
abstract Pointer<V> free(Pointer<V> pointer)
abstract Set<Pointer<V>> getPointers()
abstract void init(int numberOfBuffers, int size)
Initialize the internal structure.
abstract byte[] retrieve(Pointer<V> pointer)
abstract Pointer<V> store(byte[] payload)
Same function as store(byte[]), but add an relative expiration delta in milliseconds
abstract Pointer<V> store(byte[] payload, long expiresIn)
Store function family.
abstract Pointer<V> update(Pointer<V> pointer, byte[] payload)
Update value of a Pointer@return
abstract long used()
[Expand]
Inherited Methods
From interface java.io.Closeable

Public Methods

public abstract Pointer<V> allocate (Class<T> type, int size, long expiresIn, long expires)

public abstract long capacity ()

public abstract void clear ()

public abstract long collectExpired ()

public abstract void collectLFU ()

public abstract Pointer<V> free (Pointer<V> pointer)

public abstract Set<Pointer<V>> getPointers ()

public abstract void init (int numberOfBuffers, int size)

Initialize the internal structure. Need to be called before the service can be used.

Parameters
numberOfBuffers : number of internal bucket
size : size in B of internal buckets

public abstract byte[] retrieve (Pointer<V> pointer)

public abstract Pointer<V> store (byte[] payload)

Same function as store(byte[]), but add an relative expiration delta in milliseconds

Parameters
payload : the data to store
Returns
  • the pointer to the value, or null if not enough space has been found.

public abstract Pointer<V> store (byte[] payload, long expiresIn)

Store function family. Store the given payload at a certain offset in a MemoryBuffer, returning the pointer to the value.

Parameters
payload : the data to store
Returns
  • the pointer to the value, or null if not enough space has been found.

public abstract Pointer<V> update (Pointer<V> pointer, byte[] payload)

Update value of a Pointer@return

public abstract long used ()