@@ -28,6 +28,9 @@ impl SimpleLeveledCompactionController {
|
||||
Self { options }
|
||||
}
|
||||
|
||||
/// Generates a compaction task.
|
||||
///
|
||||
/// Returns `None` if no compaction needs to be scheduled. The order of SSTs in the compaction task id vector matters.
|
||||
pub fn generate_compaction_task(
|
||||
&self,
|
||||
snapshot: &LsmStorageState,
|
||||
@@ -68,6 +71,13 @@ impl SimpleLeveledCompactionController {
|
||||
None
|
||||
}
|
||||
|
||||
/// Apply the compaction result.
|
||||
///
|
||||
/// The compactor will call this function with the compaction task and the list of SST ids generated. This function applies the
|
||||
/// result and generates a new LSM state. The functions should only change `l0_sstables` and `levels` without changing memtables
|
||||
/// and `sstables` hash map. Though there should only be one thread running compaction jobs, you should think about the case
|
||||
/// where an L0 SST gets flushed while the compactor generates new SSTs, and with that in mind, you should do some sanity checks
|
||||
/// in your implementation.
|
||||
pub fn apply_compaction_result(
|
||||
&self,
|
||||
snapshot: &LsmStorageState,
|
||||
|
||||
Reference in New Issue
Block a user