From commits-return-91108-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Wed Jan 8 11:04:39 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id BBFCC180607 for ; Wed, 8 Jan 2020 12:04:38 +0100 (CET) Received: (qmail 96778 invoked by uid 500); 8 Jan 2020 11:04:38 -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 96768 invoked by uid 99); 8 Jan 2020 11:04:38 -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; Wed, 08 Jan 2020 11:04:38 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id CC20C8D80D; Wed, 8 Jan 2020 11:04:37 +0000 (UTC) Date: Wed, 08 Jan 2020 11:04:37 +0000 To: "commits@hbase.apache.org" Subject: [hbase] branch branch-2.2 updated: HBASE-23651 Region balance throttling can be disabled (#991) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <157848147749.18999.1414385565770857508@gitbox.apache.org> From: binlijin@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: hbase X-Git-Refname: refs/heads/branch-2.2 X-Git-Reftype: branch X-Git-Oldrev: 6d22b7c255da7bb5d2ad1699e4d7974677b0a8e3 X-Git-Newrev: c47f9e6d74e0e64c045cada67167a2ece363a1b4 X-Git-Rev: c47f9e6d74e0e64c045cada67167a2ece363a1b4 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. binlijin pushed a commit to branch branch-2.2 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.2 by this push: new c47f9e6 HBASE-23651 Region balance throttling can be disabled (#991) c47f9e6 is described below commit c47f9e6d74e0e64c045cada67167a2ece363a1b4 Author: binlijin AuthorDate: Wed Jan 8 19:01:22 2020 +0800 HBASE-23651 Region balance throttling can be disabled (#991) Signed-off-by: Viraj Jasani Signed-off-by: Anoop Sam John --- .../java/org/apache/hadoop/hbase/master/HMaster.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 90b8309..b1bf37c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -1585,12 +1585,10 @@ public class HMaster extends HRegionServer implements MasterServices { * @return Maximum time we should run balancer for */ private int getMaxBalancingTime() { - int maxBalancingTime = getConfiguration().getInt(HConstants.HBASE_BALANCER_MAX_BALANCING, -1); - if (maxBalancingTime == -1) { - // if max balancing time isn't set, defaulting it to period time - maxBalancingTime = getConfiguration().getInt(HConstants.HBASE_BALANCER_PERIOD, - HConstants.DEFAULT_HBASE_BALANCER_PERIOD); - } + // if max balancing time isn't set, defaulting it to period time + int maxBalancingTime = getConfiguration().getInt(HConstants.HBASE_BALANCER_MAX_BALANCING, + getConfiguration() + .getInt(HConstants.HBASE_BALANCER_PERIOD, HConstants.DEFAULT_HBASE_BALANCER_PERIOD)); return maxBalancingTime; } @@ -1757,11 +1755,14 @@ public class HMaster extends HRegionServer implements MasterServices { //rpCount records balance plans processed, does not care if a plan succeeds rpCount++; - balanceThrottling(balanceStartTime + rpCount * balanceInterval, maxRegionsInTransition, + if (this.maxBlancingTime > 0) { + balanceThrottling(balanceStartTime + rpCount * balanceInterval, maxRegionsInTransition, cutoffTime); + } // if performing next balance exceeds cutoff time, exit the loop - if (rpCount < plans.size() && System.currentTimeMillis() > cutoffTime) { + if (this.maxBlancingTime > 0 && rpCount < plans.size() + && System.currentTimeMillis() > cutoffTime) { // TODO: After balance, there should not be a cutoff time (keeping it as // a security net for now) LOG.debug("No more balancing till next balance run; maxBalanceTime="