Package com._1c.g5.v8.bm.store
Interface IBmPersistentObjectKeyStore<K>
- 
 public interface IBmPersistentObjectKeyStore<K>Object to byte array persistent key-value store.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes the store.longgetStoreSize()Gets the size of the store, in bytes.Iterable<K>keys()Gets all the keys in the store asIterable.<T> Tread(K key, IBmPersistentStoreReaderCallback<T> callback)Reads data associated with the specified key.booleanremove(K key)Removes data assoicated with the specified key.booleanrequiresCompacting()Checks if the store requires compacting.voidstart()Starts the store.voidwrite(K key, byte[] data)Writes the specified data to store and associates with the specified key.voidwrite(K key, byte[] data, int offset, int length)Writes the specified piece of binary data and associates it with the specified ID.
 
- 
- 
- 
Method Detail- 
startvoid start() throws IOExceptionStarts the store.- Throws:
- IOException- if any I/O error occurs.
 
 - 
closevoid close() throws IOExceptionCloses the store. Once store closed, it cannot be started again.- Throws:
- IOException- if any I/O error occurs.
 
 - 
read<T> T read(K key, IBmPersistentStoreReaderCallback<T> callback) throws IOException Reads data associated with the specified key. If the data exist the callback is invoked.- Parameters:
- key- The key. May not be- null.
- callback- The callback. May not be- null.
- Returns:
- the result returned by callback or nullif there are no data associated with the specified key.
- Throws:
- IOException- if any I/O error occurs.
 
 - 
writevoid write(K key, byte[] data) throws IOException Writes the specified data to store and associates with the specified key.- Parameters:
- key- The key. May not be- null.
- data- The byte array containing the data. May not be- null.
- Throws:
- IOException- if any I/O error occurs.
 
 - 
writevoid write(K key, byte[] data, int offset, int length) throws IOException Writes the specified piece of binary data and associates it with the specified ID.- Parameters:
- key- The key. May not be- null.
- data- The byte array containing the data. May not be- null.
- offset- The offset of the data within the array.
- length- The length of the data.
- Throws:
- IOException- if any I/O error occurs.
 
 - 
removeboolean remove(K key) throws IOException Removes data assoicated with the specified key.- Parameters:
- key- The key. May not be- null.
- Returns:
- trueif there were data associated with the specified key,- falseotherwise.
- Throws:
- IOException- if any I/O error occurs.
 
 - 
keysIterable<K> keys() Gets all the keys in the store asIterable.- Returns:
- an instance of Iterable, nevernull.
 
 - 
getStoreSizelong getStoreSize() throws IOExceptionGets the size of the store, in bytes.- Returns:
- The size of the store, in bytes. Cannot be negative.
- Throws:
- IOException- if any I/O error occurs.
 
 - 
requiresCompactingboolean requiresCompacting() throws IOExceptionChecks if the store requires compacting.- Returns:
- trueif the store requires compacting,- falseotherwise.
- Throws:
- IOException- if any I/O error occurs.
 
 
- 
 
-