Struct kvdb_rocksdb::Database [−][src]
pub struct Database { /* fields omitted */ }
Expand description
Key-Value database.
Implementations
Helper to create new transaction for this database.
Commit transaction to database.
Get value by partial key. Prefix size should match configured prefix size.
Iterator over the data in the given database column index. Will hold a lock until the iterator is dropped preventing the database from being closed.
Restore the database from a copy at given path.
The number of column families in the db.
Remove the last column family in the database. The deletion is definitive.
Add a new column family to the DB.
Get RocksDB statistics.
Try to catch up a secondary instance with the primary by reading as much from the logs as possible.
Guaranteed to have changes up to the the time that try_catch_up_with_primary
is called
if it finishes succesfully.
Blocks until the MANIFEST file and any state changes in the corresponding Write-Ahead-Logs are applied to the secondary instance. If the manifest files are very large this method could take a long time.
If Write-Ahead-Logs have been purged by the primary instance before the secondary is able to open them, the secondary will not be caught up until this function is called again and new Write-Ahead-Logs are identified.
If called while the primary is writing, the catch-up may fail.
If the secondary is unable to catch up because of missing logs, this method fails silently and no error is returned.
Calling this as primary will return an error.
Trait Implementations
Get the first value matching the given prefix.
Write a transaction of changes to the backing store.
Iterate over the data for a given column.
Iterate over the data for a given column, returning all key/value pairs where the key starts with the given prefix. Read more
Attempt to replace this database with a new one located at the given path.
Query statistics. Read more
Helper to create a new transaction.
Check for the existence of a value by key.
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
If T::size_of
is a constant, consider implementing constant_size
as well. Read more
Used to optimize MallocSizeOf
implementation for collections
like Vec
and HashMap
to avoid iterating over them unnecessarily.
The Self: Sized
bound is for object safety. Read more