Skip to content

Commit

Permalink
Clean docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassot committed Jul 3, 2023
1 parent 2627c04 commit 2a498a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions quickwit/quickwit-indexing/src/merge_policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SplitMetadata>) -> Vec<MergeOperation>;
/// 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.
Expand Down
12 changes: 6 additions & 6 deletions quickwit/quickwit-metastore/src/split_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2a498a3

Please sign in to comment.