public String explainTableState(final TableName table, TableState.State state)
    throws IOException {
    TableState tableState = MetaTableAccessor.getTableState(getConnection(), table);
    if (tableState == null) {
      return "TableState in META: No table state in META for table " + table
        + " last state in meta (including deleted is " + findLastTableState(table) + ")";
    } else if (!tableState.inStates(state)) {
      return "TableState in META: Not " + state + " state, but " + tableState;
    } else {
      return "TableState in META: OK";
    }
  }
Wait until all regions in a table have been assigned
@param table         Table to wait on.
@param timeoutMillis Timeout.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java