Esempio n. 1
0
        private ICollection <string> ResolveRacks(IList <string> nodes)
        {
            ICollection <string> racks = new HashSet <string>();

            if (nodes != null)
            {
                foreach (string node in nodes)
                {
                    // Ensure node requests are accompanied by requests for
                    // corresponding rack
                    string rack = RackResolver.Resolve(node).GetNetworkLocation();
                    if (rack == null)
                    {
                        Log.Warn("Failed to resolve rack for node " + node + ".");
                    }
                    else
                    {
                        racks.AddItem(rack);
                    }
                }
            }
            return(racks);
        }
 /// <summary>resolving the network topology.</summary>
 /// <param name="hostName">the hostname of this node.</param>
 /// <returns>
 /// the resolved
 /// <see cref="Org.Apache.Hadoop.Net.Node"/>
 /// for this nodemanager.
 /// </returns>
 public static Node Resolve(string hostName)
 {
     return(RackResolver.Resolve(hostName));
 }