TableMapping (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.net, class: TableMapping

Package org.apache.hadoop.net

# Class TableMapping

java.lang.Object
org.apache.hadoop.net.AbstractDNSToSwitchMapping
org.apache.hadoop.net.CachedDNSToSwitchMapping
org.apache.hadoop.net.TableMapping

All Implemented Interfaces:
  `Configurable`, `DNSToSwitchMapping`

@Public @Evolving public class TableMapping extends CachedDNSToSwitchMapping

Simple `DNSToSwitchMapping` implementation that reads a 2 column text file. The columns are separated by whitespace. The first column is a DNS or IP address and the second column specifies the rack where the address maps.

This class uses the configuration parameter `net.topology.table.file.name` to locate the mapping file.

Calls to `CachedDNSToSwitchMapping.resolve(List)` will look up the address as defined in the mapping file. If no entry corresponding to the address is found, the value `/default-rack` is returned.

- ## Field Summary

  ### Fields inherited from class org.apache.hadoop.net.CachedDNSToSwitchMapping

  `rawMapping`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TableMapping()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Configuration`
  `getConf()`
  Return the configuration used by this object.
  `void`
  `reloadCachedMappings()`
  Reload all of the cached mappings.
  `void`
  `setConf(Configuration conf)`
  Set the configuration to be used by this object.

  ### Methods inherited from class org.apache.hadoop.net.CachedDNSToSwitchMapping

  `getSwitchMap, isSingleSwitch, reloadCachedMappings, resolve, toString`

  ### Methods inherited from class org.apache.hadoop.net.AbstractDNSToSwitchMapping

  `dumpTopology, isMappingSingleSwitch, isSingleSwitchByScriptPolicy`

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

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

- ## Constructor Details

  - ### TableMapping

    public TableMapping()

- ## Method Details

  - ### getConf

    public Configuration getConf()
    Description copied from interface: `Configurable`
    Return the configuration used by this object.
    Specified by:
      `getConf` in interface `Configurable`
    Overrides:
      `getConf` in class `AbstractDNSToSwitchMapping`
    Returns:
      Configuration

  - ### setConf

    public void setConf(Configuration conf)
    Description copied from interface: `Configurable`
    Set the configuration to be used by this object.
    Specified by:
      `setConf` in interface `Configurable`
    Overrides:
      `setConf` in class `AbstractDNSToSwitchMapping`
    Parameters:
      `conf` - configuration to be used

  - ### reloadCachedMappings

    public void reloadCachedMappings()
    Description copied from interface: `DNSToSwitchMapping`
    Reload all of the cached mappings. If there is a cache, this method will clear it, so that future accesses will get a chance to see the new data.
    Specified by:
      `reloadCachedMappings` in interface `DNSToSwitchMapping`
    Overrides:
      `reloadCachedMappings` in class `CachedDNSToSwitchMapping`