summaryrefslogtreecommitdiffstats
path: root/include/framework/structure
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-09-17 18:27:56 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-09-17 18:27:56 -0400
commit42cb6e2b446a2879cf9bf2f4642f926c15584cb3 (patch)
tree2ae610890630bcb75c0df9335a8735385f11a069 /include/framework/structure
parent79dcefa5002f6411e05169a226ae9e3cd1114bd7 (diff)
downloaddynamic-extension-42cb6e2b446a2879cf9bf2f4642f926c15584cb3.tar.gz
Beginnings of per-level cost modeling
The total time required for each shard construction is now measured, and hooks have been added to InternalLevel to support the creation and use of per-level cost models. The appropriate calls to these functions are now made during reconstruction, but the scheduling process doesn't yet call them, nor are the models actually implemented.
Diffstat (limited to 'include/framework/structure')
-rw-r--r--include/framework/structure/ExtensionStructure.h15
-rw-r--r--include/framework/structure/InternalLevel.h8
2 files changed, 23 insertions, 0 deletions
diff --git a/include/framework/structure/ExtensionStructure.h b/include/framework/structure/ExtensionStructure.h
index 0fd737c..bb8a480 100644
--- a/include/framework/structure/ExtensionStructure.h
+++ b/include/framework/structure/ExtensionStructure.h
@@ -10,6 +10,7 @@
#pragma once
#include <atomic>
+#include <chrono>
#include <cstdio>
#include <memory>
#include <vector>
@@ -196,7 +197,13 @@ public:
result.source_shards.emplace_back(shid.level_idx, raw_shard_ptr);
}
+
+ auto start = std::chrono::high_resolution_clock::now();
result.new_shard = std::make_shared<ShardType>(shards);
+ auto stop = std::chrono::high_resolution_clock::now();
+
+ result.runtime = std::chrono::duration_cast<std::chrono::nanoseconds>(stop- start).count();
+ result.reccnt = result.new_shard->get_record_count();
return result;
}
@@ -218,6 +225,14 @@ public:
return m_levels[0]->get_shard_count();
}
+ bool apply_reconstruction(reconstruction_results<ShardType> &recon, size_t version) {
+ bool res = append_shard(recon.new_shard, version, recon.target_level);
+ m_levels[recon.target_level]->update_reconstruction_model(recon);
+ delete_shards(recon.source_shards);
+
+ return res;
+ }
+
bool append_shard(std::shared_ptr<ShardType> shard, size_t version, size_t level) {
assert(level <= m_levels.size());
auto rc = false;
diff --git a/include/framework/structure/InternalLevel.h b/include/framework/structure/InternalLevel.h
index 54b3ae2..1dee359 100644
--- a/include/framework/structure/InternalLevel.h
+++ b/include/framework/structure/InternalLevel.h
@@ -233,6 +233,14 @@ public:
}
}
+ long predict_reconstruction_time(size_t reccnt) {
+ return 0;
+ }
+
+ void update_reconstruction_model(reconstruction_results<ShardType> &recon) {
+
+ }
+
private:
ssize_t m_level_no;
std::vector<shard_ptr> m_shards;