Skip to main content

StorageManager

Struct StorageManager 

Source
pub struct StorageManager<C = ()> { /* private fields */ }

Implementations§

Source§

impl<C: ObjectCatalog> StorageManager<C>

Source

pub fn new(backends: StorageBackends, settings: StorageSettings) -> Result<Self>

Source§

impl<C> StorageManager<C>

Source

pub async fn close(&self) -> Result<()>

Source

pub async fn start<A: Application>(&self, runtime: &Runtime<A>) -> Result<()>

Methods from Deref<Target = StorageManager<C>>§

Source

pub async fn write_schema_once( &self, mutation: &MutationId, key: SchemaKey, schema: impl Into<Arc<Schema>>, ) -> Result<StorageCursor, Error>

Source

pub async fn write_records_once( &self, mutation: &MutationId, records: Vec<RecordInput>, ) -> Result<StorageCursor, Error>

Source

pub async fn write_stream_once( &self, mutation: &MutationId, rows: Vec<StreamInput>, ) -> Result<StorageCursor, Error>

Source

pub async fn delete_file_once( &self, mutation: &MutationId, file: &StagedFile, ) -> Result<StagedFile, Error>

Source

pub async fn list_directory( &self, selection: DirectorySelection, ) -> Result<DirectoryReader, Error>

Source

pub async fn watch_directory( &self, selection: DirectorySelection, include_existing: bool, ) -> Result<DirectoryWatcher, Error>

Source

pub async fn capture_file( &self, request: CaptureFile, ) -> Result<FileReference, Error>

Source

pub async fn follow_file( &self, request: FollowFile, ) -> Result<FileFollower, Error>

Source

pub async fn hash_file(&self, request: HashFile) -> Result<FileHash, Error>

Source

pub async fn follow_production( &self, file: &StagedFile, offset: u64, ) -> Result<ProductionFollower, Error>

Source

pub async fn file_progress( &self, file: &StagedFile, ) -> Result<FileProgress, Error>

Source

pub async fn read_file(&self, request: ReadFile) -> Result<FileReader, Error>

Source

pub async fn follow<T>( &self, after: Option<&StorageCursor>, selection: <T as Entry>::Selection, ) -> Result<Follower<T>, Error>
where T: Entry,

Source

pub async fn page<T>( &self, selection: &<T as Entry>::Selection, after: u64, limits: ReadLimits, ) -> Result<FollowPage<T>, Error>
where T: Entry,

Source

pub async fn lookup_schema( &self, key: &SchemaKey, ) -> Result<(StorageSchema, RetainedMemory), Error>

Source

pub async fn admit_arrow_records( &self, scope: Option<&Identifier>, batch: &DecodedBatch, ) -> Result<StorageCursor, Error>

Source

pub async fn admit_arrow_streams( &self, scope: Option<&Identifier>, batch: &DecodedBatch, ) -> Result<StorageCursor, Error>

Source

pub async fn admit_arrow_objects( &self, _scope: Option<&Identifier>, batch: &DecodedBatch, ) -> Result<StorageCursor, Error>

Source

pub async fn start_with( &self, owner: Arc<()>, spawn: impl FnOnce(Worker) -> Result<Box<dyn WorkerOwner>, Error>, ) -> Result<(), Error>

Source

pub fn settings(&self) -> &StorageSettings

Source

pub async fn acquire(&self) -> Result<(), Error>

Source

pub fn same_instance<D>(&self, other: &StorageManager<D>) -> bool

Source

pub fn claim_owner(&self, owner: Arc<()>) -> Result<(), Error>

Source

pub fn cursor_accepted(&self) -> StorageCursor

Source

pub fn cursor_saved(&self) -> StorageCursor

Source

pub fn status(&self) -> StorageMetrics

Source

pub async fn write_recovery( &self, payloads: Vec<Vec<u8>>, ) -> Result<RecoveryPosition, Error>

Source

pub async fn write_snapshot( &self, snapshot: RecoverySnapshot, ) -> Result<(), Error>

Source

pub async fn flush(&self) -> Result<StorageCursor, Error>

Source

pub async fn flush_until( &self, through: &StorageCursor, ) -> Result<StorageCursor, Error>

Source

pub async fn flush_prepared( &self, through: &StorageCursor, files: &Option<FileSave>, ) -> Result<StorageCursor, Error>

Source

pub async fn flush_recovery(&self) -> Result<RecoveryPosition, Error>

Source

pub async fn read_recovery( &self, after: &RecoveryPosition, through: &RecoveryPosition, limits: ReadLimits, ) -> Result<ReadBatch<RecoveryPage>, Error>

Source

pub async fn read_snapshot( &self, max_bytes: NonZero<usize>, ) -> Result<Option<ReadBatch<RecoverySnapshot>>, Error>

Source

pub async fn close(&self) -> Result<(), Error>

Source

pub async fn wait_saved_after( &self, cursor: &StorageCursor, ) -> Result<StorageCursor, Error>

Waits passively for a strictly newer durable primary frontier.

Intermediate frontiers may coalesce. This does not request persistence or retry failed work. Cancellation only removes the notification waiter. A newer saved cursor is returned before checking terminal storage state.

Source

pub fn check_state_dependency( &self, required: &StorageCursor, ) -> Result<(), Error>

Source

pub fn retry_transient_persistence(&self) -> bool

Source

pub fn reserve_arrow_memory( &self, bytes: usize, ) -> Result<RetainedMemory, Error>

Source

pub fn write_receipt_capacity(&self) -> usize

Source

pub async fn await_durable(&self, cursor: &StorageCursor) -> Result<(), Error>

