|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.net.AbstractDNSToSwitchMapping org.apache.hadoop.net.CachedDNSToSwitchMapping
@InterfaceAudience.Public @InterfaceStability.Evolving public class CachedDNSToSwitchMapping
A cached implementation of DNSToSwitchMapping that takes an raw DNSToSwitchMapping and stores the resolved network location in a cache. The following calls to a resolved network location will get its location from the cache.
Field Summary | |
---|---|
protected DNSToSwitchMapping |
rawMapping
The uncached mapping |
Constructor Summary | |
---|---|
CachedDNSToSwitchMapping(DNSToSwitchMapping rawMapping)
cache a raw DNS mapping |
Method Summary | |
---|---|
Map<String,String> |
getSwitchMap()
Get the (host x switch) map. |
boolean |
isSingleSwitch()
Delegate the switch topology query to the raw mapping, via AbstractDNSToSwitchMapping.isMappingSingleSwitch(DNSToSwitchMapping) |
void |
reloadCachedMappings()
Reload all of the cached mappings. |
void |
reloadCachedMappings(List<String> names)
Reload cached mappings on specific nodes. |
List<String> |
resolve(List<String> names)
Resolves a list of DNS-names/IP-addresses and returns back a list of switch information (network paths). |
String |
toString()
|
Methods inherited from class org.apache.hadoop.net.AbstractDNSToSwitchMapping |
---|
dumpTopology, getConf, isMappingSingleSwitch, isSingleSwitchByScriptPolicy, setConf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final DNSToSwitchMapping rawMapping
Constructor Detail |
---|
public CachedDNSToSwitchMapping(DNSToSwitchMapping rawMapping)
rawMapping
- the raw mapping to cacheMethod Detail |
---|
public List<String> resolve(List<String> names)
DNSToSwitchMapping
NetworkTopology.DEFAULT_RACK
. This
is what the bundled implementations do, though it is not a formal requirement
names
- the list of hosts to resolve (can be empty)
public Map<String,String> getSwitchMap()
getSwitchMap
in class AbstractDNSToSwitchMapping
public String toString()
toString
in class Object
public boolean isSingleSwitch()
AbstractDNSToSwitchMapping.isMappingSingleSwitch(DNSToSwitchMapping)
isSingleSwitch
in class AbstractDNSToSwitchMapping
public void reloadCachedMappings()
DNSToSwitchMapping
public void reloadCachedMappings(List<String> names)
DNSToSwitchMapping
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |