summaryrefslogtreecommitdiffstats
path: root/include/framework/structure/ExtensionStructure.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/framework/structure/ExtensionStructure.h')
-rw-r--r--include/framework/structure/ExtensionStructure.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/framework/structure/ExtensionStructure.h b/include/framework/structure/ExtensionStructure.h
index 078c4a9..29a45e5 100644
--- a/include/framework/structure/ExtensionStructure.h
+++ b/include/framework/structure/ExtensionStructure.h
@@ -161,13 +161,15 @@ public:
/* perform the reconstruction itself */
std::vector<const ShardType *> shards;
for (ShardID shid : task.sources) {
- assert(shid.level_idx < (level_index) m_levels.size());
+ assert(shid.level_idx <= (level_index) m_levels.size());
assert(shid.shard_idx >= -1);
if (shid == buffer_shid) {
assert(bv);
ShardType *buffer_shard = new ShardType(std::move(*bv));
shards.push_back(buffer_shard);
+ } else if (shid.level_idx == (level_index) m_levels.size()) {
+ continue;
} else if (shid.shard_idx == all_shards_idx) {
/* if unspecified, push all shards into the vector */
for (size_t i = 0; i < m_levels[shid.level_idx]->get_shard_count(); i++) {
@@ -188,6 +190,8 @@ public:
for (ShardID shid : task.sources) {
if (shid == buffer_shid) {
continue;
+ } else if (shid.level_idx == (level_index) m_levels.size()) {
+ continue;
} else if (shid.shard_idx == all_shards_idx) {
m_levels[shid.level_idx]->truncate();
} else {
@@ -315,6 +319,22 @@ public:
return ts_prop <= (long double) max_delete_prop;
}
+ void print_structure() const {
+ for (size_t i=0; i<m_levels.size(); i++) {
+ fprintf(stdout, "[%ld]:\t", i);
+
+ if (m_levels[i]) {
+ for (size_t j=0; j<m_levels[i]->get_shard_count(); j++) {
+ fprintf(stdout, "(%ld: %ld) ", j, m_levels[i]->get_shard(j)->get_record_count());
+ }
+ } else {
+ fprintf(stdout, "[Empty]");
+ }
+
+ fprintf(stdout, "\n");
+ }
+ }
+
private:
std::atomic<size_t> m_refcnt;
LevelVector m_levels;