tuweni / org.apache.tuweni.kv / RocksDBKeyValueStore

RocksDBKeyValueStore

class RocksDBKeyValueStore : KeyValueStore (source)

A key-value store backed by RocksDB.

Parameters

dbPath - The path to the RocksDB database.

options - Options for the RocksDB database.

dispatcher - The co-routine context for blocking tasks.

Exceptions

IOException - If an I/O error occurs.

Return
A key-value store.

Constructors

<init>

RocksDBKeyValueStore(dbPath: Path, options: <ERROR CLASS> = Options().setCreateIfMissing(true).setWriteBufferSize(268435456).setMaxOpenFiles(-1), dispatcher: CoroutineDispatcher = Dispatchers.IO)

Open a RocksDB-backed key-value store.

Functions

close

fun close(): Unit

Closes the underlying RocksDB 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): RocksDBKeyValueStore
fun open(dbPath: Path, options: <ERROR CLASS>): RocksDBKeyValueStore

Open a RocksDB-backed key-value store.