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

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Apekshit 2016-02-03 16:05:37 -08:00 committed by stack
parent 97fc7abd5b
commit 6a2fa739fd
1 changed files with 3 additions and 0 deletions

View File

@ -2112,6 +2112,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 new HTable(getConfiguration(), tableName);
}