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

Method get

nodedb/src/engine/kv/engine.rs:183–192  ·  view source on GitHub ↗

GET: O(1) hash table lookup. Returns None if not found or expired.

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

Source from the content-addressed store, hash-verified

181
182 /// GET: O(1) hash table lookup. Returns None if not found or expired.
183 pub fn get(
184 &self,
185 tenant_id: u64,
186 collection: &str,
187 key: &[u8],
188 now_ms: u64,
189 ) -> Option<Vec<u8>> {
190 let tkey = table_key(tenant_id, collection);
191 self.tables.get(&tkey)?.get(key, now_ms).map(|v| v.to_vec())
192 }
193
194 /// GET with surrogate: returns the value bytes AND the row's stable
195 /// surrogate when the binding was made. Used by the clone-delegated

Callers 15

register_sorted_indexMethod · 0.45
truncateMethod · 0.45
collection_lenMethod · 0.45
collection_mem_usageMethod · 0.45
incrMethod · 0.45
incr_floatMethod · 0.45
casMethod · 0.45
getsetMethod · 0.45
atomic_putMethod · 0.45
cas_create_if_not_existsFunction · 0.45
cas_successFunction · 0.45
cas_failureFunction · 0.45

Calls 2

table_keyFunction · 0.85
to_vecMethod · 0.45

Tested by 6

cas_create_if_not_existsFunction · 0.36
cas_successFunction · 0.36
cas_failureFunction · 0.36
getset_new_keyFunction · 0.36
getset_existing_keyFunction · 0.36