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

Method get_with_surrogate

nodedb/src/engine/kv/engine.rs:198–210  ·  view source on GitHub ↗

GET with surrogate: returns the value bytes AND the row's stable surrogate when the binding was made. Used by the clone-delegated read path to enforce a per-row surrogate ceiling — bindings the source allocated AFTER the clone's AS-OF point are filtered out.

(
        &self,
        tenant_id: u64,
        collection: &str,
        key: &[u8],
        now_ms: u64,
    )

Source from the content-addressed store, hash-verified

196 /// read path to enforce a per-row surrogate ceiling — bindings the
197 /// source allocated AFTER the clone's AS-OF point are filtered out.
198 pub fn get_with_surrogate(
199 &self,
200 tenant_id: u64,
201 collection: &str,
202 key: &[u8],
203 now_ms: u64,
204 ) -> Option<(Vec<u8>, nodedb_types::Surrogate)> {
205 let tkey = table_key(tenant_id, collection);
206 self.tables
207 .get(&tkey)?
208 .get_with_surrogate(key, now_ms)
209 .map(|(v, s)| (v.to_vec(), s))
210 }
211
212 /// GET TTL: Returns the remaining TTL in milliseconds for a key.
213 ///

Callers 2

execute_kv_getMethod · 0.45
scanMethod · 0.45

Calls 3

table_keyFunction · 0.85
getMethod · 0.45
to_vecMethod · 0.45

Tested by

no test coverage detected