[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-05-11 Thread stack (JIRA)

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

stack updated HBASE-5548:
-

Resolution: Fixed
Status: Resolved  (was: Patch Available)

I committed this a while back.

 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-addendum.patch, ruby_HBASE-5548-v1.patch, 
 ruby_HBASE-5548-v2.patch, ruby_HBASE-5548-v3.patch, ruby_HBASE-5548-v5.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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-05-01 Thread Jesse Yates (JIRA)

 [ 
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-addendum.patch

fixes for tests and slight bugs. Passes on locally on OSX.

Should be good for testing (and submit?).

 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-addendum.patch, ruby_HBASE-5548-v1.patch, 
 ruby_HBASE-5548-v2.patch, ruby_HBASE-5548-v3.patch, ruby_HBASE-5548-v5.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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-05-01 Thread stack (JIRA)

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

stack updated HBASE-5548:
-

Status: Patch Available  (was: Reopened)

Submitting addendum.  Pardon my being zealous for this fancy new feature

 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-addendum.patch, ruby_HBASE-5548-v1.patch, 
 ruby_HBASE-5548-v2.patch, ruby_HBASE-5548-v3.patch, ruby_HBASE-5548-v5.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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-04-26 Thread Jesse Yates (JIRA)

 [ 
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-v5.patch

Attaching patch with fixes as per stack. Turns out the get issue was just a 
misspelling I didn't catch; _think_ everything else is working.

Also, this includes a slight refactor so the help text actually lives in the 
table class, not remotely in table_help.rb. If it was enough that I forgot 
where it lived, then others will too :)

Should be good to go.

 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, ruby_HBASE-5548-v5.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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-04-19 Thread Jesse Yates (Updated) (JIRA)

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

Jesse Yates updated HBASE-5548:
---

Release Note: 
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. 

 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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-03-22 Thread Jesse Yates (Updated) (JIRA)

 [ 
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-v3.patch

Updated patch with:
* more commenting!
* updates for all the table commands
* addition of admin utilities on a table (e.g. flush, enable, disable and drop)

Think this is ready (and large enough to RB). thoughts?

 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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-03-21 Thread Jesse Yates (Updated) (JIRA)

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

Jesse Yates updated HBASE-5548:
---

Fix Version/s: 0.94.0

 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.94.0, 0.96.0

 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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-03-21 Thread Jesse Yates (Updated) (JIRA)

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

Jesse Yates updated HBASE-5548:
---

Fix Version/s: (was: 0.94.0)
   0.94.1

 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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-03-15 Thread Jesse Yates (Updated) (JIRA)

 [ 
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-v2.patch

Went back and forth a bunch on how I wanted to implement this (including coding 
up a couple different versions), hence the few days its taken me to get this 
patch up. 

Went with the current model as it helps keep concerns separate - table just 
does the internal work of how to do scans, puts, etc (the latter to be impl), 
and passes on the formatting work and specific help implementations to the 
command instances. 

To get here, had to add the ability to call a command by name in the Shell 
class, hence the internal_command method, but actually reuses most of the 
current support, even when calling the method from the table (safe views of 
commands, etc).

Final consideration: we may want to add a method to the command class so a 
command instance can add the ability to add a method to a table more easily, 
instead of having to add the section seen at the bottom of ::Commands::Scan, 
where we open back up the Table class. 

Thoughts? Or is that work minimal enough to justify for adding new commands?

If we are happy with this, I'll port the other table commands to this new model 
and post up a patch for review.

For completeness, the other major options considered:
* have table do all the formatting,etc now handled by the commands 
** side effect - commands are pretty useless except for help and is a pretty 
big rewrite and require the table to get a formmater as well as an instance of 
each command
** bonus - methods like scan_internal can be made private

* similar to this patch, but have the command on load register itself with the 
table so can do help
** minus - lots of reproduced functionality like what the Shell is currently 
doing with loading commands. Also, don't gain much and same problems as above
** bonus - code is a bit more centralized 

 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, 
 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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-03-11 Thread Jesse Yates (Updated) (JIRA)

 [ 
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   
 rcolumn=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




[jira] [Updated] (HBASE-5548) Add ability to get a table in the shell

2012-03-09 Thread Jesse Yates (Updated) (JIRA)

 [ 
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-5528-v0.patch

Initial cut at this ticket. Its a little unclean as we don't have a nice way to 
isolate the java methods from the ruby methods and absolutely zero formatting 
from the output of the different commands as that is currently handled by the 
individual 'command' implementations.

 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