pub struct ReadOnlyEdgeShard<S: UniversalReadExt + 'static> { /* private fields */ }Expand description
Read-only follower view over an edge shard’s on-disk directory.
Generic over the read backend S (e.g. MmapFile for local memory-mapped files; the same
abstraction ReadOnlySegment uses, so blob/S3 backends are possible). Use
open_mmap for the common local case.
Implementations§
Source§impl ReadOnlyEdgeShard<MmapFile>
impl ReadOnlyEdgeShard<MmapFile>
Sourcepub fn open_mmap(path: &Path) -> OperationResult<Self>
pub fn open_mmap(path: &Path) -> OperationResult<Self>
Open a read-only follower over local memory-mapped files, discovering segments from the
leader’s segment manifest. Requires the leader to write a manifest (the
write_segment_manifest feature flag).
Source§impl<S: UniversalReadExt + 'static> ReadOnlyEdgeShard<S>
impl<S: UniversalReadExt + 'static> ReadOnlyEdgeShard<S>
Sourcepub fn open(
fs: S::Fs,
path: &Path,
config: Option<EdgeConfig>,
load_profile: Option<LoadProfile>,
) -> OperationResult<Self>
pub fn open( fs: S::Fs, path: &Path, config: Option<EdgeConfig>, load_profile: Option<LoadProfile>, ) -> OperationResult<Self>
Open a read-only follower over the edge-shard directory at path using read backend fs.
Segments are discovered through the leader’s segment manifest (read via fs) — a read-only
follower always uses the manifest, so there is no discovery to configure.
A follower has no edge_config.json — the segments are the source of truth, so the config is
derived from the segments themselves (see EdgeConfig::from_segment_config), mirroring the
read-write EdgeShard’s fallback. A provided config overrides tunable
parameters at open (its Some values win over the derived ones; vectors/sparse_vectors
are ignored); a refresh re-derives the config from the segments alone.
An empty shard (no segments yet) starts from the provided config (or a default one).
A load_profile — derived from the request this shard is being opened to serve (see
LoadProfile) — parks the segment components that request won’t touch cold instead of
warming them per the persisted segment configs, cutting the cold-start cost. Without one,
loading follows the segment configs alone. The profile also applies to segments a later
refresh discovers: the shard was opened for that one request, so new
segments shouldn’t load any warmer.
Source§impl<S: UniversalReadExt + 'static> ReadOnlyEdgeShard<S>
impl<S: UniversalReadExt + 'static> ReadOnlyEdgeShard<S>
Sourcepub fn refresh(&self) -> OperationResult<()>
pub fn refresh(&self) -> OperationResult<()>
Refresh the follower to the leader’s current on-disk state.
Caller-driven (never self-triggered), mirroring ReadOnlySegment::live_reload: the host
owns the cadence (a timer, an explicit call after a known leader flush, or an FS watch).
Eventually consistent — a point becomes visible once the leader has flushed it to the
segment files and a subsequent refresh has run.
Leader-side segment churn is absorbed: a segment whose files vanish while its live-reload
runs is checked against a re-read manifest, and if the leader indeed removed it, the segment
is dropped and the refresh re-runs (bounded) to pick up its replacements. Err therefore
means the shard genuinely needs attention: a component failed to reload, or a segment’s
essential files are missing while the manifest still lists it. Either way the shard stays
consistent — every swap is atomic, a failed segment keeps serving its pre-refresh state,
and the next refresh replays its unapplied delta (see pending_reload).
Sourcepub fn refresh_with(
&self,
hw_counter: &HardwareCounterCell,
) -> OperationResult<()>
pub fn refresh_with( &self, hw_counter: &HardwareCounterCell, ) -> OperationResult<()>
refresh with a caller-supplied hardware counter.
Source§impl<S: UniversalReadExt + 'static> ReadOnlyEdgeShard<S>
impl<S: UniversalReadExt + 'static> ReadOnlyEdgeShard<S>
Auto Trait Implementations§
impl<S> !Freeze for ReadOnlyEdgeShard<S>
impl<S> !RefUnwindSafe for ReadOnlyEdgeShard<S>
impl<S> !UnwindSafe for ReadOnlyEdgeShard<S>
impl<S> Send for ReadOnlyEdgeShard<S>
impl<S> Sync for ReadOnlyEdgeShard<S>
impl<S> Unpin for ReadOnlyEdgeShard<S>where
<S as UniversalRead>::Fs: Unpin,
impl<S> UnsafeUnpin for ReadOnlyEdgeShard<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> EdgeShardRead for Twhere
T: ReadViewProvider + ?Sized,
impl<T> EdgeShardRead for Twhere
T: ReadViewProvider + ?Sized,
Source§fn config_snapshot(&self) -> Arc<EdgeConfig>
fn config_snapshot(&self) -> Arc<EdgeConfig>
fn path(&self) -> &Path
Source§fn search(
&self,
request: SearchRequest,
) -> Result<Vec<ScoredPoint>, OperationError>
fn search( &self, request: SearchRequest, ) -> Result<Vec<ScoredPoint>, OperationError>
fn query( &self, request: QueryRequest, ) -> Result<Vec<ScoredPoint>, OperationError>
fn scroll( &self, request: ScrollRequest, ) -> Result<(Vec<RecordInternal>, Option<ExtendedPointId>), OperationError>
fn retrieve( &self, request: RetrieveRequest, ) -> Result<Vec<RecordInternal>, OperationError>
fn count(&self, request: CountRequest) -> Result<usize, OperationError>
fn facet(&self, request: FacetRequest) -> Result<FacetResponse, OperationError>
fn search_matrix( &self, request: SearchMatrixRequest, ) -> Result<SearchMatrixResponse, OperationError>
fn query_groups( &self, request: GroupRequest, ) -> Result<Vec<Group>, OperationError>
fn info(&self) -> Result<ShardInfo, OperationError>
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.