R
- the raw value typepublic static class NullImplementation.NullPersistentStore<R> extends Object implements com.oracle.coherence.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(com.oracle.coherence.common.base.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.coherence.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 |
moveExtent(long lOldExtentId,
long lNewExtentId)
Move the specified extent from the old extent id to the new extent id.
|
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()
com.oracle.coherence.persistence.PersistentStore
getId
in interface com.oracle.coherence.persistence.PersistentStore<R>
public boolean ensureExtent(long lExtentId)
com.oracle.coherence.persistence.PersistentStore
ensureExtent
in interface com.oracle.coherence.persistence.PersistentStore<R>
lExtentId
- the identifier of the extent to ensurepublic void deleteExtent(long lExtentId)
com.oracle.coherence.persistence.PersistentStore
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.coherence.persistence.PersistentStore<R>
lExtentId
- the identifier of the extent to deletepublic void moveExtent(long lOldExtentId, long lNewExtentId)
com.oracle.coherence.persistence.PersistentStore
Upon control being returned the implementation guarantees that any data
data that used to reside against the old extent id is accessible from
new extent id using the load
API. In addition,
calls to store
are permitted
immediately after control is returned.
moveExtent
in interface com.oracle.coherence.persistence.PersistentStore<R>
lOldExtentId
- the old extent identifierlNewExtentId
- the new extent identifierpublic void truncateExtent(long lExtentId)
com.oracle.coherence.persistence.PersistentStore
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.coherence.persistence.PersistentStore<R>
lExtentId
- the identifier of the extent to truncatepublic long[] extents()
com.oracle.coherence.persistence.PersistentStore
extents
in interface com.oracle.coherence.persistence.PersistentStore<R>
public R load(long lExtentId, R key)
com.oracle.coherence.persistence.PersistentStore
load
in interface com.oracle.coherence.persistence.PersistentStore<R>
lExtentId
- the extent identifier for the keykey
- key whose associated value is to be returnedpublic void store(long lExtentId, R key, R value, Object oToken)
com.oracle.coherence.persistence.PersistentStore
store
in interface com.oracle.coherence.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 methodpublic void erase(long lExtentId, R key, Object oToken)
com.oracle.coherence.persistence.PersistentStore
erase
in interface com.oracle.coherence.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.coherence.persistence.PersistentStore.Visitor<R> visitor)
com.oracle.coherence.persistence.PersistentStore
iterate
in interface com.oracle.coherence.persistence.PersistentStore<R>
visitor
- the visitor to applypublic Object begin()
com.oracle.coherence.persistence.PersistentStore
committed
to the store or the atomic unit must
be aborted
.begin
in interface com.oracle.coherence.persistence.PersistentStore<R>
public Object begin(com.oracle.coherence.common.base.Collector<Object> collector, Object oReceipt)
com.oracle.coherence.persistence.PersistentStore
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.coherence.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)
com.oracle.coherence.persistence.PersistentStore
commit
in interface com.oracle.coherence.persistence.PersistentStore<R>
oToken
- a token that represents the atomic unit to commitpublic void abort(Object oToken)
com.oracle.coherence.persistence.PersistentStore
abort
in interface com.oracle.coherence.persistence.PersistentStore<R>
oToken
- a token that represents the atomic unit to abort