Interface TxnResourceApi
- All Superinterfaces:
TxnComponent
- All Known Implementing Classes:
TxnResourceApiReadUncommitted, TxnResourceApiSerializable
View over a resource w.r.t a transaction.
This means that most methods such as
declareAccess, undeclareAccess and isVisible are interpreted
w.r.t. the underlying transaction.
- Author:
- raven
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeclare that the txn accessed the resource.A container to get/set the new content for the resource Once the transaction completes the old content will be replaced with the new one.The timestamp of the most recent modificaton to the resourcebooleanWhether the resource is visible to the transactiondefault voidlock(boolean write) Convenience short hand to lock the resource for this transactionvoidRemove access declaration from the txn to this resource.default voidunlock()Convenience short hand to unlock either lockMethods inherited from interface TxnComponent
finalizeCommit, preCommit, rollback
-
Method Details
-
getResourceKey
-
getTxnResourceLock
ReadWriteLockWithOwnership getTxnResourceLock() -
getLastModifiedDate
The timestamp of the most recent modificaton to the resource- Throws:
IOException
-
declareAccess
void declareAccess()Declare that the txn accessed the resource. Upon recovery the resource will be checked for any uncommitted changes. -
undeclareAccess
void undeclareAccess()Remove access declaration from the txn to this resource. Recovery related to this txn will not consider the resource. -
isVisible
boolean isVisible()Whether the resource is visible to the transaction -
getFileSync
FileSync getFileSync()A container to get/set the new content for the resource Once the transaction completes the old content will be replaced with the new one. On rollback, the new-but-uncommitted content will by discarded -
lock
default void lock(boolean write) Convenience short hand to lock the resource for this transaction -
unlock
default void unlock()Convenience short hand to unlock either lock
-