From commits-return-98702-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Tue Jun 1 22:36:59 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 7C7A3180636 for ; Wed, 2 Jun 2021 00:36:59 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id E4C3860B48 for ; Tue, 1 Jun 2021 22:36:58 +0000 (UTC) Received: (qmail 80324 invoked by uid 500); 1 Jun 2021 22:36:58 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 80315 invoked by uid 99); 1 Jun 2021 22:36:58 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jun 2021 22:36:58 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id DE1B781A86; Tue, 1 Jun 2021 22:36:57 +0000 (UTC) Date: Tue, 01 Jun 2021 22:36:55 +0000 To: "commits@hbase.apache.org" Subject: [hbase] branch branch-2.3 updated: Revert "HBASE-25938 The SnapshotOfRegionAssignmentFromMeta.initialize call in FavoredNodeLoadBalancer is just a dummy one (#3329)" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <162258701343.506.705404701373119145@gitbox.apache.org> From: stack@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: hbase X-Git-Refname: refs/heads/branch-2.3 X-Git-Reftype: branch X-Git-Oldrev: 328d57119047629de929fbe802ca59e51475daca X-Git-Newrev: 075c055c871ec0b7271114fc24e24d7eb92180cc X-Git-Rev: 075c055c871ec0b7271114fc24e24d7eb92180cc X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 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> loadOfOneTable) { // TODO. Look at is whether Stochastic loadbalancer can be integrated with this List 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 + // serverNameToServerNameWithoutCode = new HashMap<>(); Map serverNameWithoutCodeToServerName = new HashMap<>(); ServerManager serverMgr = super.services.getServerManager(); for (ServerName sn : serverMgr.getOnlineServersList()) {