public interface DatabaseDelegate
Modifier and Type | Method and Description |
---|---|
void |
acquireTransactionLocks() |
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.
|
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 errorboolean updateJob(org.apache.ode.scheduler.simple.Job job) throws DatabaseException
job
- the jobDatabaseException
- in case of errorboolean deleteJob(java.lang.String jobid, java.lang.String nodeId) throws DatabaseException
jobid
- job identifiernodeId
- node identifierDatabaseException
- in case of errorjava.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 deqeueDatabaseException
- in case of errorint 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 updatedDatabaseException
- in case of errorint updateReassign(java.lang.String oldnode, java.lang.String newnode) throws DatabaseException
oldnode
- node assigning fromnewnode
- new node asssigning toDatabaseException
void acquireTransactionLocks()