pustota2009 commented on a change in pull request #1257:
URL: https://github.com/apache/hbase/pull/1257#discussion_r436531585



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
##########
@@ -947,7 +1019,47 @@ public void run() {
         }
         LruBlockCache cache = this.cache.get();
         if (cache == null) break;
-        cache.evict();
+        bytesFreed = cache.evict();
+        long stopTime = System.currentTimeMillis();
+        // If heavy cleaning BlockCache control.
+        // It helps avoid put too many blocks into BlockCache
+        // when evict() works very active.
+        if (stopTime - startTime <= 1000 * 10 - 1) {
+          mbFreedSum += bytesFreed/1024/1024;
+        } else {
+          freedDataOverheadPercent =
+            (int) (mbFreedSum * 100 / cache.heavyEvictionMbSizeLimit) - 100;
+          if (mbFreedSum > cache.heavyEvictionMbSizeLimit) {
+            heavyEvictionCount++;
+            if (heavyEvictionCount > cache.heavyEvictionCountLimit) {
+              int ch = (int) (freedDataOverheadPercent * 
cache.heavyEvictionOverheadCoefficient);
+              ch = ch > 15 ? 15 : ch;

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to