Scan KV engine entries → standard msgpack. Injects the `key` field directly into the msgpack map — no JSON roundtrip.
(&self, tid: u64, collection: &str, limit: usize)
| 51 | /// Scan KV engine entries → standard msgpack. |
| 52 | /// Injects the `key` field directly into the msgpack map — no JSON roundtrip. |
| 53 | fn scan_kv(&self, tid: u64, collection: &str, limit: usize) -> Vec<(String, Vec<u8>)> { |
| 54 | let now_ms = crate::engine::kv::current_ms(); |
| 55 | let (entries, _next_cursor) = self.kv_engine.scan(KvScanParams { |
| 56 | tenant_id: tid, |
| 57 | collection, |
| 58 | cursor: &[], |
| 59 | count: limit, |
| 60 | now_ms, |
| 61 | match_pattern: None, |
| 62 | filter_field: None, |
| 63 | filter_value: None, |
| 64 | surrogate_ceiling: None, |
| 65 | }); |
| 66 | let mut results = Vec::with_capacity(entries.len()); |
| 67 | for (key, value) in entries { |
| 68 | let key_str = String::from_utf8_lossy(&key).to_string(); |
| 69 | // Inject "key" field into the msgpack map at binary level. |
| 70 | let mp = msgpack_scan::inject_str_field(&value, "key", &key_str); |
| 71 | results.push((key_str, mp)); |
| 72 | } |
| 73 | results |
| 74 | } |
| 75 | |
| 76 | /// Scan columnar rows → standard msgpack. |
| 77 | fn scan_columnar(&self, tid: u64, collection: &str, limit: usize) -> Vec<(String, Vec<u8>)> { |
no test coverage detected