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

Chia-Ping Tsai commented on HBASE-18951:
----------------------------------------

bq. And for the unification of the three methods, do you mean a single method 
or three methods with the same name? RowMutations is not a Mutation so if we 
want a single method then we can only use Row as the parameter, which makes no 
sense... And if we still have three methods, it is not a big problem that we 
use three different names?
The code style i mentioned is shown below. It is ok to keep the original name. 
{code}
CheckAndMutateRequest {
    CheckAndMutateRequest qualifier(byte[])
    CheckAndMutateRequest ifNotExists();
    CompletableFuture<Boolean> execute(Put);
    CompletableFuture<Boolean> execute(Delete);
    CompletableFuture<Boolean> execute(RowMutation);
}
{code}

bq. But it is a builder anyway, just followed the Curator naming way... See 
here:
What I expect to get from XXXBuilder is XXX. The comment of 
{{CheckAndMutateBuilder}} also says the builder is *for building checkAndMutate 
request*. However, the only object we can get from the 
{{CheckAndMutateBuilder}} is the *response* from server rather than the 
*request*. That is why i say "The comment and the class name may mislead us 
about ur philosophy". 







> Use Builder pattern to remove nullable parameters for checkAndXXX methods in 
> RawAsyncTable/AsyncTable interface
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-18951
>                 URL: https://issues.apache.org/jira/browse/HBASE-18951
>             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-18951.patch
>
>
> As Optional is not supposed to be used as method parameters but we do not 
> want nullable parameters.



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

Reply via email to