public void waitForRegionServerToStart(String hostname, int port, long timeout)
    throws IOException {
    long start = EnvironmentEdgeManager.currentTime();
    while ((EnvironmentEdgeManager.currentTime() - start) < timeout) {
      for (ServerName server : getClusterMetrics().getLiveServerMetrics().keySet()) {
        if (server.getHostname().equals(hostname) && server.getPort() == port) {
          return;
        }
      }
      Threads.sleep(100);
    }
    throw new IOException(
      "did timeout " + timeout + "ms waiting for region server to start: " + hostname);
  }
Wait for the specified region server to join the cluster
@throws IOException if something goes wrong or timeout occurs
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseCluster.java