Interface LockBasedTransaction

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void begin()
      Begins transaction if underlying storage requires transactions.
      void commit()
      Commits transaction if underlying storage requires transactions
      void create​(byte[] data, RemoteBucketState state)
      Creates the data by the key associated with this transaction.
      byte[] lockAndGet()
      Locks data by the key associated with this transaction and returns data that is associated with the key.
      void release()
      Frees resources associated with this transaction
      void rollback()
      Rollbacks transaction if underlying storage requires transactions
      void unlock()
      Unlocks data by the key associated with this transaction.
      void update​(byte[] data, RemoteBucketState newState)
      Updates the data by the key associated with this transaction.
    • Method Detail

      • begin

        void begin()
        Begins transaction if underlying storage requires transactions. There is strong guarantee that commit() or rollback() will be called if begin() returns successfully.
      • rollback

        void rollback()
        Rollbacks transaction if underlying storage requires transactions
      • commit

        void commit()
        Commits transaction if underlying storage requires transactions
      • lockAndGet

        byte[] lockAndGet()
        Locks data by the key associated with this transaction and returns data that is associated with the key. There is strong guarantee that unlock() will be called if lockAndGet() returns successfully.
        Returns:
        Returns the data by the key associated with this transaction, or null data associated with key does not exist
      • unlock

        void unlock()
        Unlocks data by the key associated with this transaction.
      • create

        void create​(byte[] data,
                    RemoteBucketState state)
        Creates the data by the key associated with this transaction.
        Parameters:
        data - bucket state to persists
        state - of bucket - can be used to extract additional data is useful for persistence or logging.
      • update

        void update​(byte[] data,
                    RemoteBucketState newState)
        Updates the data by the key associated with this transaction.
        Parameters:
        data - bucket state to persists
        newState - new state of bucket - can be used to extract additional data is useful for persistence or logging.
      • release

        void release()
        Frees resources associated with this transaction