Package com._1c.g5.v8.xmdb
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcommit()Commit changes from last merge operationintgetMergeRebuildBorder()Get merge rebuild border.KeyValueStorage<K,V>getPrimaryStorage()Get base indexvoidmerge(KeyValueStorage<K,V> updates)Merge updates into base index If updates contain entry with empty (=null) value - key will be removed from base indexvoidmerge(Map<K,V> updates)Merge updates into base index If updates contain entry with empty (=null) value - key will be removed from base indexvoidmergeCommit(KeyValueStorage<K,V> updates)Merge&commit updates - fastest, but less integrity safe method to bulk update indexvoidmergeCommit(Map<K,V> updates)merge&commit updates - fastest, but less integrity safe method to bulk update indexvoidrollback()Rollback changes from last uncommited merge operationvoidsetMergeRebuildBorder(int mergeRebuildBorder)Set merge rebuild border (see getMergeRebuildBorder)
-
-
-
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 DBExceptionRollback changes from last uncommited merge operation- Throws:
DBException
-
commit
void commit() throws DBExceptionCommit changes from last 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
-
-