public class TopologyImpl extends Object implements Topology, Cloneable
Constructor and Description |
---|
TopologyImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addHostTopology(String hostName,
InetAddress hostAddress,
HashMap<String,Long> hostTopology)
Adds host information to the topology.
|
Object |
clone()
Clones the topology object, which is uses for synchronization purposes.
|
List<Cluster<String>> |
clusterize(int numberOfClusters,
DistanceFunction distanceFunction)
Clustirizes hosts into clusters based on their proximity
|
Long |
getDistance(org.objectweb.proactive.core.node.Node node,
org.objectweb.proactive.core.node.Node node2)
Returns the distance between 2 nodes.
|
Long |
getDistance(String host,
String host2)
Returns the distance between 2 hosts identified by their domain names.
|
HashMap<String,HashMap<String,Long>> |
getDistances() |
Set<String> |
getHosts()
Gets the set of hosts handled by resource manager.
|
HashMap<String,InetAddress> |
getHostsMap() |
HashMap<String,Long> |
getHostTopology(String hostName)
Gets the distances associated to the host.
|
InetAddress |
getInetAddress(String hostName)
Return the inet address associated with this host
|
boolean |
knownHost(String hostName)
Checks if the information about host is presented in the topology records.
|
boolean |
onSameHost(org.objectweb.proactive.core.node.Node node,
org.objectweb.proactive.core.node.Node node2)
Checks if 2 nodes are on the sane host.
|
void |
removeHostTopology(String hostName)
Removes all information about host from the topology.
|
public Long getDistance(org.objectweb.proactive.core.node.Node node, org.objectweb.proactive.core.node.Node node2)
getDistance
in interface Topology
public Long getDistance(String host, String host2)
getDistance
in interface Topology
public boolean onSameHost(org.objectweb.proactive.core.node.Node node, org.objectweb.proactive.core.node.Node node2)
onSameHost
in interface Topology
public InetAddress getInetAddress(String hostName)
Topology
getInetAddress
in interface Topology
public HashMap<String,InetAddress> getHostsMap()
public void addHostTopology(String hostName, InetAddress hostAddress, HashMap<String,Long> hostTopology)
hostName
- the name of the hosthostAddress
- the address of the hosthostTopology
- distances to other hostspublic void removeHostTopology(String hostName)
hostName
- name of host to be removedpublic HashMap<String,Long> getHostTopology(String hostName)
getHostTopology
in interface Topology
hostName
- - name of the hostpublic boolean knownHost(String hostName)
public Object clone()
public List<Cluster<String>> clusterize(int numberOfClusters, DistanceFunction distanceFunction)
clusterize
in interface Topology
numberOfClusters
- the number of clusters to producedistanceFunction
- the function for distances recalculation