public Table deleteTableData(TableName tableName) throws IOException {
    Table table = getConnection().getTable(tableName);
    Scan scan = new Scan();
    ResultScanner resScan = table.getScanner(scan);
    for (Result res : resScan) {
      Delete del = new Delete(res.getRow());
      table.delete(del);
    }
    resScan = table.getScanner(scan);
    resScan.close();
    return table;
  }
Provide an existing table name to truncate. Scans the table and issues a delete for each row
read.
@param tableName existing table
@return HTable to that new table
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java