org.gridbus.broker.farming.common
Class DataHost

java.lang.Object
  extended byorg.gridbus.broker.farming.common.DataHost
Direct Known Subclasses:
SrbDataHost

public class DataHost
extends java.lang.Object

This class represents a DataHost and its attributes

Version:
1.0, Mar 20, 2003
Author:
Srikumar Venugopal (srikumar@cs.mu.oz.au)

Field Summary
static float MAX_BW
          Maximum Bandwidth
static int MAX_COST
          Maximum Cost
static float MIN_BW
          Minimum Bandwidth
static int MIN_COST
          Minimum Cost
 
Constructor Summary
DataHost(java.lang.String hostname)
          Constructor for HEPDataHost class
 
Method Summary
 void addFilePath(java.lang.String filename, java.lang.String path)
          Adds a filepath to the list of existing files hosted by this datahost
 float getBandwidth(java.lang.String cs)
          Returns the bandwidth that was last recorded between this data host and the hostname supplied as argument.
 float getCost(java.lang.String cs)
          Returns the cost for the network link between this data host and the hostname supplied as argument.
 java.lang.String getFilePath(java.lang.String filename)
          Returns the path of the file on this host specified by the filename
 java.lang.String getHostname()
          Returns the hostname.
 java.lang.Object getRankedservers()
           
 boolean isFilePresent(java.lang.String filename)
          Returns whether the file specified by the filename exists on this host or not
 void setCosts(java.lang.Object o)
          Sets the costs for the compute servers randomly between 0 and MAX_COST for this data host and the compute servers in the list
 void setCosts(java.lang.String costStr, java.lang.Object o)
          Sets the costs for the compute servers after reading from a file specified by COST_FILE in Broker Properties.
 void setRankedservers(java.lang.Object o)
          Sets the list containing the servers ranked according to total costs
 void setRanks(java.lang.Object o)
          Ranks the compute servers based on the network bandwidth between the compute server and this datahost
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_BW

public static final float MAX_BW
Maximum Bandwidth

See Also:
Constant Field Values

MIN_BW

public static final float MIN_BW
Minimum Bandwidth

See Also:
Constant Field Values

MIN_COST

public static final int MIN_COST
Minimum Cost

See Also:
Constant Field Values

MAX_COST

public static final int MAX_COST
Maximum Cost

See Also:
Constant Field Values
Constructor Detail

DataHost

public DataHost(java.lang.String hostname)
Constructor for HEPDataHost class

Parameters:
hostname -
Method Detail

addFilePath

public void addFilePath(java.lang.String filename,
                        java.lang.String path)
Adds a filepath to the list of existing files hosted by this datahost

Parameters:
filename -
path -

getFilePath

public java.lang.String getFilePath(java.lang.String filename)
Returns the path of the file on this host specified by the filename

Parameters:
filename -
Returns:
string filename

getHostname

public java.lang.String getHostname()
Returns the hostname.

Returns:
String

isFilePresent

public boolean isFilePresent(java.lang.String filename)
Returns whether the file specified by the filename exists on this host or not

Parameters:
filename -
Returns:
boolean

setRanks

public void setRanks(java.lang.Object o)
              throws GridBrokerException
Ranks the compute servers based on the network bandwidth between the compute server and this datahost

Parameters:
o - - Computeservers to be ranked
Throws:
GridBrokerException

setCosts

public void setCosts(java.lang.Object o)
Sets the costs for the compute servers randomly between 0 and MAX_COST for this data host and the compute servers in the list

Parameters:
o - - Compute server list object

setCosts

public void setCosts(java.lang.String costStr,
                     java.lang.Object o)
              throws java.io.FileNotFoundException,
                     GridBrokerException
Sets the costs for the compute servers after reading from a file specified by COST_FILE in Broker Properties. * @see DataHost#setCosts(Object)

Parameters:
costStr -
o - - Compute server list object
Throws:
java.io.FileNotFoundException
GridBrokerException

getRankedservers

public java.lang.Object getRankedservers()
Returns:
rankedServers list

setRankedservers

public void setRankedservers(java.lang.Object o)
Sets the list containing the servers ranked according to total costs

Parameters:
o - - rankedServer list

getBandwidth

public float getBandwidth(java.lang.String cs)
                   throws GridBrokerException
Returns the bandwidth that was last recorded between this data host and the hostname supplied as argument. If the bandwidth to that host is not available, throws Exception

Parameters:
cs - - compute server id
Returns:
bandwidth
Throws:
GridBrokerException

getCost

public float getCost(java.lang.String cs)
              throws GridBrokerException
Returns the cost for the network link between this data host and the hostname supplied as argument. If the cost to that host is not available, throws Exception

Parameters:
cs -
Returns:
cost
Throws:
GridBrokerException