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

Remove duplicate check in ContainerManager#getCandidates method

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      ContainerManager#getCandidates:
      ```
      if ((node != null) && node.getChildren().isEmpty()) {
      /*
      cversion > 0: keep newly created containers from being deleted
      before any children have been added. If you were to create the
      container just before a container cleaning period the container
      would be immediately be deleted.
      */
      if (node.stat.getCversion() > 0) {
      candidates.add(containerPath);
      ```
      It has already checked the below logic, so no need to do it one more time.
      ```
      if ((node != null) && (node.stat.getCversion() > 0) && (node.getChildren().isEmpty()))

      { candidates.add(containerPath); }

      ```

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              technoboy Guo Jiwei
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m