hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: ToBytes or ToString
Date Fri, 11 Feb 2011 21:05:25 GMT
Have you tried this ?

   * Write a printable representation of a byte array.
   *
   * @param b byte array
   * @return string
   * @see #toStringBinary(byte[], int, int)


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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message