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 2E8BF175EA for ; Wed, 23 Sep 2015 18:46:28 +0000 (UTC) Received: (qmail 45491 invoked by uid 500); 23 Sep 2015 18:46:26 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 45424 invoked by uid 500); 23 Sep 2015 18:46:26 -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 45413 invoked by uid 99); 23 Sep 2015 18:46:26 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2015 18:46:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D79B7C0FAC for ; Wed, 23 Sep 2015 18:46:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.981 X-Spam-Level: ** X-Spam-Status: No, score=2.981 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id p62i8BgLYUU6 for ; Wed, 23 Sep 2015 18:46:16 +0000 (UTC) Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com [209.85.213.173]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 97BDD20F4A for ; Wed, 23 Sep 2015 18:46:16 +0000 (UTC) Received: by igcpb10 with SMTP id pb10so125100754igc.1 for ; Wed, 23 Sep 2015 11:46:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=fqaGm4ZTYaIhaGi/btvoG2oWudhZUf3Tupp0rC6FPlw=; b=NffjemiQOby0hNe5t/QMwRmgjL0XFzzFPPQyI9MkfVcQGV4BK2XVvlDJpYxORFAPY4 PFXArGz+BsQylxuNHkjqEW3UOdxXmwXvCdcJfCMTC85rSeiEMZBObBaoAwPJlEqMeNil dOZ4FterjhhOuLgTGPiiXeaimYpih8vd/M0Mp+EVAm+0tYeijixFi6DUO/EJtOQ3iw4p s+M3qsONj+sP2ZYRExxXP2ZbBdW7HkxEaDK78RV4fqcWY6xxtgfqDaSQFDBkafCi3aiB Yybxeorkl3V19wO3lv5t2b92QSMzjC8E+sPsOOS2DJX563HoV4ssTBuU7JPpRJDaKvwe A90g== X-Gm-Message-State: ALoCoQnQg9ctR6PKnXAhgFPpsYO2eKUNnmkbpVZ/41w0Tl5tE7km6fiMOfg/Deev4a4M5C9VeySI X-Received: by 10.50.64.178 with SMTP id p18mr23945301igs.27.1443033970206; Wed, 23 Sep 2015 11:46:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.133.68 with HTTP; Wed, 23 Sep 2015 11:45:30 -0700 (PDT) In-Reply-To: References: From: Gaurav Agarwal Date: Thu, 24 Sep 2015 00:15:30 +0530 Message-ID: Subject: Re: Large number of column qualifiers To: Hbase Users Content-Type: multipart/alternative; boundary=047d7bd75c3a3184c705206e876e --047d7bd75c3a3184c705206e876e Content-Type: text/plain; charset=UTF-8 Thanks Vlad. Could you please point me the KV size setting (default 1MB)? Just to make sure that I understand correct, are you suggesting that the following comment is incorrect in Cell.java? /** * Contiguous raw bytes that may start at any index in the containing array. Max length is * Short.MAX_VALUE which is 32,767 bytes. * @return The array containing the qualifier bytes. */ byte[] getQualifierArray(); On Thu, Sep 24, 2015 at 12:10 AM, Gaurav Agarwal wrote: > Thanks Vlad. Could you please point me the KV size setting (default 1MB)? > Just to make sure that I understand correct - the following comment is > incorrect in Cell.java: > > /** > * Contiguous raw bytes that may start at any index in the containing > array. Max length is > * Short.MAX_VALUE which is 32,767 bytes. > * @return The array containing the qualifier bytes. > */ > byte[] getQualifierArray(); > > On Wed, Sep 23, 2015 at 11:43 PM, Vladimir Rodionov < > vladrodionov@gmail.com> wrote: > >> Check KeyValue class (Cell's implementation). getQualifierArray() returns >> kv's backing array. There is no SHORT limit on a size of this array, but >> there are other limits in HBase - maximum KV size, for example, which is >> configurable, but, by default, is 1MB. Having 50K qualifiers is a bad >> idea. >> Consider redesigning your data model and use rowkey instead. >> >> -Vlad >> >> On Wed, Sep 23, 2015 at 10:24 AM, Ted Yu wrote: >> >> > Please take a look at HBASE-11544 which is in hbase 1.1 >> > >> > Cheers >> > >> > On Wed, Sep 23, 2015 at 10:18 AM, Gaurav Agarwal >> wrote: >> > >> > > Hi All, >> > > >> > > I have Column Family with very large number of column qualifiers (> >> > > 50,000). Each column qualifier is 8 bytes long. The problem is the >> when I >> > > do a scan operation to fetch some rows, the client side Cell object >> does >> > > not have enough space allocated in it to hold all the columnQaulifiers >> > for >> > > a given row and hence I cannot read all the columns back for a given >> row. >> > > >> > > Please see the code snippet that I am using: >> > > >> > > final ResultScanner rs = htable.getScanner(scan); >> > > for (Result row = rs.next(); row != null; row = rs.next()) { >> > > final Cell[] cells = row.rawCells(); >> > > if (cells != null) { >> > > for (final Cell cell : cells) { >> > > final long c = Bytes.toLong( >> > > *cell.getQualifierArray()*, >> > cell.getQualifierOffset(), >> > > cell.getQualifierLength()); >> > > final long v = Bytes.toLong(cell.getValueArray(), >> > > cell.getValueOffset()); >> > > points.put(c, v); >> > > } >> > > } >> > > } >> > > >> > > The cell.getQualifierArray() method says that it's 'Max length is >> > > Short.MAX_VALUE which is 32,767 bytes.'. Hence it can only hold around >> > > 4,000 columnQualfiers. >> > > >> > > Is there an alternate API that I should be using or am I missing some >> > > setting here? Note that in worst case I need to read all the >> > > columnQualifiers in a row and I may or may not know a subset to fetch >> in >> > > advance. >> > > >> > > Even if this is not possible in a single call, is there a way to >> cursor >> > > through the columnQualifiers? >> > > >> > > I am presently using Hbase 0.96 client but can switch to Hbase 1.x if >> > there >> > > is an API in the newer version. >> > > >> > > --cheers, gaurav >> > > >> > > -- >> > > --cheers, gaurav >> > > >> > >> > > > > -- > --cheers, gaurav > -- --cheers, gaurav --047d7bd75c3a3184c705206e876e--