kv / org.apache.tuweni.kv / MapDBKeyValueStore

MapDBKeyValueStore

class MapDBKeyValueStore : KeyValueStore (source)

A key-value store backed by a MapDB instance.

Parameters

dbPath - The path to the MapDB database.

dispatcher - The co-routine dispatcher for blocking tasks.

Exceptions

IOException - If an I/O error occurs.

Return
A key-value store.

Constructors

<init>

MapDBKeyValueStore(dbPath: Path, dispatcher: CoroutineDispatcher = Dispatchers.IO)

Open a MapDB-backed key-value store.

Functions

close

fun close(): Unit

Closes the underlying MapDB instance.

get

suspend fun get(key: Bytes): Bytes?

Retrieves data from the store.

put

suspend fun put(key: Bytes, value: Bytes): <ERROR CLASS>

Puts data into the store.

Inherited Functions

getAsync

open fun getAsync(key: Bytes): AsyncResult<Bytes?>
open fun getAsync(dispatcher: CoroutineDispatcher, key: Bytes): AsyncResult<Bytes?>

Retrieves data from the store.

putAsync

open fun putAsync(key: Bytes, value: Bytes): AsyncCompletion
open fun putAsync(dispatcher: CoroutineDispatcher, key: Bytes, value: Bytes): AsyncCompletion

Puts data into the store.

Companion Object Functions

open

fun open(dbPath: Path): MapDBKeyValueStore

Open a MapDB-backed key-value store.