/** * Given a collection of string representation of hosts, return a list of * corresponding IP addresses in the textual representation. * * @param names a collection of string representations of hosts * @return a list of corresponding IP addresses in the string format * @see #normalizeHostName(String) */ public static List<String> normalizeHostNames(Collection<String> names) { List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); } return hostNames; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
@Override public String resolve(String hostName) { return NetUtils.normalizeHostName(hostName); } }
/** * Given a collection of string representation of hosts, return a list of * corresponding IP addresses in the textual representation. * * @param names a collection of string representations of hosts * @return a list of corresponding IP addresses in the string format * @see #normalizeHostName(String) */ public static List<String> normalizeHostNames(Collection<String> names) { List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); } return hostNames; }
/** * Given a collection of string representation of hosts, return a list of * corresponding IP addresses in the textual representation. * * @param names a collection of string representations of hosts * @return a list of corresponding IP addresses in the string format * @see #normalizeHostName(String) */ public static List<String> normalizeHostNames(Collection<String> names) { List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); } return hostNames; }
/** * Given a collection of string representation of hosts, return a list of * corresponding IP addresses in the textual representation. * * @param names a collection of string representations of hosts * @return a list of corresponding IP addresses in the string format * @see #normalizeHostName(String) */ public static List<String> normalizeHostNames(Collection<String> names) { List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); } return hostNames; }
/** * Given a collection of string representation of hosts, return a list of * corresponding IP addresses in the textual representation. * * @param names a collection of string representations of hosts * @return a list of corresponding IP addresses in the string format * @see #normalizeHostName(String) */ public static List<String> normalizeHostNames(Collection<String> names) { List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); } return hostNames; }
/** * Given a collection of string representation of hosts, return a list of * corresponding IP addresses in the textual representation. * * @param names a collection of string representations of hosts * @return a list of corresponding IP addresses in the string format * @see #normalizeHostName(String) */ public static List<String> normalizeHostNames(Collection<String> names) { List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); } return hostNames; }
/** * Given a collection of string representation of hosts, return a list of * corresponding IP addresses in the textual representation. * * @param names a collection of string representations of hosts * @return a list of corresponding IP addresses in the string format * @see #normalizeHostName(String) */ public static List<String> normalizeHostNames(Collection<String> names) { List<String> hostNames = new ArrayList<String>(names.size()); for (String name : names) { hostNames.add(normalizeHostName(name)); } return hostNames; } }
private String reload(String hostName) { String ip = NetUtils.normalizeHostName(hostName); addToCache(hostName, ip); return ip; }
public boolean isValidNode(String hostName) { synchronized (hostsReader) { Set<String> hostsList = hostsReader.getHosts(); Set<String> excludeList = hostsReader.getExcludedHosts(); String ip = NetUtils.normalizeHostName(hostName); return (hostsList.isEmpty() || hostsList.contains(hostName) || hostsList .contains(ip)) && !(excludeList.contains(hostName) || excludeList.contains(ip)); } }
public boolean isValidNode(String hostName) { synchronized (hostsReader) { Set<String> hostsList = hostsReader.getHosts(); Set<String> excludeList = hostsReader.getExcludedHosts(); String ip = NetUtils.normalizeHostName(hostName); return (hostsList.isEmpty() || hostsList.contains(hostName) || hostsList .contains(ip)) && !(excludeList.contains(hostName) || excludeList.contains(ip)); } }
/** * Get a delegation token for the user from the JobTracker. * @param renewer the user who can renew the token * @return the new token * @throws IOException */ public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException, InterruptedException{ Token<DelegationTokenIdentifier> result = client.getDelegationToken(renewer); InetSocketAddress addr = JobTracker.getAddress(conf); StringBuilder service = new StringBuilder(); service.append(NetUtils.normalizeHostName(addr.getAddress(). getHostAddress())); service.append(':'); service.append(addr.getPort()); result.setService(new Text(service.toString())); return result; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
/** * Get dependencies in the topology for a given host * @param name - host name for which we are getting dependency * @return a list of hosts dependent on the provided host name */ @Override public List<String> getDependency(String name) { //normalize all input names to be in the form of IP addresses name = NetUtils.normalizeHostName(name); if (name==null) { return Collections.emptyList(); } List<String> dependencies = dependencyCache.get(name); if (dependencies == null) { //not cached dependencies = getRawMapping().getDependency(name); if(dependencies != null) { dependencyCache.put(name, dependencies); } } return dependencies; }
long maxThreadSleeptime, boolean doGraceful) throws Exception { ClusterMetrics metrics = ClusterMetrics.getMetrics(); String ip = NetUtils.normalizeHostName("localhost"); CountDownLatch latch = new CountDownLatch(1); writeToHostsFile("host1", ip, "host2");
String ip = NetUtils.normalizeHostName("localhost"); writeToHostsFile("host1", ip);
String ip = NetUtils.normalizeHostName("localhost"); writeToHostsFile("host1", ip);