From 6c906c94e1eea6d4356b8c99b93da39029e8d95d Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 17 Jan 2025 17:28:50 -0500 Subject: Progress --- .../reconstruction/FixedShardCountPolicy.h | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'include/framework/reconstruction/FixedShardCountPolicy.h') diff --git a/include/framework/reconstruction/FixedShardCountPolicy.h b/include/framework/reconstruction/FixedShardCountPolicy.h index ec8e4e6..2a3c977 100644 --- a/include/framework/reconstruction/FixedShardCountPolicy.h +++ b/include/framework/reconstruction/FixedShardCountPolicy.h @@ -25,31 +25,36 @@ public: : m_buffer_size(buffer_size), m_shard_count(shard_count), m_max_reccnt(max_record_count) {} ReconstructionVector - get_reconstruction_tasks(const Epoch *epoch, + get_reconstruction_tasks(const Version *version, size_t incoming_reccnt) const override { ReconstructionVector reconstructions; return reconstructions; } - ReconstructionTask - get_flush_task(const Epoch *epoch) const override { + ReconstructionVector + get_flush_tasks(const Version *version) const override { + + auto levels = version->get_structure()->get_level_vector(); - auto levels = epoch->get_structure()->get_level_vector(); + ReconstructionVector v; if (levels.size() == 0) { - return ReconstructionTask{ - {{buffer_shid}}, 0, m_buffer_size, ReconstructionType::Append}; + v.add_reconstruction(ReconstructionTask{ + {{buffer_shid}}, 0, m_buffer_size, ReconstructionType::Append}); + return v; } ShardID last_shid = {0, (shard_index) (levels[0]->get_shard_count() - 1)}; if (levels[0]->get_shard(last_shid.shard_idx)->get_record_count() + m_buffer_size <= capacity()) { - return ReconstructionTask{ - {{buffer_shid, last_shid}}, 0, m_buffer_size, ReconstructionType::Merge}; + v.add_reconstruction(ReconstructionTask{ + {{buffer_shid, last_shid}}, 0, m_buffer_size, ReconstructionType::Merge}); + return v; } else { - return ReconstructionTask{ - {{buffer_shid}}, 0, m_buffer_size, ReconstructionType::Append}; + v.add_reconstruction(ReconstructionTask{ + {{buffer_shid}}, 0, m_buffer_size, ReconstructionType::Append}); + return v; } } -- cgit v1.2.3