ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-835 Refactoring Zookeeper Client Code
  3. ZOOKEEPER-908

Remove code duplication and inconsistent naming in ClientCnxn.Packet creation

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: server
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      rename record -> request (since their is a counterpart record named "response")
      rename header -> requestHeader (to distinguish from responseHeader)

      remove ByteBuffer creation code from primeConnection() method and use the duplicate code in the Packet constructor. Therefor the Bytebuffer bb parameter could also be removed from the constructor's parameters.

        Activity

        Thomas Koch created issue -
        Hide
        Thomas Koch added a comment -

        ant test-core did work without failures.

        Show
        Thomas Koch added a comment - ant test-core did work without failures.
        Thomas Koch made changes -
        Field Original Value New Value
        Attachment ZOOKEEPER-908.patch [ 12457741 ]
        Patrick Hunt made changes -
        Assignee Thomas Koch [ thkoch ]
        Fix Version/s 3.4.0 [ 12314469 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Component/s server [ 12312382 ]
        Hide
        Patrick Hunt added a comment -

        Thanks Thomas. As we are refactoring this code anyway, and our raised consciousness on "best practices", how about implementing some tests for the effected class (packet?). Any low hanging fruit that you see (perhaps a bit more refactoring may be needed) wrt test coverage?

        If you think it's ready, or if after you add tests, click on the "submit patch" link to transition this to patch available (at which point we'll review for commit, and typically (if it wasn't currently broken) the automated patch tests would run.)

        Show
        Patrick Hunt added a comment - Thanks Thomas. As we are refactoring this code anyway, and our raised consciousness on "best practices", how about implementing some tests for the effected class (packet?). Any low hanging fruit that you see (perhaps a bit more refactoring may be needed) wrt test coverage? If you think it's ready, or if after you add tests, click on the "submit patch" link to transition this to patch available (at which point we'll review for commit, and typically (if it wasn't currently broken) the automated patch tests would run.)
        Thomas Koch made changes -
        Attachment ZOOKEEPER-908.patch [ 12457741 ]
        Hide
        Thomas Koch added a comment -

        new patch against the current Client after ZOOKEEPER-909

        There are not new tests in this patch. Please commit it anyway. I'm planning to move the Packet class out to a separate file as part of ZOOKEEPER-894.
        Then I'd like to do ZOOKEEPER-878.
        After this, it would be the right time to see if the Packet class needs any tests.

        I'd like to collect these low hanging fruits and make the Client java stuff more comprehensible before continuing with the Netty stuff in ZOOKEEPER-823

        Show
        Thomas Koch added a comment - new patch against the current Client after ZOOKEEPER-909 There are not new tests in this patch. Please commit it anyway. I'm planning to move the Packet class out to a separate file as part of ZOOKEEPER-894 . Then I'd like to do ZOOKEEPER-878 . After this, it would be the right time to see if the Packet class needs any tests. I'd like to collect these low hanging fruits and make the Client java stuff more comprehensible before continuing with the Netty stuff in ZOOKEEPER-823
        Thomas Koch made changes -
        Attachment ZOOKEEPER-908.patch [ 12459361 ]
        Thomas Koch made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12459361/ZOOKEEPER-908.patch
        against trunk revision 1033770.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/25//testReport/
        Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/25//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/25//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12459361/ZOOKEEPER-908.patch against trunk revision 1033770. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/25//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/25//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/25//console This message is automatically generated.
        Hide
        Patrick Hunt added a comment -

        +1 change looks good to me. Thanks Thomas! Committed to trunk.

        Show
        Patrick Hunt added a comment - +1 change looks good to me. Thanks Thomas! Committed to trunk.
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #999 (See https://hudson.apache.org/hudson/job/ZooKeeper-trunk/999/)
        ZOOKEEPER-908. Remove code duplication and inconsistent naming in ClientCnxn.Packet creation

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #999 (See https://hudson.apache.org/hudson/job/ZooKeeper-trunk/999/ ) ZOOKEEPER-908 . Remove code duplication and inconsistent naming in ClientCnxn.Packet creation
        Mahadev konar made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        21d 6h 3m 1 Thomas Koch 11/Nov/10 16:06
        Patch Available Patch Available Resolved Resolved
        1h 8m 1 Patrick Hunt 11/Nov/10 17:14
        Resolved Resolved Closed Closed
        377d 2h 7m 1 Mahadev konar 23/Nov/11 19:22

          People

          • Assignee:
            Thomas Koch
            Reporter:
            Thomas Koch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development