Module rsdb::c [] [src]

C-compatible API for the lock-free log-structured B+tree.

Functions

rsdb_cas

Compare and swap. Returns 1 if successful, 0 if unsuccessful. Otherwise sets actual_val and actual_vallen to the current value, which must be freed using rsdb_free_buf by the caller if non-null. actual_val will be null and actual_vallen 0 if the current value is not set.

rsdb_close

Close a rsdb lock-free log-structured tree.

rsdb_config_flush_every_ms

Set the configured IO buffer flush interval in milliseconds.

rsdb_config_set_cache_capacity

Set the configured cache capacity in bytes.

rsdb_config_set_path

Set the configured file path. The caller is responsible for freeing the path string after calling this (it is copied in this function).

rsdb_config_snapshot_after_ops

Set the configured snapshot operation threshold.

rsdb_config_use_compression

Configure the use of the zstd compression library.

rsdb_create_config

Create a new configuration.

rsdb_del

Delete the value of a key.

rsdb_destroy_config

Destroy a configuration.

rsdb_free_buf

Free a buffer originally allocated by RSDB.

rsdb_free_iter

Free an iterator.

rsdb_get

Get the value of a key. Caller is responsible for freeing the returned value with rsdb_free_buf if it's non-null.

rsdb_iter_next

Get they next kv pair from an iterator. Caller is responsible for freeing the key and value with rsdb_free_buf. Returns 0 when exhausted.

rsdb_open

Open a rsdb lock-free log-structured tree.

rsdb_scan

Iterate from a starting key. Caller is responsible for freeing the returned iterator with rsdb_free_iter.

rsdb_set

Set a key to a value.