Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CCB5E9242 for ; Thu, 4 Oct 2012 06:44:56 +0000 (UTC) Received: (qmail 26788 invoked by uid 500); 4 Oct 2012 06:44:55 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 26468 invoked by uid 500); 4 Oct 2012 06:44:54 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 26441 invoked by uid 99); 4 Oct 2012 06:44:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 06:44:53 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anilgupta84@gmail.com designates 209.85.223.169 as permitted sender) Received: from [209.85.223.169] (HELO mail-ie0-f169.google.com) (209.85.223.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 06:44:46 +0000 Received: by mail-ie0-f169.google.com with SMTP id 10so390105ied.14 for ; Wed, 03 Oct 2012 23:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=dCqyWjUdicj7m381VuECTTtyO1Tt1RKLAU5bf5q+5Bw=; b=NGU6OdXDlUcZSUpbH4Q+OU+Lv2Bu7Su1VC74xkE73FoGiLidEl7S3r9DLZWHpzmwLQ RpQ41sD3vZdBZniyYUQhP7kst8v8ufJJnVQKKew8YSLYJCRPp8OMYj4BQUudgQVgnrLU m0zh56HFjuDs6QF9sWw+EtUOFPKFXDuhGaZ9coQOo1qfWeoQW+PRzJAamZbfPsnCcUrr zkWqAcVaWUXXSqhlEO0XVYAqZ60NXxyNfR0dsbbcbvsuB6HPEjkK0VCKbRF96pZKG2ly l983x07EjfRHMUIaKDIyLr/ucBnQfhbWHFF8gYulwQBe56I4BRo4/xOcoItaMipvCTIz y74A== Received: by 10.43.106.69 with SMTP id dt5mr3500901icc.49.1349333064756; Wed, 03 Oct 2012 23:44:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.67.197 with HTTP; Wed, 3 Oct 2012 23:44:04 -0700 (PDT) In-Reply-To: References: From: anil gupta Date: Wed, 3 Oct 2012 23:44:04 -0700 Message-ID: Subject: Re: question about hbase rest api decoding long value stored as byte array To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=bcaec5171c79022de004cb361676 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec5171c79022de004cb361676 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry, i don't know java script. On Wed, Oct 3, 2012 at 11:40 PM, Weishung Chung wrote: > Yes I know how to do that using java api. How about using javascript ? > > On Wed, Oct 3, 2012 at 11:22 PM, anil gupta wrote= : > > > 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 > > .toLong(byte[] bytes) > > > > HTH, > > Anil Gupta > > > > On Wed, Oct 3, 2012 at 10:42 PM, Weishung Chung > > 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 > > > --=20 Thanks & Regards, Anil Gupta --bcaec5171c79022de004cb361676--