org.gridbus.broker.scheduler
Class Scheduler

java.lang.Object
  |
  +--org.gridbus.broker.scheduler.Scheduler
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
DataScheduler, DBScheduler

public abstract class Scheduler
extends java.lang.Object
implements java.lang.Runnable

This is the base scheduler class, and contains main methods for performing the scheduling/

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

Constructor Summary
Scheduler(GridbusFarmingEngine fe)
          Constructor for the Scheduler
 
Method Summary
 java.util.Collection getJobs()
           
 java.util.Collection getServers()
          Get the latest servers collection everytime from the farming engine.
 java.lang.String getStats()
           
 boolean isClassValid()
          Returns if the current class is a valid one.
 boolean isFailed()
           
 boolean isFinished()
          Returns whether the scheduling is finished.
 void recoverStats()
          This method re-initialises the scheduler stats, when the broker is recovering from a crash.
 void run()
          The run method enables the scheduler to run as a seperate thread, and calls the 'schedule()' method.
abstract  void schedule()
          Abstract method: schedule to be implemented by derived classes which implement various scheduling algorithms.
 void setFailed(boolean failed)
           
 void setFinished(boolean b)
          Sets the 'finished' state of the scheduler.
 void sortByCost(java.util.Vector server_vect)
          Sorts the compute server list by cost
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler(GridbusFarmingEngine fe)
Constructor for the Scheduler

Parameters:
fe - - Farming Engine
Method Detail

sortByCost

public void sortByCost(java.util.Vector server_vect)
Sorts the compute server list by cost

Parameters:
server_vect -

recoverStats

public final void recoverStats()
This method re-initialises the scheduler stats, when the broker is recovering from a crash.


getStats

public final java.lang.String getStats()
Returns:
Stats formatted as a string

run

public final void run()
The run method enables the scheduler to run as a seperate thread, and calls the 'schedule()' method.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

isFailed

public boolean isFailed()
Returns:
Returns the failed.

setFailed

public void setFailed(boolean failed)
Parameters:
failed - The failed to set.

isClassValid

public boolean isClassValid()
Returns if the current class is a valid one. This is used to avoid class loader problems with Tomcat.

Returns:
boolean

schedule

public abstract void schedule()
Abstract method: schedule to be implemented by derived classes which implement various scheduling algorithms.


isFinished

public boolean isFinished()
Returns whether the scheduling is finished.

Returns:
boolean

setFinished

public void setFinished(boolean b)
Sets the 'finished' state of the scheduler.

Parameters:
b - - boolean

getServers

public java.util.Collection getServers()
Get the latest servers collection everytime from the farming engine. (So that servers can be added / removed from the farming engine dynamically).

Returns:

getJobs

public java.util.Collection getJobs()
Returns: