R - the raw value typepublic static class NullImplementation.NullPersistentStore<R> extends Object implements com.oracle.datagrid.persistence.PersistentStore<R>
PersistentStore that does as little as possible.| Modifier and Type | Class and Description |
|---|---|
protected class |
NullImplementation.NullPersistentStore.Token
Token returned by
begin(Collector, Object). |
| Modifier and Type | Field and Description |
|---|---|
static NullImplementation.NullPersistentStore |
INSTANCE
Singleton instance of a NullPersistentStore.
|
| Constructor and Description |
|---|
NullPersistentStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Object oToken)
Abort an atomic sequence of mutating operations.
|
Object |
begin()
Begin a new sequence of mutating operations that should be committed to the store as an atomic unit.
|
Object |
begin(Collector<Object> collector, Object oReceipt)
Begin a new sequence of mutating operations that should be committed to the store asynchronously as an atomic unit.
|
void |
commit(Object oToken)
Commit a sequence of mutating operations represented by the given token as an atomic unit.
|
void |
deleteExtent(long lExtentId)
Delete the specified extent from the persistent store, ensuring that any key-value mappings associated with the extent are no longer valid.
|
boolean |
ensureExtent(long lExtentId)
Ensure that an extent with the given identifier exists in the persistent store, returning true iff the extent was created.
|
void |
erase(long lExtentId, R key, Object oToken)
Remove the specified key from the underlying store if present.
|
long[] |
extents()
Return a list of the extent identifiers in the underlying store.
|
String |
getId()
Return the identifier of this store.
|
void |
iterate(com.oracle.datagrid.persistence.PersistentStore.Visitor<R> visitor)
Iterate the key-value pairs in the persistent store, applying the specified visitor to each key-value pair.
|
R |
load(long lExtentId, R key)
Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
|
void |
store(long lExtentId, R key, R value, Object oToken)
Store the specified value under the specific key in the underlying store.
|
void |
truncateExtent(long lExtentId)
Truncate the specified extent from the persistent store, ensuring that any key-value mappings associated with the extent are removed.
|
public static final NullImplementation.NullPersistentStore INSTANCE
public String getId()
getId in interface com.oracle.datagrid.persistence.PersistentStore<R>public boolean ensureExtent(long lExtentId)
ensureExtent in interface com.oracle.datagrid.persistence.PersistentStore<R>lExtentId - the identifier of the extent to ensurepublic void deleteExtent(long lExtentId)
Removal of the key-value mappings associated with the extent from the underlying storage is the responsibility of the implementation, and may (for example) be performed immediately, asynchronously, or deferred until space is required.
deleteExtent in interface com.oracle.datagrid.persistence.PersistentStore<R>lExtentId - the identifier of the extent to deletepublic void truncateExtent(long lExtentId)
Removal of the key-value mappings associated with the extent from the underlying storage is the responsibility of the implementation, and may (for example) be performed immediately, asynchronously, or deferred until space is required.
truncateExtent in interface com.oracle.datagrid.persistence.PersistentStore<R>lExtentId - the identifier of the extent to truncatepublic long[] extents()
extents in interface com.oracle.datagrid.persistence.PersistentStore<R>public R load(long lExtentId, R key)
load in interface com.oracle.datagrid.persistence.PersistentStore<R>lExtentId - the extent identifier for the keykey - key whose associated value is to be returned
public void store(long lExtentId,
R key,
R value,
Object oToken)
store in interface com.oracle.datagrid.persistence.PersistentStore<R>lExtentId - the extent identifier for the key-value pairkey - key to store the value undervalue - value to be storedoToken - optional token that represents a set of mutating operations to be committed as an atomic unit; if null, the given key-value pair will be committed to the store automatically by this method
public void erase(long lExtentId,
R key,
Object oToken)
erase in interface com.oracle.datagrid.persistence.PersistentStore<R>lExtentId - the extent identifier for the keykey - key whose mapping is to be removedoToken - optional token that represents a set of mutating operations to be committed as an atomic unit; if null, the removal of the given key will be committed to the store automatically by this methodpublic void iterate(com.oracle.datagrid.persistence.PersistentStore.Visitor<R> visitor)
iterate in interface com.oracle.datagrid.persistence.PersistentStore<R>visitor - the visitor to applypublic Object begin()
committed to the store or the atomic unit must be aborted.begin in interface com.oracle.datagrid.persistence.PersistentStore<R>public Object begin(Collector<Object> collector, Object oReceipt)
committed to the store or the atomic unit must be aborted.
If a collector is passed to this method, the specified receipt will be added to it when the unit is committed. If the operation is aborted or an error occurs during the commit, an AsyncPersistenceException that wraps the cause and specified receipt will be added. Finally, the collector will be flushed.
begin in interface com.oracle.datagrid.persistence.PersistentStore<R>collector - an optional collectoroReceipt - a receipt to be added to the collector (if any) when the unit is committedpublic void commit(Object oToken)
commit in interface com.oracle.datagrid.persistence.PersistentStore<R>oToken - a token that represents the atomic unit to commit