Package org.apache.storm.networktopography

## Interface DNSToSwitchMapping

- All Known Implementing Classes:
    `AbstractDNSToSwitchMapping`, `AlternateRackDNSToSwitchMapping`, `DefaultRackDNSToSwitchMapping`

      public interface DNSToSwitchMapping

  An interface that must be implemented to allow pluggable DNS-name/IP-address to RackID resolvers.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `DEFAULT_RACK` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Map<String,​String>` | `resolve​(List<String> names)` | Resolves a list of DNS-names/IP-address and returns back a map of DNS-name->switch information ( network paths).

- - ### Field Detail

    - #### DEFAULT_RACK

          static final String DEFAULT_RACK

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### resolve

          Map<String,​String> resolve​(List<String> names)

      Resolves a list of DNS-names/IP-address and returns back a map of DNS-name->switch information ( network paths). Consider an element in the argument list - x.y.com. The switch information that is returned must be a network path of the form /foo/rack, where / is the root, and 'foo' is the switch where 'rack' is connected. Note the hostname/ip-address is not part of the returned path. The network topology of the cluster would determine the number of components in the network path.

      If a name cannot be resolved to a rack, the implementation should return {DEFAULT_RACK}. This is what the bundled implementations do, though it is not a formal requirement.

      Parameters:
        `names` - the list of hosts to resolve (can be empty)
      Returns:
        Map of hosts to resolved network paths. If names is empty, then return empty Map