diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2023-05-17 10:58:57 -0400 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2023-05-17 10:58:57 -0400 |
| commit | 75a8418b580234521b5fa23340bee959c357acf9 (patch) | |
| tree | 5c32d5fb20749a65a642a0d969f7c47adc4691b7 /include/shard | |
| parent | ff000799c3254f52e0beabbe9c62d10c3fc4178e (diff) | |
| download | dynamic-extension-75a8418b580234521b5fa23340bee959c357acf9.tar.gz | |
Removed unncessary tagging paramter from shards and levels
Diffstat (limited to 'include/shard')
| -rw-r--r-- | include/shard/MemISAM.h | 29 | ||||
| -rw-r--r-- | include/shard/WIRS.h | 27 |
2 files changed, 26 insertions, 30 deletions
diff --git a/include/shard/MemISAM.h b/include/shard/MemISAM.h index dd2fd85..d1f3bb3 100644 --- a/include/shard/MemISAM.h +++ b/include/shard/MemISAM.h @@ -43,8 +43,8 @@ constexpr static size_t inmem_isam_node_keyskip = sizeof(K) * inmem_isam_fanout; static_assert(sizeof(InMemISAMNode) == inmem_isam_node_size, "node size does not match"); public: - MemISAM(std::string data_fname, size_t record_cnt, size_t tombstone_cnt, BloomFilter *bf, bool tagging) - : m_reccnt(record_cnt), m_tombstone_cnt(tombstone_cnt), m_deleted_cnt(0), m_tagging(tagging) { + MemISAM(std::string data_fname, size_t record_cnt, size_t tombstone_cnt, BloomFilter *bf) + : m_reccnt(record_cnt), m_tombstone_cnt(tombstone_cnt), m_deleted_cnt(0) { // read the stored data file the file size_t alloc_size = (record_cnt * sizeof(R)) + (CACHELINE_SIZE - (record_cnt * sizeof(R)) % CACHELINE_SIZE); @@ -71,8 +71,8 @@ public: } } - MemISAM(MutableBuffer<R>* buffer, BloomFilter* bf, bool tagging) - :m_reccnt(0), m_tombstone_cnt(0), m_isam_nodes(nullptr), m_deleted_cnt(0), m_tagging(tagging) { + MemISAM(MutableBuffer<R>* buffer, BloomFilter* bf) + :m_reccnt(0), m_tombstone_cnt(0), m_isam_nodes(nullptr), m_deleted_cnt(0) { size_t alloc_size = (buffer->get_record_count() * sizeof(R)) + (CACHELINE_SIZE - (buffer->get_record_count() * sizeof(R)) % CACHELINE_SIZE); assert(alloc_size % CACHELINE_SIZE == 0); @@ -91,13 +91,11 @@ public: TIMER_START(); while (base < stop) { - if (!m_tagging) { - if (!base->is_tombstone() && (base + 1 < stop) - && *base == *(base + 1) && (base + 1)->is_tombstone()) { - base += 2; - mrun_cancelations++; - continue; - } + if (!base->is_tombstone() && (base + 1 < stop) + && *base == *(base + 1) && (base + 1)->is_tombstone()) { + base += 2; + mrun_cancelations++; + continue; } else if (base->is_deleted()) { base += 1; continue; @@ -126,8 +124,8 @@ public: //fprintf(stdout, "%ld %ld %ld\n", sort_time, copy_time, level_time); } - MemISAM(MemISAM** runs, size_t len, BloomFilter* bf, bool tagging) - :m_reccnt(0), m_tombstone_cnt(0), m_deleted_cnt(0), m_isam_nodes(nullptr), m_tagging(tagging) { + MemISAM(MemISAM** runs, size_t len, BloomFilter* bf) + :m_reccnt(0), m_tombstone_cnt(0), m_deleted_cnt(0), m_isam_nodes(nullptr) { std::vector<Cursor<R>> cursors; cursors.reserve(len); @@ -155,7 +153,7 @@ public: while (pq.size()) { auto now = pq.peek(); auto next = pq.size() > 1 ? pq.peek(1) : queue_record<R>{nullptr, 0}; - if (!m_tagging && !now.data->is_tombstone() && next.data != nullptr && + if (!now.data->is_tombstone() && next.data != nullptr && *now.data == *next.data && next.data->is_tombstone()) { pq.pop(); pq.pop(); @@ -165,7 +163,7 @@ public: if (advance_cursor(cursor2)) pq.push(cursor2.ptr, next.version); } else { auto& cursor = cursors[now.version]; - if (!m_tagging || !cursor.ptr->is_deleted()) { + if (!cursor.ptr->is_deleted()) { m_data[m_reccnt++] = *cursor.ptr; if (cursor.ptr->is_tombstone()) { ++m_tombstone_cnt; @@ -357,7 +355,6 @@ private: size_t m_tombstone_cnt; size_t m_internal_node_cnt; size_t m_deleted_cnt; - bool m_tagging; }; } diff --git a/include/shard/WIRS.h b/include/shard/WIRS.h index 41766b9..2572caf 100644 --- a/include/shard/WIRS.h +++ b/include/shard/WIRS.h @@ -53,9 +53,9 @@ private: }; public: - WIRS(MutableBuffer<R>* buffer, BloomFilter* bf, bool tagging) + WIRS(MutableBuffer<R>* buffer, BloomFilter* bf) : m_reccnt(0), m_tombstone_cnt(0), m_deleted_cnt(0), m_total_weight(0), m_rejection_cnt(0), - m_ts_check_cnt(0), m_tagging(tagging), m_root(nullptr) { + m_ts_check_cnt(0), m_root(nullptr) { size_t alloc_size = (buffer->get_record_count() * sizeof(R)) + (CACHELINE_SIZE - (buffer->get_record_count() * sizeof(R)) % CACHELINE_SIZE); assert(alloc_size % CACHELINE_SIZE == 0); @@ -67,13 +67,11 @@ public: auto stop = base + buffer->get_record_count(); while (base < stop) { - if (!m_tagging) { - if (!(base->is_tombstone()) && (base + 1) < stop) { - if (*base == *(base + 1) && (base + 1)->is_tombstone()) { - base += 2; - wirs_cancelations++; - continue; - } + if (!(base->is_tombstone()) && (base + 1) < stop) { + if (*base == *(base + 1) && (base + 1)->is_tombstone()) { + base += 2; + wirs_cancelations++; + continue; } } else if (base->is_deleted()) { base += 1; @@ -97,9 +95,9 @@ public: } } - WIRS(WIRS** shards, size_t len, BloomFilter* bf, bool tagging) + WIRS(WIRS** shards, size_t len, BloomFilter* bf) : m_reccnt(0), m_tombstone_cnt(0), m_deleted_cnt(0), m_total_weight(0), m_rejection_cnt(0), m_ts_check_cnt(0), - m_tagging(tagging), m_root(nullptr) { + m_root(nullptr) { std::vector<Cursor<R>> cursors; cursors.reserve(len); @@ -125,7 +123,7 @@ public: while (pq.size()) { auto now = pq.peek(); auto next = pq.size() > 1 ? pq.peek(1) : queue_record<R>{nullptr, 0}; - if (!m_tagging && !now.data->is_tombstone() && next.data != nullptr && + if (!now.data->is_tombstone() && next.data != nullptr && *now.data == *next.data && next.data->is_tombstone()) { pq.pop(); pq.pop(); @@ -135,7 +133,7 @@ public: if (advance_cursor<R>(cursor2)) pq.push(cursor2.ptr, next.version); } else { auto& cursor = cursors[now.version]; - if (!m_tagging || !cursor.ptr->is_deleted()) { + if (!cursor.ptr->is_deleted()) { m_data[m_reccnt++] = *cursor.ptr; m_total_weight += cursor.ptr->weight; if (bf && cursor.ptr->is_tombstone()) { @@ -295,6 +293,7 @@ public: return min; } + /* bool check_delete(K key, V val) { size_t idx = get_lower_bound(key); if (idx >= m_reccnt) { @@ -312,6 +311,7 @@ public: m_rejection_cnt += result; return result; } + */ bool check_tombstone(const R& rec) { m_ts_check_cnt++; @@ -421,7 +421,6 @@ private: R* m_data; std::vector<Alias *> m_alias; wirs_node<R>* m_root; - bool m_tagging; W m_total_weight; size_t m_reccnt; size_t m_tombstone_cnt; |