org.apache.hadoop.net
Class ScriptBasedMapping

java.lang.Object
  extended by org.apache.hadoop.net.ScriptBasedMapping
All Implemented Interfaces:
Configurable, DNSToSwitchMapping

public final class ScriptBasedMapping
extends Object
implements Configurable, DNSToSwitchMapping

This class implements the DNSToSwitchMapping interface using a script configured via topology.script.file.name .


Constructor Summary
ScriptBasedMapping()
           
 
Method Summary
 Configuration getConf()
          Return the configuration used by this object.
 List<String> resolve(List<String> names)
          Resolves a list of DNS-names/IP-addresses and returns back a list of switch information (network paths).
 void setConf(Configuration conf)
          Set the configuration to be used by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptBasedMapping

public ScriptBasedMapping()
Method Detail

setConf

public void setConf(Configuration conf)
Description copied from interface: Configurable
Set the configuration to be used by this object.

Specified by:
setConf in interface Configurable

getConf

public Configuration getConf()
Description copied from interface: Configurable
Return the configuration used by this object.

Specified by:
getConf in interface Configurable

resolve

public List<String> resolve(List<String> names)
Description copied from interface: DNSToSwitchMapping
Resolves a list of DNS-names/IP-addresses and returns back a list of switch information (network paths). One-to-one correspondence must be maintained between the elements in the lists. 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.

Specified by:
resolve in interface DNSToSwitchMapping
Returns:
list of resolved network paths


Copyright © 2008 The Apache Software Foundation