From 1f6021037e6cdf18c3981008b6281096e7fcf304 Mon Sep 17 00:00:00 2001 From: "Lei, HUANG" Date: Wed, 22 May 2024 06:24:07 +0000 Subject: [PATCH] fix: some cr comments --- src/mito2/src/compaction.rs | 16 ++++++++-------- src/mito2/src/compaction/window.rs | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) 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,