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

Add ability to get a table in the shell

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.95.0
    • shell
    • None
    • Reviewed
    • Hide
      Adding the ability to get a reference to a table in the shell.

      Previously, all commands that acted on a table would need to take the name of the table as a string, which is annoying in an OO REPL. This patch introduces the ability to get and hold a reference to a table both on creation (via create(...)) and at will (via get_table(...)).

      Further, to actually make the table useful, modifications to table specific class were made so you can have a reference and just do things like put, scan, get, etc. on that table reference. To accommodate new table functionality, table specific methods are easily added (one line) in a dynamic fashion via class methods in the Table. See examples in get, put, scan, etc..

      There is also a lot of admin functionality tied to a table - things like disabling, dropping, describing, etc - that were added to the table class. Now you can do things like 'table.disable' and 'table.describe'. Again these were dynamically added, so new admin functionality for a table is as simple as adding the method name to one line in the Table class.
      Show
      Adding the ability to get a reference to a table in the shell. Previously, all commands that acted on a table would need to take the name of the table as a string, which is annoying in an OO REPL. This patch introduces the ability to get and hold a reference to a table both on creation (via create(...)) and at will (via get_table(...)). Further, to actually make the table useful, modifications to table specific class were made so you can have a reference and just do things like put, scan, get, etc. on that table reference. To accommodate new table functionality, table specific methods are easily added (one line) in a dynamic fashion via class methods in the Table. See examples in get, put, scan, etc.. There is also a lot of admin functionality tied to a table - things like disabling, dropping, describing, etc - that were added to the table class. Now you can do things like 'table.disable' and 'table.describe'. Again these were dynamically added, so new admin functionality for a table is as simple as adding the method name to one line in the Table class.

    Description

      Currently, all the commands that operate on a table in the shell first have to take the table as name as input.

      There are two main considerations:

      • It is annoying to have to write the table name every time, when you should just be able to get a reference to a table
      • the current implementation is very wasteful - it creates a new HTable for each call (but reuses the connection since it uses the same configuration)

      We should be able to get a handle to a single HTable and then operate on that.

      Attachments

        1. ruby_HBASE-5528-v0.patch
          4 kB
          Jesse Yates
        2. ruby_HBASE-5548-addendum.patch
          14 kB
          Jesse Yates
        3. ruby_HBASE-5548-v1.patch
          9 kB
          Jesse Yates
        4. ruby_HBASE-5548-v2.patch
          9 kB
          Jesse Yates
        5. ruby_HBASE-5548-v3.patch
          22 kB
          Jesse Yates
        6. ruby_HBASE-5548-v5.patch
          28 kB
          Jesse Yates

        Issue Links

          Activity

            People

              jesse_yates Jesse Yates
              jesse_yates Jesse Yates
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: