org.gridbus.broker.farming.common
Class ComputeServer

java.lang.Object
  extended byorg.gridbus.broker.farming.common.ComputeServer
Direct Known Subclasses:
AlchemiComputeServer, GlobusComputeServer, UnicoreComputeServer

public class ComputeServer
extends java.lang.Object

This class describes a general computational server and provides the methods for accessing and manipulating the information contained.

Author:
Srikumar Venugopal(srikumar@cs.mu.oz.au)

Constructor Summary
ComputeServer()
          Constructor - initializes the ComputeServer
 
Method Summary
 void calcJobLimit(int totalWaitJobs, float totalAvgRateCompl)
          Calculates the number of jobs that can be allocated to this server.
 void decExecutingJobs()
          Decrements the number of jobs currently executing on this server
 int getAllocatedJobs()
          Returns the number of jobs allocated to this server and not in execution
 float getAvgJobComputationTime()
          Returns the average job completion time
 float getAvgRateofCompletion()
          Returns the rate of completion of jobs of this server averaged over the number of polling intervals
 float getBusytime()
          Returns the time interval for which the server was busy.
 int getExecutingJobs()
          Returns the number of jobs currently executing on the server.
 int getFailedJobs()
          Returns the number of failed jobs
 java.lang.String getHostname()
          Returns the hostname for this computational server
 int getJobLimit()
          Returns the maximum number of jobs that can be allocated to this server.
 int getJobsCompletedCurrentPoll()
          Returns the number of jobs finished since the last time the server information was updated
 java.lang.String getOS()
          Returns the OS string
 float getPrevtime()
          Returns the prevtime.
 int getPricePerCpuSec()
          Returns the cost of using the server per one second of CPU execution time
 float getPricePerJob()
          Returns the cost per each job executed on this computeserver
 java.lang.String getServerID()
          Returns the Unique ID of this server.
 java.lang.String getStatus()
          returns the Status of this compute Server
 float getTimeperjob()
          Returns the time taken per job
 int getTotalFinishedJobs()
          Returns the number of jobs that have been finished on this server so far.
 void incAllocatedJobs()
          Increments the number of jobs allocated to this server
 void incExecutingJobs()
          Increments the number of jobs executing on this server
 void incFailedJobs()
          Increments the number of jobs failed on this server
 void incJobsCompletedCurrentPoll()
          Increments the number of jobs that have finished on this server
 void incTotalFinishedJobs()
          Increments the totalFinishedJobs.
 boolean isAlive()
          Checks if this server is alive or not, that is whether it is reachable and responding to queries
 void setAliveFlag(boolean alive)
          Sets the alive flag
 void setAllocatedJobs(int number)
          Sets the number of jobs that have been allocated to this server
 void setAvgJobComputationTime(float f)
          Sets the average job completion time
 void setBusytime(float busytime)
          Sets the busytime.
 void setHostname(java.lang.String hostname)
          Sets the hostname for this server
 void setJobLimit(int jobLimit)
          Sets the maximum number of jobs that can be allocated to this server.
 void setJobsCompletedCurrentPoll(int n)
          Sets the number of Finished jobs
 void setOS(java.lang.String string)
          Sets the OS
 void setPrevtime(float prevtime)
          Sets the last time the server information was updated
 void setPricePerCpuSec(int cost)
          Sets the cost of using the server per second of the CPUtime used
 void setPricePerJob(float cost)
          Sets the cost per job for this compute server
 void setServerID(java.lang.String string)
          Sets the server ID
 void setStatus(java.lang.String string)
          Sets the Status
 void setTimeperjob(float timeperjob)
          Sets the timeperjob.
 void setTotalFinishedJobs(int i)
          Sets the number of jobs that have been finished so far
 void submitJob(Job j)
          Submits a job for execution on this server.
 void updateAvgRateofCompletion(int numPoll)
          Updates the average rate of completion
 void updateAvgRateofCompletion(int numPoll, int pollTime)
          Updates the average rate of completion
 void updateStatus()
          Updates the status of this server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComputeServer

public ComputeServer()
Constructor - initializes the ComputeServer

Method Detail

calcJobLimit

public void calcJobLimit(int totalWaitJobs,
                         float totalAvgRateCompl)
Calculates the number of jobs that can be allocated to this server. Based on performance criteria such as its rate of completion in comparison to the total rate of completion.

Parameters:
totalWaitJobs -
totalAvgRateCompl -

getAllocatedJobs

public int getAllocatedJobs()
Returns the number of jobs allocated to this server and not in execution

Returns:
# of jobs allocated to this server

getAvgRateofCompletion

public float getAvgRateofCompletion()
Returns the rate of completion of jobs of this server averaged over the number of polling intervals

Returns:
average job completion rate

getBusytime

public float getBusytime()
Returns the time interval for which the server was busy.

Returns:
time duration for which the server is busy

