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 9BCDAD21D for ; Thu, 4 Oct 2012 06:23:19 +0000 (UTC) Received: (qmail 66949 invoked by uid 500); 4 Oct 2012 06:23:16 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 66619 invoked by uid 500); 4 Oct 2012 06:23:16 -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 66591 invoked by uid 99); 4 Oct 2012 06:23:15 -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:23:15 +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:23:08 +0000 Received: by mail-ie0-f169.google.com with SMTP id 10so357141ied.14 for ; Wed, 03 Oct 2012 23:22:48 -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=9ytVg0Vto4aej/qxGJqOThuJVWxz6MM3ZjRpe5FH7T8=; b=f/KP4KX4HG201QY25ABi04sBfTzzTsNOEutIIcVeW17dOXgSOPb1AE3XkNbstOAbHI FMQkrdi5SUIPN6O0K/pHxaqGXH6spnS5RzLE1xB4jbsshUwTm+wyELDBcHGoHPhmVw2D oGp92RDZqdFQKAqtuMVn7xCKzlYRI1u6TevkBm5uN+PDCx5n02pb+nVnGFLEIwav4iyO Eqrb1eO4NGpo7w0g/2N5Gnysm7RIcYs4PJLD4tHCN+Mi8qagCZSADZneqm3YuvVH6DgF 7k0ZXHxmx/S4+iiw0TYgZAYBWozYLFbhXA5Ch3fRFRqzLLpvvzsuvd6YXTRa7sJAGJHK edlw== Received: by 10.50.150.176 with SMTP id uj16mr60172igb.38.1349331768222; Wed, 03 Oct 2012 23:22:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.67.197 with HTTP; Wed, 3 Oct 2012 23:22:27 -0700 (PDT) In-Reply-To: References: From: anil gupta Date: Wed, 3 Oct 2012 23:22:27 -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=f46d04339d1abaa2d704cb35c863 X-Virus-Checked: Checked by ClamAV on apache.org --f46d04339d1abaa2d704cb35c863 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 objec= t. > > 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 > --=20 Thanks & Regards, Anil Gupta --f46d04339d1abaa2d704cb35c863--