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

Method batch_get

nodedb/src/engine/kv/engine.rs:241–251  ·  view source on GitHub ↗

BATCH GET: fetch multiple keys. Returns values in order (None for missing).

(
        &self,
        tenant_id: u64,
        collection: &str,
        keys: &[Vec<u8>],
        now_ms: u64,
    )

Source from the content-addressed store, hash-verified

239
240 /// BATCH GET: fetch multiple keys. Returns values in order (None for missing).
241 pub fn batch_get(
242 &self,
243 tenant_id: u64,
244 collection: &str,
245 keys: &[Vec<u8>],
246 now_ms: u64,
247 ) -> Vec<Option<Vec<u8>>> {
248 keys.iter()
249 .map(|k| self.get(tenant_id, collection, k, now_ms))
250 .collect()
251 }
252
253 /// BATCH PUT: insert/update multiple pairs. Returns count of new keys.
254 pub fn batch_put(

Callers 2

execute_kv_batch_getMethod · 0.80
batch_get_and_putFunction · 0.80

Calls 3

collectMethod · 0.80
iterMethod · 0.45
getMethod · 0.45

Tested by 1

batch_get_and_putFunction · 0.64