Class AbstractDNSToSwitchMapping
java.lang.Object
org.apache.storm.networktopography.AbstractDNSToSwitchMapping
- All Implemented Interfaces:
- DNSToSwitchMapping
- Direct Known Subclasses:
- AlternateRackDNSToSwitchMapping,- DefaultRackDNSToSwitchMapping
This is a base class for DNS to Switch mappings.
 
It is not mandatory to derive DNSToSwitchMapping implementations from it, but it is strongly recommended,
 as it makes it easy for the developers to add new methods to this base class that are automatically picked up by all
 implementations.
- 
Field SummaryFields inherited from interface org.apache.storm.networktopography.DNSToSwitchMappingDEFAULT_RACK
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreate an unconfigured instance.
- 
Method SummaryModifier and TypeMethodDescriptionGenerate 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.Get a copy of the map (for diagnostics).booleanPredicate that indicates that the switch mapping is known to be single-switch.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.storm.networktopography.DNSToSwitchMappingresolve
- 
Constructor Details- 
AbstractDNSToSwitchMappingprotected AbstractDNSToSwitchMapping()Create an unconfigured instance.
 
- 
- 
Method Details- 
isSingleSwitchpublic boolean isSingleSwitch()Predicate that indicates that the switch mapping is known to be single-switch. The base class returns false: it assumes all mappings are multi-rack. Subclasses may override this with methods that are more aware of their topologies.- Returns:
- true if the mapping thinks that it is on a single switch
 
- 
getSwitchMapGet a copy of the map (for diagnostics).- Returns:
- a clone of the map or null for none known
 
- 
dumpTopologyGenerate 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.- Returns:
- a string that can be presented to the ops team or used in debug messages.
 
 
-