Interface TransactionalKVS<K,​V>

  • All Superinterfaces:
    KeyValueStorage<K,​V>
    All Known Implementing Classes:
    TransactionalKVSImpl

    public interface TransactionalKVS<K,​V>
    extends KeyValueStorage<K,​V>
    Wrapper around standart KeyValueStorage with transactional features (merge, commit, rollback)
    • Method Detail

      • merge

        void merge​(KeyValueStorage<K,​V> updates)
        Merge updates into base index If updates contain entry with empty (=null) value - key will be removed from base index
        Parameters:
        updates - updates to merge
      • merge

        void merge​(Map<K,​V> updates)
        Merge updates into base index If updates contain entry with empty (=null) value - key will be removed from base index
        Parameters:
        updates - updates to merge
      • rollback

        void rollback()
               throws DBException
        Rollback changes from last uncommited merge operation
        Throws:
        DBException
      • getPrimaryStorage

        KeyValueStorage<K,​V> getPrimaryStorage()
        Get base index
        Returns:
        KeyValueStorage
      • getMergeRebuildBorder

        int getMergeRebuildBorder()
        Get merge rebuild border. Value (in percent) show how many updates need to full rebuild of base index. If updates have less size - it will be merge by simple put into base index (on mergeCommit method) or base index clone (on merge method)
        Returns:
        merge rebuld border
      • setMergeRebuildBorder

        void setMergeRebuildBorder​(int mergeRebuildBorder)
        Set merge rebuild border (see getMergeRebuildBorder)
        Parameters:
        mergeRebuildBorder - merge rebuild border
      • mergeCommit

        void mergeCommit​(KeyValueStorage<K,​V> updates)
        Merge&commit updates - fastest, but less integrity safe method to bulk update index
        Parameters:
        updates - updates
      • mergeCommit

        void mergeCommit​(Map<K,​V> updates)
        merge&commit updates - fastest, but less integrity safe method to bulk update index
        Parameters:
        updates - updates