On Thu, Mar 8, 2012 at 2:50 PM, de Souza Medeiros Andre < [email protected]> 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: [email protected] [[email protected]] on behalf of Stack [ > [email protected]] > Sent: Thursday, March 08, 2012 18:48 > To: [email protected] > Subject: Re: HTable.getEndKeys() returning empty results > > On Thu, Mar 8, 2012 at 8:25 AM, de Souza Medeiros Andre > <[email protected]> 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 >
