Job Specification and Status
A Job Specification is a detailed set of instructions that tells the IPF Persistent Scheduler how to run a specific job. It includes several key components, each with a specific purpose. A job can have different status’ depending on where it is in its lifecycle:
Job Specification
It consists of the following parts:
| Name | Mandatory? | Description |
|---|---|---|
|
Yes |
a unique identifier for this job |
|
Yes |
A unique identifier for the requestor (a requestor can have multiple jobs) |
|
Yes |
The cron expression for this job |
|
Yes |
The |
|
Yes |
An ID to use to send to the SchedulingHelper at the scheduled time(s) |
|
Yes |
When a failed execution is detected, the SchedulingHelper will receive this message. |
|
Yes |
An ID to use to send to the SchedulingHelper at the scheduled time(s) |
|
No |
Calendar to use for this job (see Calendars) |
|
No |
A time-zone id, such as |
|
No |
Used for Time-To-Live index (TTL Indexes). One time jobs that have been executed successfully. One time jobs that have failed execution. All jobs that have been cancelled. All these jobs, will be updated with a "delete time" and will no longer be available when querying them in the database. It will allow us to quickly retrieve the latest job specifications, and filter out (in case of rehydration) the jobs that have been excluded. |
Job Execution Status
The JobExecutionStatus collection is linked to the JobSpecification collection by the jobSpecificationId field.
The JobExecutionStatus collection is going to change more frequently, because the status of a job changes more frequently than its specification.
It contains the jobSpecificationId, the executionStatus the updatedTime and the deleteTime.
It is an append only collection and in order to get the current job execution status we just need to order by updatedTime and get the latest more recent entry.
Similarly to the JobSpecification collection, the deleteTime field is used for TTL (Time-To-Live) index.
In addition, for recurrent jobs, when a job is triggered, the previous entry will be marked for deletion. Only the most recent entry is worth keeping.