public int countRows(final TableName tableName) throws IOException {
    Table table = getConnection().getTable(tableName);
    try {
      return countRows(table);
    } finally {
      table.close();
    }
  }
Return the number of rows in the given table.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java