Class TwoPhaseVolatileStore

java.lang.Object
com.arjuna.ats.arjuna.objectstore.ObjectStore
com.arjuna.ats.internal.arjuna.objectstore.TwoPhaseVolatileStore
All Implemented Interfaces:
BaseStore, ObjectStoreAPI, ParticipantStore, RecoveryStore, TxLog

public class TwoPhaseVolatileStore extends ObjectStore
Two phase volatile store. Allows for recoverable and shared object instances to participate in a transaction. Does not support all recovery methods that are specific to persistent (durable) object stores.
Author:
marklittle
  • Constructor Details

  • Method Details

    • allObjUids

      public boolean allObjUids(String s, InputObjectState buff, int m) throws ObjectStoreException
      Obtain all of the Uids for a specified type.
      Parameters:
      s - The type to scan for.
      buff - The object state in which to store the Uids
      m - The file type to look for (e.g., committed, shadowed).
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • allTypes

      public boolean allTypes(InputObjectState buff) throws ObjectStoreException
      Obtain all types of objects stored in the object store.
      Parameters:
      buff - The state in which to store the types.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • currentState

      public int currentState(Uid u, String tn) throws ObjectStoreException
      Parameters:
      u - The object to query.
      tn - The type of the object to query.
      Returns:
      the current state of the object's state (e.g., shadowed, committed ...)
      Throws:
      ObjectStoreException
    • getStoreName

      public String getStoreName()
      Returns:
      the name of the object store.
    • commit_state

      public boolean commit_state(Uid u, String tn) throws ObjectStoreException
      Commit the object's state in the object store.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • hide_state

      public boolean hide_state(Uid u, String tn) throws ObjectStoreException
      Hide the object's state in the object store. Used by crash recovery.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • reveal_state

      public boolean reveal_state(Uid u, String tn) throws ObjectStoreException
      Reveal a hidden object's state.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • read_committed

      public InputObjectState read_committed(Uid u, String tn) throws ObjectStoreException
      Read the object's committed state.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      Returns:
      the state of the object.
      Throws:
      ObjectStoreException
    • read_uncommitted

      public InputObjectState read_uncommitted(Uid u, String tn) throws ObjectStoreException
      Read the object's shadowed state.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      Returns:
      the state of the object.
      Throws:
      ObjectStoreException
    • remove_committed

      public boolean remove_committed(Uid u, String tn) throws ObjectStoreException
      Remove the object's committed state.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • remove_uncommitted

      public boolean remove_uncommitted(Uid u, String tn) throws ObjectStoreException
      Remove the object's uncommitted state.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • write_committed

      public boolean write_committed(Uid u, String tn, OutputObjectState buff) throws ObjectStoreException
      Write a new copy of the object's committed state.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      buff - The state to write.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • write_uncommitted

      public boolean write_uncommitted(Uid u, String tn, OutputObjectState buff) throws ObjectStoreException
      Write a copy of the object's uncommitted state.
      Parameters:
      u - The object to work on.
      tn - The type of the object to work on.
      buff - The state to write.
      Returns:
      true if no errors occurred, false otherwise.
      Throws:
      ObjectStoreException
    • supressEntry

      protected boolean supressEntry(String name)
      Suppress directories of the specified type from allTypes etc?
      Specified by:
      supressEntry in class ObjectStore