hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Basjes (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-11990) Make setting the start and stop row for a specific prefix easier
Date Thu, 18 Sep 2014 13:42:34 GMT

    [ https://issues.apache.org/jira/browse/HBASE-11990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14138932#comment-14138932

Niels Basjes commented on HBASE-11990:

[~lhofhansl] Sorry, no that doesn't work. 
Simply appending 0x00 does not give the correct result (see also HBASE-9035 ).
Assume I have these rowids (note: I actually tested this to be 100% sure) 
{ 0x12, 0x23, 0xFF, 0xFF }
{ 0x12, 0x23, 0xFF, 0xFF, 0x00 }
{ 0x12, 0x23, 0xFF, 0xFF, 0x01 }
{ 0x12, 0x24 }
{ 0x12, 0x24, 0x00 }
{ 0x12, 0x24, 0x00, 0x00 }
And I want all rows with prefix
{ 0x12, 0x23, 0xFF, 0xFF }

Then using for the stopRow
{ 0x12, 0x23, 0xFF, 0xFF, 0x00 }
does not give me the wanted rows.

If I use 
{ 0x12, 0x24 }
I do get exactly what I expected.

Like I said in the original description: Setting the right value is actually pretty hard.

> Make setting the start and stop row for a specific prefix easier
> ----------------------------------------------------------------
>                 Key: HBASE-11990
>                 URL: https://issues.apache.org/jira/browse/HBASE-11990
>             Project: HBase
>          Issue Type: New Feature
>          Components: Client
>            Reporter: Niels Basjes
>         Attachments: 11990v4.txt, HBASE-11990-20140916-v2.patch, HBASE-11990-20140916-v3.patch,
HBASE-11990-20140916-v5.patch, HBASE-11990-20140916-v6.patch, HBASE-11990-20140916.patch,
> If you want to set a scan from your application to scan for a specific row prefix this
is actually quite hard.
> As described in several places you can set the startRow to the prefix; yet the stopRow
should be set to the prefix '+1'
> If the prefix 'ASCII' put into a byte[] then this is easy because you can simply increment
the last byte of the array. 
> But if your application uses real binary rowids you may run into the scenario that your
prefix is something like 
> {code}{ 0x12, 0x23, 0xFF, 0xFF }{code} Then the increment should be {code}{ 0x12, 0x24
> I have prepared a proposed patch that makes setting these values correctly a lot easier.

This message was sent by Atlassian JIRA

View raw message