class RocksDBKeyValueStore<K, V> : KeyValueStore<K, V>
(source)
A key-value store backed by RocksDB.
dbPath
- The path to the RocksDB database.
options
- Options for the RocksDB database.
coroutineContext
- The co-routine context for blocking tasks.
IOException
- If an I/O error occurs.
Return
A key-value store.
<init> |
Open a RocksDB-backed key-value store. RocksDBKeyValueStore(dbPath: Path, keySerializer: (K) -> Bytes, valueSerializer: (V) -> Bytes, keyDeserializer: (Bytes) -> K, valueDeserializer: (Bytes) -> V, options: Options = Options().setCreateIfMissing(true).setWriteBufferSize(268435456).setMaxOpenFiles(-1), coroutineContext: CoroutineContext = Dispatchers.IO) |
coroutineContext |
The co-routine context for blocking tasks. val coroutineContext: CoroutineContext |
clear |
Clears the contents of the store. suspend fun clear(): Unit |
close |
Closes the underlying RocksDB instance. fun close(): Unit |
containsKey |
Returns true if the store contains the key. suspend fun containsKey(key: K): Boolean |
get |
Retrieves data from the store. suspend fun get(key: K): V? |
keys |
Provides an iterator over the keys of the store. suspend fun keys(): Iterable<K> |
put |
Puts data into the store. suspend fun put(key: K, value: V): Unit |
open |
Open a RocksDB-backed key-value store. fun <K, V> open(dbPath: Path, keySerializer: Function<K, Bytes>, valueSerializer: Function<V, Bytes>, keyDeserializer: Function<Bytes, K>, valueDeserializer: Function<Bytes, V>): RocksDBKeyValueStore<K, V> fun <K, V> open(dbPath: Path, keySerializer: Function<K, Bytes>, valueSerializer: Function<V, Bytes>, keyDeserializer: Function<Bytes, K>, valueDeserializer: Function<Bytes, V>, options: Options): RocksDBKeyValueStore<K, V> |