|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.util.PoolInfo
The PoolInfo
class provides a utility for finding out
information about the nodes involved in a closed-world run.
This class can be used when the names of the nodes involved in the
run are known in advance, and can be given in the
ibis.pool.host_names
property.
If these names are not known in advance, a PoolInfoClient
can be used instead. The
createPoolInfo
static method
can be used to take care of this automatically.
The PoolInfo
class depends on the following system properties:
ibis.pool.total_hostsmust contain the total number of hosts involved in the run.
ibis.pool.host_namesmust contain a space-separated list of hostnames. The number of hostnames in the list must at least be equal to the number of hosts involved in the run as given by the
ibis.pool.total_hosts
property. Any additional host names
are ignored.
ibis.pool.host_numberoptional, gives the index of the current host in the list of host names. Should be between 0 and
ibis.pool.total_hosts
(inclusive).
If not supplied, it is determined by looking up the current host in
the list of host names.
Method Summary | |
int[] |
clusterIPRank()
Return a Grid Cluster rank based on the lower IP byte of the host names |
int |
clusterIPSize()
Return the number of Grid Clusters based on the lower IP byte of the host names |
java.lang.String |
clusterName()
Returns the cluster name for the current host. |
java.lang.String |
clusterName(int rank)
Returns the cluster name for the host specified by the rank number. |
java.lang.String[] |
clusterNames()
Returns an array of cluster names, one for each host involved in the run. |
static PoolInfo |
createPoolInfo()
Creates and returns a PoolInfo . |
static PoolInfo |
createPoolInfo(boolean forceSeq)
Creates and returns a PoolInfo . |
java.lang.String |
hostName()
Returns the name of the current host. |
java.lang.String |
hostName(int rank)
Returns the name of the host with the given rank. |
java.lang.String[] |
hostNames()
Returns an array of hostnames of the hosts. |
void |
printTime(java.lang.String id,
long time)
Utility method to print the time used in a uniform format. |
int |
rank()
Returns the rank number in the pool of the current host. |
int |
size()
Returns the number of nodes in the pool. |
java.lang.String |
toString()
Returns a string representation of the information in this PoolInfo . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public int size()
public int rank()
public java.lang.String hostName()
public java.lang.String clusterName()
public java.lang.String clusterName(int rank)
rank
- the rank number.
public int[] clusterIPRank()
public int clusterIPSize()
public java.lang.String[] clusterNames()
public java.lang.String hostName(int rank)
rank
- the rank number.
public java.lang.String[] hostNames()
public void printTime(java.lang.String id, long time)
id
- name of the applicationtime
- the time used, in milliseconds.public static PoolInfo createPoolInfo(boolean forceSeq)
PoolInfo
.
The parameter indicates wether a pool for a sequential run
must be created. If not, if the system property
ibis.pool.host_names
is set, a PoolInfo
is created. If not, a PoolInfoClient
is created.
forceSeq
- indicates wether a pool for a sequential run must
be created.
PoolInfo
object.public static PoolInfo createPoolInfo()
PoolInfo
.
If the system property ibis.pool.host_names
is set,
a PoolInfo
is created.
If not, a PoolInfoClient
is created.
PoolInfo
object.public java.lang.String toString()
PoolInfo
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |