Package org.apache.hadoop.net
Class ScriptBasedMappingWithDependency
java.lang.Object
org.apache.hadoop.net.AbstractDNSToSwitchMapping
org.apache.hadoop.net.CachedDNSToSwitchMapping
org.apache.hadoop.net.ScriptBasedMapping
org.apache.hadoop.net.ScriptBasedMappingWithDependency
- All Implemented Interfaces:
Configurable,DNSToSwitchMapping,DNSToSwitchMappingWithDependency
@Private
@Evolving
public class ScriptBasedMappingWithDependency
extends ScriptBasedMapping
implements DNSToSwitchMappingWithDependency
This class extends ScriptBasedMapping class and implements
the
DNSToSwitchMappingWithDependency interface using
a script configured via the
CommonConfigurationKeysPublic.NET_DEPENDENCY_SCRIPT_FILE_NAME_KEY option.
It contains a static class RawScriptBasedMappingWithDependency
that performs the getDependency work.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.net.ScriptBasedMapping
ScriptBasedMapping.RawScriptBasedMapping -
Field Summary
Fields inherited from class org.apache.hadoop.net.ScriptBasedMapping
NO_SCRIPTFields inherited from class org.apache.hadoop.net.CachedDNSToSwitchMapping
rawMapping -
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance with the default configuration. -
Method Summary
Modifier and TypeMethodDescriptiongetDependency(String name) Get dependencies in the topology for a given hostvoidsetConf(Configuration conf) Set the configuration to be used by this object.toString()Methods inherited from class org.apache.hadoop.net.ScriptBasedMapping
getConfMethods inherited from class org.apache.hadoop.net.CachedDNSToSwitchMapping
getSwitchMap, isSingleSwitch, reloadCachedMappings, reloadCachedMappings, resolveMethods inherited from class org.apache.hadoop.net.AbstractDNSToSwitchMapping
dumpTopology, isMappingSingleSwitch, isSingleSwitchByScriptPolicyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.net.DNSToSwitchMapping
reloadCachedMappings, reloadCachedMappings, resolve
-
Constructor Details
-
ScriptBasedMappingWithDependency
public ScriptBasedMappingWithDependency()Create an instance with the default configuration.Calling
setConf(Configuration)will trigger a re-evaluation of the configuration settings and so be used to set up the mapping script.
-
-
Method Details
-
toString
- Overrides:
toStringin classScriptBasedMapping
-
setConf
Set the configuration to be used by this object..This will get called in the superclass constructor, so a check is needed to ensure that the raw mapping is defined before trying to relaying a null configuration.
.This will get called in the superclass constructor, so a check is needed to ensure that the raw mapping is defined before trying to relaying a null configuration.
- Specified by:
setConfin interfaceConfigurable- Overrides:
setConfin classScriptBasedMapping- Parameters:
conf- input Configuration.
-
getDependency
Get dependencies in the topology for a given host- Specified by:
getDependencyin interfaceDNSToSwitchMappingWithDependency- Parameters:
name- - host name for which we are getting dependency- Returns:
- a list of hosts dependent on the provided host name
-