summaryrefslogtreecommitdiffstats
path: root/include/framework/DynamicExtension.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-12-21 17:07:29 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2023-12-21 17:07:29 -0500
commit8113b32d124f487856a858c7f68a4e531399f66d (patch)
treed755aa05f9cbff4bb8262c64e2a72914acd59ecd /include/framework/DynamicExtension.h
parent46dfe1e0f3bb05016da14b39b2e35babbba4027a (diff)
downloaddynamic-extension-8113b32d124f487856a858c7f68a4e531399f66d.tar.gz
DynamicExtension: comments/reorganization
Clarified the reasoning for a few things in comments that just tripped me up during debugging.
Diffstat (limited to 'include/framework/DynamicExtension.h')
-rw-r--r--include/framework/DynamicExtension.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/include/framework/DynamicExtension.h b/include/framework/DynamicExtension.h
index fe43c52..c5c4a1a 100644
--- a/include/framework/DynamicExtension.h
+++ b/include/framework/DynamicExtension.h
@@ -261,23 +261,29 @@ private:
auto compactions = structure->get_compaction_tasks();
while (compactions.size() > 0) {
- /* otherwise, we need to schedule a compaction */
+
+ /* schedule a compaction */
ReconstructionArgs<R, S, Q, L> *args = new ReconstructionArgs<R, S, Q, L>();
args->epoch = epoch;
- // FIXME: all full buffers can be flushed at this point--but that requires
- // retooling the shard interface a bit to do efficiently.
args->merges = compactions;
args->extension = this;
args->compaction = true;
+ /* NOTE: args is deleted by the reconstruction job, so shouldn't be freed here */
auto wait = args->result.get_future();
+ /*
+ * the reconstruction process calls end_job(),
+ * so we must start one before calling it
+ */
epoch->start_job();
+
m_sched.schedule_job(reconstruction, 0, args);
- /* wait for reconstruction completion */
+ /* wait for compaction completion */
wait.get();
+ /* get a new batch of compactions to perform, if needed */
compactions = structure->get_compaction_tasks();
}
}
@@ -557,17 +563,23 @@ private:
}
void schedule_reconstruction() {
- //fprintf(stderr, "%ld\t Reconstruction Scheduling", m_current_epoch);
auto epoch = create_new_epoch();
+ /*
+ * the reconstruction process calls end_job(),
+ * so we must start one before calling it
+ */
epoch->start_job();
- ReconstructionArgs<R, S, Q, L> *args = new ReconstructionArgs<R, S, Q, L>();
- args->epoch = epoch;
// FIXME: all full buffers can be flushed at this point--but that requires
// retooling the shard interface a bit to do efficiently.
+ //
+ ReconstructionArgs<R, S, Q, L> *args = new ReconstructionArgs<R, S, Q, L>();
+ args->epoch = epoch;
args->merges = epoch->get_structure()->get_reconstruction_tasks(epoch->get_buffers()[0]->get_record_count());
args->extension = this;
args->compaction = false;
+ /* NOTE: args is deleted by the reconstruction job, so shouldn't be freed here */
+
m_sched.schedule_job(reconstruction, 0, args);
}