Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1688,12 +1688,10 @@ InetAddress getRemoteInetAddress(final int port,
* @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;
}

Expand Down Expand Up @@ -1860,11 +1858,14 @@ public List<RegionPlan> executeRegionPlansWithThrottling(List<RegionPlan> plans)
//rpCount records balance plans processed, does not care if a plan succeeds
rpCount++;

balanceThrottling(balanceStartTime + rpCount * balanceInterval, maxRegionsInTransition,
if (this.maxBlancingTime > 0) {
Copy link
Contributor

@virajjasani virajjasani Jan 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so by disabling throttling what we mean is providing negative int value for hbase.balancer.max.balancing in master site config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you will change this maxBlancingTime dynamically at HM config?
If permanently for the cluster the throttling needs disabled, hbase.master.balancer.maxRitPercent can be 100% right (which is the def value). What am missing here? I did not read this part of code fully though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this do not change maxBlancingTime dynamically, It just skip the balanceThrottling when 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="
Expand Down