-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
run_pending_tasks
to evict more entries from the cache at once
Add unit tests.
- Loading branch information
1 parent
ba9f53d
commit 092ad46
Showing
11 changed files
with
605 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +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 = 64; | ||
pub(crate) const READ_LOG_SIZE: usize = READ_LOG_FLUSH_POINT * (MAX_SYNC_REPEATS + 2); // 384 | ||
|
||
pub(crate) const WRITE_LOG_FLUSH_POINT: usize = 64; | ||
pub(crate) const WRITE_LOG_SIZE: usize = WRITE_LOG_FLUSH_POINT * (MAX_SYNC_REPEATS + 2); // 384 | ||
|
||
// 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 EVICTION_BATCH_SIZE: usize = WRITE_LOG_SIZE; | ||
pub(crate) const INVALIDATION_BATCH_SIZE: usize = WRITE_LOG_SIZE; | ||
pub(crate) const DEFAULT_EVICTION_BATCH_SIZE: usize = WRITE_LOG_CH_SIZE; | ||
|
||
/// The default timeout duration for the `run_pending_tasks` method. | ||
pub(crate) const DEFAULT_RUN_PENDING_TASKS_TIMEOUT_MILLIS: u64 = 100; | ||
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.