You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Ben West (Updated) (JIRA)" <ji...@apache.org> on 2012/03/09 19:32:58 UTC

[jira] [Updated] (HBASE-4818) HBase Shell - Add support for formatting row keys before output

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

Ben West updated HBASE-4818:
----------------------------

    Attachment: hbase-4818.patch

Attaching a patch which includes:

1. The ability to specify a custom formatter on the command line
2. A sample custom formatter which reverses the keys before printing them in a scan 

You can use the new formatter by doing {code}
hbase shell --format=Shell::Formatter::ReverseID.new
{code}

We have an existing shell variable (JRUBY_OPTS) which you can set in your config script to persist your options, as Lars suggested. I'm not sure how to implement Eran's suggestion of per-table formatters using the command line; maybe we should deprecate the command line option since it doesn't do anything anyway and store this in .irbrc.

Also, the reverse ID formatter works by a kind of hack. 

I'd like to hear from people more familiar with the shell on how to make this better. 
                
> HBase Shell - Add support for formatting row keys before output
> ---------------------------------------------------------------
>
>                 Key: HBASE-4818
>                 URL: https://issues.apache.org/jira/browse/HBASE-4818
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>            Reporter: Eran Kampf
>            Priority: Trivial
>         Attachments: hbase-4818.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> As many HBase users use binary row keys rather than strings to optimize memory consumption displaying an escaped string in the HBase shell isn't useful (and takes a lot of screen space)
> Allowing user to provide a row key formatter as part of the scan\get commands would allow developers to display the row key in a way thats makes sense for them.
> Example:
> scan 'stats', { ROWFORMATTER => MyRowFormatter.new }
> The row formatter simply gets the bytes array key and formats it to a string.
> Its an easy change tomake with simple monkey-patching of the shell commands but I would be happy to see it as part of the shell itself.

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