com.thinkaurelius.titan.diskstorage.locking.consistentkey

## Class ExpectedValueCheckingTransaction

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.locking.consistentkey.ExpectedValueCheckingTransaction

- All Implemented Interfaces:
    BaseTransaction, BaseTransactionConfigurable, StoreTransaction

      public class ExpectedValueCheckingTransaction
      extends Object
      implements StoreTransaction

  A `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 Summary

    Constructors
    Constructor and Description
    `ExpectedValueCheckingTransaction(StoreTransaction inconsistentTx, StoreTransaction strongConsistentTx, Duration maxReadTime)`

  - ### Method Summary

    Methods
    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
    `StoreTransaction` | `getConsistentTx()`
    `StoreTransaction` | `getInconsistentTx()`
    `boolean` | `isMutationStarted()` Tells whether this transaction has been used in a `ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)` call.
    `void` | `rollback()` Aborts (or rolls back) the transaction.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExpectedValueCheckingTransaction

          public ExpectedValueCheckingTransaction(StoreTransaction inconsistentTx,
                                          StoreTransaction strongConsistentTx,
                                          Duration maxReadTime)

  - ### Method Detail

    - #### rollback

          public void rollback()
                        throws BackendException

      Description copied from interface: `BaseTransaction`
      Aborts (or rolls back) the transaction. Call either this method or `BaseTransaction.commit()` at most once per instance.
      Specified by:
        `rollback` in interface `BaseTransaction`
      Throws:
        `BackendException`

    - #### commit

          public void commit()
                      throws BackendException

      Description copied from interface: `BaseTransaction`
      Commits the transaction and persists all modifications to the backend. Call either this method or `BaseTransaction.rollback()` at most once per instance.
      Specified by:
        `commit` in interface `BaseTransaction`
      Throws:
        `BackendException`

    - #### isMutationStarted

          public boolean isMutationStarted()

      Tells whether this transaction has been used in a `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)`.
      Returns:
        False until `ExpectedValueCheckingStore.mutate(StaticBuffer, List, List, StoreTransaction)` is called on this transaction instance. Returns true forever after.

    - #### getConfiguration

          public BaseTransactionConfig getConfiguration()

      Description copied from interface: `BaseTransactionConfigurable`
      Get the configuration for this transaction
      Specified by:
        `getConfiguration` in interface `BaseTransactionConfigurable`
      Returns:

    - #### getInconsistentTx

          public StoreTransaction getInconsistentTx()

    - #### getConsistentTx

          public StoreTransaction getConsistentTx()

Copyright © 2012–2014. All rights reserved.