Class Operation<KEY,VALUE>
- java.lang.Object
-
- com.github.basking2.sdsai.dsds.node.tx.Operation<KEY,VALUE>
-
- Direct Known Subclasses:
CachedReadOperation
public abstract class Operation<KEY,VALUE> extends java.lang.ObjectAn Operation is write, read, or other activity on aNodeStorewhich is included in aTransactionalNodeStore.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddelete()Delete this operation.protected abstract voiddoExecute()Implementing classes should implement this method.voidexecute()Execute this operation ifdelete()has not been called on it.KEYgetKey()Return a unique identifier that allows for tracking of this operation.VALUEgetValue()Return the value of this operation if it is successful.booleanisDeleted()Return if this operation is deleted.
-
-
-
Method Detail
-
getValue
public VALUE getValue()
Return the value of this operation if it is successful. The null value is appropriate if this is a write operation where there is no data returned.- Returns:
- VALUE of operation or null.
-
getKey
public KEY getKey()
Return a unique identifier that allows for tracking of this operation.
-
delete
public void delete()
Delete this operation. An operation structure typically has a lot of data associated with it. When a future operation obviates a previous operation that previous operation is not removed from theTransactionalNodeStorestructure. Rather, itsdelete()method is called to release all unecessary data and mark the Operation as deleted. Deleted operations will not be executed when theTransactionalNodeStoreis committed.
-
isDeleted
public boolean isDeleted()
Return if this operation is deleted.
-
execute
public void execute()
Execute this operation ifdelete()has not been called on it.- Throws:
java.lang.RuntimeException- or other unchecked exceptions to communicate failure.
-
-