@Override
      public boolean visit(Result r) throws IOException {
        if (!Arrays.equals(r.getRow(), table.getName())) {
          return false;
        }
        TableState state = CatalogFamilyFormat.getTableState(r);
        if (state != null) {
          lastTableState.set(state);
        }
        return true;
      }
Wait until all regions in a table have been assigned
@param table         Table to wait on.
@param timeoutMillis Timeout.
hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java