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

Lars Hofhansl commented on HBASE-7221:
--------------------------------------

Sorry, have been quiet here. Orderly and Lily have code for this. We could 
either lift the code from there (license permitting) or include one of these 
libraries (again license permitting).

We also have build encoders for primitive types in our Phoenix (SQL on HBase) 
project - to be open sourced soon hopefully. I'm sure we could donate those 
before the release of Phoenix ([~giacomotaylor]).

So to be clear, we are all agreeing that we need two facilities: one to encode 
primitive values into byte[]'s suitable for sorting, and another one to build 
composite keys. Right?

That would clearly be a good step for HBase. (1) it would introduce a 
"standard" way to encode primitive type and (2) it would help with the 
recurring task of build composite keys (something each and every user of HBase 
has to build eventually).

                
> 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

Reply via email to