private static int getRegionServerCount(final Connection connection) throws IOException {
    try (Admin admin = connection.getAdmin()) {
      Collection<ServerName> servers = admin.getRegionServers();
      return servers == null || servers.isEmpty() ? 0 : servers.size();
    }
  }
Alternative getCurrentNrHRS which is no longer available.
@return Rough count of regionservers out on cluster.
@throws IOException if a remote or network exception occurs
hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java