HostsFileReader (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.util, class: HostsFileReader

Package org.apache.hadoop.util

# Class HostsFileReader

java.lang.Object
org.apache.hadoop.util.HostsFileReader

@LimitedPrivate({"HDFS","MapReduce"}) @Unstable public class HostsFileReader extends Object

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `HostsFileReader.HostDetails`
  An atomic view of the included and excluded hosts

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HostsFileReader(String includesFile, InputStream inFileInputStream, String excludesFile, InputStream exFileInputStream)`
  `HostsFileReader(String inFile, String exFile)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `finishRefresh()`
  `Set<String>`
  `getExcludedHosts()`
  `HostsFileReader.HostDetails`
  `getHostDetails()`
  Retrieve an atomic view of the included and excluded hosts.
  `void`
  `getHostDetails(Set<String> includeHosts, Map<String,Integer> excludeHosts)`
  Deprecated.
  use `instead`
  `void`
  `getHostDetails(Set<String> includes, Set<String> excludes)`
  Deprecated.
  use `instead`
  `Set<String>`
  `getHosts()`
  `HostsFileReader.HostDetails`
  `getLazyLoadedHostDetails()`
  `void`
  `lazyRefresh(String includesFile, String excludesFile)`
  `static void`
  `readFileToMap(String type, String filename, Map<String,Integer> map)`
  `static void`
  `readFileToMapWithFileInputStream(String type, String filename, InputStream inputStream, Map<String,Integer> map)`
  `static void`
  `readFileToSet(String type, String filename, Set<String> set)`
  `static void`
  `readFileToSetWithFileInputStream(String type, String filename, InputStream fileInputStream, Set<String> set)`
  `static void`
  `readXmlFileToMapWithFileInputStream(String type, String filename, InputStream fileInputStream, Map<String,Integer> map)`
  `void`
  `refresh()`
  `void`
  `refresh(InputStream inFileInputStream, InputStream exFileInputStream)`
  `void`
  `refresh(String includesFile, String excludesFile)`
  `void`
  `setExcludesFile(String excludesFile)`
  `void`
  `setIncludesFile(String includesFile)`
  `void`
  `updateFileNames(String includesFile, String excludesFile)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### HostsFileReader

    public HostsFileReader(String inFile, String exFile) throws IOException
    Throws:
      `IOException`

  - ### HostsFileReader

    @Private public HostsFileReader(String includesFile, InputStream inFileInputStream, String excludesFile, InputStream exFileInputStream) throws IOException
    Throws:
      `IOException`

- ## Method Details

  - ### readFileToSet

    public static void readFileToSet(String type, String filename, Set<String> set) throws IOException
    Throws:
      `IOException`

  - ### readFileToSetWithFileInputStream

    @Private public static void readFileToSetWithFileInputStream(String type, String filename, InputStream fileInputStream, Set<String> set) throws IOException
    Throws:
      `IOException`

  - ### refresh

    public void refresh() throws IOException
    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

    public void refresh(String includesFile, String excludesFile) throws IOException
    Throws:
      `IOException`

  - ### lazyRefresh

    public void lazyRefresh(String includesFile, String excludesFile) throws IOException
    Throws:
      `IOException`

  - ### finishRefresh

    public void finishRefresh()

  - ### refresh

    @Private public void refresh(InputStream inFileInputStream, InputStream exFileInputStream) throws IOException
    Throws:
      `IOException`

  - ### getHosts

    public Set<String> getHosts()

  - ### getExcludedHosts

    public Set<String> getExcludedHosts()

  - ### getHostDetails

    @Deprecated public void getHostDetails(Set<String> includes, Set<String> excludes)
    Deprecated.
    use `instead`
    Retrieve an atomic view of the included and excluded hosts.
    Parameters:
      `includes` - set to populate with included hosts
      `excludes` - set to populate with excluded hosts

  - ### getHostDetails

    @Deprecated public void getHostDetails(Set<String> includeHosts, Map<String,Integer> excludeHosts)
    Deprecated.
    use `instead`
    Retrieve an atomic view of the included and excluded hosts.
    Parameters:
      `includeHosts` - set to populate with included hosts
      `excludeHosts` - map to populate with excluded hosts

  - ### getHostDetails

    public HostsFileReader.HostDetails getHostDetails()
    Retrieve an atomic view of the included and excluded hosts.
    Returns:
      the included and excluded hosts

  - ### getLazyLoadedHostDetails

    public HostsFileReader.HostDetails getLazyLoadedHostDetails()

  - ### setIncludesFile

    public void setIncludesFile(String includesFile)

  - ### setExcludesFile

    public void setExcludesFile(String excludesFile)

  - ### updateFileNames

    public void updateFileNames(String includesFile, String excludesFile)