Package org.aksw.commons.txn.impl
Class TxnResourceApiReadUncommitted<T extends TxnReadUncommitted>
java.lang.Object
org.aksw.commons.txn.impl.TxnResourceApiReadUncommitted<T>
- All Implemented Interfaces:
TxnResourceApi,TxnComponent
- Direct Known Subclasses:
TxnResourceApiSerializable
public class TxnResourceApiReadUncommitted<T extends TxnReadUncommitted>
extends Object
implements TxnResourceApi
Api to a resource w.r.t. a transaction.
- Author:
- raven
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileSyncImplprotected Pathprotected Pathprotected org.aksw.commons.path.core.Path<String> protected T -
Constructor Summary
ConstructorsConstructorDescriptionTxnResourceApiReadUncommitted(T txn, org.aksw.commons.path.core.Path<String> resKey) -
Method Summary
Modifier and TypeMethodDescriptionvoidDeclare that the txn accessed the resource.voidA 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 resourceorg.aksw.commons.path.core.Path<String> booleanWhether the resource is visible to the transactionvoidvoidputContent(Consumer<OutputStream> handler) voidrollback()voidRemove access declaration from the txn to this resource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.txn.api.TxnResourceApi
lock, unlock
-
Field Details
-
txn
-
resKey
-
resFilePath
-
resFileAbsPath
-
fileSync
-
-
Constructor Details
-
TxnResourceApiReadUncommitted
-
-
Method Details
-
getTxnResourceLock
- Specified by:
getTxnResourceLockin interfaceTxnResourceApi
-
getLastModifiedDate
Description copied from interface:TxnResourceApiThe timestamp of the most recent modificaton to the resource- Specified by:
getLastModifiedDatein interfaceTxnResourceApi- Throws:
IOException
-
getResourceKey
- Specified by:
getResourceKeyin interfaceTxnResourceApi
-
isVisible
public boolean isVisible()Description copied from interface:TxnResourceApiWhether the resource is visible to the transaction- Specified by:
isVisiblein interfaceTxnResourceApi
-
declareAccess
public void declareAccess()Description copied from interface:TxnResourceApiDeclare that the txn accessed the resource. Upon recovery the resource will be checked for any uncommitted changes.- Specified by:
declareAccessin interfaceTxnResourceApi
-
undeclareAccess
public void undeclareAccess()Description copied from interface:TxnResourceApiRemove access declaration from the txn to this resource. Recovery related to this txn will not consider the resource.- Specified by:
undeclareAccessin interfaceTxnResourceApi
-
getFileSync
Description copied from interface:TxnResourceApiA 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- Specified by:
getFileSyncin interfaceTxnResourceApi
-
putContent
- Throws:
IOException
-
preCommit
- Specified by:
preCommitin interfaceTxnComponent- Throws:
Exception
-
finalizeCommit
- Specified by:
finalizeCommitin interfaceTxnComponent- Throws:
Exception
-
rollback
- Specified by:
rollbackin interfaceTxnComponent- Throws:
Exception
-