diff --git a/src/mito2/src/compaction.rs b/src/mito2/src/compaction.rs index b41f7319496f..424198439a88 100644 --- a/src/mito2/src/compaction.rs +++ b/src/mito2/src/compaction.rs @@ -12,6 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +mod buckets; +mod picker; +mod task; +#[cfg(test)] +mod test_util; +mod twcs; +mod window; + use std::collections::HashMap; use std::sync::Arc; use std::time::{Duration, Instant}; @@ -54,14 +62,6 @@ use crate::sst::file_purger::FilePurgerRef; use crate::sst::version::LevelMeta; use crate::worker::WorkerListener; -mod buckets; -mod picker; -mod task; -#[cfg(test)] -mod test_util; -mod twcs; -mod window; - /// Region compaction request. pub struct CompactionRequest { pub(crate) engine_config: Arc, diff --git a/src/mito2/src/compaction/window.rs b/src/mito2/src/compaction/window.rs index ccd1203a6beb..ee4f7c181c9e 100644 --- a/src/mito2/src/compaction/window.rs +++ b/src/mito2/src/compaction/window.rs @@ -191,6 +191,7 @@ fn assign_files_to_time_windows<'a>( } let (start, end) = file.time_range(); let bounds = file_time_bucket_span( + // safety: converting whatever timestamp to seconds will not overflow. start.convert_to(TimeUnit::Second).unwrap().value(), end.convert_to(TimeUnit::Second).unwrap().value(), bucket_sec,