org.apache.hadoop.net
Class TableMapping

java.lang.Object
  extended by org.apache.hadoop.net.AbstractDNSToSwitchMapping
      extended by org.apache.hadoop.net.CachedDNSToSwitchMapping
          extended by org.apache.hadoop.net.TableMapping
All Implemented Interfaces:
Configurable, DNSToSwitchMapping

@InterfaceAudience.Public
@InterfaceStability.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
TableMapping()
           
 
Method Summary
 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 Detail

TableMapping

public TableMapping()
Method Detail

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

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

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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.