HBASE-15209 (compatibility) Disable table in HBaseTestingUtility.truncateTable. (Apekshit)

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Apekshit 2016-02-02 18:24:17 -08:00 committed by stack
parent 81d81c9839
commit 31f9f2fb67
1 changed files with 3 additions and 0 deletions

View File

@ -1874,6 +1874,9 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
*/
public HTable truncateTable(final TableName tableName, final boolean preserveRegions) throws IOException {
Admin admin = getHBaseAdmin();
if (!admin.isTableDisabled(tableName)) {
admin.disableTable(tableName);
}
admin.truncateTable(tableName, preserveRegions);
return (HTable) getConnection().getTable(tableName);
}