[
https://issues.apache.org/jira/browse/HBASE-7221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510472#comment-13510472
]
Doug Meil commented on HBASE-7221:
----------------------------------
So what now? Seems like there is general agreement that something like this
would be a good idea. And we all agree that there are plenty of edge cases
that this doesn't cover.
One thing to mention re: alternate encodings... I think this pattern is
extensible and RowKeySchema can be augmented for different encoding strategies,
while still keeping the easy-to-use that exists in the RowKey class.
As for class-names, Elliot isn't crazy about the name RowKey.
FixedLengthRowKey?
As for variable length keys (e.g., for people that still insist on using
Strings in keys), that's not a pattern that this class supports. I think you'd
have to use delimiters between fields in that case, but that's seems like it
could be supported in a subsequent patch (e.g., VariableLengthRowKey) in a
different ticket.
Thanks everybody for the review effort!
> RowKey utility class for rowkey construction
> --------------------------------------------
>
> Key: HBASE-7221
> URL: https://issues.apache.org/jira/browse/HBASE-7221
> Project: HBase
> Issue Type: Improvement
> Reporter: Doug Meil
> Assignee: Doug Meil
> Priority: Minor
> Attachments: HBASE_7221.patch, hbase-common_hbase_7221_2.patch,
> hbase-common_hbase_7221_v3.patch
>
>
> A common question in the dist-lists is how to construct rowkeys, particularly
> composite keys. Put/Get/Scan specifies byte[] as the rowkey, but it's up to
> you to sensibly populate that byte-array, and that's where things tend to go
> off the rails.
> The intent of this RowKey utility class isn't meant to add functionality into
> Put/Get/Scan, but rather make it simpler for folks to construct said arrays.
> Example:
> {code}
> RowKey key = RowKey.create(RowKey.SIZEOF_MD5_HASH + RowKey.SIZEOF_LONG);
> key.addHash(a);
> key.add(b);
> byte bytes[] = key.getBytes();
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira