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

Add new shell command 'rit' for listing regions in transition

    XMLWordPrintableJSON

Details

    • Reviewed
    • Hide
      <!-- markdown -->

      The HBase `shell` now includes a command to list regions currently in transition.

      ```
      HBase Shell
      Use "help" to get list of supported commands.
      Use "exit" to quit this interactive shell.
      Version 1.5.0-SNAPSHOT, r9bb6d2fa8b760f16cd046657240ebd4ad91cb6de, Mon Oct 8 21:05:50 UTC 2018

      hbase(main):001:0> help 'rit'
      List all regions in transition.
      Examples:
        hbase> rit

      hbase(main):002:0> create ...
      0 row(s) in 2.5150 seconds
      => Hbase::Table - IntegrationTestBigLinkedList

      hbase(main):003:0> rit
      0 row(s) in 0.0340 seconds

      hbase(main):004:0> unassign '56f0c38c81ae453d19906ce156a2d6a1'
      0 row(s) in 0.0540 seconds

      hbase(main):005:0> rit
      IntegrationTestBigLinkedList,L\xCC\xCC\xCC\xCC\xCC\xCC\xCB,1539117183224.56f0c38c81ae453d19906ce156a2d6a1. state=PENDING_CLOSE, ts=Tue Oct 09 20:33:34 UTC 2018 (0s ago), server=null
      1 row(s) in 0.0170 seconds
      ```
      Show
      <!-- markdown --> The HBase `shell` now includes a command to list regions currently in transition. ``` HBase Shell Use "help" to get list of supported commands. Use "exit" to quit this interactive shell. Version 1.5.0-SNAPSHOT, r9bb6d2fa8b760f16cd046657240ebd4ad91cb6de, Mon Oct 8 21:05:50 UTC 2018 hbase(main):001:0> help 'rit' List all regions in transition. Examples:   hbase> rit hbase(main):002:0> create ... 0 row(s) in 2.5150 seconds => Hbase::Table - IntegrationTestBigLinkedList hbase(main):003:0> rit 0 row(s) in 0.0340 seconds hbase(main):004:0> unassign '56f0c38c81ae453d19906ce156a2d6a1' 0 row(s) in 0.0540 seconds hbase(main):005:0> rit IntegrationTestBigLinkedList,L\xCC\xCC\xCC\xCC\xCC\xCC\xCB,1539117183224.56f0c38c81ae453d19906ce156a2d6a1. state=PENDING_CLOSE, ts=Tue Oct 09 20:33:34 UTC 2018 (0s ago), server=null 1 row(s) in 0.0170 seconds ```

    Description

      The 'status' shell command shows regions in transition but sometimes an operator may want to retrieve a simple list of regions in transition. Here's a patch that adds a new 'rit' command to the TOOLS group that does just that.

      No test, because it seems hard to mock RITs from the ruby test code, but I have run TestShell and it passes, so the command is verified to meet minimum requirements, like help text, and manually verified with branch-1 (shell in branch-2 and up doesn't return until TransitRegionProcedure has completed so by that time no RIT):

      HBase Shell
      Use "help" to get list of supported commands.
      Use "exit" to quit this interactive shell.
      Version 1.5.0-SNAPSHOT, r9bb6d2fa8b760f16cd046657240ebd4ad91cb6de, Mon Oct  8 21:05:50 UTC 2018
      
      hbase(main):001:0> help 'rit'
      List all regions in transition.
      Examples:
        hbase> rit
      
      hbase(main):002:0> create ...
      0 row(s) in 2.5150 seconds
      => Hbase::Table - IntegrationTestBigLinkedList
      
      hbase(main):003:0> rit
      0 row(s) in 0.0340 seconds
      
      hbase(main):004:0> unassign '56f0c38c81ae453d19906ce156a2d6a1'
      0 row(s) in 0.0540 seconds
      
      hbase(main):005:0> rit 
      IntegrationTestBigLinkedList,L\xCC\xCC\xCC\xCC\xCC\xCC\xCB,1539117183224.56f0c38c81ae453d19906ce156a2d6a1. state=PENDING_CLOSE, ts=Tue Oct 09 20:33:34 UTC 2018 (0s ago), server=null                                                                                                                                                                                   
      1 row(s) in 0.0170 seconds
      

      Attachments

        1. HBASE-21283-branch-1.patch
          3 kB
          Andrew Kyle Purtell
        2. HBASE-21283.patch
          3 kB
          Andrew Kyle Purtell
        3. HBASE-21283-branch-1.patch
          3 kB
          Andrew Kyle Purtell
        4. HBASE-21283.patch
          3 kB
          Andrew Kyle Purtell
        5. HBASE-21283-branch-1.patch
          3 kB
          Andrew Kyle Purtell
        6. HBASE-21283.patch
          3 kB
          Andrew Kyle Purtell

        Activity

          People

            apurtell Andrew Kyle Purtell
            apurtell Andrew Kyle Purtell
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: