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<InetAddress,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(InetAddress host,
InetAddress host2)
Returns the distance between 2 hosts identified by their inet addresses.
|
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 hostName,
String hostName2)
Returns the distance between 2 hosts identified by their domain names.
|
Set<InetAddress> |
getHosts()
Gets the set of hosts handled by resource manager.
|
HashMap<InetAddress,Long> |
getHostTopology(InetAddress hostAddress)
Gets the distances associated to the host.
|
boolean |
knownHost(InetAddress hostAddress)
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,
InetAddress hostAddress)
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(InetAddress host, InetAddress host2)
getDistance
in interface Topology
public Long getDistance(String hostName, String hostName2)
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 Set<InetAddress> getHosts()
public void addHostTopology(String hostName, InetAddress hostAddress, HashMap<InetAddress,Long> hostTopology)
hostName
- the name of the hosthostAddress
- the address of the hosthostTopology
- distances to other hostspublic void removeHostTopology(String hostName, InetAddress hostAddress)
hostName
- name of host to be removedhostAddress
- host address to be removedpublic HashMap<InetAddress,Long> getHostTopology(InetAddress hostAddress)
getHostTopology
in interface Topology
hostAddress
- - inet address of the hostpublic boolean knownHost(InetAddress hostAddress)
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