@RestrictedApi(explanation = "Should only be called in tests", link = "",
      allowedOnPath = ".*(/src/test/.*|SimpleLoadBalancer).java")
  void setClusterLoad(Map<TableName, Map<ServerName, List<RegionInfo>>> clusterLoad) {
    serverLoadList.clear();
    Map<ServerName, Integer> server2LoadMap = new HashMap<>();
    float sum = 0;
    for (Map.Entry<TableName, Map<ServerName, List<RegionInfo>>> clusterEntry : clusterLoad
      .entrySet()) {
      for (Map.Entry<ServerName, List<RegionInfo>> entry : clusterEntry.getValue().entrySet()) {
        int regionNum = entry.getValue().size();
        server2LoadMap.compute(entry.getKey(), (k, v) -> v == null ? regionNum : regionNum + v);
        sum += regionNum;
      }
    }
    server2LoadMap.forEach((k, v) -> {
      serverLoadList.add(new ServerAndLoad(k, v));
    });
    avgLoadOverall = sum / serverLoadList.size();
  }
Pass RegionStates and allow balancer to set the current cluster load.
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java