Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12295

Improve NetworkTopology#InnerNode#remove logic

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      In NetworkTopology#InnerNode#remove, We can use childrenMap to get the parent node, no need to loop the children list. Then it is more efficient since in most cases deleting parent node doesn't happen.
      Another nit in current code is:

        String parent = n.getNetworkLocation();
        String currentPath = getPath(this);
      

      can be in closure of !isAncestor(n)

        Attachments

          Activity

            People

            • Assignee:
              hitliuyi Yi Liu
              Reporter:
              hitliuyi Yi Liu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: