diff options
| author | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2023-06-09 12:01:18 -0400 |
|---|---|---|
| committer | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2023-06-09 12:01:18 -0400 |
| commit | 9bbac08e23067efe8ae2568ba507c73a3cf8c4ad (patch) | |
| tree | 95742a67a040f38668b2003318db63995e68a0a8 /include/shard/MemISAM.h | |
| parent | 9973065a1eebac0ccfb8dd16cd723290cdf82734 (diff) | |
| download | dynamic-extension-9bbac08e23067efe8ae2568ba507c73a3cf8c4ad.tar.gz | |
Updated bloom filters to use whole record
Diffstat (limited to 'include/shard/MemISAM.h')
| -rw-r--r-- | include/shard/MemISAM.h | 12 |
1 files changed, 6 insertions, 6 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; |