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:43:27 UTC

(hbase) branch branch-2 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
in repository https://gitbox.apache.org/repos/asf/hbase.git


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

commit 810b4c858c178120e6553d1c72914fd6cb324bce
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 5bd10f7515d..d223dc97024 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
@@ -1992,13 +1992,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();
@@ -2026,7 +2025,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);
           }
         }
       }