Interface SegmentedKeyValueStorageTransaction


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

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

    • put

      void put(SegmentIdentifier segmentIdentifier, 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:
      segmentIdentifier - the segment identifier
      key - the given value is to be associated with.
      value - associated with the specified key.
    • remove

      void remove(SegmentIdentifier segmentIdentifier, byte[] key)
      When the given key is present, the key and mapped value will be removed from storage.
      Parameters:
      segmentIdentifier - the segment identifier
      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.
    • close

      void close()
      close the transaction