pub struct StructuredDb { /* private fields */ }Implementations§
Source§impl StructuredDb
impl StructuredDb
pub fn open( config: Config, bucket_ranges: Vec<RangeInclusive<u16>>, ) -> Result<Self>
pub fn open_from_snapshot( config: Config, snapshot_id: u64, db_id: impl Into<String>, ) -> Result<Self>
pub fn open_from_snapshot_with_resolver( config: Config, snapshot_id: u64, db_id: impl Into<String>, resolver: Option<Arc<dyn MergeOperatorResolver>>, ) -> Result<Self>
Sourcepub fn open_from_snapshot_with_recovery_mode(
config: Config,
snapshot_id: u64,
db_id: impl Into<String>,
recovery_mode: RecoveryMode,
) -> Result<Self>
pub fn open_from_snapshot_with_recovery_mode( config: Config, snapshot_id: u64, db_id: impl Into<String>, recovery_mode: RecoveryMode, ) -> Result<Self>
Open a selected snapshot using the requested WAL recovery behavior.
pub fn open_new_with_snapshot( config: Config, snapshot_id: u64, db_id: impl Into<String>, ) -> Result<Self>
pub fn open_new_with_snapshot_with_resolver( config: Config, snapshot_id: u64, db_id: impl Into<String>, resolver: Option<Arc<dyn MergeOperatorResolver>>, ) -> Result<Self>
pub fn open_new_with_manifest_path( config: Config, manifest_path: impl Into<String>, ) -> Result<Self>
pub fn open_new_with_manifest_path_with_resolver( config: Config, manifest_path: impl Into<String>, resolver: Option<Arc<dyn MergeOperatorResolver>>, ) -> Result<Self>
pub fn resume(config: Config, db_id: impl Into<String>) -> Result<Self>
pub fn resume_with_resolver( config: Config, db_id: impl Into<String>, resolver: Option<Arc<dyn MergeOperatorResolver>>, ) -> Result<Self>
Sourcepub fn resume_with_recovery_mode(
config: Config,
db_id: impl Into<String>,
recovery_mode: RecoveryMode,
) -> Result<Self>
pub fn resume_with_recovery_mode( config: Config, db_id: impl Into<String>, recovery_mode: RecoveryMode, ) -> Result<Self>
Resume the latest snapshot using the requested WAL recovery behavior.
Sourcepub fn resume_from_snapshot(
config: Config,
snapshot_id: u64,
db_id: impl Into<String>,
) -> Result<Self>
pub fn resume_from_snapshot( config: Config, snapshot_id: u64, db_id: impl Into<String>, ) -> Result<Self>
Resume an exact historical snapshot without replaying WAL.
Sourcepub fn resume_from_snapshot_with_resolver(
config: Config,
snapshot_id: u64,
db_id: impl Into<String>,
resolver: Option<Arc<dyn MergeOperatorResolver>>,
) -> Result<Self>
pub fn resume_from_snapshot_with_resolver( config: Config, snapshot_id: u64, db_id: impl Into<String>, resolver: Option<Arc<dyn MergeOperatorResolver>>, ) -> Result<Self>
Resume an exact historical snapshot with a custom merge-operator resolver.
Sourcepub fn resume_from_snapshot_with_recovery_mode(
config: Config,
snapshot_id: u64,
db_id: impl Into<String>,
recovery_mode: RecoveryMode,
) -> Result<Self>
pub fn resume_from_snapshot_with_recovery_mode( config: Config, snapshot_id: u64, db_id: impl Into<String>, recovery_mode: RecoveryMode, ) -> Result<Self>
Resume a selected snapshot using the requested WAL recovery behavior.
pub fn expand_bucket( &self, source_db_id: impl Into<String>, snapshot_id: Option<u64>, ranges: Option<Vec<RangeInclusive<u16>>>, ) -> Result<u64>
pub fn expand_bucket_with_storage_mode( &self, source_db_id: impl Into<String>, snapshot_id: Option<u64>, ranges: Option<Vec<RangeInclusive<u16>>>, storage_mode: ExpandStorageMode, ) -> Result<u64>
pub fn wait_for_expand_adoption(&self, timeout: Duration) -> Result<()>
pub fn shrink_bucket(&self, ranges: Vec<RangeInclusive<u16>>) -> Result<u64>
pub fn id(&self) -> &str
Sourcepub fn metrics(&self) -> Vec<MetricSample>
pub fn metrics(&self) -> Vec<MetricSample>
Returns the native Cobble metric samples for this structured database.
pub fn current_schema(&self) -> StructuredSchema
Sourcepub fn register_schema_transform<F, T>(
&self,
transform_type: impl Into<String>,
factory: F,
) -> Result<()>
pub fn register_schema_transform<F, T>( &self, transform_type: impl Into<String>, factory: F, ) -> Result<()>
Register a factory for raw single-column transform specifications.
pub fn update_schema(&mut self) -> StructuredSchemaBuilder<'_, Self>
pub fn new_priority_queue<'a>( &'a mut self, name: impl Into<String>, ) -> Result<PriorityQueue<'a>>
pub fn get_priority_queue<'a>( &'a self, name: impl Into<String>, ) -> Result<PriorityQueue<'a>>
pub fn get_or_new_priority_queue<'a>( &'a mut self, name: impl Into<String>, ) -> Result<PriorityQueue<'a>>
pub fn reload_schema(&mut self) -> Result<()>
pub fn apply_schema( &mut self, structured_schema: StructuredSchema, ) -> Result<StructuredSchema>
pub fn put<K, V>( &self, bucket: u16, key: K, column: u16, value: V, ) -> Result<()>
pub fn put_with_options<K, V>( &self, bucket: u16, key: K, column: u16, value: V, options: &StructuredWriteOptions, ) -> Result<()>
pub fn merge<K, V>( &self, bucket: u16, key: K, column: u16, value: V, ) -> Result<()>
pub fn merge_with_options<K, V>( &self, bucket: u16, key: K, column: u16, value: V, options: &StructuredWriteOptions, ) -> Result<()>
pub fn delete<K>(&self, bucket: u16, key: K, column: u16) -> Result<()>
pub fn delete_with_options<K>( &self, bucket: u16, key: K, column: u16, options: &StructuredWriteOptions, ) -> Result<()>
pub fn new_write_batch(&self) -> StructuredWriteBatch
pub fn write_batch(&self, batch: StructuredWriteBatch) -> Result<()>
pub fn write_batch_with_options( &self, batch: StructuredWriteBatch, options: &StructuredWriteOptions, ) -> Result<()>
pub fn get<K>( &self, bucket: u16, key: K, ) -> Result<Option<Vec<Option<StructuredColumnValue>>>>
pub fn multi_get<K>( &self, keys: &[(u16, K)], ) -> Result<Vec<Option<Vec<Option<StructuredColumnValue>>>>>
pub fn multi_get_with_options<K>( &self, keys: &[(u16, K)], options: &StructuredReadOptions, ) -> Result<Vec<Option<Vec<Option<StructuredColumnValue>>>>>
pub fn get_with_options<K>( &self, bucket: u16, key: K, options: &StructuredReadOptions, ) -> Result<Option<Vec<Option<StructuredColumnValue>>>>
pub fn scan( &self, bucket: u16, range: Range<&[u8]>, ) -> Result<StructuredDbIterator>
pub fn scan_with_options( &self, bucket: u16, range: Range<&[u8]>, options: &StructuredScanOptions, ) -> Result<StructuredDbIterator>
pub fn scan_bounds( &self, bucket: u16, start_key_inclusive: Option<&[u8]>, end_key_exclusive: Option<&[u8]>, ) -> Result<StructuredDbIterator>
pub fn scan_with_options_bounds( &self, bucket: u16, start_key_inclusive: Option<&[u8]>, end_key_exclusive: Option<&[u8]>, options: &StructuredScanOptions, ) -> Result<StructuredDbIterator>
pub fn snapshot(&self) -> Result<u64>
Sourcepub fn switch_to_snapshot(&mut self, snapshot_id: u64) -> Result<()>
pub fn switch_to_snapshot(&mut self, snapshot_id: u64) -> Result<()>
Switch this running handle to an exact historical snapshot.
Sourcepub fn switch_memtable_type(
&self,
memtable_type: MemtableType,
flush_current: bool,
) -> Result<()>
pub fn switch_memtable_type( &self, memtable_type: MemtableType, flush_current: bool, ) -> Result<()>
Change the memtable implementation for future rotations.
flush_current = false leaves the active memtable untouched; true rotates a non-empty
active memtable now through the normal flush path.
Sourcepub fn load_readonly_files_to_primary(&self) -> Result<usize>
pub fn load_readonly_files_to_primary(&self) -> Result<usize>
Mark all currently referenced READONLY files for asynchronous loading into primary storage.
pub fn snapshot_with_callback<F>(&self, callback: F) -> Result<u64>
pub fn cancel_snapshot(&self, snapshot_id: u64) -> Result<bool>
pub fn expire_snapshot(&self, snapshot_id: u64) -> Result<bool>
pub fn retain_snapshot(&self, snapshot_id: u64) -> bool
pub fn shard_snapshot_metadata( &self, snapshot_id: u64, ) -> Result<ShardSnapshotMetadata>
pub fn set_time(&self, next: u32)
pub fn now_seconds(&self) -> u32
pub fn close(&self) -> Result<()>
Auto Trait Implementations§
impl !Freeze for StructuredDb
impl !RefUnwindSafe for StructuredDb
impl !UnwindSafe for StructuredDb
impl Send for StructuredDb
impl Sync for StructuredDb
impl Unpin for StructuredDb
impl UnsafeUnpin for StructuredDb
Blanket Implementations§
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more