@Override public void refresh() throws IOException { refresh(conf.get(DFSConfigKeys.DFS_HOSTS, ""), conf.get(DFSConfigKeys.DFS_HOSTS_EXCLUDE, "")); } private static HostSet readFile(String type, String filename)
/** * Read the includes and excludes lists from the named files. Any previous * includes and excludes lists are discarded. * @param includeFile the path to the new includes list * @param excludeFile the path to the new excludes list * @throws IOException thrown if there is a problem reading one of the files */ private void refresh(String includeFile, String excludeFile) throws IOException { HostSet newIncludes = readFile("included", includeFile); HostSet newExcludes = readFile("excluded", excludeFile); refresh(newIncludes, newExcludes); }
/** Reread include/exclude files. */ private void refreshHostsReader(Configuration conf) throws IOException { // Reread the conf to get dfs.hosts and dfs.hosts.exclude filenames. // Update the file names and refresh internal includes and excludes list. if (conf == null) { conf = new HdfsConfiguration(); } this.hostFileManager.refresh(conf.get(DFSConfigKeys.DFS_HOSTS, ""), conf.get(DFSConfigKeys.DFS_HOSTS_EXCLUDE, "")); }
/** Reread include/exclude files. */ private void refreshHostsReader(Configuration conf) throws IOException { // Reread the conf to get dfs.hosts and dfs.hosts.exclude filenames. // Update the file names and refresh internal includes and excludes list. if (conf == null) { conf = new HdfsConfiguration(); } this.hostFileManager.refresh(conf.get(DFSConfigKeys.DFS_HOSTS, ""), conf.get(DFSConfigKeys.DFS_HOSTS_EXCLUDE, "")); }
/** * Read the includes and excludes lists from the named files. Any previous * includes and excludes lists are discarded. * @param includeFile the path to the new includes list * @param excludeFile the path to the new excludes list * @throws IOException thrown if there is a problem reading one of the files */ void refresh(String includeFile, String excludeFile) throws IOException { HostSet newIncludes = readFile("included", includeFile); HostSet newExcludes = readFile("excluded", excludeFile); refresh(newIncludes, newExcludes); }
/** * Read the includes and excludes lists from the named files. Any previous * includes and excludes lists are discarded. * @param includeFile the path to the new includes list * @param excludeFile the path to the new excludes list * @throws IOException thrown if there is a problem reading one of the files */ void refresh(String includeFile, String excludeFile) throws IOException { HostSet newIncludes = readFile("included", includeFile); HostSet newExcludes = readFile("excluded", excludeFile); refresh(newIncludes, newExcludes); }
DFSConfigKeys.DFS_DATANODE_IPC_ADDRESS_DEFAULT)).getPort(); try { this.hostFileManager.refresh(conf.get(DFSConfigKeys.DFS_HOSTS, ""), conf.get(DFSConfigKeys.DFS_HOSTS_EXCLUDE, "")); } catch (IOException e) {
DFSConfigKeys.DFS_DATANODE_IPC_ADDRESS_DEFAULT)).getPort(); try { this.hostFileManager.refresh(conf.get(DFSConfigKeys.DFS_HOSTS, ""), conf.get(DFSConfigKeys.DFS_HOSTS_EXCLUDE, "")); } catch (IOException e) {
Assert.assertEquals(2, excludedNodes.size()); hm.refresh(includedNodes, excludedNodes);