Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xxhZs committed Aug 27, 2024
1 parent 63b4d47 commit 98871b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/storage/hummock_sdk/src/change_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,16 @@ impl TableChangeLog {
&self.0[start..end]
}

/// Returns epochs where value is non-null and >= `min_epoch`.
pub fn get_epochs(&self, min_epoch: u64, max_count: usize) -> Vec<u64> {
self.filter_epoch((min_epoch, u64::MAX))
.iter()
.filter(|epoch_change_log| {
// Filter out empty change logs
let new_value_empty = epoch_change_log.new_value.is_empty();
let old_value_empty = epoch_change_log.old_value.is_empty();
!new_value_empty || !old_value_empty
})
.flat_map(|epoch_change_log| epoch_change_log.epochs.iter().cloned())
.filter(|a| a >= &min_epoch)
.clone()
Expand Down

0 comments on commit 98871b8

Please sign in to comment.