[
https://issues.apache.org/jira/browse/HBASE-18951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16197165#comment-16197165
]
Chia-Ping Tsai commented on HBASE-18951:
----------------------------------------
bq. What about 'Helper class for sending checkAndMutate request'?
ok
{code}
+ @Override
+ public CheckAndMutateBuilder qualifier(byte[] qualifier) {
+ this.qualifier = Preconditions.checkNotNull(qualifier);
+ return this;
+ }
{code}
The null qualifier is legal in our data model, so the null check is
unnecessary. Also the null check will cause the ugly code like below.
{code}
CheckAndMutateBuilder builder = table.checkAndMutate(row, family);
if (qualifier != null) {
builder.qualifier(qualifier);
}
...
{code}
> 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)