vaijosh commented on code in PR #5462:
URL: https://github.com/apache/hbase/pull/5462#discussion_r1366524617
##########
hbase-shell/src/main/ruby/hbase/admin.rb:
##########
@@ -196,6 +196,16 @@ def split(table_or_region_name, split_point = nil)
end
end
+
#----------------------------------------------------------------------------------------------
+ # Requests a region truncate
+ def truncate_region(region_name)
+ begin
+
org.apache.hadoop.hbase.util.FutureUtils.get(@admin.truncateRegionAsync(region_name.to_java_bytes))
+ rescue java.lang.IllegalArgumentException,
org.apache.hadoop.hbase.UnknownRegionException
+ @admin.truncate_region(region_name.to_java_bytes)
Review Comment:
@NihalJain Thank for suggestion.
UnknownRegionException is from getRegionLocation() check
[this](https://github.com/apache/hbase/blob/523e4f971d7c990c45574b203bdaf6d7935018d2/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java#L2590C1-L2590C11)
I think we may not get "NoServerForRegionException", we expect only online
region in truncate region and have checks for it. So not sure how this
exception will come.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]