Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3926

make the rc constant in the ClientCnxn

    XMLWordPrintableJSON

Details

    Description

      Lots of codes about the result code in the callback(ClientCnxn.EventThread#processEvent) is hardcode. For example:

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

      This makes the codes difficult to maintain. What we want looks like this:

      if (rc == Code.OK.intValue()) {
         ////////////////////////
      }
      

       

      Attachments

        Issue Links

          Activity

            People

              ztzg Damien Diederen
              maoling Ling Mao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h