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