hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: ToBytes or ToString
Date Fri, 11 Feb 2011 21:27:17 GMT
Shell does lowest-common denominator printing out String version of
the row bytes escaping the non-printables.

If all your tables use longs for row keys, it wouldn't be hard hacking
the formatter to print actual long for row bytes.

If you do this:

stack-3:trunk Stack$ ./bin/hbase shell --help
HBase Shell command-line options:
 format        Formatter for outputting results: console | html.
Default: console
 -d | --debug  Set DEBUG log levels.

Notice how you can pass a 'format' to use outputting shell emissions.

If you read bin/hirb.rb, it seems like only console is implemented.
You could add in a formatter that wrote out rows however you wanted.

St.Ack


On Fri, Feb 11, 2011 at 1:01 PM, devush <devushanker@gmail.com> wrote:
> hi,
>  I want to have the fixed size row key. i want to see the key in the
> shell also. Currently i have java Long as the key id, so the string
> representation is 19 characters maximum. I am using java
> String.format("%019d", myLongVariable).
>
> I am not sure if this is the correct way. If i use bytes array
>
> byte[] b = Bytes.toBytes(long), then i will have the length equal 8
> which is correct as the SIZEOF_LONG is 8. But in this case i am not
> able to see the decimal values in hbase shell.
>
> what is the best way to handle this. My row is rather big, but
> contains only the Long values i.e. digits.
>
> thanks
> devush.
>

Mime
View raw message