-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from moka-rs/evict-more-entries-at-once
Make a single call to `run_pending_tasks` to evict as many entries as possible from the cache
- Loading branch information
Showing
13 changed files
with
1,120 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
pub(crate) const MAX_SYNC_REPEATS: usize = 4; | ||
pub(crate) const PERIODICAL_SYNC_INITIAL_DELAY_MILLIS: u64 = 300; | ||
pub(crate) const DEFAULT_MAX_LOG_SYNC_REPEATS: usize = 4; | ||
pub(crate) const LOG_SYNC_INTERVAL_MILLIS: u64 = 300; | ||
|
||
pub(crate) const READ_LOG_FLUSH_POINT: usize = 512; | ||
pub(crate) const READ_LOG_SIZE: usize = READ_LOG_FLUSH_POINT * (MAX_SYNC_REPEATS + 2); | ||
pub(crate) const READ_LOG_FLUSH_POINT: usize = 64; | ||
pub(crate) const WRITE_LOG_FLUSH_POINT: usize = 64; | ||
|
||
pub(crate) const WRITE_LOG_FLUSH_POINT: usize = 512; | ||
pub(crate) const WRITE_LOG_SIZE: usize = WRITE_LOG_FLUSH_POINT * (MAX_SYNC_REPEATS + 2); | ||
// 384 elements | ||
pub(crate) const READ_LOG_CH_SIZE: usize = | ||
READ_LOG_FLUSH_POINT * (DEFAULT_MAX_LOG_SYNC_REPEATS + 2); | ||
|
||
// 384 elements | ||
pub(crate) const WRITE_LOG_CH_SIZE: usize = | ||
WRITE_LOG_FLUSH_POINT * (DEFAULT_MAX_LOG_SYNC_REPEATS + 2); | ||
|
||
// TODO: Calculate the batch size based on the number of entries in the cache (or an | ||
// estimated number of entries to evict) | ||
pub(crate) const DEFAULT_EVICTION_BATCH_SIZE: u32 = WRITE_LOG_CH_SIZE as u32; | ||
|
||
/// The default timeout duration for the `run_pending_tasks` method. | ||
pub(crate) const DEFAULT_MAINTENANCE_TASK_TIMEOUT_MILLIS: u64 = 100; | ||
|
||
#[cfg(feature = "sync")] | ||
pub(crate) const WRITE_RETRY_INTERVAL_MICROS: u64 = 50; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.