From cf5f3bbb0cb58430ed68ad3ebfcefc009e553d71 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Thu, 25 Sep 2025 14:42:44 -0400 Subject: Code reformatting --- .../reconstruction/FixedShardCountPolicy.h | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'include/framework/reconstruction/FixedShardCountPolicy.h') diff --git a/include/framework/reconstruction/FixedShardCountPolicy.h b/include/framework/reconstruction/FixedShardCountPolicy.h index cc8dce4..52d9f39 100644 --- a/include/framework/reconstruction/FixedShardCountPolicy.h +++ b/include/framework/reconstruction/FixedShardCountPolicy.h @@ -16,16 +16,20 @@ namespace de { template QueryType> -class FixedShardCountPolicy : public ReconstructionPolicy { +class FixedShardCountPolicy + : public ReconstructionPolicy { typedef std::vector>> LevelVector; public: - FixedShardCountPolicy(size_t buffer_size, size_t shard_count, size_t max_record_count) - : m_buffer_size(buffer_size), m_shard_count(shard_count), m_max_reccnt(max_record_count) {} + FixedShardCountPolicy(size_t buffer_size, size_t shard_count, + size_t max_record_count) + : m_buffer_size(buffer_size), m_shard_count(shard_count), + m_max_reccnt(max_record_count) {} std::vector - get_reconstruction_tasks(const Version *version, LockManager &lock_mngr) const override { + get_reconstruction_tasks(const Version *version, + LockManager &lock_mngr) const override { return {}; } @@ -37,26 +41,26 @@ public: /* if this is the very first flush, there won't be an L1 yet */ if (levels.size() > 1 && levels[1]->get_shard_count() > 0) { - ShardID last_shid = {1, (shard_index) (levels[1]->get_shard_count() - 1)}; - if (levels[1]->get_shard(last_shid.shard_idx)->get_record_count() + m_buffer_size <= capacity()) { - auto task = ReconstructionTask { - {{0, 0}, last_shid}, 1, m_buffer_size,ReconstructionType::Merge - }; + ShardID last_shid = {1, (shard_index)(levels[1]->get_shard_count() - 1)}; + if (levels[1]->get_shard(last_shid.shard_idx)->get_record_count() + + m_buffer_size <= + capacity()) { + auto task = ReconstructionTask{ + {{0, 0}, last_shid}, 1, m_buffer_size, ReconstructionType::Merge}; v.add_reconstruction(task); return v; } } - auto task = ReconstructionTask { - {{0, 0}}, 1, m_buffer_size, ReconstructionType::Append - }; + auto task = ReconstructionTask{ + {{0, 0}}, 1, m_buffer_size, ReconstructionType::Append}; v.add_reconstruction(task); return v; } private: inline size_t capacity() const { - double bps = (double) m_max_reccnt / (double) m_buffer_size / m_shard_count; + double bps = (double)m_max_reccnt / (double)m_buffer_size / m_shard_count; return ceil(bps) * m_buffer_size; } -- cgit v1.2.3