hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chia-Ping Tsai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-18951) Use Builder pattern to remove nullable parameters for checkAndXXX methods in RawAsyncTable/AsyncTable interface
Date Mon, 09 Oct 2017 11:08:00 GMT

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

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

{code}
+
+    /**
+     * Check for lack of column.
+     */
+    CheckAndMutateBuilder ifNotExists();
{code}
I love this method. :)   To check the non-existence column, we pass the null value to Table#checkAndXXX...That
is really a ambiguous way.

{code}
+  /**
+   * A helper class for building checkAndMutate request.
+   */
+  interface CheckAndMutateBuilder {
{code}
The comment and the class name may mislead us about ur philosophy, as the {{CheckAndMutateBuilder}}
not only creates the request but also executes the request. 
What about the name {{CheckAndMutateRequest}} ? It may be better to merge {{thenMutate}},
{{thenDelete}}, and {{thenMutate}} into one method {{thenExecute(Put/Delete/RowMutation)}}.

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

Mime
View raw message