From 55fefd4b5a43ab7221a08a1410a113b9c41bbd60 Mon Sep 17 00:00:00 2001 From: Guangxu Cheng Date: Wed, 20 Dec 2017 11:59:06 +0800 Subject: [PATCH] HBASE-19561 maxCacheSize in CacheEvictionStats can't be accumulated repeatedly When dealing with each region Signed-off-by: tedyu --- .../java/org/apache/hadoop/hbase/regionserver/HRegionServer.java | 1 - .../java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index e2d6ba061bc..3a7680a99ac 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -3632,7 +3632,6 @@ public class HRegionServer extends HasThread implements return CacheEvictionStats.builder() .withEvictedBlocks(evictedBlocks) - .withMaxCacheSize(blockCache.getMaxSize()) .build(); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java index a77856aaa67..1bcb70f3db2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java @@ -3462,6 +3462,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler, stats.addException(region.getRegionInfo().getRegionName(), e); } } + stats.withMaxCacheSize(regionServer.getCacheConfig().getBlockCache().getMaxSize()); return builder.setStats(ProtobufUtil.toCacheEvictionStats(stats.build())).build(); } }