org.apache.storm.networktopography

## Class DefaultRackDNSToSwitchMapping

- java.lang.Object
- - org.apache.storm.networktopography.AbstractDNSToSwitchMapping
  - - org.apache.storm.networktopography.DefaultRackDNSToSwitchMapping

- All Implemented Interfaces:
    DNSToSwitchMapping

      public final class DefaultRackDNSToSwitchMapping
      extends AbstractDNSToSwitchMapping

  This class implements the `DNSToSwitchMapping` interface It returns the DEFAULT_RACK for every host.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.storm.networktopography.DNSToSwitchMapping

      `DEFAULT_RACK`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultRackDNSToSwitchMapping()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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).
    `String` | `toString()`

    - ### Methods inherited from class org.apache.storm.networktopography.AbstractDNSToSwitchMapping

      `dumpTopology, getSwitchMap, isSingleSwitch`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultRackDNSToSwitchMapping

          public DefaultRackDNSToSwitchMapping()

  - ### Method Detail

    - #### resolve

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

      Description copied from interface: `DNSToSwitchMapping`

      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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2021 The Apache Software Foundation. All rights reserved.