|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ourgrid.mygrid.scheduler.jobmanager.AbstractJobManager
org.ourgrid.mygrid.scheduler.jobmanager.EBJobManager
public class EBJobManager
Class responsible for managing the jobs. It maintains a list of all jobs submitted by the user and controls all operations made in these jobs.
Field Summary | |
---|---|
protected java.util.Map<java.lang.Integer,JobEntry> |
jobs
|
Constructor Summary | |
---|---|
EBJobManager()
The constructor. |
Method Summary | |
---|---|
void |
addJobInterested(JobInterested jobInterested)
Adds a new JobInterested . |
protected void |
addNewJob(int jobId,
JobEntry newJob)
|
void |
cleanFinishedJobs()
Clean the list of terminated jobs |
java.util.Collection<JobEntry> |
clonedJobList()
Returns a clone of the Job list. |
protected JobEntry |
createJobEntry(int jobId,
JobSpec jobSpec,
int maxReplicas,
int maxFails)
|
JobEntry |
getJobById(int jobId)
Returns a Job with the specified identification. |
ExecutionStatus |
getJobState(int jobId)
Returns the state of the given Job. |
int |
getMaxFails()
Gets the number of task replicas allowed to be running at the same time. |
int |
getMaxReplicas()
Gets the number of task replicas allowed to be running at the same time. |
java.util.Collection<JobEntry> |
jobList()
Returns the Job list. |
protected void |
realAddJob(int jobId,
JobSpec jobSpec)
|
protected ReplicaEntry |
realCreateNewReplica(TaskEntry task)
Creates and returns a new Replica . |
protected void |
realRemoveJob(int jobId)
|
protected void |
realReplicaAborted(ReplicaExecutorResult result)
Sets the Replica state to aborted. |
protected void |
realReplicaCanceled(ReplicaExecutorResult result)
Sets the Replica state to canceled. |
protected void |
realReplicaFailed(ReplicaExecutorResult result)
Sets the Replica state to failed. |
protected void |
realReplicaFinished(ReplicaExecutorResult result)
Sets the Replica state to finished. |
protected void |
realReplicaRunning(ReplicaEntry replica,
GumID gumID)
|
protected void |
realSetCanceled(int jobId)
|
protected void |
realShutdown()
|
protected void |
setJobList(java.util.Map<java.lang.Integer,JobEntry> newJobList)
|
void |
setMaxFails(java.lang.String maxFails)
Sets the number of failed task replicas until consider the Task itself as failed. |
void |
setMaxReplicas(java.lang.String maxReplicas)
Sets the number of task replicas allowed to be running at the same time. |
Methods inherited from class org.ourgrid.mygrid.scheduler.jobmanager.AbstractJobManager |
---|
addJob, addNewListener, createNewReplica, removeJob, removeListener, replicaAborted, replicaCanceled, replicaFailed, replicaFinished, replicaRunning, setCanceled, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.Integer,JobEntry> jobs
Constructor Detail |
---|
public EBJobManager()
Method Detail |
---|
public java.util.Collection<JobEntry> clonedJobList()
Job
list. All objects within this
list are clones.
Job
list.public java.util.Collection<JobEntry> jobList()
Job
list.
Job
list.public void addJobInterested(JobInterested jobInterested)
JobInterested
.
jobInterested
- The JobInterested
.protected void realReplicaFinished(ReplicaExecutorResult result)
Replica
state to finished. It also
notifies JobInteresteds
case it is necessary.
realReplicaFinished
in class AbstractJobManager
result
- The ReplicaExecutorResult
.protected void realReplicaFailed(ReplicaExecutorResult result)
Replica
state to failed. It also notifies
JobInteresteds
case it is necessary.
realReplicaFailed
in class AbstractJobManager
result
- The ReplicaExecutorResult
.protected void realReplicaAborted(ReplicaExecutorResult result)
Replica
state to aborted. It also
notifies JobInteresteds
case it is necessary.
realReplicaAborted
in class AbstractJobManager
result
- The ReplicaExecutorResult
.protected void realReplicaCanceled(ReplicaExecutorResult result)
Replica
state to canceled. It also
notifies JobInteresteds
case it is necessary.
realReplicaCanceled
in class AbstractJobManager
result
- The ReplicaExecutorResult
.protected void realReplicaRunning(ReplicaEntry replica, GumID gumID)
realReplicaRunning
in class AbstractJobManager
protected ReplicaEntry realCreateNewReplica(TaskEntry task)
Replica
.
realCreateNewReplica
in class AbstractJobManager
Replica
in case that a replication is
possible to be made, null
otherwise.public ExecutionStatus getJobState(int jobId)
jobId
- The Job identification
public JobEntry getJobById(int jobId)
Job
with the specified identification.
jobId
- The job identification.
Job
case it exists,
null
otherwise.public void setMaxReplicas(java.lang.String maxReplicas) throws ConfigException
maxReplicas
- The number of max replicas
ConfigException
public int getMaxReplicas()
public void setMaxFails(java.lang.String maxFails) throws ConfigException
maxFails
- The number of max fails
ConfigException
public int getMaxFails()
protected void realSetCanceled(int jobId) throws JobNotFoundException, JobCouldNotBeCancelledException
realSetCanceled
in class AbstractJobManager
JobNotFoundException
JobCouldNotBeCancelledException
public void cleanFinishedJobs()
JobManager
protected void realRemoveJob(int jobId) throws JobCannotBeRemovedException
realRemoveJob
in class AbstractJobManager
JobCannotBeRemovedException
protected void realAddJob(int jobId, JobSpec jobSpec)
realAddJob
in class AbstractJobManager
protected JobEntry createJobEntry(int jobId, JobSpec jobSpec, int maxReplicas, int maxFails)
protected void addNewJob(int jobId, JobEntry newJob)
protected void setJobList(java.util.Map<java.lang.Integer,JobEntry> newJobList)
protected void realShutdown()
realShutdown
in class AbstractJobManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |