You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "maoling (Jira)" <ji...@apache.org> on 2020/09/04 09:54:00 UTC
[jira] [Created] (ZOOKEEPER-3926) make the rc constant in the
ClientCnxn
maoling created ZOOKEEPER-3926:
----------------------------------
Summary: 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
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)