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 A1A259A68 for ; Fri, 9 Mar 2012 10:29:36 +0000 (UTC) Received: (qmail 45011 invoked by uid 500); 9 Mar 2012 10:29:34 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 44976 invoked by uid 500); 9 Mar 2012 10:29:34 -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 44967 invoked by uid 99); 9 Mar 2012 10:29:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Mar 2012 10:29:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [130.233.222.102] (HELO mx03.aalto.fi) (130.233.222.102) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Mar 2012 10:29:27 +0000 Received: from mx03.aalto.fi (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 853AE28160 for ; Fri, 9 Mar 2012 12:29:05 +0200 (EET) Received: from EXHUB04.org.aalto.fi (ex-hub04.org.aalto.fi [130.233.222.117]) by mx03.aalto.fi (Postfix) with ESMTP id 706152815F for ; Fri, 9 Mar 2012 12:29:05 +0200 (EET) Received: from EXMDB02.org.aalto.fi ([169.254.4.27]) by EXHUB04.org.aalto.fi ([130.233.222.117]) with mapi id 14.01.0339.001; Fri, 9 Mar 2012 12:29:05 +0200 From: de Souza Medeiros Andre To: "user@hbase.apache.org" Subject: RE: HTable.getEndKeys() returning empty results Thread-Topic: HTable.getEndKeys() returning empty results Thread-Index: Acz9SAYLFo+KE3P3RaCnK/UmIMbmXf//5RGAgABUW6P///m+gIAA8ybOgAAHXps= Date: Fri, 9 Mar 2012 10:29:05 +0000 Message-ID: <460ED1013765BD4A92CDA53C2082DCC68DD8D57C@EXMDB02.org.aalto.fi> References: <460ED1013765BD4A92CDA53C2082DCC68DD8D414@EXMDB02.org.aalto.fi> <460ED1013765BD4A92CDA53C2082DCC68DD8D49D@EXMDB02.org.aalto.fi>,,<460ED1013765BD4A92CDA53C2082DCC68DD8D568@EXMDB02.org.aalto.fi> In-Reply-To: <460ED1013765BD4A92CDA53C2082DCC68DD8D568@EXMDB02.org.aalto.fi> Accept-Language: en-US, fi-FI Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [130.233.178.1] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Ok, now I'm not sure if I what I just said can be done.=0A= =0A= According to Lars George's book, in HBase "there are no index files that al= low such direct access of a particular row or column.". Does this mean that= my scan "starting" at the given pointer will actually start scanning from = the beginning of the block in HFile, ignoring everything until it scans the= row I specified as the start? =0A= ________________________________________=0A= From: de Souza Medeiros Andre [andre.medeiros@aalto.fi]=0A= Sent: Friday, March 09, 2012 12:02=0A= To: user@hbase.apache.org=0A= Subject: RE: HTable.getEndKeys() returning empty results=0A= =0A= Hi Drz,=0A= =0A= Yes, I've thought about that problem. But I've got an idea that sounds quit= e ok. Since scanning seems to be the only way of getting the last data row = of table A, one can implement a "counter" table (single row, single column)= to point to the row in A where the scanner should start. The counter value= can be periodically updated to improve the performance of scanners.=0A= =0A= Thanks for the support=0A= =0A= -- Andre Medeiros=0A= ________________________________________=0A= From: Michael Drzal [mdrzal@gmail.com]=0A= Sent: Thursday, March 08, 2012 23:28=0A= To: user@hbase.apache.org=0A= Subject: Re: HTable.getEndKeys() returning empty results=0A= =0A= On Thu, Mar 8, 2012 at 2:50 PM, de Souza Medeiros Andre <=0A= andre.medeiros@aalto.fi> wrote:=0A= =0A= > Thanks for the answer.=0A= > This is quite confusing though, what is the point of having a method to= =0A= > retrieve the last key if we know that anyway it will be an empty byte arr= ay?=0A= >=0A= > Or does this happen only with one-region tables?=0A= >=0A= > Any way, is there some way of getting the last _data_ row of a table?=0A= > Other than scanning the whole thing...=0A= >=0A= =0A= Think about it this way:=0A= =0A= - the last key for the region is key099=0A= - you insert key100=0A= - you insert key101=0A= - you insert key102=0A= =0A= Do you really want the meta table updated for each an every insert that=0A= touches the end?=0A= =0A= Drz=0A= =0A= =0A= > Thanks,=0A= > - Andre Medeiros=0A= > ________________________________________=0A= > From: saint.ack@gmail.com [saint.ack@gmail.com] on behalf of Stack [=0A= > stack@duboce.net]=0A= > Sent: Thursday, March 08, 2012 18:48=0A= > To: user@hbase.apache.org=0A= > Subject: Re: HTable.getEndKeys() returning empty results=0A= >=0A= > On Thu, Mar 8, 2012 at 8:25 AM, de Souza Medeiros Andre=0A= > wrote:=0A= > > Hi all,=0A= > >=0A= > > Has someone had problems with HTable.getEndKeys() method? In my=0A= > application it returns an array of byte[], but the first (and only) byte[= ]=0A= > is empty, so essentially it's telling me that the (single) region has no= =0A= > end key.=0A= > >=0A= > > The table has 3 rows and I'm running standalone HBase 0.90.4 CDH3u3 on= =0A= > my local machine. Moreover, the call getEndKeys() is executed immediately= =0A= > after I put rows in the table.=0A= > >=0A= > > Do I need to wait until the .META. table gets updated with the regions'= =0A= > end row keys?=0A= > > Does HTable.getEndKeys() work only in a fully distributed mode?=0A= > > Is there any other way of getting the last row in a table? (this is my= =0A= > objective after all)=0A= > >=0A= >=0A= > An empty byte array is the last key in a table of one region only. An=0A= > hbase table uses empty byte array as both the start and end row=0A= > signifier as per the bigtable paper (I don't see this explicitly=0A= > called out in the reference guide but I'm probably not looking in=0A= > right place).=0A= >=0A= > St.Ack=0A= >=0A=