Skip to main content

StorageManager

Struct StorageManager 

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

Implementations§

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

pub fn settings(&self) -> &StorageSettings

Source

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

Source

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

Source

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

Source

pub fn cursor_accepted(&self) -> StorageCursor

Source

pub fn cursor_saved(&self) -> StorageCursor

Source

pub fn status(&self) -> StorageMetrics

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

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<()>

Source

pub fn retry_transient_persistence(&self) -> bool

Source

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

Source

pub fn write_receipt_capacity(&self) -> usize

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source

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

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source§

impl<C: ObjectCatalog> StorageManager<C>

Source

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

Source

pub fn with_execution( backends: StorageBackends, settings: StorageSettings, execution: Execution, ) -> Result<Self>

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C: ObjectCatalog> StorageManager<C>

Source

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

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

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§

impl<C> StorageManager<C>

Source

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

Source§

impl<C: ObjectCatalog> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source§

impl<C> StorageManager<C>

Source

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

Source

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

Source

pub async fn settle_transition(&self)

Source§

impl<C> StorageManager<C>

Source

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

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

Auto Trait Implementations§

§

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

§

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

§

impl<C> Freeze for StorageManager<C>
where PhantomData<fn() -> C>: Freeze,

§

impl<C> Send for StorageManager<C>
where PhantomData<fn() -> C>: Send,

§

impl<C> Sync for StorageManager<C>
where PhantomData<fn() -> C>: Sync,

§

impl<C> Unpin for StorageManager<C>
where PhantomData<fn() -> C>: Unpin,

§

impl<C> UnsafeUnpin for StorageManager<C>
where PhantomData<fn() -> C>: UnsafeUnpin,

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<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