public Table truncateTable(final TableName tableName, final boolean preserveRegions)
    throws IOException {
    Admin admin = getAdmin();
    if (!admin.isTableDisabled(tableName)) {
      admin.disableTable(tableName);
    }
    admin.truncateTable(tableName, preserveRegions);
    return getConnection().getTable(tableName);
  }
Truncate a table using the admin command. Effectively disables, deletes, and recreates the
table.
@param tableName       table which must exist.
@param preserveRegions keep the existing split points
@return HTable for the new table
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java