pub struct BulkWriter<'a> { /* private fields */ }Expand description
Deferred-fsync writer returned by ObjectStore::bulk_writer.
See that method for the crash-safety contract.
Implementations§
Source§impl BulkWriter<'_>
impl BulkWriter<'_>
Sourcepub fn write(&mut self, bytes: &[u8]) -> StoreResult<Hash>
pub fn write(&mut self, bytes: &[u8]) -> StoreResult<Hash>
Write one object durable-before-visible: contents are fsynced
before the rename publishes the object, and only the shard-dir
fsync (rename durability) is deferred to commit. This upholds the
store’s global invariant (an object is never visible before its
bytes are durable), so another process’s contains() dedup can
never reference a half-written object. An existing path is
byte-verified: matched objects are left in place (but still
fsynced at commit, see below), torn ones are rewritten.
§Panics
Never in practice: object paths always have a 2-hex shard parent by construction.
Sourcepub fn commit(self) -> StoreResult<()>
pub fn commit(self) -> StoreResult<()>
Make the session durable: fsync the CONTENTS of any pre-existing
objects this batch re-used (newly written objects were already
content-fsynced before their rename in write),
then every touched shard directory (renames become durable).
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for BulkWriter<'a>
impl<'a> !UnwindSafe for BulkWriter<'a>
impl<'a> Freeze for BulkWriter<'a>
impl<'a> Send for BulkWriter<'a>
impl<'a> Sync for BulkWriter<'a>
impl<'a> Unpin for BulkWriter<'a>
impl<'a> UnsafeUnpin for BulkWriter<'a>
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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