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

stack commented on HBASE-7221:
------------------------------

Hey boss... fix the formatting.  Its all over the place -- see the patch.  You 
have tabs in there?   If you look at other code you'll see it uses spaces for 
tabs and two spaces at that.

Builder is a good name but you don't seem to follow the general builder 
pattern... i.e. get a 'builder', then do things against it and on the end call 
'build' to return the result.  That could confuse (You have some of it w/ your 
static to create an instance...)

You keep adding to the backing array... just let the ArrayOutOfBounds happen if 
they try to add off the end?

Why does the key have to be of fixed size?

Good stuff.

                
> 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
>
>
> 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