|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ourgrid.mygrid.scheduler.FakeSchedulingHeuristic
public class FakeSchedulingHeuristic
Field Summary | |
---|---|
protected GridManager |
gridManager
|
protected JobManager |
jobManager
|
Constructor Summary | |
---|---|
FakeSchedulingHeuristic(JobManager jobManager,
GridManager ebGridManager,
EBReplicaExecutorFacade ebReplicaExecutorFacade)
|
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. |
void |
executeReplica(ReplicaEntry replica,
GumClient gumClient)
It clones the replica and sends it to be executed by the ReplicaExecutor . |
GridManager |
getEBGridManager()
Returns the EBGridManager . |
JobManager |
getEBJobManager()
Returns the EBJobManager . |
ReplicaEntry |
getLatestScheduledReplica()
|
int |
getNumberOfNeededGums(JobSpec jobSpec)
Returns the number of needed Gums according the Job specification. |
protected java.lang.String |
getRequirementsOfJob(int jobId)
Returns a String representing the given job requirements. |
protected java.util.List<TaskEntry> |
getTasksToScheduleQueue()
Gets the list of tasks to schedule. |
void |
newPeersHaveBeenSet()
Notifies the heuristic that new GridMachineProvider s 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JobManager jobManager
protected GridManager gridManager
Constructor Detail |
---|
public FakeSchedulingHeuristic(JobManager jobManager, GridManager ebGridManager, EBReplicaExecutorFacade ebReplicaExecutorFacade)
Method Detail |
---|
public boolean schedule()
EBSchedulingHeuristic
schedule
in interface EBSchedulingHeuristic
EBSchedulingHeuristic.schedule()
public ReplicaEntry getLatestScheduledReplica()
public final GridManager getEBGridManager()
EBSchedulingHeuristic
EBGridManager
.
getEBGridManager
in interface EBSchedulingHeuristic
EBGridManager
.EBSchedulingHeuristic.getEBGridManager()
public final JobManager getEBJobManager()
EBSchedulingHeuristic
EBJobManager
.
getEBJobManager
in interface EBSchedulingHeuristic
EBJobManager
.EBSchedulingHeuristic.getEBJobManager()
public void addJob(int jobId, JobSpec jobSpec)
EBSchedulingHeuristic
Job
.
addJob
in interface EBSchedulingHeuristic
jobId
- The job identification.jobSpec
- The new Job specification.EBSchedulingHeuristic.addJob(int,org.ourgrid.common.spec.JobSpec)
public void newPeersHaveBeenSet()
EBSchedulingHeuristic
GridMachineProvider
s have
been set. GridMachine
s should be requested to the
GridMachineProvider
s.
newPeersHaveBeenSet
in interface EBSchedulingHeuristic
EBSchedulingHeuristic.newPeersHaveBeenSet()
public int getNumberOfNeededGums(JobSpec jobSpec)
jobSpec
- The Job specification.
public void executeReplica(ReplicaEntry replica, GumClient gumClient)
ReplicaExecutor
. It also sets the replica state to
'Running' and sets the GridMachine
as allocated.
replica
- The replica to be executed.gumClient
- The GridMachine
to execute the replicapublic void replicaFinished(ReplicaExecutorResult result)
EBSchedulingHeuristic
replicaFinished
in interface EBSchedulingHeuristic
result
- The ReplicaExecutorResult
that contains all
information about the replica execution.EBSchedulingHeuristic.replicaFinished(ReplicaExecutorResult)
public void replicaAborted(ReplicaExecutorResult result)
EBSchedulingHeuristic
replicaAborted
in interface EBSchedulingHeuristic
result
- The ReplicaExecutorResult
that contains all
information about the replica execution.EBSchedulingHeuristic.replicaAborted(ReplicaExecutorResult)
public void replicaCanceled(ReplicaExecutorResult result)
EBSchedulingHeuristic
replicaCanceled
in interface EBSchedulingHeuristic
result
- The ReplicaExecutorResult
that contains all
information about the replica execution.EBSchedulingHeuristic.replicaCanceled(ReplicaExecutorResult)
public void replicaFailed(ReplicaExecutorResult result)
EBSchedulingHeuristic
replicaFailed
in interface EBSchedulingHeuristic
result
- The ReplicaExecutorResult
that contains all
information about the replica execution.By analyzing the cause of a task failure, it is possible to know
whether the failure has been provoked by an error in the application
or by a machine failure. In the first case, the grid machine has its
status set to READY, so it may be used again. In the latter case,
the gum entry is removed from the broker's Grid Manager.
public void cancelJob(int jobId) throws JobNotFoundException, JobCouldNotBeCancelledException
EBSchedulingHeuristic
cancelJob
in interface EBSchedulingHeuristic
jobId
- The job identification
JobNotFoundException
- if asked to cancel an invalid job.
JobCouldNotBeCancelledException
EBSchedulingHeuristic.cancelJob(int)
protected java.util.List<TaskEntry> getTasksToScheduleQueue()
protected java.lang.String getRequirementsOfJob(int jobId)
jobId
- The identification of the job to get the requirements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |