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
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 -
Method Summary
Modifier and TypeMethodDescriptiongetConf()Return the configuration used by this object.voidReload all of the cached mappings.voidsetConf(Configuration conf) Set the configuration to be used by this object.Methods inherited from class org.apache.hadoop.net.CachedDNSToSwitchMapping
getSwitchMap, isSingleSwitch, reloadCachedMappings, resolve, toStringMethods inherited from class org.apache.hadoop.net.AbstractDNSToSwitchMapping
dumpTopology, isMappingSingleSwitch, isSingleSwitchByScriptPolicy
-
Constructor Details
-
TableMapping
public TableMapping()
-
-
Method Details
-
getConf
Description copied from interface:ConfigurableReturn the configuration used by this object.- Specified by:
getConfin interfaceConfigurable- Overrides:
getConfin classAbstractDNSToSwitchMapping- Returns:
- Configuration
-
setConf
Description copied from interface:ConfigurableSet the configuration to be used by this object.- Specified by:
setConfin interfaceConfigurable- Overrides:
setConfin classAbstractDNSToSwitchMapping- Parameters:
conf- configuration to be used
-
reloadCachedMappings
public void reloadCachedMappings()Description copied from interface:DNSToSwitchMappingReload 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:
reloadCachedMappingsin interfaceDNSToSwitchMapping- Overrides:
reloadCachedMappingsin classCachedDNSToSwitchMapping
-