diff --git a/hbase-shell/src/main/ruby/shell/commands/move_namespaces_rsgroup.rb b/hbase-shell/src/main/ruby/shell/commands/move_namespaces_rsgroup.rb index 7878eb9317c..60b0bff62c2 100644 --- a/hbase-shell/src/main/ruby/shell/commands/move_namespaces_rsgroup.rb +++ b/hbase-shell/src/main/ruby/shell/commands/move_namespaces_rsgroup.rb @@ -31,6 +31,10 @@ CMD def command(dest, namespaces) rsgroup_admin.move_namespaces(dest, namespaces) + namespaces.each do |ns| + arg = {'METHOD' => 'set', 'hbase.rsgroup.name' => dest} + admin.alter_namespace(ns, arg) + end end end end diff --git a/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb b/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb index f7c53000c85..b45d5ad778e 100644 --- a/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb +++ b/hbase-shell/src/test/ruby/shell/rsgroup_shell_test.rb @@ -115,8 +115,16 @@ module Hbase assert_not_nil(group) assert_equal(ns_table_name, group.getTables.iterator.next.toString) + ns_table_name2 = 'test_namespace:test_ns_table2' + @shell.command(:create, ns_table_name2, 'f') + + assert_true(@admin.listTablesInRSGroup(group_name).contains(org.apache.hadoop.hbase.TableName.valueOf(ns_table_name2))) + assert_equal(2, @admin.listTablesInRSGroup(group_name).count) + @shell.command(:disable, ns_table_name) @shell.command(:drop, ns_table_name) + @shell.command(:disable, ns_table_name2) + @shell.command(:drop, ns_table_name2) @shell.command(:drop_namespace, namespace_name) remove_rsgroup(group_name) end