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

Small fix for NetworkTopologyWithNodeGroup#sortByDistance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6.0
    • 2.6.0
    • None
    • None

    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

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

            Dates

              Created:
              Updated:
              Resolved: