|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.net.AbstractDNSToSwitchMapping
@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class AbstractDNSToSwitchMapping
This is a base class for DNS to Switch mappings.
It is not mandatory to deriveDNSToSwitchMapping
implementations from it, but it is strongly
recommended, as it makes it easy for the Hadoop developers to add new methods
to this base class that are automatically picked up by all implementations.
This class does not extend the Configured
base class, and should not be changed to do so, as it causes problems
for subclasses. The constructor of the Configured
calls
the setConf(Configuration)
method, which will call into the
subclasses before they have been fully constructed.
Constructor Summary | |
---|---|
protected |
AbstractDNSToSwitchMapping()
Create an unconfigured instance |
protected |
AbstractDNSToSwitchMapping(Configuration conf)
Create an instance, caching the configuration file. |
Method Summary | |
---|---|
String |
dumpTopology()
Generate a string listing the switch mapping implementation, the mapping for every known node and the number of nodes and unique switches known about -each entry to a separate line. |
Configuration |
getConf()
Return the configuration used by this object. |
Map<String,String> |
getSwitchMap()
Get a copy of the map (for diagnostics) |
static boolean |
isMappingSingleSwitch(DNSToSwitchMapping mapping)
Query for a DNSToSwitchMapping instance being on a single
switch. |
boolean |
isSingleSwitch()
Predicate that indicates that the switch mapping is known to be single-switch. |
protected boolean |
isSingleSwitchByScriptPolicy()
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.net.DNSToSwitchMapping |
---|
reloadCachedMappings, reloadCachedMappings, resolve |
Constructor Detail |
---|
protected AbstractDNSToSwitchMapping()
protected AbstractDNSToSwitchMapping(Configuration conf)
setConf(Configuration)
; if
a subclass extracts information in that method, it must call it explicitly.
conf
- the configurationMethod Detail |
---|
public Configuration getConf()
Configurable
getConf
in interface Configurable
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
public boolean isSingleSwitch()
public Map<String,String> getSwitchMap()
public String dumpTopology()
protected boolean isSingleSwitchByScriptPolicy()
public static boolean isMappingSingleSwitch(DNSToSwitchMapping mapping)
DNSToSwitchMapping
instance being on a single
switch.
This predicate simply assumes that all mappings not derived from
this class are multi-switch.
mapping
- the mapping to query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |