Class SlotStoreAdaptor
java.lang.Object
com.arjuna.ats.internal.arjuna.objectstore.slot.SlotStoreAdaptor
- All Implemented Interfaces:
BaseStore
,ObjectStoreAPI
,ParticipantStore
,RecoveryStore
,TxLog
Adaptor class that wraps the SlotStore to make it look like an ObjectStore.
Modelled on HornetqObjectStoreAdaptor.
- Author:
- Jonathan Halliday (jonathan.halliday@redhat.com), 2020-03
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allObjUids
(String typeName, InputObjectState foundInstances) Obtain all of the Uids for a specified type, regardless of their state.boolean
allObjUids
(String typeName, InputObjectState foundInstances, int matchState) Obtain all of the Uids for a specified type.boolean
allTypes
(InputObjectState foundTypes) Obtain all types of objects stored in the object store.boolean
commit_state
(Uid u, String tn) Commit the object's state in the object store.int
currentState
(Uid uid, String typeName) boolean
boolean
hide_state
(Uid u, String tn) Hide the object's state in the object store.boolean
Is the current state of the object the same as that provided as the last parameter?read_committed
(Uid uid, String typeName) Read the object's committed state.read_uncommitted
(Uid u, String tn) Read the object's shadowed state.boolean
remove_committed
(Uid uid, String typeName) Remove the object's committed state.boolean
remove_uncommitted
(Uid u, String tn) Remove the object's uncommitted state.boolean
reveal_state
(Uid u, String tn) Reveal a hidden object's state.void
start()
void
stop()
void
sync()
Some object store implementations may be running with automatic sync disabled.boolean
write_committed
(Uid uid, String typeName, OutputObjectState buff) Write a new copy of the object's committed state.boolean
write_uncommitted
(Uid u, String tn, OutputObjectState buff) Write a copy of the object's uncommitted state.
-
Constructor Details
-
SlotStoreAdaptor
- Throws:
IOException
-
SlotStoreAdaptor
-
-
Method Details
-
allObjUids
public boolean allObjUids(String typeName, InputObjectState foundInstances, int matchState) throws ObjectStoreException Obtain all of the Uids for a specified type.- Specified by:
allObjUids
in interfaceRecoveryStore
- Parameters:
typeName
- The type to scan for.foundInstances
- The object state in which to store the UidsmatchState
- The file type to look for (e.g., committed, shadowed). [StateStatus] Note: matchState=OS_UNKNOWN matches any state.- Returns:
true
if no errors occurred,false
otherwise.- Throws:
ObjectStoreException
-
allObjUids
public boolean allObjUids(String typeName, InputObjectState foundInstances) throws ObjectStoreException Obtain all of the Uids for a specified type, regardless of their state.- Specified by:
allObjUids
in interfaceRecoveryStore
- Parameters:
typeName
- The type to scan for.foundInstances
- The object state in which to store the Uids- Returns:
true
if no errors occurred,false
otherwise.- Throws:
ObjectStoreException
-
allTypes
Obtain all types of objects stored in the object store.- Specified by:
allTypes
in interfaceRecoveryStore
- Parameters:
foundTypes
- The state in which to store the types.- Returns:
true
if no errors occurred,false
otherwise.- Throws:
ObjectStoreException
-
currentState
- Specified by:
currentState
in interfaceRecoveryStore
- Parameters:
uid
- The object to query.typeName
- The type of the object to query.- Returns:
- the current state of the object's state (e.g., shadowed, committed ...) [StateStatus]
- Throws:
ObjectStoreException
-
hide_state
Hide the object's state in the object store. Used by crash recovery.- Specified by:
hide_state
in interfaceRecoveryStore
- 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
Reveal a hidden object's state.- Specified by:
reveal_state
in interfaceRecoveryStore
- 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
Read the object's committed state.- Specified by:
read_committed
in interfaceParticipantStore
- Specified by:
read_committed
in interfaceRecoveryStore
- Parameters:
uid
- The object to work on.typeName
- The type of the object to work on.- Returns:
- the state of the object.
- Throws:
ObjectStoreException
-
isType
Is the current state of the object the same as that provided as the last parameter?- Specified by:
isType
in interfaceRecoveryStore
- Parameters:
u
- The object to work on.tn
- The type of the object.st
- The expected type of the object. [StateType]- Returns:
true
if the current state is as expected,false
otherwise.- Throws:
ObjectStoreException
-
remove_committed
Remove the object's committed state.- Specified by:
remove_committed
in interfaceTxLog
- Parameters:
uid
- The object to work on.typeName
- 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 uid, String typeName, OutputObjectState buff) throws ObjectStoreException Write a new copy of the object's committed state.- Specified by:
write_committed
in interfaceTxLog
- Parameters:
uid
- The object to work on.typeName
- The type of the object to work on.buff
- The state to write.- Returns:
true
if no errors occurred,false
otherwise.- Throws:
ObjectStoreException
-
sync
Description copied from interface:TxLog
Some object store implementations may be running with automatic sync disabled. Calling this method will ensure that any states are flushed to disk.- Specified by:
sync
in interfaceTxLog
- Throws:
SyncFailedException
ObjectStoreException
-
commit_state
Description copied from interface:ParticipantStore
Commit the object's state in the object store.- Specified by:
commit_state
in interfaceParticipantStore
- 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_uncommitted
Description copied from interface:ParticipantStore
Read the object's shadowed state.- Specified by:
read_uncommitted
in interfaceParticipantStore
- 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_uncommitted
Description copied from interface:ParticipantStore
Remove the object's uncommitted state.- Specified by:
remove_uncommitted
in interfaceParticipantStore
- 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_uncommitted
public boolean write_uncommitted(Uid u, String tn, OutputObjectState buff) throws ObjectStoreException Description copied from interface:ParticipantStore
Write a copy of the object's uncommitted state.- Specified by:
write_uncommitted
in interfaceParticipantStore
- 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
-
fullCommitNeeded
public boolean fullCommitNeeded()- Specified by:
fullCommitNeeded
in interfaceParticipantStore
-
getStoreName
- Specified by:
getStoreName
in interfaceBaseStore
- Returns:
- the "name" of the object store. Where in the hierarchy it appears, e.g., /ObjectStore/MyName/...
-
start
public void start() -
stop
public void stop()
-