summaryrefslogtreecommitdiffstats
path: root/include/framework/reconstruction/BSMPolicy.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-04-05 19:08:12 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-04-05 19:08:12 -0400
commit6bdcf74ad91e0efaa8c2e4339f5085fde8a7982b (patch)
tree0cd8037f9c9a35966c3022329716a2dc73e2abbb /include/framework/reconstruction/BSMPolicy.h
parentdddb68e5479a047014f5eec4071fb8e96884354c (diff)
downloaddynamic-extension-6bdcf74ad91e0efaa8c2e4339f5085fde8a7982b.tar.gz
working commit (temporary progress, doesn't build)
Diffstat (limited to 'include/framework/reconstruction/BSMPolicy.h')
-rw-r--r--include/framework/reconstruction/BSMPolicy.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/framework/reconstruction/BSMPolicy.h b/include/framework/reconstruction/BSMPolicy.h
index 6d55a12..ae17182 100644
--- a/include/framework/reconstruction/BSMPolicy.h
+++ b/include/framework/reconstruction/BSMPolicy.h
@@ -21,8 +21,8 @@ class BSMPolicy : public ReconstructionPolicy<ShardType, QueryType> {
LevelVector;
public:
- BSMPolicy(size_t buffer_size)
- : m_scale_factor(2), m_buffer_size(buffer_size) {}
+ BSMPolicy(size_t buffer_size, size_t scale_factor, size_t modifier=0)
+ : m_scale_factor(scale_factor), m_buffer_size(buffer_size), m_size_modifier(modifier) {}
std::vector<ReconstructionVector>
get_reconstruction_tasks(const Version<ShardType, QueryType> *version, LockManager &lock_mngr) const override {
@@ -79,11 +79,13 @@ private:
return target_level;
}
- inline size_t capacity(level_index level) const {
- return m_buffer_size * pow(m_scale_factor, level + 1);
+ inline size_t capacity(level_index level, size_t reccnt) const {
+ size_t base = m_scale_factor * pow(log(reccnt), m_size_modifier);
+ return m_buffer_size * (base - 1) * pow(base, level + 1);
}
size_t m_scale_factor;
size_t m_buffer_size;
+ size_t m_size_modifier;
};
} // namespace de