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 8FF1D9631 for ; Thu, 8 Mar 2012 21:28:43 +0000 (UTC) Received: (qmail 39313 invoked by uid 500); 8 Mar 2012 21:28:41 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 39273 invoked by uid 500); 8 Mar 2012 21:28:41 -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 39264 invoked by uid 99); 8 Mar 2012 21:28:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2012 21:28:41 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mdrzal@gmail.com designates 74.125.82.169 as permitted sender) Received: from [74.125.82.169] (HELO mail-we0-f169.google.com) (74.125.82.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2012 21:28:37 +0000 Received: by werj55 with SMTP id j55so920560wer.14 for ; Thu, 08 Mar 2012 13:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ARLw3k92agaEkr0oaIEjZ8lx8Bq6lz+cbodxftuumUs=; b=1G0MIn4O1EbZjVHgzmXmUk+BBzOkA7edXIMA7ZX1XVFvMOUwgzCYMez7CpuzT3jbuA B/FzIeuNYGb8wqIdtB7FFqsz9LTKhjDdS6LaPzJMUhgO1toebRu48WlD+KKCFJ+YN9Ai OCkFUqHlgohbMJod6yMWJAzVvSVNmUsigB/ztT92H5YBEVy39z7f3LWcejlwsxMKYEf4 ZiL2NEmwJ2hPhspufIhpqm4H1OF5i2+JtjLDh5PtgJZdw9Dp0MiX0IAgbA5wQKuRWb/T yEZsmNt8OLu3Cz/lDE6q47a3FxhREksChj55Ogx+whumSe9+SE1zg5otFjWAtLXwgtcf DYsA== MIME-Version: 1.0 Received: by 10.180.102.231 with SMTP id fr7mr15121795wib.10.1331242095836; Thu, 08 Mar 2012 13:28:15 -0800 (PST) Received: by 10.216.155.209 with HTTP; Thu, 8 Mar 2012 13:28:15 -0800 (PST) In-Reply-To: <460ED1013765BD4A92CDA53C2082DCC68DD8D49D@EXMDB02.org.aalto.fi> References: <460ED1013765BD4A92CDA53C2082DCC68DD8D414@EXMDB02.org.aalto.fi> <460ED1013765BD4A92CDA53C2082DCC68DD8D49D@EXMDB02.org.aalto.fi> Date: Thu, 8 Mar 2012 16:28:15 -0500 Message-ID: Subject: Re: HTable.getEndKeys() returning empty results From: Michael Drzal To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=f46d044519a73b7c8104bac1f4b9 X-Virus-Checked: Checked by ClamAV on apache.org --f46d044519a73b7c8104bac1f4b9 Content-Type: text/plain; charset=UTF-8 On Thu, Mar 8, 2012 at 2:50 PM, de Souza Medeiros Andre < andre.medeiros@aalto.fi> wrote: > Thanks for the answer. > This is quite confusing though, what is the point of having a method to > retrieve the last key if we know that anyway it will be an empty byte array? > > Or does this happen only with one-region tables? > > Any way, is there some way of getting the last _data_ row of a table? > Other than scanning the whole thing... > Think about it this way: - the last key for the region is key099 - you insert key100 - you insert key101 - you insert key102 Do you really want the meta table updated for each an every insert that touches the end? Drz > Thanks, > - Andre Medeiros > ________________________________________ > From: saint.ack@gmail.com [saint.ack@gmail.com] on behalf of Stack [ > stack@duboce.net] > Sent: Thursday, March 08, 2012 18:48 > To: user@hbase.apache.org > Subject: Re: HTable.getEndKeys() returning empty results > > On Thu, Mar 8, 2012 at 8:25 AM, de Souza Medeiros Andre > wrote: > > Hi all, > > > > Has someone had problems with HTable.getEndKeys() method? In my > application it returns an array of byte[], but the first (and only) byte[] > is empty, so essentially it's telling me that the (single) region has no > end key. > > > > The table has 3 rows and I'm running standalone HBase 0.90.4 CDH3u3 on > my local machine. Moreover, the call getEndKeys() is executed immediately > after I put rows in the table. > > > > Do I need to wait until the .META. table gets updated with the regions' > end row keys? > > Does HTable.getEndKeys() work only in a fully distributed mode? > > Is there any other way of getting the last row in a table? (this is my > objective after all) > > > > An empty byte array is the last key in a table of one region only. An > hbase table uses empty byte array as both the start and end row > signifier as per the bigtable paper (I don't see this explicitly > called out in the reference guide but I'm probably not looking in > right place). > > St.Ack > --f46d044519a73b7c8104bac1f4b9--