hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yi Liu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-10964) Small fix for NetworkTopologyWithNodeGroup#sortByDistance
Date Wed, 13 Aug 2014 07:00:18 GMT
Yi Liu created HADOOP-10964:

             Summary: Small fix for NetworkTopologyWithNodeGroup#sortByDistance
                 Key: HADOOP-10964
                 URL: https://issues.apache.org/jira/browse/HADOOP-10964
             Project: Hadoop Common
          Issue Type: Bug
    Affects Versions: 2.6.0
            Reporter: Yi Liu
            Assignee: Yi Liu
            Priority: Minor

{{nodes.length}} should be {{activeLen}}.
  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 {
    super.sortByDistance(reader, nodes, nodes.length, seed,

This message was sent by Atlassian JIRA

View raw message