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)
|
public HTable truncateTable(final TableName tableName, final boolean preserveRegions)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Admin admin = getHBaseAdmin();
|
Admin admin = getHBaseAdmin();
|
||||||
|
if (!admin.isTableDisabled(tableName)) {
|
||||||
|
admin.disableTable(tableName);
|
||||||
|
}
|
||||||
admin.truncateTable(tableName, preserveRegions);
|
admin.truncateTable(tableName, preserveRegions);
|
||||||
return new HTable(getConfiguration(), tableName);
|
return new HTable(getConfiguration(), tableName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue