public void moveRegionAndWait(RegionInfo destRegion, ServerName destServer)
    throws InterruptedException, IOException {
    HMaster master = getMiniHBaseCluster().getMaster();
    // TODO: Here we start the move. The move can take a while.
    getAdmin().move(destRegion.getEncodedNameAsBytes(), destServer);
    while (true) {
      ServerName serverName =
        master.getAssignmentManager().getRegionStates().getRegionServerOfRegion(destRegion);
      if (serverName != null && serverName.equals(destServer)) {
        assertRegionOnServer(destRegion, serverName, 2000);
        break;
      }
      Thread.sleep(10);
    }
  }
Move region to destination server and wait till region is completely moved and online
@param destRegion region to move
@param destServer destination server of the region
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java