Interface Transactional<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<Version> begin​(TransactionId transactionId)
      Begins the transaction.
      java.util.concurrent.CompletableFuture<java.lang.Void> commit​(TransactionId transactionId)
      Commits a previously prepared transaction and unlocks the object.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> prepare​(TransactionLog<T> transactionLog)
      Prepares a transaction for commitment.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> prepareAndCommit​(TransactionLog<T> transactionLog)
      Prepares and commits a transaction.
      java.util.concurrent.CompletableFuture<java.lang.Void> rollback​(TransactionId transactionId)
      Aborts a previously prepared transaction and unlocks the object.
    • Method Detail

      • begin

        java.util.concurrent.CompletableFuture<Version> begin​(TransactionId transactionId)
        Begins the transaction.
        Parameters:
        transactionId - the transaction identifier for the transaction to begin
        Returns:
        a completable future to be completed with the lock version
      • prepare

        java.util.concurrent.CompletableFuture<java.lang.Boolean> prepare​(TransactionLog<T> transactionLog)
        Prepares a transaction for commitment.
        Parameters:
        transactionLog - transaction log
        Returns:
        true if prepare is successful and transaction is ready to be committed false otherwise
      • prepareAndCommit

        java.util.concurrent.CompletableFuture<java.lang.Boolean> prepareAndCommit​(TransactionLog<T> transactionLog)
        Prepares and commits a transaction.
        Parameters:
        transactionLog - transaction log
        Returns:
        true if prepare is successful and transaction was committed false otherwise
      • commit

        java.util.concurrent.CompletableFuture<java.lang.Void> commit​(TransactionId transactionId)
        Commits a previously prepared transaction and unlocks the object.
        Parameters:
        transactionId - transaction identifier
        Returns:
        future that will be completed when the operation finishes
      • rollback

        java.util.concurrent.CompletableFuture<java.lang.Void> rollback​(TransactionId transactionId)
        Aborts a previously prepared transaction and unlocks the object.
        Parameters:
        transactionId - transaction identifier
        Returns:
        future that will be completed when the operation finishes