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

Improve NetworkTopology#InnerNode#remove logic

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: