You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Suraj Naik (Jira)" <ji...@apache.org> on 2020/09/14 13:49:00 UTC

[jira] [Commented] (ZOOKEEPER-3926) make the rc constant in the ClientCnxn

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

Suraj Naik commented on ZOOKEEPER-3926:
---------------------------------------

[~maoling] if you are not working on this, can I work on this?

> make the rc constant in the ClientCnxn
> --------------------------------------
>
>                 Key: ZOOKEEPER-3926
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3926
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: maoling
>            Priority: Minor
>
> Lots of codes about the result code in the callback(ClientCnxn.EventThread#processEvent) is hardcode. For example:
> {code:java}
> } else if (p.response instanceof GetACLResponse) {
>     ACLCallback cb = (ACLCallback) p.cb;
>     GetACLResponse rsp = (GetACLResponse) p.response;
>     if (rc == 0) {
>         cb.processResult(rc, clientPath, p.ctx, rsp.getAcl(), rsp.getStat());
>     } else {
>         cb.processResult(rc, clientPath, p.ctx, null, null);
>     }
> }{code}
> This makes the codes difficult to maintain. What we want looks like this:
> {code:java}
> if (rc == Code.OK.intValue()) {
>    ////////////////////////
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)