public boolean isUntrackedNode(String hostName) { String ip = resolver.resolve(hostName); HostDetails hostDetails = hostsReader.getHostDetails(); Set<String> hostsList = hostDetails.getIncludedHosts(); Set<String> excludeList = hostDetails.getExcludedHosts(); return !hostsList.isEmpty() && !hostsList.contains(hostName) && !hostsList.contains(ip) && !excludeList.contains(hostName) && !excludeList.contains(ip); }
private void printConfiguredHosts() { if (!LOG.isDebugEnabled()) { return; } LOG.debug("hostsReader: in=" + conf.get(YarnConfiguration.RM_NODES_INCLUDE_FILE_PATH, YarnConfiguration.DEFAULT_RM_NODES_INCLUDE_FILE_PATH) + " out=" + conf.get(YarnConfiguration.RM_NODES_EXCLUDE_FILE_PATH, YarnConfiguration.DEFAULT_RM_NODES_EXCLUDE_FILE_PATH)); HostDetails hostDetails = hostsReader.getHostDetails(); for (String include : hostDetails.getIncludedHosts()) { LOG.debug("include: " + include); } for (String exclude : hostDetails.getExcludedHosts()) { LOG.debug("exclude: " + exclude); } }
public boolean isValidNode(String hostName) { HostDetails hostDetails = hostsReader.getHostDetails(); return isValidNode(hostName, hostDetails.getIncludedHosts(), hostDetails.getExcludedHosts()); }
HostDetails hostDetails = hostsReader.getHostDetails(); Set<String> includes = hostDetails.getIncludedHosts(); Map<String, Integer> excludes = hostDetails.getExcludedMap();