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

Jesse Yates commented on HBASE-5548:
------------------------------------

{code}
+        #define the command name in 'where' namespace
+        #which actually just delegates to the shell instance
{code}
The 'where' namespace is just the variable name, which in our case is the IRB 
shell namespace. However, internally, hirb just has a reference to the an 
instance of the Shell class, to which it is delegating all the calls. I'll fix 
the commenting to make it clearer.

{code}
+        ret = translate_hbase_exceptions(*args) { command(*args) }
+        return ret
{code}
Yeah, that is just cruft from debugging, where I dumping some output in the 
middle.

bq. I don't see table.help. Is it missing from this patch?

Yeah, completely forgot to implement it ;) I'll put it into the next version. 
There are still some issues around hiding methods, since we do actually get 
autocomplete, which is nice. I'm also working on a version that will format the 
output (as opposed to the raw stuff we see from a scan below).

Here is what some shell output looks like with the current patch:
{code}
1.9.2-p290 :001 > create 't', 'f'
0 row(s) in 1.7060 seconds

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

 => #<Hbase::Table:0x6c6742d0 
@table=#<Java::OrgApacheHadoopHbaseClient::HTable:0x59046270>> 
1.9.2-p290 :003 > t.put 'r', 'f', 'value'
1.9.2-p290 :004 > t.scan
 => {"r"=>{"f:"=>"timestamp=1331353365816, value=value"}} 
{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
>
>
> 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

        

Reply via email to