You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/10/12 17:10:01 UTC

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

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-3926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated ZOOKEEPER-3926:
--------------------------------------
    Labels: pull-request-available  (was: )

> 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
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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)