summaryrefslogtreecommitdiffstats
path: root/include/shard/MemISAM.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-05-22 14:58:22 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2023-05-22 14:58:22 -0400
commit0cf160ee68d37be93665e665ef22ae6e211a157d (patch)
treebadaca4c5654e7abbe9291b18b08748aeeadc518 /include/shard/MemISAM.h
parent08d6c84b9d69b500c964a8ff66e726e1f01f2095 (diff)
downloaddynamic-extension-0cf160ee68d37be93665e665ef22ae6e211a157d.tar.gz
More updates/restructuring
Diffstat (limited to 'include/shard/MemISAM.h')
-rw-r--r--include/shard/MemISAM.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/shard/MemISAM.h b/include/shard/MemISAM.h
index 55699be..8ac17e4 100644
--- a/include/shard/MemISAM.h
+++ b/include/shard/MemISAM.h
@@ -27,6 +27,8 @@ thread_local size_t mrun_cancelations = 0;
template <RecordInterface R>
class MemISAM {
private:
+ friend class InternalLevel;
+
typedef decltype(R::key) K;
typedef decltype(R::value) V;
@@ -178,6 +180,26 @@ public:
return m_tombstone_cnt;
}
+ R *point_lookup(R &rec, bool filter) {
+
+ if (filter && !m_bf->lookup(rec.key)) {
+ return nullptr;
+ }
+
+ size_t idx = get_lower_bound(rec.key);
+ if (idx >= m_reccnt) {
+ return false;
+ }
+
+ while (idx < m_reccnt && m_data[idx] < rec) ++idx;
+
+ if (m_data[idx] == rec) {
+ return m_data + idx;
+ }
+
+ return nullptr;
+ }
+
bool delete_record(const K& key, const V& val) {
size_t idx = get_lower_bound(key);
if (idx >= m_reccnt) {