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

Remove duplicate check in ContainerManager#getCandidates method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • 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

            Unassigned Unassigned
            technoboy Guo Jiwei
            Votes:
            0 Vote for this issue
            Watchers:
            1 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