diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-05-03 00:15:02 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-05-03 00:20:36 +0300 |
| commit | 84ac3652415b662aae9580c008a5aa996d58c9f4 (patch) | |
| tree | 3d39fe6ce5da76a1102458c120480e4190a70fcf /log_db/src/memtable_primary.rs | |
| parent | e17048eddfe2df86abd2d498da2a33b9c3dd8a72 (diff) | |
Rename to AutereDB
Diffstat (limited to 'log_db/src/memtable_primary.rs')
| -rw-r--r-- | log_db/src/memtable_primary.rs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/log_db/src/memtable_primary.rs b/log_db/src/memtable_primary.rs deleted file mode 100644 index 573592e..0000000 --- a/log_db/src/memtable_primary.rs +++ /dev/null @@ -1,40 +0,0 @@ -use super::*; -use std::collections::BTreeMap; - -pub struct PrimaryMemtable { - /// Map of records indexed by key. Used as a shared heap of records - /// for all secondary memtables also. Secondary memtables store an - /// IndexableValue as their record value, which is used to get - /// the actual record from the primary memtable `records` map. - /// - /// Note: it must be invariant that all memtables (primary and secondary) - /// contain the same keys. - records: BTreeMap<IndexableValue, LogKey>, -} - -impl PrimaryMemtable { - pub fn new() -> PrimaryMemtable { - PrimaryMemtable { - records: BTreeMap::new(), - } - } - - pub fn set(&mut self, key: IndexableValue, value: LogKey) { - self.records.insert(key, value); - } - - pub fn get(&self, key: &IndexableValue) -> Option<&LogKey> { - self.records.get(key) - } - - pub fn remove(&mut self, key: &IndexableValue) -> Option<LogKey> { - self.records.remove(key) - } - - pub fn range<B: RangeBounds<IndexableValue>>(&self, range: B) -> Vec<&LogKey> { - self.records - .range(range) - .map(|(_, log_key)| log_key) - .collect() - } -} |
