pub struct DBCommon<T: ThreadMode, D: DBInner> { /* private fields */ }
Expand description

A helper type to implement some common methods for DBWithThreadMode and OptimisticTransactionDB.

Implementations

Methods of DBWithThreadMode.

Opens a database with default options.

Opens the database with the specified options.

Opens the database for read only with the specified options.

Opens the database as a secondary.

Opens the database with a Time to Live compaction filter.

Opens the database with a Time to Live compaction filter and column family names.

Column families opened using this function will be created with default Options.

Opens a database with the given database with a Time to Live compaction filter and column family descriptors.

Opens a database with the given database options and column family names.

Column families opened using this function will be created with default Options.

Opens a database for read only with the given database options and column family names.

Opens a database for read only with the given database options and column family names.

Opens a database for ready only with the given database options and column family descriptors.

Opens the database as a secondary with the given database options and column family names.

Opens the database as a secondary with the given database options and column family descriptors.

Opens a database with the given database options and column family descriptors.

Removes the database entries in the range ["from", "to") using given write options.

Removes the database entries in the range ["from", "to") using default write options.

Common methods of DBWithThreadMode and OptimisticTransactionDB.

Flushes the WAL buffer. If sync is set to true, also syncs the data to disk.

Flushes database memtables to SST files on the disk.

Flushes database memtables to SST files on the disk using default options.

Flushes database memtables to SST files on the disk for a given column family.

Flushes database memtables to SST files on the disk for a given column family using default options.

Return the bytes associated with a key value with read options. If you only intend to use the vector returned temporarily, consider using get_pinned_opt to avoid unnecessary memory copy.

Return the bytes associated with a key value. If you only intend to use the vector returned temporarily, consider using get_pinned to avoid unnecessary memory copy.

Return the bytes associated with a key value and the given column family with read options. If you only intend to use the vector returned temporarily, consider using get_pinned_cf_opt to avoid unnecessary memory.

Return the bytes associated with a key value and the given column family. If you only intend to use the vector returned temporarily, consider using get_pinned_cf to avoid unnecessary memory.

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy.

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_opt but leverages default options.

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_opt but allows specifying ColumnFamily

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_cf_opt but leverages default options.

Return the values associated with the given keys.

Return the values associated with the given keys using read options.

Return the values associated with the given keys and column families.

Return the values associated with the given keys and column families using read options.

Return the values associated with the given keys and the specified column family where internally the read requests are processed in batch if block-based table SST format is used. It is a more optimized version of multi_get_cf.

Return the values associated with the given keys and the specified column family where internally the read requests are processed in batch if block-based table SST format is used. It is a more optimized version of multi_get_cf_opt.

Returns false if the given key definitely doesn’t exist in the database, otherwise returns true. This function uses default ReadOptions.

Returns false if the given key definitely doesn’t exist in the database, otherwise returns true.

Returns false if the given key definitely doesn’t exist in the specified column family, otherwise returns true. This function uses default ReadOptions.

Returns false if the given key definitely doesn’t exist in the specified column family, otherwise returns true.

Opens an iterator using the provided ReadOptions. This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions

Opens an iterator with set_total_order_seek enabled. This must be used to iterate across prefixes when set_memtable_factory has been called with a Hash-based implementation.

Opens a raw iterator over the database, using the default read options

Opens a raw iterator over the given column family, using the default read options

Opens a raw iterator over the database, using the given read options

Opens a raw iterator over the given column family, using the given read options

Runs a manual compaction on the Range of keys given. This is not likely to be needed for typical usage.

Same as compact_range but with custom options.

Runs a manual compaction on the Range of keys given on the given column family. This is not likely to be needed for typical usage.

Same as compact_range_cf but with custom options.

Retrieves a RocksDB property by name.

Full list of properties could be find here.

Retrieves a RocksDB property by name, for a specific column family.

Full list of properties could be find here.

Retrieves a RocksDB property and casts it to an integer.

Full list of properties that return int values could be find here.

Retrieves a RocksDB property for a specific column family and casts it to an integer.

Full list of properties that return int values could be find here.

The sequence number of the most recent transaction.

Iterate over batches of write operations since a given sequence.

Produce an iterator that will provide the batches of write operations that have occurred since the given sequence (see latest_sequence_number()). Use the provided iterator to retrieve each (u64, WriteBatch) tuple, and then gather the individual puts and deletes using the WriteBatch::iterate() function.

Calling get_updates_since() with a sequence number that is out of bounds will return an error.

Tries to catch up with the primary by reading as much as possible from the log files.

Loads a list of external SST files created with SstFileWriter into the DB with default opts

Loads a list of external SST files created with SstFileWriter into the DB

Loads a list of external SST files created with SstFileWriter into the DB for given Column Family with default opts

Loads a list of external SST files created with SstFileWriter into the DB for given Column Family

Returns a list of all table files with their level, start key and end key

Delete sst files whose keys are entirely in the given range.

Could leave some keys in the range which are in files which are not entirely in the range.

Note: L0 files are left regardless of whether they’re in the range.

SnapshotWithThreadModes before the delete might not see the data in the given range.

Same as delete_file_in_range but only for specific column family

Request stopping background work, if wait is true wait until it’s done.

Creates column family with given name and options

Drops the column family with the given name

Returns the underlying column family handle

Creates column family with given name and options

Drops the column family with the given name by internally locking the inner column family map. This avoids needing &mut self reference

Returns the underlying column family handle

Methods of OptimisticTransactionDB.

Opens a database with default options.

Opens the database with the specified options.

Opens a database with the given database options and column family names.

Column families opened using this function will be created with default Options.

Opens a database with the given database options and column family descriptors.

Creates a transaction with default options.

Creates a transaction with default options.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.