Struct ckb_rocksdb::OptimisticTransactionDB
source · pub struct OptimisticTransactionDB { /* private fields */ }
Expand description
A optimistic transaction database.
Implementations§
source§impl OptimisticTransactionDB
impl OptimisticTransactionDB
pub fn path(&self) -> &Path
pub fn base_db_ptr(&self) -> *mut rocksdb_t
pub fn repair<P: AsRef<Path>>(opts: Options, path: P) -> Result<(), Error>
pub fn transaction( &self, write_options: &WriteOptions, tx_options: &OptimisticTransactionOptions ) -> OptimisticTransaction
pub fn transaction_default(&self) -> OptimisticTransaction
Trait Implementations§
source§impl Drop for OptimisticTransactionDB
impl Drop for OptimisticTransactionDB
source§impl GetColumnFamilys for OptimisticTransactionDB
impl GetColumnFamilys for OptimisticTransactionDB
fn get_cfs(&self) -> &BTreeMap<String, ColumnFamily>
fn get_mut_cfs(&mut self) -> &mut BTreeMap<String, ColumnFamily>
source§impl Handle<rocksdb_optimistictransactiondb_t> for OptimisticTransactionDB
impl Handle<rocksdb_optimistictransactiondb_t> for OptimisticTransactionDB
fn handle(&self) -> *mut rocksdb_optimistictransactiondb_t
source§impl Iterate for OptimisticTransactionDB
impl Iterate for OptimisticTransactionDB
fn get_raw_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions ) -> DBRawIterator<'b>
fn get_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions, mode: IteratorMode<'_> ) -> DBIterator<'b> ⓘ
fn iterator_opt<'a: 'b, 'b>( &'a self, mode: IteratorMode<'_>, readopts: &ReadOptions ) -> DBIterator<'b> ⓘ
fn iterator<'a: 'b, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘ
source§fn full_iterator<'a: 'b, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘ
fn full_iterator<'a: 'b, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘ
Opens an interator 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.fn prefix_iterator<'a: 'b, 'b>(&'a self, prefix: &[u8]) -> DBIterator<'b> ⓘ
fn raw_iterator<'a: 'b, 'b>(&'a self) -> DBRawIterator<'b>
source§impl IterateCF for OptimisticTransactionDB
impl IterateCF for OptimisticTransactionDB
fn get_raw_iter_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, readopts: &ReadOptions ) -> Result<DBRawIterator<'b>, Error>
fn get_iter_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, readopts: &ReadOptions, mode: IteratorMode<'_> ) -> Result<DBIterator<'b>, Error>
source§fn iterator_cf_opt<'a: 'b, 'b>(
&'a self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>,
readopts: &ReadOptions
) -> Result<DBIterator<'b>, Error>
fn iterator_cf_opt<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, readopts: &ReadOptions ) -> Result<DBIterator<'b>, Error>
Opens an interator using the provided ReadOptions.
This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions
fn iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_> ) -> Result<DBIterator<'b>, Error>
fn full_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_> ) -> Result<DBIterator<'b>, Error>
fn prefix_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, prefix: &[u8] ) -> Result<DBIterator<'b>, Error>
fn raw_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily ) -> Result<DBRawIterator<'b>, Error>
source§impl Open for OptimisticTransactionDB
impl Open for OptimisticTransactionDB
source§fn open_default<P: AsRef<Path>>(path: P) -> Result<Self, Error>
fn open_default<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Open a database with default options.
source§fn open<P: AsRef<Path>>(opts: &Options, path: P) -> Result<Self, Error>
fn open<P: AsRef<Path>>(opts: &Options, path: P) -> Result<Self, Error>
Open the database with the specified options.
fn open_with_descriptor<P: AsRef<Path>>( opts: &Options, path: P, descriptor: Self::Descriptor ) -> Result<Self, Error>
source§impl OpenCF for OptimisticTransactionDB
impl OpenCF for OptimisticTransactionDB
source§fn open_cf<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<Self, Error>where
P: AsRef<Path>,
I: IntoIterator<Item = N>,
N: AsRef<str>,
fn open_cf<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<Self, Error>where P: AsRef<Path>, I: IntoIterator<Item = N>, N: AsRef<str>,
Open a database with the given database options and column family names. Read more
source§fn open_cf_descriptors<P, I>(
opts: &Options,
path: P,
cfs: I
) -> Result<Self, Error>where
P: AsRef<Path>,
I: IntoIterator<Item = ColumnFamilyDescriptor>,
fn open_cf_descriptors<P, I>( opts: &Options, path: P, cfs: I ) -> Result<Self, Error>where P: AsRef<Path>, I: IntoIterator<Item = ColumnFamilyDescriptor>,
Open a database with the given database options and column family descriptors.
fn open_cf_descriptors_with_descriptor<P, I>( opts: &Options, path: P, cfs: I, descriptor: Self::Descriptor ) -> Result<Self, Error>where P: AsRef<Path>, I: IntoIterator<Item = ColumnFamilyDescriptor>,
impl Read for OptimisticTransactionDB
impl Send for OptimisticTransactionDB
impl Sync for OptimisticTransactionDB
impl Write for OptimisticTransactionDB
Auto Trait Implementations§
impl RefUnwindSafe for OptimisticTransactionDB
impl Unpin for OptimisticTransactionDB
impl UnwindSafe for OptimisticTransactionDB
Blanket Implementations§
source§impl<T> BatchedMultiGetCF<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> BatchedMultiGetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
fn batched_multi_get_cf_full<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator<Item = &'a K>,
fn batched_multi_get_cf<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator<Item = &'a K>,
fn batched_multi_get_cf_opt<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: &R ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator<Item = &'a K>,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CompactRangeCF for Twhere
T: Handle<rocksdb_t> + Write + GetColumnFamilys,
impl<T> CompactRangeCF for Twhere T: Handle<rocksdb_t> + Write + GetColumnFamilys,
fn compact_range_cf( &self, cf: &ColumnFamily, start: Option<&[u8]>, end: Option<&[u8]> )
source§impl<T> CreateCheckpointObject for Twhere
T: Handle<rocksdb_t>,
impl<T> CreateCheckpointObject for Twhere T: Handle<rocksdb_t>,
unsafe fn create_checkpoint_object_raw( &self ) -> Result<*mut rocksdb_checkpoint_t, Error>
fn create_checkpoint_object(&self) -> Result<Checkpoint<'_>, Error>
source§impl<T, W> Delete<W> for Twhere
T: DeleteCF<W>,
impl<T, W> Delete<W> for Twhere T: DeleteCF<W>,
fn delete_full<K>(&self, key: K, writeopts: Option<&W>) -> Result<(), Error>where K: AsRef<[u8]>,
source§fn delete<K>(&self, key: K) -> Result<(), Error>where
K: AsRef<[u8]>,
fn delete<K>(&self, key: K) -> Result<(), Error>where K: AsRef<[u8]>,
Remove the database entry for key. Read more
fn delete_opt<K>(&self, key: K, writeopts: &W) -> Result<(), Error>where K: AsRef<[u8]>,
source§impl<T> DeleteCF<WriteOptions> for Twhere
T: Handle<rocksdb_t> + Write,
impl<T> DeleteCF<WriteOptions> for Twhere T: Handle<rocksdb_t> + Write,
fn delete_cf_full<K>( &self, cf: Option<&ColumnFamily>, key: K, writeopts: Option<&WriteOptions> ) -> Result<(), Error>where K: AsRef<[u8]>,
fn delete_cf<K>(&self, cf: &ColumnFamily, key: K) -> Result<(), Error>where K: AsRef<[u8]>,
fn put_cf_opt<K>( &self, cf: &ColumnFamily, key: K, writeopts: &W ) -> Result<(), Error>where K: AsRef<[u8]>,
source§impl<T, R> Get<R> for Twhere
T: GetCF<R>,
impl<T, R> Get<R> for Twhere T: GetCF<R>,
fn get_full<K>( &self, key: K, readopts: Option<&R> ) -> Result<Option<DBVector>, Error>where K: AsRef<[u8]>,
source§fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<DBVector>, Error>
fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<DBVector>, Error>
Return the bytes associated with a key value
fn get_opt<K: AsRef<[u8]>>( &self, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl<T> GetCF<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> GetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
fn get_cf_full<K>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>where K: AsRef<[u8]>,
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl<'a, T, R> GetPinned<'a> for Twhere
T: GetPinnedCF<'a, ReadOptions = R>,
impl<'a, T, R> GetPinned<'a> for Twhere T: GetPinnedCF<'a, ReadOptions = R>,
type ReadOptions = R
source§fn get_pinned_full<K>(
&'a self,
key: K,
readopts: Option<<T as GetPinned<'a>>::ReadOptions>
) -> Result<Option<DBPinnableSlice<'a>>, Error>where
K: AsRef<[u8]>,
fn get_pinned_full<K>( &'a self, key: K, readopts: Option<<T as GetPinned<'a>>::ReadOptions> ) -> Result<Option<DBPinnableSlice<'a>>, Error>where K: AsRef<[u8]>,
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
source§fn get_pinned<K: AsRef<[u8]>>(
&'a self,
key: K
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned<K: AsRef<[u8]>>( &'a self, key: K ) -> Result<Option<DBPinnableSlice<'a>>, Error>
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.
source§fn get_pinned_opt<K: AsRef<[u8]>>(
&'a self,
key: K,
readopts: Self::ReadOptions
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_opt<K: AsRef<[u8]>>( &'a self, key: K, readopts: Self::ReadOptions ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
source§impl<'a, T> GetPinnedCF<'a> for Twhere
T: Handle<rocksdb_t> + Read,
impl<'a, T> GetPinnedCF<'a> for Twhere T: Handle<rocksdb_t> + Read,
type ColumnFamily = &'a ColumnFamily
type ReadOptions = &'a ReadOptions
source§fn get_pinned_cf_full<K>(
&'a self,
cf: Option<<T as GetPinnedCF<'a>>::ColumnFamily>,
key: K,
readopts: Option<<T as GetPinnedCF<'a>>::ReadOptions>
) -> Result<Option<DBPinnableSlice<'a>>, Error>where
K: AsRef<[u8]>,
fn get_pinned_cf_full<K>( &'a self, cf: Option<<T as GetPinnedCF<'a>>::ColumnFamily>, key: K, readopts: Option<<T as GetPinnedCF<'a>>::ReadOptions> ) -> Result<Option<DBPinnableSlice<'a>>, Error>where K: AsRef<[u8]>,
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
source§fn get_pinned_cf<K: AsRef<[u8]>>(
&'a self,
cf: Self::ColumnFamily,
key: K
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf<K: AsRef<[u8]>>( &'a self, cf: Self::ColumnFamily, key: K ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
source§fn get_pinned_cf_opt<K: AsRef<[u8]>>(
&'a self,
cf: Self::ColumnFamily,
key: K,
readopts: Self::ReadOptions
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf_opt<K: AsRef<[u8]>>( &'a self, cf: Self::ColumnFamily, key: K, readopts: Self::ReadOptions ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
source§impl<T> GetProperty for Twhere
T: Handle<rocksdb_t>,
impl<T> GetProperty for Twhere T: Handle<rocksdb_t>,
source§impl<T> GetPropertyCF for Twhere
T: Handle<rocksdb_t>,
impl<T> GetPropertyCF for Twhere T: Handle<rocksdb_t>,
source§fn property_value_cf(
&self,
cf: &ColumnFamily,
name: &str
) -> Result<Option<String>, Error>
fn property_value_cf( &self, cf: &ColumnFamily, name: &str ) -> Result<Option<String>, Error>
Retrieves a RocksDB property by name, for a specific column family. Read more
source§fn property_int_value_cf(
&self,
cf: &ColumnFamily,
name: &str
) -> Result<Option<u64>, Error>
fn property_int_value_cf( &self, cf: &ColumnFamily, name: &str ) -> Result<Option<u64>, Error>
Retrieves a RocksDB property for a specific column family and casts it to an integer. Read more
source§impl<T> IngestExternalFile for Twhere
T: IngestExternalFileCF,
impl<T> IngestExternalFile for Twhere T: IngestExternalFileCF,
fn ingest_external_file_full<P>( &self, paths: Vec<P>, opts: Option<&IngestExternalFileOptions> ) -> Result<(), Error>where P: AsRef<Path>,
source§fn ingest_external_file<P: AsRef<Path>>(
&self,
paths: Vec<P>
) -> Result<(), Error>
fn ingest_external_file<P: AsRef<Path>>( &self, paths: Vec<P> ) -> Result<(), Error>
Loads a list of external SST files created with SstFileWriter into the DB with default opts
source§fn ingest_external_file_opts<P: AsRef<Path>>(
&self,
paths: Vec<P>,
opts: &IngestExternalFileOptions
) -> Result<(), Error>
fn ingest_external_file_opts<P: AsRef<Path>>( &self, paths: Vec<P>, opts: &IngestExternalFileOptions ) -> Result<(), Error>
Loads a list of external SST files created with SstFileWriter into the DB
source§impl<T> IngestExternalFileCF for Twhere
T: Handle<rocksdb_t> + Write,
impl<T> IngestExternalFileCF for Twhere T: Handle<rocksdb_t> + Write,
fn ingest_external_file_cf_full<P>( &self, cf: Option<&ColumnFamily>, paths: Vec<P>, opts: Option<&IngestExternalFileOptions> ) -> Result<(), Error>where P: AsRef<Path>,
source§fn ingest_external_file_cf<P: AsRef<Path>>(
&self,
cf: &ColumnFamily,
paths: Vec<P>
) -> Result<(), Error>
fn ingest_external_file_cf<P: AsRef<Path>>( &self, cf: &ColumnFamily, paths: Vec<P> ) -> Result<(), Error>
Loads a list of external SST files created with SstFileWriter into the DB for given Column Family
with default opts
source§fn ingest_external_file_opts<P: AsRef<Path>>(
&self,
cf: &ColumnFamily,
paths: Vec<P>,
opts: &IngestExternalFileOptions
) -> Result<(), Error>
fn ingest_external_file_opts<P: AsRef<Path>>( &self, cf: &ColumnFamily, paths: Vec<P>, opts: &IngestExternalFileOptions ) -> Result<(), Error>
Loads a list of external SST files created with SstFileWriter into the DB for given Column Family
source§impl<T, W> Merge<W> for Twhere
T: MergeCF<W>,
impl<T, W> Merge<W> for Twhere T: MergeCF<W>,
fn merge_full<K, V>( &self, key: K, value: V, writeopts: Option<&W> ) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
fn merge<K, V>(&self, key: K, value: V) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
fn merge_opt<K, V>(&self, key: K, value: V, writeopts: &W) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
source§impl<T> MergeCF<WriteOptions> for Twhere
T: Handle<rocksdb_t> + Write,
impl<T> MergeCF<WriteOptions> for Twhere T: Handle<rocksdb_t> + Write,
fn merge_cf_full<K, V>( &self, cf: Option<&ColumnFamily>, key: K, value: V, writeopts: Option<&WriteOptions> ) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
fn merge_cf<K, V>( &self, cf: &ColumnFamily, key: K, value: V ) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
fn merge_cf_opt<K, V>( &self, cf: &ColumnFamily, key: K, value: V, writeopts: &W ) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
source§impl<T> MultiGet<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> MultiGet<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
source§fn multi_get_full<K, I>(
&self,
keys: I,
readopts: Option<&ReadOptions>
) -> Vec<Result<Option<DBVector>, Error>>where
K: AsRef<[u8]>,
I: IntoIterator<Item = K>,
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
Return the values associated with the given keys using read options.
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl<T> MultiGetCF<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> MultiGetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
source§fn multi_get_cf_full<'a, K, I>(
&self,
keys: I,
readopts: Option<&ReadOptions>
) -> Vec<Result<Option<DBVector>, Error>>where
K: AsRef<[u8]>,
I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_full<'a, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
Return the values associated with the given keys and column families using read options.
fn multi_get_cf<'a, K, I>( &self, keys_cf: I ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
source§impl<T, W> Put<W> for Twhere
T: PutCF<W>,
impl<T, W> Put<W> for Twhere T: PutCF<W>,
fn put_full<K, V>( &self, key: K, value: V, writeopts: Option<&W> ) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
source§fn put<K, V>(&self, key: K, value: V) -> Result<(), Error>where
K: AsRef<[u8]>,
V: AsRef<[u8]>,
fn put<K, V>(&self, key: K, value: V) -> Result<(), Error>where K: AsRef<[u8]>, V: AsRef<[u8]>,
Insert a value into the database under the given key.