From 09949110fe71cd1594e53a2ddd4d21722a8774df Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 9 May 2023 14:37:59 -0400 Subject: WIRS Shard testing and bugfixes --- include/shard/WIRS.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'include/shard/WIRS.h') diff --git a/include/shard/WIRS.h b/include/shard/WIRS.h index d2f728f..c89a407 100644 --- a/include/shard/WIRS.h +++ b/include/shard/WIRS.h @@ -22,9 +22,6 @@ namespace de { -extern thread_local size_t bounds_rejections; -extern thread_local size_t tombstone_rejections; - thread_local size_t m_wirsrun_cancelations = 0; template @@ -95,7 +92,7 @@ public: WIRS(WIRS** runs, size_t len, BloomFilter* bf, bool tagging) : 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) { - std::vector cursors; + std::vector> cursors; cursors.reserve(len); PriorityQueue pq(len); @@ -103,14 +100,13 @@ public: size_t attemp_reccnt = 0; for (size_t i = 0; i < len; ++i) { - //assert(runs[i]); if (runs[i]) { auto base = runs[i]->sorted_output(); cursors.emplace_back(Cursor{base, base + runs[i]->get_record_count(), 0, runs[i]->get_record_count()}); attemp_reccnt += runs[i]->get_record_count(); pq.push(cursors[i].ptr, i); } else { - cursors.emplace_back(Cursor{nullptr, nullptr, 0, 0}); + cursors.emplace_back(Cursor{nullptr, nullptr, 0, 0}); } } @@ -127,8 +123,8 @@ public: pq.pop(); pq.pop(); auto& cursor1 = cursors[now.version]; auto& cursor2 = cursors[next.version]; - if (advance_cursor(cursor1)) pq.push(cursor1.ptr, now.version); - if (advance_cursor(cursor2)) pq.push(cursor2.ptr, next.version); + if (advance_cursor(cursor1)) pq.push(cursor1.ptr, now.version); + if (advance_cursor(cursor2)) pq.push(cursor2.ptr, next.version); } else { auto& cursor = cursors[now.version]; if (!m_tagging || !cursor.ptr->get_delete_status()) { @@ -141,7 +137,7 @@ public: } pq.pop(); - if (advance_cursor(cursor)) pq.push(cursor.ptr, now.version); + if (advance_cursor(cursor)) pq.push(cursor.ptr, now.version); } } @@ -224,7 +220,6 @@ public: } } - //assert(tot_weight > 0.0); std::vector weights; for (const auto& node: res->nodes) { weights.emplace_back(node->weight / tot_weight); @@ -263,7 +258,6 @@ public: // bounds rejection if (lower_key > record->key || upper_key < record->key) { - bounds_rejections++; continue; } -- cgit v1.2.3