Package org.apache.hadoop.util
Class HostsFileReader
java.lang.Object
org.apache.hadoop.util.HostsFileReader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn atomic view of the included and excluded hosts -
Constructor Summary
ConstructorsConstructorDescriptionHostsFileReader(String includesFile, InputStream inFileInputStream, String excludesFile, InputStream exFileInputStream) HostsFileReader(String inFile, String exFile) -
Method Summary
Modifier and TypeMethodDescriptionvoidRetrieve an atomic view of the included and excluded hosts.voidDeprecated.voidgetHostDetails(Set<String> includes, Set<String> excludes) Deprecated.useinsteadgetHosts()voidlazyRefresh(String includesFile, String excludesFile) static voidstatic voidreadFileToMapWithFileInputStream(String type, String filename, InputStream inputStream, Map<String, Integer> map) static voidreadFileToSet(String type, String filename, Set<String> set) static voidreadFileToSetWithFileInputStream(String type, String filename, InputStream fileInputStream, Set<String> set) static voidreadXmlFileToMapWithFileInputStream(String type, String filename, InputStream fileInputStream, Map<String, Integer> map) voidrefresh()voidrefresh(InputStream inFileInputStream, InputStream exFileInputStream) voidvoidsetExcludesFile(String excludesFile) voidsetIncludesFile(String includesFile) voidupdateFileNames(String includesFile, String excludesFile)
-
Constructor Details
-
HostsFileReader
- Throws:
IOException
-
HostsFileReader
@Private public HostsFileReader(String includesFile, InputStream inFileInputStream, String excludesFile, InputStream exFileInputStream) throws IOException - Throws:
IOException
-
-
Method Details
-
readFileToSet
- Throws:
IOException
-
readFileToSetWithFileInputStream
@Private public static void readFileToSetWithFileInputStream(String type, String filename, InputStream fileInputStream, Set<String> set) throws IOException - Throws:
IOException
-
refresh
- Throws:
IOException
-
readFileToMap
public static void readFileToMap(String type, String filename, Map<String, Integer> map) throws IOException- Throws:
IOException
-
readFileToMapWithFileInputStream
public static void readFileToMapWithFileInputStream(String type, String filename, InputStream inputStream, Map<String, Integer> map) throws IOException- Throws:
IOException
-
readXmlFileToMapWithFileInputStream
public static void readXmlFileToMapWithFileInputStream(String type, String filename, InputStream fileInputStream, Map<String, Integer> map) throws IOException- Throws:
IOException
-
refresh
- Throws:
IOException
-
lazyRefresh
- Throws:
IOException
-
finishRefresh
public void finishRefresh() -
refresh
@Private public void refresh(InputStream inFileInputStream, InputStream exFileInputStream) throws IOException - Throws:
IOException
-
getHosts
-
getExcludedHosts
-
getHostDetails
Deprecated.useinsteadRetrieve an atomic view of the included and excluded hosts.- Parameters:
includes- set to populate with included hostsexcludes- set to populate with excluded hosts
-
getHostDetails
Deprecated.useinsteadRetrieve an atomic view of the included and excluded hosts.- Parameters:
includeHosts- set to populate with included hostsexcludeHosts- map to populate with excluded hosts
-
getHostDetails
Retrieve an atomic view of the included and excluded hosts.- Returns:
- the included and excluded hosts
-
getLazyLoadedHostDetails
-
setIncludesFile
-
setExcludesFile
-
updateFileNames
-
instead