org.ourgrid.mygrid.scheduler
Interface EBSchedulingHeuristic

All Known Implementing Classes:
FakeSchedulingHeuristic, StorageAffinity, Workqueue

public interface EBSchedulingHeuristic

Interface to be implemented by the scheduling heuristics. It defines the basic methods that these heuristics should implement.


Method Summary
 void addJob(int jobId, JobSpec jobSpec)
          Adds a new Job.
 void cancelJob(int jobId)
          Cancels the given job and put an Event indicating that in the responseQueue.
 GridManager getEBGridManager()
          Returns the EBGridManager.
 JobManager getEBJobManager()
          Returns the EBJobManager.
 void newPeersHaveBeenSet()
          Notifies the heuristic that new GridMachineProviders have been set.
 void replicaAborted(ReplicaExecutorResult result)
          Notifies that a task replica has been aborted.
 void replicaCanceled(ReplicaExecutorResult result)
          Notifies that a task replica has canceled.
 void replicaFailed(ReplicaExecutorResult result)
          Notifies that a task replica has failed.
 void replicaFinished(ReplicaExecutorResult result)
          Notifies that a task replica has finished.
 boolean schedule()
          Schedules a task replica to a machine.
 

Method Detail

addJob

void addJob(int jobId,
            JobSpec jobSpec)
Adds a new Job.

Parameters:
jobId - The job identification.
jobSpec - The new Job specification.

newPeersHaveBeenSet

void newPeersHaveBeenSet()
Notifies the heuristic that new GridMachineProviders have been set. GridMachines should be requested to the GridMachineProviders.


getEBGridManager

GridManager getEBGridManager()
Returns the EBGridManager.

Returns:
The EBGridManager.

getEBJobManager

JobManager getEBJobManager()
Returns the EBJobManager.

Returns:
The EBJobManager.

replicaFinished

void replicaFinished(ReplicaExecutorResult result)
Notifies that a task replica has finished.

Parameters:
result - The ReplicaExecutorResult that contains all information about the replica execution.

replicaFailed

void replicaFailed(ReplicaExecutorResult result)
Notifies that a task replica has failed.

Parameters:
result - The ReplicaExecutorResult that contains all information about the replica execution.

replicaAborted

void replicaAborted(ReplicaExecutorResult result)
Notifies that a task replica has been aborted.

Parameters:
result - The ReplicaExecutorResult that contains all information about the replica execution.

replicaCanceled

void replicaCanceled(ReplicaExecutorResult result)
Notifies that a task replica has canceled.

Parameters:
result - The ReplicaExecutorResult that contains all information about the replica execution.

schedule

boolean schedule()
Schedules a task replica to a machine. Important: only one task replica should be scheduled in call to this method..


cancelJob

void cancelJob(int jobId)
               throws JobNotFoundException,
                      JobCouldNotBeCancelledException
Cancels the given job and put an Event indicating that in the responseQueue.

Parameters:
jobId - The job identification
Throws:
JobNotFoundException - if asked to cancel an invalid job.
JobCouldNoBeCancelledException - if asked to cancel a job that cannot be cancelled anymore.
JobCouldNotBeCancelledException