Class 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.

  • 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

      public String toString()
      Overrides:
      toString in class ScriptBasedMapping
    • setConf

      public void setConf(Configuration conf)
      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:
      setConf in interface Configurable
      Overrides:
      setConf in class ScriptBasedMapping
      Parameters:
      conf - input Configuration.
    • getDependency

      public List<String> getDependency(String name)
      Get dependencies in the topology for a given host
      Specified by:
      getDependency in interface DNSToSwitchMappingWithDependency
      Parameters:
      name - - host name for which we are getting dependency
      Returns:
      a list of hosts dependent on the provided host name