struct RegistryStaging {
dir: PathBuf,
runs: Vec<PathBuf>,
entries: u64,
}Expand description
Staged registry SST run files awaiting bulk ingest at the end of an offline import.
The offline path defers registry writes instead of applying one WriteBatch
per chunk (the old serial dictionary choke): each chunk’s deduped entries —
already hash-sorted by the per-chunk BTreeMap — become one sorted SST run
under {data_dir}/{repository}/registry.sst-staging, and every run is
IngestExternalFile-ed into the registry CF in bulk at the end, concurrent
with the hexastore compactions. Nothing reads the registry mid-import (this
process holds the data dir exclusively), so deferring preserves the
“registered before visible” invariant at import granularity. A run may
overlap earlier runs on key ranges: a StrHash is a pure hash of its raw
string, so a duplicate hash always carries the same value.
A chunk writes run-N.sst.partial at the same time as its hexastore apply.
The file is renamed to run-N.sst only when both succeed. Ingest and
recovery look only at the renamed files.
Fields§
§dir: PathBufRun-file directory for this import.
runs: Vec<PathBuf>One path per renamed run, in staging order.
entries: u64Total staged entries across all runs (status reporting).
Implementations§
Source§impl RegistryStaging
impl RegistryStaging
Sourcefn create(data_dir: &Path) -> Result<Self, DevError>
fn create(data_dir: &Path) -> Result<Self, DevError>
Create the staging directory under data_dir.
Finished run-*.sst files are not deleted. Registry open ingests those
before this is called; if any remain, ingest failed and wiping them
would drop the only copy of that dictionary. In-progress .partial files
are incomplete and are removed.
Sourcefn partial_path(&self) -> PathBuf
fn partial_path(&self) -> PathBuf
Path of the in-progress SST for the next chunk. Not a finished run until
Self::commit_run.
Sourcefn commit_run(&mut self, partial: &Path, n_entries: u64) -> Result<(), DevError>
fn commit_run(&mut self, partial: &Path, n_entries: u64) -> Result<(), DevError>
Rename a finished partial into run-N.sst and remember it.
Sourcefn discard_partial(partial: &Path)
fn discard_partial(partial: &Path)
Delete an in-progress partial. Missing is fine: the SST writer may not have created it, or Finish may already have removed it.
Auto Trait Implementations§
impl Freeze for RegistryStaging
impl RefUnwindSafe for RegistryStaging
impl Send for RegistryStaging
impl Sync for RegistryStaging
impl Unpin for RegistryStaging
impl UnsafeUnpin for RegistryStaging
impl UnwindSafe for RegistryStaging
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].