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

Appy commented on HBASE-18972:
------------------------------

So we have 2 nullable/non-mandatory params here - startKey, endKey.
How about default values for startKeyInclusive and endKeyInclusive? Maybe true 
and false respectively to match our default way of writing keyranges?

So we have 7 params, 3 mandatory (stubMaker, callable and callback) and 4 
optional.
Nice! Builder pattern is perfect here! And with that execute() fn, it has 
perfect 'fluent' finish.

Some change suggestions:
- Reading from(..) and to(..) in AsyncAggregationClient, i had to go back and 
see what they were. Let's rename them to {from/to}RowKey to make it explicit?
- Also, since we are already using builder patterns, there's no point merging 
setters for different params. Let's add {start/end}Key{Inclusive/Exclusive}() 
functions.
- It was weird seeing those checkNotNull preconditions in execute(). Since 
those three (stubMaker, callable and callback) are mandatory params, they 
should go in builder's constructor. (That's the common pattern - mandatory 
params through constructor and optional params by setters; exception being, 
when there are many mandatory params but that's not the case here).

-----
{quote}
 \* TODO: For now the only difference between this interface and \{@link 
AsyncTable} is the scan
 \* method. The \{@link RawScanResultConsumer} exposes the implementation 
details of a scan(heartbeat)
 \* so it is not suitable for a normal user. If it is still the only difference 
after we implement
 \* most features of AsyncTable, we can think about merge these two interfaces.
 \* @since 2.0.0
{quote}
ref: 
https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncTable.java#L42
So i guess this won't be happening anymore?


> Use Builder pattern to remove nullable parameters for coprocessor methods in 
> RawAsyncTable interface
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-18972
>                 URL: https://issues.apache.org/jira/browse/HBASE-18972
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Client
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>            Priority: Blocker
>             Fix For: 2.0.0-beta-1
>
>         Attachments: HBASE-18972-v1.patch, HBASE-18972.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to