You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2024/01/26 10:41:38 UTC

(hbase) branch branch-2.4 updated: HBASE-28332 Type conversion is no need in method CompactionChecker.chore() (#5653)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 5bb7e5d5e70 HBASE-28332 Type conversion is no need in method CompactionChecker.chore() (#5653)
5bb7e5d5e70 is described below

commit 5bb7e5d5e707ab6ab464c30ed914696f6a223402
Author: guluo <lu...@qq.com>
AuthorDate: Fri Jan 26 18:17:22 2024 +0800

    HBASE-28332 Type conversion is no need in method CompactionChecker.chore() (#5653)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit addb4e7fc3c0b6e486281033499b6de1f368d686)
---
 .../java/org/apache/hadoop/hbase/regionserver/HRegionServer.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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 2bed2a95cb5..f521706f887 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
@@ -1848,13 +1848,12 @@ public class HRegionServer extends Thread
 
     @Override
     protected void chore() {
-      for (Region r : this.instance.onlineRegions.values()) {
+      for (HRegion hr : this.instance.onlineRegions.values()) {
         // If region is read only or compaction is disabled at table level, there's no need to
         // iterate through region's stores
-        if (r == null || r.isReadOnly() || !r.getTableDescriptor().isCompactionEnabled()) {
+        if (hr == null || hr.isReadOnly() || !hr.getTableDescriptor().isCompactionEnabled()) {
           continue;
         }
-        HRegion hr = (HRegion) r;
         for (HStore s : hr.stores.values()) {
           try {
             long multiplier = s.getCompactionCheckMultiplier();
@@ -1882,7 +1881,7 @@ public class HRegionServer extends Thread
               }
             }
           } catch (IOException e) {
-            LOG.warn("Failed major compaction check on " + r, e);
+            LOG.warn("Failed major compaction check on " + hr, e);
           }
         }
       }