Struct ckb_db::db::RocksDB [−][src]
pub struct RocksDB { /* fields omitted */ }
Expand description
RocksDB wrapper base on OptimisticTransactionDB
https://github.com/facebook/rocksdb/wiki/Transactions#optimistictransactiondb
Implementations
Repairer does best effort recovery to recover as much data as possible after a disaster without compromising consistency. It does not guarantee bringing the database to a time consistent state. Note: Currently there is a limitation that un-flushed column families will be lost after repair. This would happen even if the DB is in healthy state.
Open a database with the given configuration and columns count.
Open a database in the given directory with the default configuration and columns count.
Set appropriate parameters for bulk loading.
Return the value associated with a key using RocksDB’s PinnableSlice from the given column so as to avoid unnecessary memory copy.
Return the value associated with a key using RocksDB’s PinnableSlice from the default column so as to avoid unnecessary memory copy.
Insert a value into the database under the given key.
Traverse database column with the given callback function.
Traverse database column with the given callback function.
Set a snapshot at start of transaction by setting set_snapshot=true
Construct RocksDBWriteBatch
with default option.
Write batch into transaction db.
WriteOptions set_sync true If true, the write will be flushed from the operating system buffer cache (by calling WritableFile::Sync()) before the write is considered complete. If this flag is true, writes will be slower.
If this flag is false, and the machine crashes, some recent writes may be lost. Note that if it is just the process that crashes (i.e., the machine does not reboot), no writes will be lost even if sync==false.
In other words, a DB write with sync==false has similar crash semantics as the “write()” system call. A DB write with sync==true has similar crash semantics to a “write()” system call followed by “fdatasync()”.
Default: false
The begin and end arguments define the key range to be compacted. The behavior varies depending on the compaction style being used by the db. In case of universal and FIFO compaction styles, the begin and end arguments are ignored and all files are compacted. Also, files in each level are compacted and left in the same level. For leveled compaction style, all files containing keys in the given range are compacted to the last level containing files. If either begin or end are NULL, it is taken to mean the key before all keys in the db or the key after all keys respectively.
If more than one thread calls manual compaction, only one will actually schedule it while the other threads will simply wait for the scheduled manual compaction to complete.
CompactRange waits while compaction is performed on the background threads and thus is a blocking call.
Return RocksDBSnapshot
.
Return rocksdb OptimisticTransactionDB
.
Create a new column family for the database.
Trait Implementations
fn iter_opt(
&self,
col: Col,
mode: IteratorMode<'_>,
readopts: &ReadOptions
) -> Result<DBIter<'_>>
fn iter_opt(
&self,
col: Col,
mode: IteratorMode<'_>,
readopts: &ReadOptions
) -> Result<DBIter<'_>>
Opens an interator using the provided IteratorMode and ReadOptions. This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions Read more
Auto Trait Implementations
impl RefUnwindSafe for RocksDB
impl UnwindSafe for RocksDB
Blanket Implementations
Mutably borrows from an owned value. Read more