hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [hbase] branch branch-2.3 updated: Revert "HBASE-25938 The SnapshotOfRegionAssignmentFromMeta.initialize call in FavoredNodeLoadBalancer is just a dummy one (#3329)"
Date Tue, 01 Jun 2021 22:36:55 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new 075c055  Revert "HBASE-25938 The SnapshotOfRegionAssignmentFromMeta.initialize call
in FavoredNodeLoadBalancer is just a dummy one (#3329)"
075c055 is described below

commit 075c055c871ec0b7271114fc24e24d7eb92180cc
Author: stack <stack@apache.org>
AuthorDate: Tue Jun 1 15:35:12 2021 -0700

    Revert "HBASE-25938 The SnapshotOfRegionAssignmentFromMeta.initialize call in FavoredNodeLoadBalancer
is just a dummy one (#3329)"
    
    This reverts commit 0620f08bdf4a28ff8e80db31d1e655b8abca7fbb.
    
    Mistakenly pushed on branch-2.3
---
 .../apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java
index fc311e5..5845f2c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.favored.FavoredNodesPlan.Position;
 import org.apache.hadoop.hbase.master.RackManager;
 import org.apache.hadoop.hbase.master.RegionPlan;
 import org.apache.hadoop.hbase.master.ServerManager;
+import org.apache.hadoop.hbase.master.SnapshotOfRegionAssignmentFromMeta;
 import org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.yetus.audience.InterfaceAudience;
@@ -91,6 +92,17 @@ public class FavoredNodeLoadBalancer extends BaseLoadBalancer implements
Favored
       Map<ServerName, List<RegionInfo>> loadOfOneTable) {
     // TODO. Look at is whether Stochastic loadbalancer can be integrated with this
     List<RegionPlan> plans = new ArrayList<>();
+    // perform a scan of the meta to get the latest updates (if any)
+    SnapshotOfRegionAssignmentFromMeta snaphotOfRegionAssignment =
+        new SnapshotOfRegionAssignmentFromMeta(super.services.getConnection());
+    try {
+      snaphotOfRegionAssignment.initialize();
+    } catch (IOException ie) {
+      LOG.warn("Not running balancer since exception was thrown " + ie);
+      return plans;
+    }
+    // This is not used? Findbugs says so: Map<ServerName, ServerName>
+    // serverNameToServerNameWithoutCode = new HashMap<>();
     Map<ServerName, ServerName> serverNameWithoutCodeToServerName = new HashMap<>();
     ServerManager serverMgr = super.services.getServerManager();
     for (ServerName sn : serverMgr.getOnlineServersList()) {

Mime
View raw message