Details
-
Task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.0.0-alpha-1, 2.3.0
-
None
-
Remove backward compatibility from `truncate` and `truncate_preserve` shell commands. This means that these commands from HBase Clients are not compatible with pre-0.99 HBase clusters.
Description
The truncate and truncate_preserve commands in shell have a compatibility block to handle the case when Master does not have truncate command.
This was added in HBASE-8332 for HBase 0.99 so it is safe to remove it now.
The current compatibility block catches DoNotRetryIOException which can hide different kind of errors and just drops and recreates the table.
begin puts 'Truncating table...' @admin.truncateTable(table_name, false) rescue => e # Handle the compatibility case, where the truncate method doesn't exists on the Master raise e unless e.respond_to?(:cause) && !e.cause.nil? rootCause = e.cause if rootCause.is_a?(org.apache.hadoop.hbase.DoNotRetryIOException) # Handle the compatibility case, where the truncate method doesn't exists on the Master puts 'Dropping table...' @admin.deleteTable(table_name) puts 'Creating table...' @admin.createTable(table_description) else raise e end end
Attachments
Issue Links
- links to