Class TopologyMapper

Object
org.apache.spark.storage.TopologyMapper
Direct Known Subclasses:
DefaultTopologyMapper, FileBasedTopologyMapper

public abstract class TopologyMapper extends Object
::DeveloperApi:: TopologyMapper provides topology information for a given host param: conf SparkConf to get required properties, if needed
  • Constructor Details

    • TopologyMapper

      public TopologyMapper(SparkConf conf)
  • Method Details

    • getTopologyForHost

      public abstract scala.Option<String> getTopologyForHost(String hostname)
      Gets the topology information given the host name

      Parameters:
      hostname - Hostname
      Returns:
      topology information for the given hostname. One can use a 'topology delimiter' to make this topology information nested. For example : &lsquo;/myrack/myhost&rsquo;, where &lsquo;/&rsquo; is the topology delimiter, &lsquo;myrack&rsquo; is the topology identifier, and &lsquo;myhost&rsquo; is the individual host. This function only returns the topology information without the hostname. This information can be used when choosing executors for block replication to discern executors from a different rack than a candidate executor, for example.

      An implementation can choose to use empty strings or None in case topology info is not available. This would imply that all such executors belong to the same rack.