getPricePerCpuSec

public int getPricePerCpuSec()
Returns the cost of using the server per one second of CPU execution time

Returns:
pricePerCpuSecond

getPricePerJob

public float getPricePerJob()
Returns the cost per each job executed on this computeserver

Returns:
cost per job

getExecutingJobs

public int getExecutingJobs()
Returns the number of jobs currently executing on the server.

Returns:
# of executing jobs

getJobsCompletedCurrentPoll

public int getJobsCompletedCurrentPoll()
Returns the number of jobs finished since the last time the server information was updated

Returns:
# of jobs completed since last poll

getHostname

public java.lang.String getHostname()
Returns the hostname for this computational server

Returns:
host name

getJobLimit

public int getJobLimit()
Returns the maximum number of jobs that can be allocated to this server. This limit comes from @see #calcJobLimit

Returns:
job limit

getServerID

public java.lang.String getServerID()
Returns the Unique ID of this server.

Returns:
serverID

getPrevtime

public float getPrevtime()
Returns the prevtime.

Returns:
previous time

getStatus

public java.lang.String getStatus()
returns the Status of this compute Server

Returns:
status string

getTimeperjob

public float getTimeperjob()
Returns the time taken per job

Returns:
time per job

getTotalFinishedJobs

public int getTotalFinishedJobs()
Returns the number of jobs that have been finished on this server so far.

Returns:
# of finished jobs

incAllocatedJobs

public void incAllocatedJobs()
Increments the number of jobs allocated to this server


incExecutingJobs

public void incExecutingJobs()
Increments the number of jobs executing on this server


incJobsCompletedCurrentPoll

public void incJobsCompletedCurrentPoll()
Increments the number of jobs that have finished on this server


incTotalFinishedJobs

public void incTotalFinishedJobs()
Increments the totalFinishedJobs.


incFailedJobs

public void incFailedJobs()
Increments the number of jobs failed on this server


isAlive

public boolean isAlive()
Checks if this server is alive or not, that is whether it is reachable and responding to queries

Returns:
true if this server is alive, false otherwise

setAliveFlag

public void setAliveFlag(boolean alive)
Sets the alive flag

Parameters:
alive -

setAllocatedJobs

public void setAllocatedJobs(int number)
Sets the number of jobs that have been allocated to this server

Parameters:
number -

updateAvgRateofCompletion

public void updateAvgRateofCompletion(int numPoll)
Updates the average rate of completion

Parameters:
numPoll -

updateAvgRateofCompletion

public void updateAvgRateofCompletion(int numPoll,
                                      int pollTime)
Updates the average rate of completion

Parameters:
numPoll -
pollTime -

setBusytime

public void setBusytime(float busytime)
Sets the busytime.

Parameters:
busytime - The busytime to set

setPricePerCpuSec

public void setPricePerCpuSec(int cost)
Sets the cost of using the server per second of the CPUtime used

Parameters:
cost -

setPricePerJob

public void setPricePerJob(float cost)
Sets the cost per job for this compute server

Parameters:
cost -

setJobsCompletedCurrentPoll

public void setJobsCompletedCurrentPoll(int n)
Sets the number of Finished jobs

Parameters:
n -

setHostname

public void setHostname(java.lang.String hostname)
Sets the hostname for this server

Parameters:
hostname -

setJobLimit

public void setJobLimit(int jobLimit)
Sets the maximum number of jobs that can be allocated to this server.

Parameters:
jobLimit - The jobLimit to set

setPrevtime

public void setPrevtime(float prevtime)
Sets the last time the server information was updated

Parameters:
prevtime - The prevtime to set

setStatus

public void setStatus(java.lang.String string)
Sets the Status

Parameters:
string -

setTimeperjob

public void setTimeperjob(float timeperjob)
Sets the timeperjob.

Parameters:
timeperjob - The timeperjob to set

setServerID

public void setServerID(java.lang.String string)
Sets the server ID

Parameters:
string -

setTotalFinishedJobs

public void setTotalFinishedJobs(int i)
Sets the number of jobs that have been finished so far

Parameters:
i -

decExecutingJobs

public void decExecutingJobs()
Decrements the number of jobs currently executing on this server


updateStatus

public void updateStatus()
Updates the status of this server.


submitJob

public void submitJob(Job j)
Submits a job for execution on this server.

Parameters:
j - - the Job to be executed.

getOS

public java.lang.String getOS()
Returns the OS string

Returns:
OS

setOS

public void setOS(java.lang.String string)
Sets the OS

Parameters:
string -

getAvgJobComputationTime

public float getAvgJobComputationTime()
Returns the average job completion time

Returns:
Average Job Completion Time

setAvgJobComputationTime

public void setAvgJobComputationTime(float f)
Sets the average job completion time

Parameters:
f -

getFailedJobs

public int getFailedJobs()
Returns the number of failed jobs

Returns:
# of failed jobs