pub struct UpdateOnlyEdgeShard<S: UniversalRead + 'static> { /* private fields */ }Expand description
A batch writer over the segments of one shard directory, generic over the
backend S.
Compared to EdgeShard, there is no WAL, no
optimizers, and no EdgeConfig — the write target’s own segment config is
the only configuration a write needs.
Implementations§
Source§impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
Sourcepub fn apply_batch(
&self,
operations: impl IntoIterator<Item = (u64, CollectionUpdateOperations)>,
) -> OperationResult<UpdateBatchOutcome>
pub fn apply_batch( &self, operations: impl IntoIterator<Item = (u64, CollectionUpdateOperations)>, ) -> OperationResult<UpdateBatchOutcome>
Apply a batch of update operations, each paired with the operation
number to record as its version. Operations are expected in ascending
operation-number order; see UpdateBatchPlan::build for what is
rejected.
Atomic in the sense that matters without a WAL: applied in full or the error is returned, and re-applying a batch that partially landed skips the points that already carry its version.
Source§impl UpdateOnlyEdgeShard<MmapFile>
impl UpdateOnlyEdgeShard<MmapFile>
Sourcepub fn open_mmap(path: &Path) -> OperationResult<Self>
pub fn open_mmap(path: &Path) -> OperationResult<Self>
Open a writer over local memory-mapped files, discovering segments by
scanning the segments/ directory — the writer owns the directory it
writes to, so there is no manifest to agree with.
Source§impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
Sourcepub fn open(
fs: S::Fs,
path: &Path,
enumerator: impl SegmentEnumerator + 'static,
) -> OperationResult<Self>where
S::Fs: UniversalReadFs<File = S>,
pub fn open(
fs: S::Fs,
path: &Path,
enumerator: impl SegmentEnumerator + 'static,
) -> OperationResult<Self>where
S::Fs: UniversalReadFs<File = S>,
Open a writer over the shard directory at path, using fs as the
read backend and enumerator to discover the segments.
Segments are opened in parallel on the shard’s thread pool, each over
its own prefetching CachedFs (see
[UpdateOnlySegment::open]) — the same shape as the read-only
follower’s load — and entirely cold: no point data is fetched until a
batch reads a point. A segment that fails to load is an error, not a
skip — a writer that misses a segment would resolve a point against a
stale copy of itself, or duplicate it.
Source§impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
Sourcepub fn preview_batch(
&self,
operations: impl IntoIterator<Item = (u64, CollectionUpdateOperations)>,
) -> OperationResult<UpdateBatchPreview>
pub fn preview_batch( &self, operations: impl IntoIterator<Item = (u64, CollectionUpdateOperations)>, ) -> OperationResult<UpdateBatchPreview>
Resolve a batch without writing anything: what
apply_batch would do, reported per point.
Runs the same resolution code path as the real apply — the same operations are rejected, the same points read — so the report cannot drift from the apply’s behavior.
Source§impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
impl<S: UniversalRead + 'static> UpdateOnlyEdgeShard<S>
pub fn path(&self) -> &Path
Sourcepub fn segments_count(&self) -> usize
pub fn segments_count(&self) -> usize
Number of segments the writer has open.
Sourcepub fn segment_configs(&self) -> Vec<SegmentConfigInfo>
pub fn segment_configs(&self) -> Vec<SegmentConfigInfo>
Every segment’s config, cloned out, with the write target marked. Order is unspecified. The write target’s config is the schema a write must conform to: the named vectors a point carries, and their shapes.
Auto Trait Implementations§
impl<S> !Freeze for UpdateOnlyEdgeShard<S>
impl<S> !RefUnwindSafe for UpdateOnlyEdgeShard<S>
impl<S> !UnwindSafe for UpdateOnlyEdgeShard<S>
impl<S> Send for UpdateOnlyEdgeShard<S>
impl<S> Sync for UpdateOnlyEdgeShard<S>
impl<S> Unpin for UpdateOnlyEdgeShard<S>where
<S as UniversalRead>::Fs: Unpin,
impl<S> UnsafeUnpin for UpdateOnlyEdgeShard<S>where
<S as UniversalRead>::Fs: UnsafeUnpin,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.