diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2025-01-17 17:28:50 -0500 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2025-01-17 17:28:50 -0500 |
| commit | 6c906c94e1eea6d4356b8c99b93da39029e8d95d (patch) | |
| tree | 8c5cd0d5bc5186cf6f19b29a94d424224a1cde8e /include/framework/reconstruction/FixedShardCountPolicy.h | |
| parent | 77589d4cc82b766d2cf16294fab98a57f6579cb4 (diff) | |
| download | dynamic-extension-6c906c94e1eea6d4356b8c99b93da39029e8d95d.tar.gz | |
Progress
Diffstat (limited to 'include/framework/reconstruction/FixedShardCountPolicy.h')
| -rw-r--r-- | include/framework/reconstruction/FixedShardCountPolicy.h | 25 |
1 files changed, 15 insertions, 10 deletions
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<ShardType, QueryType> *epoch, + get_reconstruction_tasks(const Version<ShardType, QueryType> *version, size_t incoming_reccnt) const override { ReconstructionVector reconstructions; return reconstructions; } - ReconstructionTask - get_flush_task(const Epoch<ShardType, QueryType> *epoch) const override { + ReconstructionVector + get_flush_tasks(const Version<ShardType, QueryType> *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; } } |