You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Damien Diederen (Jira)" <ji...@apache.org> on 2020/10/28 10:22:00 UTC
[jira] [Resolved] (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 ]
Damien Diederen resolved ZOOKEEPER-3926.
----------------------------------------
Fix Version/s: 3.7.0
Resolution: Fixed
Issue resolved by pull request 1497
[https://github.com/apache/zookeeper/pull/1497]
> 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
> Assignee: Damien Diederen
> Priority: Minor
> Labels: pull-request-available
> Fix For: 3.7.0
>
> Time Spent: 1h 20m
> 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)