Interface KeyValueStorageTransaction


  • public interface KeyValueStorageTransaction
    A transaction that can atomically commit a sequence of operations to a key-value store.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void commit()
      Performs an atomic commit of all the operations queued in the transaction.
      void put​(byte[] key, byte[] value)
      Associates the specified value with the specified key.
      void remove​(byte[] key)
      When the given key is present, the key and mapped value will be removed from storage.
      void rollback()
      Reset the transaction to a state prior to any operations being queued.
    • Method Detail

      • put

        void put​(byte[] key,
                 byte[] value)
        Associates the specified value with the specified key.

        If a previously value had been store against the given key, the old value is replaced by the given value.

        Parameters:
        key - the given value is to be associated with.
        value - associated with the specified key.
      • remove

        void remove​(byte[] key)
        When the given key is present, the key and mapped value will be removed from storage.
        Parameters:
        key - the key and mapped value that will be removed.
      • commit

        void commit()
             throws StorageException
        Performs an atomic commit of all the operations queued in the transaction.
        Throws:
        StorageException - problem was encountered preventing the commit
      • rollback

        void rollback()
        Reset the transaction to a state prior to any operations being queued.