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

Remove dead code and basic cleanup in DataTree

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Tags:
      cleanup, cleancode

      Description

      • DataTree members scount, initialized and method listACLEquals are never used
      • transform if(!C) B else A to if(C) A else B (removes one indirection to follow for the brain)
      • remove unused imports and one annotation
      • add method getApproximateDataSize to DataNode (I work towards an immutable DataNode without public properties)
      • move assignments (lastPrefix = getMaxPrefixWithQuota(path)) out of if statements
      • combine nested if statements: if A if B then C => if A && B => C
      • make ACL maps private and add getAclSize() to hide implementation details of the ACLs.

        Attachments

        1. ZOOKEEPER-1176.patch
          67 kB
          Thomas Koch
        2. ZOOKEEPER-1176.patch
          13 kB
          Thomas Koch
        3. ZOOKEEPER-1176.patch
          13 kB
          Thomas Koch
        4. ZOOKEEPER-1176.patch
          13 kB
          Thomas Koch
        5. ZOOKEEPER-1176.patch
          13 kB
          Thomas Koch

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: