-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not admit entries that exceed the maximum weight
If an entry's weight exceeds the cache's maximum capacity, then evict it immediately. This avoids flushing the probation segment, though it probably does flush the admission window (1% of the total size). Thanks to @blemale for reminding me when I peeked at his WeigherSpec test [1]. This was fixed in Guava [2], but I had forgotten to port that over after v19 was released. Also improved the correction of evaluating the admission candidates when evicting multiple entries. When a candidate is accepted or evicted the count is decremented and the next is set for evaluation. This most often occurs for weighted caches. [1] https://github.com/blemale/scaffeine [2] google/guava@b3855ef
- Loading branch information
Showing
5 changed files
with
88 additions
and
4 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
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