summaryrefslogtreecommitdiffstats
path: root/include/shard/PGM.h
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2023-06-09 12:01:18 -0400
committerDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2023-06-09 12:01:18 -0400
commit9bbac08e23067efe8ae2568ba507c73a3cf8c4ad (patch)
tree95742a67a040f38668b2003318db63995e68a0a8 /include/shard/PGM.h
parent9973065a1eebac0ccfb8dd16cd723290cdf82734 (diff)
downloaddynamic-extension-9bbac08e23067efe8ae2568ba507c73a3cf8c4ad.tar.gz
Updated bloom filters to use whole record
Diffstat (limited to 'include/shard/PGM.h')
-rw-r--r--include/shard/PGM.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/shard/PGM.h b/include/shard/PGM.h
index 3d680e7..f84fcc4 100644
--- a/include/shard/PGM.h
+++ b/include/shard/PGM.h
@@ -72,7 +72,7 @@ public:
m_data = (Wrapped<R>*)std::aligned_alloc(CACHELINE_SIZE, alloc_size);
std::vector<K> keys;
- m_bf = new BloomFilter<K>(BF_FPR, buffer->get_tombstone_count(), BF_HASH_FUNCS);
+ m_bf = new BloomFilter<R>(BF_FPR, buffer->get_tombstone_count(), BF_HASH_FUNCS);
size_t offset = 0;
m_reccnt = 0;
@@ -105,7 +105,7 @@ public:
if (m_bf && base->is_tombstone()) {
m_tombstone_cnt++;
- m_bf->insert(base->rec.key);
+ m_bf->insert(base->rec);
}
base++;
@@ -139,7 +139,7 @@ public:
}
}
- m_bf = new BloomFilter<K>(BF_FPR, tombstone_count, BF_HASH_FUNCS);
+ m_bf = new BloomFilter<R>(BF_FPR, tombstone_count, BF_HASH_FUNCS);
size_t alloc_size = (attemp_reccnt * sizeof(Wrapped<R>)) + (CACHELINE_SIZE - (attemp_reccnt * sizeof(Wrapped<R>)) % CACHELINE_SIZE);
assert(alloc_size % CACHELINE_SIZE == 0);
@@ -165,7 +165,7 @@ public:
keys.emplace_back(cursor.ptr->rec.key);
if (m_bf && cursor.ptr->is_tombstone()) {
++m_tombstone_cnt;
- if (m_bf) m_bf->insert(cursor.ptr->rec.key);
+ if (m_bf) m_bf->insert(cursor.ptr->rec);
}
}
pq.pop();
@@ -186,7 +186,7 @@ public:
}
Wrapped<R> *point_lookup(const R &rec, bool filter=false) {
- if (filter && !m_bf->lookup(rec.key)) {
+ if (filter && !m_bf->lookup(rec)) {
return nullptr;
}
@@ -266,7 +266,7 @@ private:
K m_max_key;
K m_min_key;
pgm::PGMIndex<K> m_pgm;
- BloomFilter<K> *m_bf;
+ BloomFilter<R> *m_bf;
};