From 5e67e6badcc5a00922bca2ff471f1b4b221734d1 Mon Sep 17 00:00:00 2001 From: Viraj Jasani Date: Fri, 6 Mar 2020 13:01:17 +0530 Subject: [PATCH] HBASE-23909 : list_regions raise correct error if it is being splitted/merged/transitioning (#1238) Signed-off-by: Wellington Ramos Chevreuil Signed-off-by: Peter Somogyi Signed-off-by: Jan Hentschel --- hbase-shell/src/main/ruby/shell/commands/list_regions.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb index dc77ae758bc..f63ff786d0a 100644 --- a/hbase-shell/src/main/ruby/shell/commands/list_regions.rb +++ b/hbase-shell/src/main/ruby/shell/commands/list_regions.rb @@ -215,7 +215,12 @@ EOF def get_regions_for_server(regions_for_table, server_name) regions_for_table.select do |hregion| - accept_server_name? server_name, hregion.getServerName.toString + actual_server_name = hregion.getServerName + if actual_server_name == nil + raise "Some regions might be splitting or merging or transitioning due to other" \ + " reasons" + end + accept_server_name? server_name, actual_server_name.toString end end