[
https://issues.apache.org/jira/browse/HBASE-29467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Duo Zhang resolved HBASE-29467.
-------------------------------
Fix Version/s: 2.7.0
3.0.0-beta-2
2.6.4
2.5.13
Hadoop Flags: Reviewed
Resolution: Fixed
Pushed to all active branches.
Thanks [~pengjialun] for contributing!
> Redundant conditions in CostFunction.scale() method
> ---------------------------------------------------
>
> Key: HBASE-29467
> URL: https://issues.apache.org/jira/browse/HBASE-29467
> Project: HBase
> Issue Type: Improvement
> Components: Balancer
> Reporter: Jialun Peng
> Assignee: Jialun Peng
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.7.0, 3.0.0-beta-2, 2.6.4, 2.5.13
>
>
> Description: In org.apache.hadoop.hbase.master.balancer.CostFunction.scale(),
> there are redundant conditions: 1. The check `max <= min` appears twice 2.
> The check `Math.abs(max - min) <= costEpsilon` appears twice
>
> The first if-block already covers all these cases, making the second if-block
> completely redundant as it will never be reached with conditions that would
> make it evaluate differently.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)