@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) |
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() |
dumpTopology, getConf, isMappingSingleSwitch, isSingleSwitchByScriptPolicy, setConfprotected final DNSToSwitchMapping rawMapping
public CachedDNSToSwitchMapping(DNSToSwitchMapping rawMapping)
rawMapping - the raw mapping to cachepublic List<String> resolve(List<String> names)
DNSToSwitchMappingNetworkTopology.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 AbstractDNSToSwitchMappingpublic boolean isSingleSwitch()
AbstractDNSToSwitchMapping.isMappingSingleSwitch(DNSToSwitchMapping)isSingleSwitch in class AbstractDNSToSwitchMappingpublic void reloadCachedMappings()
DNSToSwitchMappingpublic void reloadCachedMappings(List<String> names)
DNSToSwitchMappingCopyright © 2008–2022 Apache Software Foundation. All rights reserved.