org.gridbus.broker.farming.common.data
Class DataHost

java.lang.Object
  extended by org.gridbus.broker.farming.common.Server
      extended by org.gridbus.broker.farming.common.data.DataHost
Direct Known Subclasses:
SrbDataHost

public class DataHost
extends Server

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 DataHost 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
 void clearFilePaths()
          Clears all the file paths associated with 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 getEnv()
          Gets the required environment script for the DataHost, used during job submission.
 java.util.Hashtable getFileList()
           
 java.lang.String getFilePath(java.lang.String filename)
          Returns the path of the file on this host specified by the filename
 java.lang.String getFullFilePath(java.lang.String filename)
          Returns the full path of the file (including the filename) on this host specified by the filename
 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 setNetworkService(NetworkStatusService nss)
          Sets the NetworkStatusService to use for querying information about the network.
 void setRankedservers(java.lang.Object o)
          Sets the list containing the servers ranked according to total costs
 void setRanks(java.lang.Object o)
           
 void setRanks(java.lang.Object o, java.lang.String opt)
          Ranks the compute servers based on the network bandwidth between the compute server and this datahost
 
Methods inherited from class org.gridbus.broker.farming.common.Server
getHostname, getServerID, setHostname, setServerID
 
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 DataHost class. The DataHost class represents a node on the grid which is used as a source for reading data. To optimise data transfers, a DataHost can use a NetworkStatusService and calculate the available bandwidth between itself and another Compute node. For this to happen, the NetworkStatusService field of the DataHost has to be set using the setNetworkService() method.

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 -

clearFilePaths

public void clearFilePaths()
Clears all the file paths associated with this datahost


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

setNetworkService

public void setNetworkService(NetworkStatusService nss)
Sets the NetworkStatusService to use for querying information about the network.

Parameters:
nss -

getFullFilePath

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

Parameters:
filename -
Returns:
string filename

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
Parameters:
o -
Throws:
GridBrokerException

setRanks

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

Parameters:
o - - Computeservers to be ranked
opt -
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.

Parameters:
costStr -
o - - Compute server list object
Throws:
java.io.FileNotFoundException
GridBrokerException
See Also:
setCosts(Object)

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

getEnv

public java.lang.String getEnv()
Gets the required environment script for the DataHost, used during job submission.

Returns:

getFileList

public java.util.Hashtable getFileList()
Returns:
Returns the fileList.