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

Small fix for NetworkTopologyWithNodeGroup#sortByDistance

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.6.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      nodes.length should be activeLen.

        @Override
        public void sortByDistance(Node reader, Node[] nodes, int activeLen,
            long seed, boolean randomizeBlockLocationsPerBlock) {
          // If reader is not a datanode (not in NetworkTopology tree), we need to
          // replace this reader with a sibling leaf node in tree.
          if (reader != null && !this.contains(reader)) {
            Node nodeGroup = getNode(reader.getNetworkLocation());
            if (nodeGroup != null && nodeGroup instanceof InnerNode) {
              InnerNode parentNode = (InnerNode) nodeGroup;
              // replace reader with the first children of its parent in tree
              reader = parentNode.getLeaf(0, null);
            } else {
              return;
            }
          }
          super.sortByDistance(reader, nodes, nodes.length, seed,
              randomizeBlockLocationsPerBlock);
        }
      

        Attachments

        1. HADOOP-10964.001.patch
          0.6 kB
          Yi Liu

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: