Class NullImplementation.NullPersistentStore<R>

java.lang.Object
com.tangosol.util.NullImplementation.NullPersistentStore<R>
Type Parameters:
R - the raw value type
All Implemented Interfaces:
com.oracle.coherence.persistence.PersistentStore<R>
Direct Known Subclasses:
SafePersistenceWrappers.SafePersistentStore
Enclosing class:
NullImplementation

public static class NullImplementation.NullPersistentStore<R> extends Object implements com.oracle.coherence.persistence.PersistentStore<R>
A PersistentStore that does as little as possible.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
    Token returned by begin(Collector, Object).

    Nested classes/interfaces inherited from interface com.oracle.coherence.persistence.PersistentStore

    com.oracle.coherence.persistence.PersistentStore.Visitor<R>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Singleton instance of a NullPersistentStore.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    abort(Object oToken)
    Abort an atomic sequence of mutating operations.
    Begin a new sequence of mutating operations that should be committed to the store as an atomic unit.
    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[]
    Return a list of the extent identifiers in the underlying store.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.oracle.coherence.persistence.PersistentStore

    exclusively
  • Field Details

  • Constructor Details

    • NullPersistentStore

      public NullPersistentStore()
  • Method Details

    • getId

      public String getId()
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Return the identifier of this store.
      Specified by:
      getId in interface com.oracle.coherence.persistence.PersistentStore<R>
      Returns:
      the identifier that was used to open this store
    • ensureExtent

      public boolean ensureExtent(long lExtentId)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Ensure that an extent with the given identifier exists in the persistent store, returning true iff the extent was created.
      Specified by:
      ensureExtent in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      lExtentId - the identifier of the extent to ensure
      Returns:
      true iff the specified extent did not previously exist
    • deleteExtent

      public void deleteExtent(long lExtentId)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Delete the specified extent from the persistent store, ensuring that any key-value mappings associated with the extent are no longer valid.

      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.

      Specified by:
      deleteExtent in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      lExtentId - the identifier of the extent to delete
    • moveExtent

      public void moveExtent(long lOldExtentId, long lNewExtentId)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Move the specified extent from the old extent id to the new extent id.

      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.

      Specified by:
      moveExtent in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      lOldExtentId - the old extent identifier
      lNewExtentId - the new extent identifier
    • truncateExtent

      public void truncateExtent(long lExtentId)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Truncate the specified extent from the persistent store, ensuring that any key-value mappings associated with the extent are removed.

      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.

      Specified by:
      truncateExtent in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      lExtentId - the identifier of the extent to truncate
    • extents

      public long[] extents()
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Return a list of the extent identifiers in the underlying store.
      Specified by:
      extents in interface com.oracle.coherence.persistence.PersistentStore<R>
      Returns:
      a list of the extent identifiers in the underlying store
    • load

      public R load(long lExtentId, R key)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
      Specified by:
      load in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      lExtentId - the extent identifier for the key
      key - key whose associated value is to be returned
      Returns:
      the value associated with the specified key, or null if no value is available for that key
    • store

      public void store(long lExtentId, R key, R value, Object oToken)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Store the specified value under the specific key in the underlying store. This method is intended to support both key-value pair creation and value update for a specific key.
      Specified by:
      store in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      lExtentId - the extent identifier for the key-value pair
      key - key to store the value under
      value - value to be stored
      oToken - 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
    • erase

      public void erase(long lExtentId, R key, Object oToken)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Remove the specified key from the underlying store if present.
      Specified by:
      erase in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      lExtentId - the extent identifier for the key
      key - key whose mapping is to be removed
      oToken - 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 method
    • iterate

      public void iterate(com.oracle.coherence.persistence.PersistentStore.Visitor<R> visitor)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Iterate the key-value pairs in the persistent store, applying the specified visitor to each key-value pair.
      Specified by:
      iterate in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      visitor - the visitor to apply
    • begin

      public Object begin()
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Begin a new sequence of mutating operations that should be committed to the store as an atomic unit. The returned token should be passed to all mutating operations that should be part of the atomic unit. Once the sequence of operations have been performed, they must either be committed to the store or the atomic unit must be aborted.
      Specified by:
      begin in interface com.oracle.coherence.persistence.PersistentStore<R>
      Returns:
      a token that represents the atomic unit
    • begin

      public Object begin(Collector<Object> collector, Object oReceipt)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Begin a new sequence of mutating operations that should be committed to the store asynchronously as an atomic unit. The returned token should be passed to all mutating operations that should be part of the atomic unit. Once the sequence of operations have been performed, they must either be 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.

      Specified by:
      begin in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      collector - an optional collector
      oReceipt - a receipt to be added to the collector (if any) when the unit is committed
      Returns:
      a token representing the atomic unit that will be committed asynchronously
    • commit

      public void commit(Object oToken)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Commit a sequence of mutating operations represented by the given token as an atomic unit.
      Specified by:
      commit in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      oToken - a token that represents the atomic unit to commit
    • abort

      public void abort(Object oToken)
      Description copied from interface: com.oracle.coherence.persistence.PersistentStore
      Abort an atomic sequence of mutating operations.
      Specified by:
      abort in interface com.oracle.coherence.persistence.PersistentStore<R>
      Parameters:
      oToken - a token that represents the atomic unit to abort