summaryrefslogtreecommitdiffstats
path: root/include/framework/structure/InternalLevel.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-01-16 13:18:37 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2025-01-16 13:18:37 -0500
commit77589d4cc82b766d2cf16294fab98a57f6579cb4 (patch)
tree0cc136d13c20021e0278b8b2ededf2652c27a84e /include/framework/structure/InternalLevel.h
parentbac86504220da4c169089a3a1803e0a21f5acbc2 (diff)
downloaddynamic-extension-77589d4cc82b766d2cf16294fab98a57f6579cb4.tar.gz
Additional layout policies + more flexibility in buffer flushing
Diffstat (limited to 'include/framework/structure/InternalLevel.h')
-rw-r--r--include/framework/structure/InternalLevel.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/framework/structure/InternalLevel.h b/include/framework/structure/InternalLevel.h
index c9d1749..5bc891b 100644
--- a/include/framework/structure/InternalLevel.h
+++ b/include/framework/structure/InternalLevel.h
@@ -166,6 +166,17 @@ public:
return (double)tscnt / (double)(tscnt + reccnt);
}
+ size_t get_nonempty_shard_count() const {
+ size_t cnt = 0;
+ for (size_t i = 0; i < m_shards.size(); i++) {
+ if (m_shards[i] && m_shards[i]->get_record_count() > 0) {
+ cnt += 1;
+ }
+ }
+
+ return cnt;
+ }
+
std::shared_ptr<InternalLevel> clone() const {
auto new_level = std::make_shared<InternalLevel>(m_level_no);
for (size_t i = 0; i < m_shards.size(); i++) {
@@ -185,6 +196,14 @@ public:
m_shards.emplace_back(shard);
}
+ const ShardType *get_shard(ShardID shid) const {
+ if (shid < m_shards.size()) {
+ return m_shards[shid].get();
+ }
+
+ return nullptr;
+ }
+
private:
ssize_t m_level_no;
std::vector<std::shared_ptr<ShardType>> m_shards;