summaryrefslogtreecommitdiffstats
path: root/include
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
parent9973065a1eebac0ccfb8dd16cd723290cdf82734 (diff)
downloaddynamic-extension-9bbac08e23067efe8ae2568ba507c73a3cf8c4ad.tar.gz
Updated bloom filters to use whole record
Diffstat (limited to 'include')
-rw-r--r--include/shard/MemISAM.h12
-rw-r--r--include/shard/PGM.h12
-rw-r--r--include/shard/TrieSpline.h12
-rw-r--r--include/shard/WIRS.h12
-rw-r--r--include/shard/WSS.h12
5 files changed, 30 insertions, 30 deletions
diff --git a/include/shard/MemISAM.h b/include/shard/MemISAM.h
index 5815fd7..2b6e3df 100644
--- a/include/shard/MemISAM.h
+++ b/include/shard/MemISAM.h
@@ -77,7 +77,7 @@ public:
MemISAM(MutableBuffer<R>* buffer)
:m_reccnt(0), m_tombstone_cnt(0), m_isam_nodes(nullptr), m_deleted_cnt(0) {
- 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 alloc_size = (buffer->get_record_count() * sizeof(Wrapped<R>)) + (CACHELINE_SIZE - (buffer->get_record_count() * sizeof(Wrapped<R>)) % CACHELINE_SIZE);
assert(alloc_size % CACHELINE_SIZE == 0);
@@ -115,7 +115,7 @@ public:
m_data[m_reccnt++] = *base;
if (m_bf && base->is_tombstone()) {
++m_tombstone_cnt;
- m_bf->insert(base->rec.key);
+ m_bf->insert(base->rec);
}
base++;
@@ -153,7 +153,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);
@@ -178,7 +178,7 @@ public:
m_data[m_reccnt++] = *cursor.ptr;
if (cursor.ptr->is_tombstone()) {
++m_tombstone_cnt;
- m_bf->insert(cursor.ptr->rec.key);
+ m_bf->insert(cursor.ptr->rec);
}
}
pq.pop();
@@ -199,7 +199,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;
}
@@ -344,7 +344,7 @@ private:
// Members: sorted data, internal ISAM levels, reccnt;
Wrapped<R>* m_data;
- BloomFilter<K> *m_bf;
+ BloomFilter<R> *m_bf;
InMemISAMNode* m_isam_nodes;
InMemISAMNode* m_root;
size_t m_reccnt;
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;
};
diff --git a/include/shard/TrieSpline.h b/include/shard/TrieSpline.h
index 349f41a..1588507 100644
--- a/include/shard/TrieSpline.h
+++ b/include/shard/TrieSpline.h
@@ -73,7 +73,7 @@ public:
assert(alloc_size % CACHELINE_SIZE == 0);
m_data = (Wrapped<R>*)std::aligned_alloc(CACHELINE_SIZE, alloc_size);
- 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;
@@ -116,7 +116,7 @@ public:
if (m_bf && base->is_tombstone()) {
m_tombstone_cnt++;
- m_bf->insert(base->rec.key);
+ m_bf->insert(base->rec);
}
base++;
@@ -158,7 +158,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);
auto bldr = ts::Builder<K>(m_min_key, m_max_key, g_max_error);
size_t alloc_size = (attemp_reccnt * sizeof(Wrapped<R>)) + (CACHELINE_SIZE - (attemp_reccnt * sizeof(Wrapped<R>)) % CACHELINE_SIZE);
@@ -183,7 +183,7 @@ public:
bldr.AddKey(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();
@@ -204,7 +204,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;
}
@@ -285,7 +285,7 @@ private:
K m_max_key;
K m_min_key;
ts::TrieSpline<K> m_ts;
- BloomFilter<K> *m_bf;
+ BloomFilter<R> *m_bf;
};
diff --git a/include/shard/WIRS.h b/include/shard/WIRS.h
index 163311e..fa071da 100644
--- a/include/shard/WIRS.h
+++ b/include/shard/WIRS.h
@@ -102,7 +102,7 @@ public:
assert(alloc_size % CACHELINE_SIZE == 0);
m_data = (Wrapped<R>*)std::aligned_alloc(CACHELINE_SIZE, alloc_size);
- 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;
@@ -133,7 +133,7 @@ public:
if (m_bf && base->is_tombstone()) {
m_tombstone_cnt++;
- m_bf->insert(base->rec.key);
+ m_bf->insert(base->rec);
}
base++;
@@ -166,7 +166,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);
@@ -190,7 +190,7 @@ public:
m_total_weight += cursor.ptr->rec.weight;
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();
@@ -216,7 +216,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;
}
@@ -361,7 +361,7 @@ private:
size_t m_reccnt;
size_t m_tombstone_cnt;
size_t m_group_size;
- BloomFilter<K> *m_bf;
+ BloomFilter<R> *m_bf;
};
diff --git a/include/shard/WSS.h b/include/shard/WSS.h
index 15c8b2e..b2dbb96 100644
--- a/include/shard/WSS.h
+++ b/include/shard/WSS.h
@@ -83,7 +83,7 @@ public:
assert(alloc_size % CACHELINE_SIZE == 0);
m_data = (Wrapped<R>*)std::aligned_alloc(CACHELINE_SIZE, alloc_size);
- 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;
@@ -117,7 +117,7 @@ public:
if (m_bf && base->is_tombstone()) {
m_tombstone_cnt++;
- m_bf->insert(base->rec.key);
+ m_bf->insert(base->rec);
}
base++;
@@ -150,7 +150,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);
@@ -177,7 +177,7 @@ public:
weights.push_back(cursor.ptr->rec.weight);
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();
@@ -199,7 +199,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;
}
@@ -278,7 +278,7 @@ private:
size_t m_reccnt;
size_t m_tombstone_cnt;
size_t m_group_size;
- BloomFilter<K> *m_bf;
+ BloomFilter<R> *m_bf;
};