hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Meil <doug.m...@explorysmedical.com>
Subject Re: Constructing rowkeys and HBASE-7221
Date Tue, 15 Jan 2013 22:01:50 GMT

Hi there, well, this request for input fell like a thud.  :-)

But I think perhaps it has to do with the fact that I sent it to the
dev-list instead of the user-list, as people that are actively writing
HBase itself (devs) need less help with such keybuilding utilities.

So one last request for feedback, but this time aimed at users of HBase:
how has your key-building experience been?


On 1/7/13 11:04 AM, "Doug Meil" <doug.meil@explorysmedical.com> wrote:

>Greetings folks-
>I would like to restart the conversation on
>https://issues.apache.org/jira/browse/HBASE-7221 because there continue
>to be conversations on the dist-list about creating composite rowkeys,
>and while HBase makes just about anything possible, it doesn¹t make much
>easy in this respect.
>What I¹m lobbying for is a utility class (see the v3 patch in HBASE-7221)
>that can both create and read rowkeys (so this isn¹t just a one-way
>builder pattern).
>This is currently stuck because it was noted that Bytes has an issue with
>sort-order of numbers specifically if you have both negative and positive
>values, which is really a different issue, but because this patch uses
>Bytes it¹s related.
>What are people¹s thoughts on this topic in general, and the v3 version
>of the patch specifically?  (and the last set of comments).  Thanks!
>One of the unit tests shows the example of usage.  The last set of
>comments suggested that RowKey be renamed FixedLengthRowKey, which I
>think is a good idea.  A follow-on patch could include
>VariableLengthRowKey for folks that use strings in the rowkeys.
>  public void testCreate() throws Exception {
>    int elements[] = {RowKeySchema.SIZEOF_MD5_HASH,
>RowKeySchema.SIZEOF_INT, RowKeySchema.SIZEOF_LONG};
>    RowKeySchema schema = new RowKeySchema(elements);
>    RowKey rowkey = schema.createRowKey();
>    rowkey.setHash(0, hashVal);
>    rowkey.setInt(1, intVal);
>    rowkey.setLong(2, longVal);
>    byte bytes[] = rowkey.getBytes();
>    Assert.assertEquals("key length", schema.getRowKeyLength(),
>    Assert.assertEquals("e1", rowkey.getInt(1), intVal);
>    Assert.assertEquals("e2", rowkey.getLong(2), longVal);
>  }
>Doug Meil
>Chief Software Architect, Explorys

View raw message