Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-8663

a HBase Shell command to list the tables replicated from current cluster

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 0.98.0, 0.95.2, 0.94.11
    • Replication, shell
    • None
    • clusters setup as Master and Slave for replication of tables

    • Reviewed
    • list_replicated_tables can now be used in the shell to get the list of tables and families that are configured to be replicated, instead of having to describe all the tables and manually filter those that have a replication scope of 1
    • replication

    Description

      Thanks for the discussion and very good suggestions,I'd reduce the scope of this jira to only display the tables replicated from current cluster. Since currently no good(accurate and consistent) way to flag a table on slave cluster, this jira will not cover such scenario. Instead, the patch will be flexible enough to adapt such scenario and a follow up JIRA will be opened to address such situation.

      The shell command and output will be like. Since all replication is 'global', so no need to display the cluster name here. In the future, the command will be extended for other scenarios, such as 1) replicated only to selected peers or 2) indicate table:colfam on slave side

      hbase shell command:list_replicated_tables
      hbase(main):001:0> list_replicated_tables
      TABLE:COLUMNFAMILY                           ReplicationType                                                                           
       t1_dn:cf1                                   GLOBAL                                                                                    
       t2_dn:cf2                                   GLOBAL                                                                                    
       usertable:family                            GLOBAL                                                                                    
      3 row(s) in 0.4110 seconds
      
      hbase(main):003:0> list_replicated_tables "dn"
      TABLE:COLUMNFAMILY                           ReplicationType                                                                           
       t1_dn:cf1                                   GLOBAL                                                                                    
       t2_dn:cf2                                   GLOBAL                                                                                    
      2 row(s) in 0.0280 seconds
      

      -------------- The original JIRA description, keep as the history of discussion ---------------
      This jira is to provide a hbase shell command which can give user can overview of the tables/columnfamilies currently being replicated. The information will help system administrator for design and planning, and also help application programmer to know which tables/columns should be watchout(for example, not to modify a replicated columnfamily on the slave cluster)

      Currently there is no easy way to tell which table(s)/columnfamily(ies)
      replicated from or to a particular cluster.

      On Master Cluster, an indirect method can be used by combining two steps: 1) $describe 'usertable' and 2) $list_peers to map the REPLICATION_SCOPE to target(aka slave) cluster

      On slave cluster, this is no existing API/methods to list all the tables replicated to this cluster.

      Here is an example, and prototype for Master cluster

      hbase shell command:list_replicated_tables
      hbase(main):001:0> list_replicated_tables
       TABLE      COLUMNFAMILY       TARGET_CLUSTER
       scores      course            hdtest017.svl.ibm.com:2181:/hbase
       t3_dn       cf1               hdtest017.svl.ibm.com:2181:/hbase
       usertable   family            hdtest017.svl.ibm.com:2181:/hbase
      3 row(s) in 0.3380 seconds
      

      -------------- end of original description

      Attachments

        1. HBASE-8663-0.94.9-v0.patch
          10 kB
          Demai Ni
        2. HBASE-8663-trunk-v5.patch
          10 kB
          Jean-Daniel Cryans
        3. HBASE-8663-trunk-v4.patch
          10 kB
          Demai Ni
        4. HBASE-8663-trunk-v3.patch
          10 kB
          Demai Ni
        5. HBASE-8663-trunk-v2.patch
          7 kB
          Demai Ni
        6. HBASE-8663-trunk-v1.patch
          6 kB
          Demai Ni
        7. HBASE-8663-trunk-v0.patch
          13 kB
          Demai Ni
        8. HBASE-8663-v2.PATCH
          13 kB
          Demai Ni
        9. HBASE-8663.PATCH
          5 kB
          Demai Ni

        Activity

          People

            nidmhbase Demai Ni
            nidmhbase Demai Ni
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: