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

Phabricator commented on HBASE-5357:
------------------------------------

mbautin has commented on the revision "[jira] [HBASE-5357] Refactoring: use the 
builder pattern for HColumnDescriptor".

  The patch passed all unit tests in my map-reduce run, except 
TestAtomicOperation, which passed locally. Still waiting for the Hadoop QA run.

INLINE COMMENTS
  src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java:438 I don't 
think this can break existing code. The return value will most likely be simply 
ignored.

  From http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html:

  "You cannot declare more than one method with the same name and the same 
number and type of arguments, because the compiler cannot tell them apart.

  The compiler does not consider return type when differentiating methods, so 
you cannot declare two methods with the same signature even if they have a 
different return type."


REVISION DETAIL
  https://reviews.facebook.net/D1851

                
> Use builder pattern in HColumnDescriptor
> ----------------------------------------
>
>                 Key: HBASE-5357
>                 URL: https://issues.apache.org/jira/browse/HBASE-5357
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Mikhail Bautin
>            Assignee: Mikhail Bautin
>         Attachments: D1851.1.patch, D1851.2.patch, D1851.3.patch, 
> D1851.4.patch, 
> Use-builder-pattern-for-HColumnDescriptor-2012-02-21_19_13_35.patch, 
> Use-builder-pattern-for-HColumnDescriptor-2012-02-23_12_42_49.patch, 
> Use-builder-pattern-for-HColumnDescriptor-20120223113155-e387d251.patch
>
>
> We have five ways to create an HFile writer, two ways to create a StoreFile 
> writer, and the sets of parameters keep changing, creating a lot of 
> confusion, especially when porting patches across branches. The same thing is 
> happening to HColumnDescriptor. I think we should move to a "builder pattern" 
> solution, e.g.
> {code:java}
>   HFileWriter w = HFile.getWriterBuilder(conf, <some common args>)
>       .setParameter1(value1)
>       .setParameter2(value2)
>       ...
>       .build();
> {code}
> Each parameter setter being on its own line will make merges/cherry-pick work 
> properly, we will not have to even mention default parameters again, and we 
> can eliminate a dozen impossible-to-remember constructors.
> This particular JIRA addresses the HColumnDescriptor refactoring. For 
> StoreFile/HFile refactoring see HBASE-5442.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to