Source

pub async fn release_object_history( &self, schema: &SchemaKey, item: &ObjectKey, through: &StorageCursor, ) -> Result<(), Error>

Source

pub async fn write_schema( &self, key: SchemaKey, schema: impl Into<Arc<Schema>>, ) -> Result<StorageCursor, Error>

Source

pub fn record_batch_len(&self, records: &[RecordInput]) -> Result<usize, Error>

Source

pub fn stream_batch_len(&self, rows: &[StreamInput]) -> Result<usize, Error>

Source

pub async fn write_records( &self, records: Vec<RecordInput>, ) -> Result<StorageCursor, Error>

Source

pub async fn write_stream( &self, rows: Vec<StreamInput>, ) -> Result<StorageCursor, Error>

Source

pub fn erased(&self) -> StorageManager<ErasedCatalog>

Source

pub async fn write_objects_once( &self, mutation: &MutationId, objects: Vec<ObjectValue>, ) -> Result<Vec<ObjectReceipt>, Error>

Source

pub async fn write_object<T>(&self, value: &T) -> Result<ObjectReceipt, Error>
where T: StoredObject, C: Contains<T>,

Source

pub async fn write_object_group( &self, max_bytes: NonZero<usize>, count: NonZero<usize>, build: impl FnOnce(&mut ObjectGroup<'_, C>) -> Result<(), Error> + Send, ) -> Result<Vec<ObjectReceipt>, Error>

Source

pub async fn read_object<T>( &self, key: &<T as StoredObject>::Key, version: ObjectVersion, ) -> Result<Option<ReadBatch<ObjectRevision<T>>>, Error>
where T: StoredObject, C: Contains<T>,

Source

pub fn object_receipts_memory( &self, count: NonZero<usize>, ) -> Result<usize, Error>

Bounds the owned receipt Vec returned for an object group.

Uses the producer’s declared history, including both cloned histories in each receipt. Preclaim this plus caller-owned pending/response scaffolding before writing. Move the resulting cursor and claim into pending ownership before the next await; retries reuse that receipt instead of reissuing an ordinary group write. This method neither allocates nor admits memory.

Source

pub async fn query(&self, query: Query) -> Result<QueryReader, Error>

Source

pub async fn read_objects<T>( &self, read: ObjectRead<'_, T>, ) -> Result<ObjectReader<T>, Error>
where T: StoredObject, C: Contains<T>,

Source

pub async fn read_records<T>( &self, read: RecordRead, ) -> Result<RecordReader<T>, Error>
where T: Message + MemorySize,

Source

pub async fn read_memory( &self, bytes: NonZero<usize>, ) -> Result<RetainedMemory, Error>

Source

pub fn read_session(&self) -> ReadSession<C>

Source

pub fn info(&self) -> Result<StorageInfo, Error>

Source

pub fn mutation_window(&self) -> Result<MutationWindow, Error>

Source

pub fn capture_files( &self, through: Option<&StorageCursor>, ) -> Result<Option<FileSave>, Error>

Source

pub async fn persist_files(&self, save: &Option<FileSave>) -> Result<(), Error>

Source

pub async fn create_file( &self, metadata: FileMetadata, ) -> Result<StorageFile, Error>

Source

pub async fn write_file( &self, metadata: FileMetadata, bytes: Vec<u8>, ) -> Result<FileReference, Error>

Source

pub async fn append_file_once( &self, mutation: &MutationId, token: &FileSession, offset: u64, bytes: impl Into<StorageBatch<u8>>, ) -> Result<FileProducer, Error>

Source

pub async fn create_file_once( &self, mutation: &MutationId, metadata: &FileMetadata, ) -> Result<FileProducer, Error>

Source

pub async fn finish_file_once( &self, mutation: &MutationId, token: &FileSession, ) -> Result<FileReference, Error>

Source

pub async fn abandon_file_once( &self, mutation: &MutationId, token: &FileSession, ) -> Result<FileProgress, Error>

Source

pub async fn resume_file_once( &self, mutation: &MutationId, token: &FileSession, ) -> Result<FileProducer, Error>

Source

pub async fn produce_file( &self, metadata: FileMetadata, ) -> Result<StorageFile, Error>

Source

pub async fn resume_file( &self, token: &FileSession, ) -> Result<StorageFile, Error>

Source

pub async fn reserve_transition( &self, payload_bytes: usize, records: Option<ReadLimits>, ) -> Result<Permit, Error>

Source

pub async fn reserve_snapshot( &self, payload_bytes: usize, ) -> Result<Permit, Error>

Source

pub async fn settle_transition(&self)

Source

pub async fn recovery_reader( &self, limits: ReadLimits, snapshot_bytes: Option<NonZero<usize>>, ) -> Result<RecoveryReader<'_, C>, Error>

Trait Implementations§

Source§

impl<C> Clone for StorageManager<C>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C> Deref for StorageManager<C>

Source§

type Target = StorageManager<C>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<C = ()> !RefUnwindSafe for StorageManager<C>

§

impl<C = ()> !UnwindSafe for StorageManager<C>

§

impl<C> Freeze for StorageManager<C>

§

impl<C> Send for StorageManager<C>
where StorageManager<C>: Send,

§

impl<C> Sync for StorageManager<C>
where StorageManager<C>: Sync,

§

impl<C> Unpin for StorageManager<C>

§

impl<C> UnsafeUnpin for StorageManager<C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<C, T> Catalogued<C> for T
where T: Into<C>,

Source§

fn catalogued(self) -> C

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Mutual<T> for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<R> RecordProjection<R> for R

Source§

fn project(&self) -> Option<&R>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more