@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, setConf
protected final DNSToSwitchMapping rawMapping
public CachedDNSToSwitchMapping(DNSToSwitchMapping rawMapping)
rawMapping
- the raw mapping to cachepublic List<String> resolve(List<String> names)
DNSToSwitchMapping
If a name cannot be resolved to a rack, the implementation
should return 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 boolean isSingleSwitch()
AbstractDNSToSwitchMapping.isMappingSingleSwitch(DNSToSwitchMapping)
isSingleSwitch
in class AbstractDNSToSwitchMapping
public void reloadCachedMappings()
DNSToSwitchMapping
public void reloadCachedMappings(List<String> names)
DNSToSwitchMapping
Copyright © 2019 Apache Software Foundation. All rights reserved.