|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DatabaseDelegate
Database abstraction; provides all database access for the simple scheduler.
| Method Summary | |
|---|---|
boolean |
deleteJob(java.lang.String jobid,
java.lang.String nodeId)
Delete a job from the database. |
java.util.List<org.apache.ode.scheduler.simple.Job> |
dequeueImmediate(java.lang.String nodeId,
long maxtime,
int maxjobs)
"Dequeue" jobs from the database that are ready for immediate execution; this basically is a select/delete operation with constraints on the nodeId and scheduled time. |
java.util.List<java.lang.String> |
getNodeIds()
Return a list of unique nodes identifiers found in the database. |
boolean |
insertJob(org.apache.ode.scheduler.simple.Job job,
java.lang.String nodeId,
boolean loaded)
Save the job in the database. |
int |
updateAssignToNode(java.lang.String nodeId,
int x,
int y,
long maxtime)
Assign a particular node identifier to a fraction of jobs in the database that do not have one, and are up for execution within a certain time. |
boolean |
updateJob(org.apache.ode.scheduler.simple.Job job)
Update the job in the database (only updates timestamp and retryCount) |
int |
updateReassign(java.lang.String oldnode,
java.lang.String newnode)
Reassign jobs from one node to another. |
| Method Detail |
|---|
boolean insertJob(org.apache.ode.scheduler.simple.Job job,
java.lang.String nodeId,
boolean loaded)
throws DatabaseException
job - the jobnodeId - node assigned to the job (or null if no node has been asssigned)loaded - whether the job has been loaded into memory (i.e. in preperation for execution)
DatabaseException - in case of error
boolean updateJob(org.apache.ode.scheduler.simple.Job job)
throws DatabaseException
job - the job
DatabaseException - in case of error
boolean deleteJob(java.lang.String jobid,
java.lang.String nodeId)
throws DatabaseException
jobid - job identifiernodeId - node identifier
DatabaseException - in case of error
java.util.List<java.lang.String> getNodeIds()
throws DatabaseException
DatabaseException
java.util.List<org.apache.ode.scheduler.simple.Job> dequeueImmediate(java.lang.String nodeId,
long maxtime,
int maxjobs)
throws DatabaseException
nodeId - node identifier of the jobsmaxtime - only jobs with scheduled time earlier than this will be dequeuedmaxjobs - maximum number of jobs to deqeue
DatabaseException - in case of error
int updateAssignToNode(java.lang.String nodeId,
int x,
int y,
long maxtime)
throws DatabaseException
UPDATE jobs AS job
WHERE job.scheduledTime before :maxtime
AND job.nodeId is null
AND job.scheduledTime MOD :y == :x
SET job.nodeId = :nodeId
nodeId - node identifier to assign to jobsx - the result of the mod-divisiony - the dividend of the mod-divisionmaxtime - only jobs with scheduled time earlier than this will be updated
DatabaseException - in case of error
int updateReassign(java.lang.String oldnode,
java.lang.String newnode)
throws DatabaseException
oldnode - node assigning fromnewnode - new node asssigning to
DatabaseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||