/** Wait until all the regions are assigned. */ private void waitForAllRegionsAssigned() throws IOException { while (true) { int regionCount = HBaseTestingUtility.getAllOnlineRegions(cluster).size(); if (regionCount >= totalRegionNum) break; LOG.debug( "Waiting for there to be " + totalRegionNum + " regions, but there are " + regionCount + " right now."); try { Thread.sleep(100); } catch (InterruptedException e) { } } }