hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guangxu Cheng (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-19336) Improve rsgroup to allow assign all tables within a specified namespace by only writing namespace
Date Thu, 23 Nov 2017 08:28:01 GMT

    [ https://issues.apache.org/jira/browse/HBASE-19336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16263969#comment-16263969
] 

Guangxu Cheng commented on HBASE-19336:
---------------------------------------

{code}
+        if(isNamespace?(t))
+          namespace_name = t[1...t.length]
+          raise(ArgumentError, "Can't find a namespace: #{namespace_name}") unless namespace_exists?(namespace_name)
+          tablelist = @connection.getAdmin.listTableNamesByNamespace(namespace_name).map
{ |table| table.getNameAsString() }
+          tablelist.each do |table|
+            tables.add(org.apache.hadoop.hbase.TableName.valueOf(table))
+          end
+        else
+          tables.add(org.apache.hadoop.hbase.TableName.valueOf(t))
+        end
{code}
If some tables of the specified namespace already exist in the target group, the command will
fails. Should we exclude the tables that already exist in the target group?

> Improve rsgroup to allow assign all tables within a specified namespace by only writing
namespace
> -------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-19336
>                 URL: https://issues.apache.org/jira/browse/HBASE-19336
>             Project: HBase
>          Issue Type: Improvement
>          Components: rsgroup
>    Affects Versions: 2.0.0-alpha-4
>            Reporter: xinxin fan
>            Assignee: xinxin fan
>         Attachments: HBASE-19336-master.patch
>
>
> Currently, use can only assign tables within a namespace from one group to another by
writing all table names in move_tables_rsgroup command. Allowing to assign all tables within
a specifed namespace by only wirting namespace name is useful.
> Usage as follows:
> {code:java}
> hbase(main):055:0> move_tables_rsgroup 'default',['@ns1']
> Took 2.2211 seconds
> {code}
> {code:java}
> hbase(main):051:0* move_servers_tables_rsgroup 'rsgroup1',['hbase39.lt.163.org:60020'],['@ns1','@ns2','table3']
> Took 15.3710 seconds 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message