You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/01/12 06:34:13 UTC

[GitHub] [hbase] leyangyueshan commented on a change in pull request #2874: HBASE-25496 add get_namespace_rsgroup command

leyangyueshan commented on a change in pull request #2874:
URL: https://github.com/apache/hbase/pull/2874#discussion_r555541973



##########
File path: hbase-shell/src/main/ruby/hbase/admin.rb
##########
@@ -1447,6 +1447,17 @@ def alter_namespace(namespace_name, *args)
       @admin.modifyNamespace(nsb.build)
     end
 
+    #----------------------------------------------------------------------------------------------
+    # Get namespace's rsgroup
+    def get_namespace_rsgroup(namespace_name)
+      # Fail if namespace name is not a string
+      raise(ArgumentError, 'Namespace name must be of type String') unless namespace_name.is_a?(String)
+      nsd = @admin.getNamespaceDescriptor(namespace_name)
+      raise(ArgumentError, 'Namespace does not exist') unless nsd
+      res = nsd.getConfigurationValue("hbase.rsgroup.name")
+      res

Review comment:
       no, I tried, but it doesn't work。
   like rsgroup_admin.rb 
     #--------------------------------------------------------------------------
       # get group of server
       def get_rsgroup_of_server(server)
         res = @admin.getRSGroup(
           org.apache.hadoop.hbase.net.Address.fromString(server)
         )
         raise(ArgumentError, 'Server has no group: ' + server) if res.nil?
         res
       end




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org