Class HeterogeneousRegionCountCostFunction

java.lang.Object
org.apache.hadoop.hbase.master.balancer.CostFunction
org.apache.hadoop.hbase.master.balancer.HeterogeneousRegionCountCostFunction

This is an optional Cost function designed to allow region count skew across RegionServers. A rule file is loaded from the local FS or HDFS before balancing. It contains lines of rules. A rule is composed of a regexp for hostname, and a limit. For example, we could have:

* rs[0-9] 200 * rs1[0-9] 50

RegionServers with hostname matching the first rules will have a limit of 200, and the others 50. If there's no match, a default is set. The costFunction is trying to fill all RegionServers linearly, meaning that if the global usage is at 50%, then all RegionServers should hold half of their capacity in terms of regions. In order to use this CostFunction, you need to set the following options:
  • hbase.master.balancer.stochastic.additionalCostFunctions
  • hbase.master.balancer.stochastic.heterogeneousRegionCountRulesFile
  • hbase.master.balancer.stochastic.heterogeneousRegionCountDefault
The rule file can be located on local FS or HDFS, depending on the prefix (file//: or hdfs://).