HBASE-15209 (compatibility) Disable table in HBaseTestingUtility.truncateTable. (Apekshit)
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
97fc7abd5b
commit
6a2fa739fd
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue