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

Method persist_row

nodedb/src/control/array_sync/ack_registry.rs:204–228  ·  view source on GitHub ↗
(&self, key: &[u8], hlc: Hlc)

Source from the content-addressed store, hash-verified

202 }
203
204 fn persist_row(&self, key: &[u8], hlc: Hlc) -> crate::Result<()> {
205 let txn = self.db.begin_write().map_err(|e| crate::Error::Storage {
206 engine: "array_sync".into(),
207 detail: format!("ack_registry persist begin_write: {e}"),
208 })?;
209 {
210 let mut table = txn
211 .open_table(ACK_TABLE)
212 .map_err(|e| crate::Error::Storage {
213 engine: "array_sync".into(),
214 detail: format!("ack_registry persist open_table: {e}"),
215 })?;
216 let hlc_bytes = hlc.to_bytes();
217 table
218 .insert(key, hlc_bytes.as_slice())
219 .map_err(|e| crate::Error::Storage {
220 engine: "array_sync".into(),
221 detail: format!("ack_registry persist insert: {e}"),
222 })?;
223 }
224 txn.commit().map_err(|e| crate::Error::Storage {
225 engine: "array_sync".into(),
226 detail: format!("ack_registry persist commit: {e}"),
227 })
228 }
229
230 /// Return the minimum ack HLC across all replicas for `array`.
231 ///

Callers 1

recordMethod · 0.80

Calls 5

begin_writeMethod · 0.80
to_bytesMethod · 0.45
insertMethod · 0.45
as_sliceMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected