[
https://issues.apache.org/jira/browse/HBASE-5548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13248070#comment-13248070
]
[email protected] commented on HBASE-5548:
------------------------------------------------------
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4668/
-----------------------------------------------------------
Review request for hbase and Michael Stack.
Summary
-------
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.
This addresses bug HBASE-5548.
https://issues.apache.org/jira/browse/HBASE-5548
Diffs
-----
src/main/ruby/hbase/hbase.rb 2c37840
src/main/ruby/hbase/table.rb 41dcf21
src/main/ruby/shell.rb 53f3de8
src/main/ruby/shell/commands.rb af6df33
src/main/ruby/shell/commands/count.rb 6596441
src/main/ruby/shell/commands/create.rb 14c1b0f
src/main/ruby/shell/commands/delete.rb 12bc405
src/main/ruby/shell/commands/deleteall.rb 5731b60
src/main/ruby/shell/commands/get.rb 754c3d6
src/main/ruby/shell/commands/get_counter.rb 3cbe226
src/main/ruby/shell/commands/get_table.rb PRE-CREATION
src/main/ruby/shell/commands/incr.rb 38a2fc5
src/main/ruby/shell/commands/put.rb dde0433
src/main/ruby/shell/commands/scan.rb e58aaac
src/main/ruby/shell/commands/table_help.rb PRE-CREATION
src/test/ruby/hbase/admin_test.rb 0c2672b
Diff: https://reviews.apache.org/r/4668/diff
Testing
-------
Manual and basic unit tests.
Thanks,
Jesse
> Add ability to get a table in the shell
> ---------------------------------------
>
> Key: HBASE-5548
> URL: https://issues.apache.org/jira/browse/HBASE-5548
> Project: HBase
> Issue Type: Improvement
> Components: shell
> Reporter: Jesse Yates
> Assignee: Jesse Yates
> Fix For: 0.96.0, 0.94.1
>
> Attachments: ruby_HBASE-5528-v0.patch, ruby_HBASE-5548-v1.patch,
> ruby_HBASE-5548-v2.patch, ruby_HBASE-5548-v3.patch
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira