Class TxnReadUncommitted
java.lang.Object
org.aksw.commons.txn.impl.TxnReadUncommitted
- All Implemented Interfaces:
Txn
- Direct Known Subclasses:
TxnSerializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.google.common.cache.LoadingCache<Path<String>, TxnResourceApi> protected Stringprotected TxnMgrImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidbooleanclaim()Instruct this TxnMgr to try to claim (i.e.voidprotected TxnResourceApicreateResourceApi(Path<String> key) getId()Get the id of this transactiongetResourceApi(Path<String> resRelPath) Get access to a resource as seen from this txnbooleanisCommit()booleanbooleanbooleanisStale()Whether the transaction has become stalebooleanisWrite()listVisibleFiles(Path<String> prefix) voidpromote()Promote a read transaction to write.voidsetActivityDate(Instant instant) Update the transaction's most recent activity timestamp to given timestamp; Used to prevent other processes from considering the transaction stale.voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Txn
updateActivityDate
-
Field Details
-
txnMgr
-
txnId
-
containerCache
-
-
Constructor Details
-
TxnReadUncommitted
-
-
Method Details
-
createResourceApi
-
getId
-
promote
-
getTxnMgr
-
listVisibleFiles
- Specified by:
listVisibleFilesin interfaceTxn
-
getCreationDate
- Specified by:
getCreationDatein interfaceTxn
-
getResourceApi
Description copied from interface:TxnGet access to a resource as seen from this txn- Specified by:
getResourceApiin interfaceTxn
-
isWrite
-
cleanUpTxn
- Specified by:
cleanUpTxnin interfaceTxn- Throws:
IOException
-
addCommit
- Specified by:
addCommitin interfaceTxn- Throws:
IOException
-
addFinalize
- Specified by:
addFinalizein interfaceTxn- Throws:
IOException
-
addRollback
- Specified by:
addRollbackin interfaceTxn- Throws:
IOException
-
isFinalize
- Specified by:
isFinalizein interfaceTxn- Throws:
IOException
-
isCommit
- Specified by:
isCommitin interfaceTxn- Throws:
IOException
-
isRollback
- Specified by:
isRollbackin interfaceTxn- Throws:
IOException
-
streamAccessedResourcePaths
- Specified by:
streamAccessedResourcePathsin interfaceTxn- Throws:
IOException
-
setActivityDate
Description copied from interface:TxnUpdate the transaction's most recent activity timestamp to given timestamp; Used to prevent other processes from considering the transaction stale.- Specified by:
setActivityDatein interfaceTxn- Throws:
IOException
-
getActivityDate
- Specified by:
getActivityDatein interfaceTxn- Throws:
IOException
-
isStale
Description copied from interface:TxnWhether the transaction has become stale- Specified by:
isStalein interfaceTxn- Throws:
IOException
-
claim
Description copied from interface:TxnInstruct this TxnMgr to try to claim (i.e. take ownership) of this txn. Should only be used on stale transactions. A claim fails - indicated by a return value of false - if the txn's heartbeat timeout has not been reached. This condition also occurs if another thread won the competition for claiming a txn.- Specified by:
claimin interfaceTxn- Throws:
IOException
-
updateHeartbeat
- Specified by:
updateHeartbeatin interfaceTxn- Throws:
IOException
-
getMostRecentHeartbeat
- Specified by:
getMostRecentHeartbeatin interfaceTxn- Throws:
IOException
-
getDurationToNextHeartbeat
- Specified by:
getDurationToNextHeartbeatin interfaceTxn- Throws:
IOException
-