@InterfaceAudience.Public @InterfaceStability.Evolving public class CachedDNSToSwitchMapping extends AbstractDNSToSwitchMapping
Modifier and Type | Field and Description |
---|---|
protected DNSToSwitchMapping |
rawMapping
The uncached mapping
|
Constructor and Description |
---|
CachedDNSToSwitchMapping(DNSToSwitchMapping rawMapping)
cache a raw DNS mapping
|
Modifier and Type | Method and Description |
---|---|
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) |
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() |
dumpTopology, getConf, isMappingSingleSwitch, isSingleSwitchByScriptPolicy, setConf
protected final DNSToSwitchMapping rawMapping
public CachedDNSToSwitchMapping(DNSToSwitchMapping rawMapping)
rawMapping
- the raw mapping to cachepublic List<String> resolve(List<String> names)
DNSToSwitchMapping
NetworkTopology.DEFAULT_RACK
. This
is what the bundled implementations do, though it is not a formal requirementnames
- the list of hosts to resolve (can be empty)public Map<String,String> getSwitchMap()
getSwitchMap
in class AbstractDNSToSwitchMapping
public boolean isSingleSwitch()
AbstractDNSToSwitchMapping.isMappingSingleSwitch(DNSToSwitchMapping)
isSingleSwitch
in class AbstractDNSToSwitchMapping
Copyright © 2014 Apache Software Foundation. All Rights Reserved.