From 2544bc1b2e71664eff89e814504e23ae00c9b41b Mon Sep 17 00:00:00 2001 From: pustota2009 Date: Sun, 14 Feb 2021 12:37:47 +0300 Subject: [PATCH 1/4] bug fix heavyEvictionMbSizeLimit --- .../org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java index 083f1098af5c..8980d6f1387f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java @@ -434,7 +434,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); From 7ffac64bb801cfb5529f91f9663d42b172d12ba9 Mon Sep 17 00:00:00 2001 From: pustota2009 Date: Sun, 14 Feb 2021 13:32:16 +0300 Subject: [PATCH 2/4] fix javadoc --- .../hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java index 8980d6f1387f..d756692b9e0e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java @@ -1,4 +1,5 @@ -/** +* @param memoryFactor percentage of total size for in-memory blocks + /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -388,6 +389,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, From 1ec7fc965491c4667b4b2e82acd3f4b4557d46c5 Mon Sep 17 00:00:00 2001 From: pustota2009 <61382543+pustota2009@users.noreply.github.com> Date: Sun, 14 Feb 2021 16:42:24 +0300 Subject: [PATCH 3/4] Update LruAdaptiveBlockCache.java fix codestile --- .../apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java index d756692b9e0e..aff78a02eae7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java @@ -1,5 +1,4 @@ -* @param memoryFactor percentage of total size for in-memory blocks - /** +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information From aeb8149959ad70f5625b221ae59df9802536805a Mon Sep 17 00:00:00 2001 From: pustota2009 <61382543+pustota2009@users.noreply.github.com> Date: Sun, 14 Feb 2021 16:44:53 +0300 Subject: [PATCH 4/4] Update LruAdaptiveBlockCache.java --- .../org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java index aff78a02eae7..99a3a2b5a21b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruAdaptiveBlockCache.java @@ -1,4 +1,4 @@ -/* +/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information