hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Yates (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-5548) Add ability to get a table in the shell
Date Mon, 12 Mar 2012 03:05:09 GMT

     [ https://issues.apache.org/jira/browse/HBASE-5548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jesse Yates updated HBASE-5548:
-------------------------------

    Attachment: ruby_HBASE-5548-v1.patch

Attaching patch...
1) Fixed stack's comments
2) Added features:
 - create now returns the table that was created
 - scan now dynamically adds a scan method to htable

The latter makes sure that the table will output a scan 'nicely', and could be a decent paradigm
for adding methods to the Table class (though probably some cleanup needs to be done as far
as aliasing methods etc.). Thoughts on this new style?

Also, here is the output from some usage:
{code}
1.9.2-p290 :006 > t = create 't', 'f'
0 row(s) in 1.0470 seconds

 => #<Hbase::Table:0x55187eb3 @table=#<Java::OrgApacheHadoopHbaseClient::HTable:0x92524b0>,
@shell=#<Shell::Shell:0x329b5c95 @formatter=#<Shell::Formatter::Console:0x75db5427 @out=Kernel,
@row_count=0, @max_width=80>, @hbase_admin=#<Hbase::Admin:0x127208e4 @zk_wrapper=#<Java::OrgApacheHadoopHbaseZookeeper::ZooKeeperWatcher:0xcb80017>,
@zk_main=#<Java::OrgApacheZookeeper::ZooKeeperMain:0x646326e5>, @formatter=#<Shell::Formatter::Console:0x75db5427
@out=Kernel, @row_count=0, @max_width=80>, @conf=#<Java::OrgApacheHadoopConf::Configuration:0x4332b67c>,
@admin=#<Java::OrgApacheHadoopHbaseClient::HBaseAdmin:0x2fbb3e9a>>, @hbase=#<Hbase::Hbase:0x56781dd4
@configuration=#<Java::OrgApacheHadoopConf::Configuration:0x4332b67c>>>> 
1.9.2-p290 :007 > t.put 'r', 'f', 'v'
1.9.2-p290 :008 > t1 = get_table 't'
0 row(s) in 0.0240 seconds

 => #<Hbase::Table:0x7194f467 @table=#<Java::OrgApacheHadoopHbaseClient::HTable:0x6a39d072>,
@shell=#<Shell::Shell:0x329b5c95 @formatter=#<Shell::Formatter::Console:0x75db5427 @out=Kernel,
@row_count=0, @max_width=80>, @hbase_admin=#<Hbase::Admin:0x127208e4 @zk_wrapper=#<Java::OrgApacheHadoopHbaseZookeeper::ZooKeeperWatcher:0xcb80017>,
@zk_main=#<Java::OrgApacheZookeeper::ZooKeeperMain:0x646326e5>, @formatter=#<Shell::Formatter::Console:0x75db5427
@out=Kernel, @row_count=0, @max_width=80>, @conf=#<Java::OrgApacheHadoopConf::Configuration:0x4332b67c>,
@admin=#<Java::OrgApacheHadoopHbaseClient::HBaseAdmin:0x2fbb3e9a>>, @hbase=#<Hbase::Hbase:0x56781dd4
@configuration=#<Java::OrgApacheHadoopConf::Configuration:0x4332b67c>>>> 
1.9.2-p290 :009 > t.put 'r2', 'f', 'v'
1.9.2-p290 :010 > t.scan
ROW                   COLUMN+CELL                                               
 r                    column=f:, timestamp=1331521351836, value=v               
 r2                   column=f:, timestamp=1331521368969, value=v               
2 row(s) in 0.0870 seconds
{code}

                
> 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
>
>         Attachments: ruby_HBASE-5528-v0.patch, ruby_HBASE-5548-v1.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

        

Mime
View raw message