aboutsummaryrefslogtreecommitdiffstats
path: root/log_db/src/memtable_secondary.rs
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-01-11 23:16:06 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-01-11 23:40:20 +0200
commit60c9d1037f012e76cf8f8c11d82b065b1f97269f (patch)
treea050c7ecb46bdbdf9dfd7bdeb15b9c5f84e70b24 /log_db/src/memtable_secondary.rs
parent899927cf6e517690622cb6cab40d15f19bd229cb (diff)
Add range_by, refactor reading from file
Diffstat (limited to 'log_db/src/memtable_secondary.rs')
-rw-r--r--log_db/src/memtable_secondary.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/log_db/src/memtable_secondary.rs b/log_db/src/memtable_secondary.rs
index 9309fa2..dc161c8 100644
--- a/log_db/src/memtable_secondary.rs
+++ b/log_db/src/memtable_secondary.rs
@@ -75,4 +75,12 @@ impl SecondaryMemtable {
removed
}
+
+ pub fn range<B: RangeBounds<IndexableValue>>(&self, range: B) -> Vec<LogKey> {
+ let mut keys = Vec::new();
+ for (_, set) in self.records.range(range) {
+ keys.extend(set.log_keys().iter().cloned());
+ }
+ keys
+ }
}