class LevelDBKeyValueStore : KeyValueStore
(source)
A key-value store backed by LevelDB.
dbPath
- The path to the levelDB database.
options
- Options for the levelDB database.
dispatcher
- The co-routine context for blocking tasks.
IOException
- If an I/O error occurs.
Return
A key-value store.
LevelDBKeyValueStore(dbPath: Path, options: Options = Options().createIfMissing(true).cacheSize((100 * 1048576).toLong()), dispatcher: CoroutineDispatcher = Dispatchers.IO)
Open a LevelDB-backed key-value store. |
fun close(): Unit
Closes the underlying LevelDB instance. |
|
suspend fun get(key: Bytes): Bytes?
Retrieves data from the store. |
|
suspend fun put(key: Bytes, value: Bytes): <ERROR CLASS>
Puts data into the store. |
open fun getAsync(key: Bytes): AsyncResult<Bytes?> open fun getAsync(dispatcher: CoroutineDispatcher, key: Bytes): AsyncResult<Bytes?>
Retrieves data from the store. |
|
open fun putAsync(key: Bytes, value: Bytes): AsyncCompletion open fun putAsync(dispatcher: CoroutineDispatcher, key: Bytes, value: Bytes): AsyncCompletion
Puts data into the store. |
fun open(dbPath: Path): LevelDBKeyValueStore fun open(dbPath: Path, options: Options): LevelDBKeyValueStore
Open a LevelDB-backed key-value store. |