hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Yates (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-5548) Add ability to get a table in the shell
Date Fri, 06 Apr 2012 04:43:19 GMT

    [ https://issues.apache.org/jira/browse/HBASE-5548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13248045#comment-13248045

Jesse Yates commented on HBASE-5548:

bq. When I create a table, the output is kinda ugly? I suppose no way around it.... its not
end of world.

Doing a 360 on my comments above; looks like you can suppress it pretty easily, if not entirely
cleanly. I'd rather not hack the irb too much, but just do it via changes to the methods on
Table. Below is the output I have it using now.

1.9.2-p290 :002 > t = get_table 't'
0 row(s) in 0.0240 seconds

 =>Hbase::Table - t  
1.9.2-p290 :003 >

Essentially, we are just printing out the class and then the name of the table. If we wanted
to do more complicated things  (for instance, print the CFs for the table, or the whole descriptor)
we can easily add it later to the Table.to_s method.

Pretty clean and makes sense for people used to the ruby REPL as you see the value of what
you just got back (as a string).

bq. I'm thinking it might be nice to add in some help specific to a table command more dynamically.

Punting on this - doubt it is going to be very rare that we will have to mod the help for
the command dynamically - you probably are changing the nature of the command, so its really
not worth it at the moment.
> 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,
> 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


View raw message