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

Develop HBase shell command/tool to list table's region info through command line

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0, 2.0.0
    • Component/s: shell
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Hide
      Added a shell command 'list_regions' for displaying the table's region info through command line.

              List all regions for a particular table as an array and also filter them by server name (optional) as prefix
              and maximum locality (optional). By default, it will return all the regions for the table with any locality.
              The command displays server name, region name, start key, end key, size of the region in MB, number of requests
              and the locality. The information can be projected out via an array as third parameter. By default all these information
              is displayed. Possible array values are SERVER_NAME, REGION_NAME, START_KEY, END_KEY, SIZE, REQ and LOCALITY. Values
              are not case sensitive. If you don't want to filter by server name, pass an empty hash / string as shown below.

              Examples:
              hbase> list_regions 'table_name'
              hbase> list_regions 'table_name', 'server_name'
              hbase> list_regions 'table_name', {SERVER_NAME => 'server_name', LOCALITY_THRESHOLD => 0.8}
              hbase> list_regions 'table_name', {SERVER_NAME => 'server_name', LOCALITY_THRESHOLD => 0.8}, ['SERVER_NAME']
              hbase> list_regions 'table_name', {}, ['SERVER_NAME', 'start_key']
              hbase> list_regions 'table_name', '', ['SERVER_NAME', 'start_key']
      Show
      Added a shell command 'list_regions' for displaying the table's region info through command line.         List all regions for a particular table as an array and also filter them by server name (optional) as prefix         and maximum locality (optional). By default, it will return all the regions for the table with any locality.         The command displays server name, region name, start key, end key, size of the region in MB, number of requests         and the locality. The information can be projected out via an array as third parameter. By default all these information         is displayed. Possible array values are SERVER_NAME, REGION_NAME, START_KEY, END_KEY, SIZE, REQ and LOCALITY. Values         are not case sensitive. If you don't want to filter by server name, pass an empty hash / string as shown below.         Examples:         hbase> list_regions 'table_name'         hbase> list_regions 'table_name', 'server_name'         hbase> list_regions 'table_name', {SERVER_NAME => 'server_name', LOCALITY_THRESHOLD => 0.8}         hbase> list_regions 'table_name', {SERVER_NAME => 'server_name', LOCALITY_THRESHOLD => 0.8}, ['SERVER_NAME']         hbase> list_regions 'table_name', {}, ['SERVER_NAME', 'start_key']         hbase> list_regions 'table_name', '', ['SERVER_NAME', 'start_key']

      Description

      I am going through the hbase shell commands to see if there is anything I can use to get all the regions info just for a particular table. I don’t see any such command that provides me that information.
      It would be better to have a command that provides region info, start key, end key etc taking a table name as the input parameter. This is available through HBase UI on clicking on a particular table's link

      A tool/shell command to get a list of regions for a table or all tables in a tabular structured output (that is machine readable)

        Attachments

        1. HBASE-14925.patch
          3 kB
          Karan Mehta
        2. HBASE-14925.002.patch
          4 kB
          Karan Mehta
        3. HBASE-14925.003.patch
          4 kB
          Karan Mehta
        4. HBASE-14925.003.addendum.001.patch
          8 kB
          Karan Mehta

          Issue Links

            Activity

              People

              • Assignee:
                karanmehta93 Karan Mehta
                Reporter:
                romil.choksi Romil Choksi
              • Votes:
                1 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: