pub struct DiskSpool<R, S> { /* private fields */ }Expand description
Durable write-ahead spool tier. See the module docs for the on-disk protocol and crash-recovery semantics.
Construction is infallible and does no I/O; the spool directory is
created and leftover segments from a previous run are replayed
downstream on the first ingest or flush call.
File I/O uses synchronous std::fs calls: appends are a few kilobytes
plus an fsync, which is acceptable to block the runtime for at the
collection rates this crate targets.
Implementations§
Source§impl<R, S> DiskSpool<R, S>
impl<R, S> DiskSpool<R, S>
Sourcepub fn new(dir: impl Into<PathBuf>, policy: FlushPolicy, inner: S) -> Self
pub fn new(dir: impl Into<PathBuf>, policy: FlushPolicy, inner: S) -> Self
Create a spool rooted at dir. The pipeline name used when
reconstructing WindowMeta for replayed segments is the last
component of dir.
Sourcepub fn with_pipeline_name(self, name: impl Into<String>) -> Self
pub fn with_pipeline_name(self, name: impl Into<String>) -> Self
Override the pipeline name derived from the directory.
Trait Implementations§
Source§impl<R, S> Sink<R> for DiskSpool<R, S>
impl<R, S> Sink<R> for DiskSpool<R, S>
Source§type Error = SpoolError<<S as Sink<R>>::Error>
type Error = SpoolError<<S as Sink<R>>::Error>
Concrete error type (a
thiserror enum, not a boxed error).Auto Trait Implementations§
impl<R, S> Freeze for DiskSpool<R, S>where
S: Freeze,
impl<R, S> RefUnwindSafe for DiskSpool<R, S>where
S: RefUnwindSafe,
impl<R, S> Send for DiskSpool<R, S>where
S: Send,
impl<R, S> Sync for DiskSpool<R, S>where
S: Sync,
impl<R, S> Unpin for DiskSpool<R, S>where
S: Unpin,
impl<R, S> UnsafeUnpin for DiskSpool<R, S>where
S: UnsafeUnpin,
impl<R, S> UnwindSafe for DiskSpool<R, S>where
S: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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