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

Function bulk_insert

nodedb-columnar/src/pk_index.rs:253–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

251
252 #[test]
253 fn bulk_insert() {
254 let mut idx = PkIndex::new();
255 let pks: Vec<Vec<u8>> = (0..10).map(|i| encode_pk(&Value::Integer(i))).collect();
256
257 idx.bulk_insert(0, &pks).expect("bulk insert");
258 assert_eq!(idx.len(), 10);
259
260 // Verify row indices.
261 let loc = idx.get(&pks[5]).expect("lookup");
262 assert_eq!(loc.segment_id, 0);
263 assert_eq!(loc.row_index, 5);
264 }
265
266 #[test]
267 fn remap_segment() {

Callers

nothing calls this directly

Calls 5

encode_pkFunction · 0.85
collectMethod · 0.80
bulk_insertMethod · 0.80
expectMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected