Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-23887 Bug fix heavyEvictionMbSizeLimit (AdaptiveLRU cache) #2957

Merged
merged 4 commits into from
Feb 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ public LruAdaptiveBlockCache(long maxSize, long blockSize, Configuration conf) {
* @param singleFactor percentage of total size for single-access blocks
* @param multiFactor percentage of total size for multiple-access blocks
* @param memoryFactor percentage of total size for in-memory blocks
* @param hardLimitFactor hard capacity limit
* @param forceInMemory in-memory hfile's data block has higher priority when evicting
* @param maxBlockSize maximum block size for caching
* @param heavyEvictionCountLimit when starts AdaptiveLRU algoritm work
* @param heavyEvictionMbSizeLimit how many bytes desirable putting into BlockCache
* @param heavyEvictionOverheadCoefficient how aggressive AdaptiveLRU will reduce GC
*/
public LruAdaptiveBlockCache(long maxSize, long blockSize, boolean evictionThread,
int mapInitialSize, float mapLoadFactor, int mapConcurrencyLevel,
Expand Down Expand Up @@ -434,7 +440,7 @@ public LruAdaptiveBlockCache(long maxSize, long blockSize, boolean evictionThrea

// check the bounds
this.heavyEvictionCountLimit = Math.max(heavyEvictionCountLimit, 0);
this.heavyEvictionMbSizeLimit = Math.max(heavyEvictionCountLimit, 1);
this.heavyEvictionMbSizeLimit = Math.max(heavyEvictionMbSizeLimit, 1);
this.cacheDataBlockPercent = 100;
heavyEvictionOverheadCoefficient = Math.min(heavyEvictionOverheadCoefficient, 1.0f);
heavyEvictionOverheadCoefficient = Math.max(heavyEvictionOverheadCoefficient, 0.001f);
Expand Down