hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anil gupta <anilgupt...@gmail.com>
Subject Re: question about hbase rest api decoding long value stored as byte array
Date Thu, 04 Oct 2012 06:22:27 GMT
Hi Weishung,

Since you stored the value as a long rather than String. You need to
convert the byte [] of value into a Long. You can use the  following method
to convert byte[] into long.
long org.apache.hadoop.hbase.util.Bytes<eclipse-javadoc:%E2%98%82=hbase_resteasy/C:%5C/Users%5C/agupta5%5C/.m2%5C/repository%5C/org%5C/apache%5C/hbase%5C/hbase%5C/0.92.1-cdh4.0.1%5C/hbase-0.92.1-cdh4.0.1.jar%3Corg.apache.hadoop.hbase.util(Bytes.class%E2%98%83Bytes>
.toLong(byte[] bytes)

HTH,
Anil Gupta

On Wed, Oct 3, 2012 at 10:42 PM, Weishung Chung <weishung@gmail.com> wrote:

> Hi,
>
> I store a long value as byte array in HBase cell using an Increment object.
>
> When I try to access the value via javascript using rest api, how do I
> decode the value ? It works fine for String value when using atob method
> but somehow I couldn't decode the long value correctly :(
>
> Thank you,
> Wei Shung
>



-- 
Thanks & Regards,
Anil Gupta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message