MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / install_segment

Method install_segment

nodedb/src/engine/array/store/catalog.rs:146–156  ·  view source on GitHub ↗

Register a freshly-flushed (or freshly-merged) segment. The file must already exist on disk. Updates the manifest in-memory only; callers must call [`ArrayStore::persist_manifest`] afterwards.

(&mut self, seg: SegmentRef)

Source from the content-addressed store, hash-verified

144 /// must already exist on disk. Updates the manifest in-memory only;
145 /// callers must call [`ArrayStore::persist_manifest`] afterwards.
146 pub fn install_segment(&mut self, seg: SegmentRef) -> Result<(), ArrayStoreError> {
147 let h = SegmentHandle::open(
148 &segment_path(&self.root, &seg.id),
149 seg.id.clone(),
150 self.schema_hash,
151 self.kek.as_ref(),
152 )?;
153 self.segments.insert(seg.id.clone(), h);
154 self.manifest.append(seg);
155 Ok(())
156 }
157
158 /// Remove segments from the manifest and drop their handles. The
159 /// underlying file is deleted only after the manifest is persisted

Callers 1

Calls 6

segment_pathFunction · 0.70
openFunction · 0.50
cloneMethod · 0.45
as_refMethod · 0.45
insertMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected