diff --git a/quickwit/quickwit-indexing/src/merge_policy/mod.rs b/quickwit/quickwit-indexing/src/merge_policy/mod.rs index 75e405294aa..86e5098a4b2 100644 --- a/quickwit/quickwit-indexing/src/merge_policy/mod.rs +++ b/quickwit/quickwit-indexing/src/merge_policy/mod.rs @@ -108,8 +108,10 @@ impl fmt::Debug for MergeOperation { pub trait MergePolicy: Send + Sync + fmt::Debug { /// Returns the list of merge operations that should be performed. fn operations(&self, splits: &mut Vec) -> Vec; - /// Returns split maturity after which a split becomes mature. - /// A split is mature if it does not undergo new merge operations. + /// Returns split maturity. + /// A split is either: + /// - `Mature` if it does not undergo new merge operations. + /// - will become mature after a `TimeToMaturity` period of time. fn split_maturity(&self, split_num_docs: usize, split_num_merge_ops: usize) -> SplitMaturity; /// Checks a bunch of properties specific to the given merge policy. diff --git a/quickwit/quickwit-metastore/src/split_metadata.rs b/quickwit/quickwit-metastore/src/split_metadata.rs index cd772971014..7a1cd0951f9 100644 --- a/quickwit/quickwit-metastore/src/split_metadata.rs +++ b/quickwit/quickwit-metastore/src/split_metadata.rs @@ -168,10 +168,10 @@ impl SplitMetadata { } /// Returns the unix timestamp at which the split becomes mature. - /// Not that if the split is mature `SplitMaturity::Mature`, we return 0. - /// This is handy only for metastore implementations where we want to filter - /// out splits that are not mature yet and/or for persisting the maturity - /// timestamp in a database. + /// If the split is mature (`SplitMaturity::Mature`), we return 0. + /// This is handy only for metastore implementations that need to filter + /// on split maturity and/or for persisting the maturity timestamp + /// in a database. pub(crate) fn maturity_timestamp(&self) -> i64 { match self.maturity { SplitMaturity::Mature => 0, @@ -272,10 +272,10 @@ impl FromStr for SplitState { } } -/// Split maturity is determined by the `MergePolicy`. Once a split is mature, -/// it does not undergo new merge operations. +/// A split is mature if it does not undergo new merge operations. /// A split is either `Mature` or becomes mature after a given period, aka /// `TimeToMaturity`. +/// The maturity is determined by the `MergePolicy`. #[derive(Clone, Copy, Debug, Default, Eq, Serialize, Deserialize, PartialEq)] #[serde(untagged)] pub enum SplitMaturity {