public class ExpectedValueCheckingTransaction extends Object implements StoreTransaction
StoreTransaction that supports locking via
LocalLockMediator and writing and reading lock records in a
ExpectedValueCheckingStore.
This class is not safe for concurrent use by multiple threads.
Multithreaded access must be prevented or externally synchronized.| Constructor and Description |
|---|
ExpectedValueCheckingTransaction(StoreTransaction dataTx,
StoreTransaction lockTx,
Duration maxReadTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commits the transaction and persists all modifications to the backend.
|
BaseTransactionConfig |
getConfiguration()
Get the configuration for this transaction
|
boolean |
isMutationStarted()
Tells whether this transaction has been used in a
ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
call. |
void |
mutationStarted()
Signals the transaction that it has been used in a call to
ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
. |
void |
rollback()
Aborts (or rolls back) the transaction.
|
public ExpectedValueCheckingTransaction(StoreTransaction dataTx, StoreTransaction lockTx, Duration maxReadTime)
public void rollback()
throws StorageException
BaseTransactionBaseTransaction.commit() at most once per instance.rollback in interface BaseTransactionStorageExceptionpublic void commit()
throws StorageException
BaseTransactionBaseTransaction.rollback() at most once per instance.commit in interface BaseTransactionStorageExceptionpublic boolean isMutationStarted()
ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
call. When this returns true, the transaction is no longer allowed in
calls to
ExpectedValueCheckingStore.acquireLock(StaticBuffer, StaticBuffer, StaticBuffer, StoreTransaction).ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
is called on this transaction instance. Returns true forever
after.public void mutationStarted()
ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)
. This transaction can't be used in subsequent calls to
ExpectedValueCheckingStore.acquireLock(StaticBuffer, StaticBuffer, StaticBuffer, StoreTransaction)
.
Calling this method at the appropriate time is handled automatically by
ExpectedValueCheckingStore. Titan users don't need to call this
method by hand.public BaseTransactionConfig getConfiguration()
BaseTransactionConfigurablegetConfiguration in interface BaseTransactionConfigurableCopyright © 2012–2014. All rights reserved.