org.gridbus.broker.common
Class ComputeServer

java.lang.Object
  extended by org.gridbus.broker.common.Service
      extended by org.gridbus.broker.common.ComputeServer
Direct Known Subclasses:
SimComputeServer

public abstract class ComputeServer
extends Service

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
protected ComputeServer()
           
  ComputeServer(java.lang.String hostname)
           
 
Method Summary
 void addQueue(JobQueue jq)
           
protected abstract  boolean discoverProperties(UserCredential uc)
          Discover the dynamic server properties
 java.lang.String getArch()
          Returns the architecture of the compute server
 float getAvgJobComputationTime()
          Returns the average job completion time
 java.lang.String getCPU()
          Returns the processor in the compute server
 java.lang.String getCPUspeed()
          Returns the processor speed.
 long getFreeMemory()
          Returns the free RAM available
 java.lang.String getHostname()
           
 int getJobLimit()
          Returns the maximum number of jobs that can be allocated to this server.
 JobStatistics getJobStats()
           
abstract  int getMiddlewareType()
           
 int getNumCPUs()
          Returns the number of processors.
 java.lang.String getOS()
          Returns the OS string
 float 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.util.List getQueues()
           
 int getServiceType()
           
 long getTotalMemory()
          Returns total physical memory (RAM) available
 boolean hasQueues()
           
 boolean isFirewalled()
           
 boolean isGateway()
           
abstract  int queryJobStatus(Job j)
           
abstract  int queryJobStatus(org.gridbus.scs.common.SCSJob j)
           
 void setArch(java.lang.String string)
          Sets the architecture of this server
 void setAvgJobComputationTime(float f)
          Sets the average job completion time
protected  void setCPU(java.lang.String string)
          Sets the processor for this server
protected  void setCPUspeed(java.lang.String string)
          Sets the processor speed value.
 void setFirewalled(boolean isFirewalled)
           
protected  void setFreeMemory(long f)
          Sets the value for the free physical memory for this server (in bytes)
 void setGateway(boolean gateway)
           
 void setHostname(java.lang.String hostname)
           
 void setJobLimit(int jobLimit)
          Sets the maximum number of jobs that can be allocated to this server.
 void setJobStats(JobStatistics jobStats)
           
 void setNumCPUs(int i)
          Sets the number of processors.
 void setOS(java.lang.String string)
          Sets the OS
 void setPricePerCpuSec(float 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 setQueues(java.util.List queues)
           
 void setTotalMemory(long f)
          Sets the value for the total physical memory for this server
 boolean supportServiceDiscovery()
          only the compute server who implements the ServiceFinder interface will support service discovery
 
Methods inherited from class org.gridbus.broker.common.Service
getApplicationID, getId, getMappingID, getName, isAvailable, setApplicationID, setAvailable, setMappingID, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComputeServer

protected ComputeServer()

ComputeServer

public ComputeServer(java.lang.String hostname)
Parameters:
hostname -
Method Detail

queryJobStatus

public abstract int queryJobStatus(org.gridbus.scs.common.SCSJob j)
                            throws java.lang.Exception
Throws:
java.lang.Exception

queryJobStatus

public abstract int queryJobStatus(Job j)
                            throws java.lang.Exception
Parameters:
j -
Returns:
job status
Throws:
java.lang.Exception

getMiddlewareType

public abstract int getMiddlewareType()
Returns:
MiddlewareType constant

getServiceType

public int getServiceType()
Specified by:
getServiceType in class Service
Returns:
Returns the type of the service (One of the contants in ServiceType class).
See Also:
Service.getServiceType()

getPricePerCpuSec

public float 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

getJobLimit

public int getJobLimit()
Returns the maximum number of jobs that can be allocated to this server.

Returns:
job limit

setPricePerCpuSec

public void setPricePerCpuSec(float 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 -

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

discoverProperties

protected abstract boolean discoverProperties(UserCredential uc)
                                       throws GridBrokerException
Discover the dynamic server properties

Specified by:
discoverProperties in class Service
Parameters:
uc - : credential to use while discovering properties
Returns:
boolean specifying whether this server is available
Throws:
java.lang.Exception
GridBrokerException

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 -

getArch

public java.lang.String getArch()
Returns the architecture of the compute server

Returns:
string

getTotalMemory

public long getTotalMemory()
Returns total physical memory (RAM) available

Returns:
total RAM in bytes

setArch

public void setArch(java.lang.String string)
Sets the architecture of this server

Parameters:
string -

setTotalMemory

public void setTotalMemory(long f)
Sets the value for the total physical memory for this server

Parameters:
f -

getNumCPUs

public int getNumCPUs()
Returns the number of processors.

Returns:
int

setNumCPUs

public void setNumCPUs(int i)
Sets the number of processors.

Parameters:
i - int

isFirewalled

public boolean isFirewalled()
Returns:
Returns the firewalled.

setFirewalled

public void setFirewalled(boolean isFirewalled)
Parameters:
isFirewalled - The firewalled to set.

getCPU

public java.lang.String getCPU()
Returns the processor in the compute server

Returns:
string

getFreeMemory

public long getFreeMemory()
Returns the free RAM available

Returns:
free RAM in bytes

setCPU

protected void setCPU(java.lang.String string)
Sets the processor for this server

Parameters:
string -

setFreeMemory

protected void setFreeMemory(long f)
Sets the value for the free physical memory for this server (in bytes)

Parameters:
f - - memory

getCPUspeed

public java.lang.String getCPUspeed()
Returns the processor speed.

Returns:
string

setCPUspeed

protected void setCPUspeed(java.lang.String string)
Sets the processor speed value.

Parameters:
string -

getHostname

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

setHostname

public void setHostname(java.lang.String hostname)
Parameters:
hostname - The hostname to set.

setQueues

public void setQueues(java.util.List queues)
Parameters:
queues -

getQueues

public java.util.List getQueues()
Returns:
list of queues on this server

addQueue

public void addQueue(JobQueue jq)
Parameters:
jq -

hasQueues

public boolean hasQueues()
Returns:
true if this server has any queues. false otherwise

getJobStats

public JobStatistics getJobStats()

setJobStats

public void setJobStats(JobStatistics jobStats)

isGateway

public boolean isGateway()

setGateway

public void setGateway(boolean gateway)

supportServiceDiscovery

public boolean supportServiceDiscovery()
only the compute server who implements the ServiceFinder interface will support service discovery

Returns:

Copyright © The University of Melbourne. 2006