RenderX

Chapter 11 of the VDPMill User Guide

VDPMill Job Manager

A.1.  Job Manager Brief Description

Job Manager is an internal component of VDPMill intended for queueing and processing VDPMill jobs. It accepts VDPMill job tickets (see Appendix C, Job Ticket Format Description**), queues them and processes sequentially. Once a job is applied, it can be paused/canceled/resumed after pausing. Jobs are identified using unique identifiers generated by Job Manager when a job is applied.

The job applied to the job manager goes to the queue monitored by a separate thread that takes the first job with 'waiting' status from the queue to process. After the current job is finished Job Manager puts it to the finished jobs list that is being held to provide information about last finished jobs to the client components. The size of the list for finished jobs is limited (the limit is configurable). When the limit is exceeded the oldest finished job is removed from the list. All the files and directories for that job are removed as well.

Job Manager stores all the queued jobs and finished jobs list to the session directory on quit and loads saved jobs on launching. The path to session directory is a configurable parameter of Job Manager.

For detailed information about VDPMill Job Manager and its API see VDPMill DevKit package, the API documentation.

 

A.2. Job Manager Actions

The list below describes job actions without technical details (refer to VDPMill DevKit package for Job Manager API documentation).

 

  • apply ticket validates and queues the ticket for processing if valid, or reports the error occurred during the validation.

  • pause job-id pauses the given job. If the job currently is in process, it enters the pausing mode. Error flag is returned if the given job is not found, or the pause operation is not allowed for the job.

  • cancel job-id cancels the job. If the job currently is in process it enters the canceling mode. Error flag is returned if the given job is not found, or the cancel operation is not allowed for that job. When the job is canceled, it is removed from the queue. All files and folders for that job is removed from the session directory.

  • resume job-id resumes the previously paused or failed job. The job takes waiting status and is processed, when it's turn comes. Error flag is returned if the given job is not found or the resume operation is not allowed for that job.

  • list jobs returns a map job-id -> job-status for all the queued and finished jobs. Returns an empty map if there are no queued/finished jobs.

  • get-state job-id returns the current state for the given job or error flag if the job is not found.

 

 

A.3. Job States

The table below describes the states that a job can have when it is applied to Job Manager. Depending on its state, several actions can be allowed for the job. Possible subsequent states of the job depend on the current state as well.

 

Table A.1. Job States, Allowed Actions, Possible Subsequent States

StateAllowed ActionsPossible Subsequent States
waitingpause, cancelprocessing, paused
processingpause, cancelpausing, canceling, failed, finished
pausedresume, cancelwaiting
failedresume, cancelwaiting
pausingno actions allowedpaused, failed, finished
cancelingno actions allowedno subsequent state
finishedno actions allowedno subsequent state