Class DurableJobs
java.lang.Object
com.kingsrook.qqq.backend.core.jobs.DurableJobs
The durable jobs facade: launch any eligible process as a job, control it,
and read its status. Every client (UI, API, assistant, scheduler) goes
through here, so permissions, caps and the assistant confirmation gate are
enforced in one place, by the server.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringTake a control action on a job, as the current session.static Map<String, Serializable> downloadFailedRows(Integer jobId) Write a job's failed rows as CSV for download (standard process download values: downloadFileName, storageTableName, storageReference).static voidRe-evaluate a job's status from its chunks (finish, pause or cancel it when its chunks allow).static StringFor a streamed ETL process whose extract step is partitionable, the extract class name; else null.static booleanisEligible(QProcessMetaData process) Whether a process may run as a durable job: its own durable meta data decides first, then the instance's list of eligible names, then the default for its kind (streamed ETL whose extract is ExtractViaQueryStep or BulkInsertExtractStep - which covers the core bulk processes).static booleanWhether durable jobs are on for the current instance.static Integerlaunch(LaunchRequest request) Launch a process as a durable job, as the current session's user.static IntegerretryFailedRows(Integer jobId, String correctedProfileJson, Integer correctedSavedProfileId) Retry a job's failed rows as a child job, optionally with a corrected bulk-load profile (JSON, or a saved profile id).static IntegerRun again and return the child id to clients.static DurableJobsMetaDatasettings()The instance settings; throws when durable jobs are off.static QRecordStatus of a job the current session can see (owner or jobs_admin).
-
Method Details
-
settings
The instance settings; throws when durable jobs are off.- Throws:
QException
-
isEnabled
public static boolean isEnabled()Whether durable jobs are on for the current instance. -
isEligible
Whether a process may run as a durable job: its own durable meta data decides first, then the instance's list of eligible names, then the default for its kind (streamed ETL whose extract is ExtractViaQueryStep or BulkInsertExtractStep - which covers the core bulk processes). -
getStreamedEtlExtractClassName
For a streamed ETL process whose extract step is partitionable, the extract class name; else null. -
launch
Launch a process as a durable job, as the current session's user. Returns the job id. A launch from the assistant channel waits for confirmation.- Throws:
QException
-
control
Take a control action on a job, as the current session. Owners may control their own jobs; jobs_admin may control any. From the assistant channel only pause and cancel are allowed. Returns a one-line result for summaries.- Throws:
QException
-
retryFailedRows
public static Integer retryFailedRows(Integer jobId, String correctedProfileJson, Integer correctedSavedProfileId) throws QException Retry a job's failed rows as a child job, optionally with a corrected bulk-load profile (JSON, or a saved profile id). Returns the new job id.- Throws:
QException
-
downloadFailedRows
Write a job's failed rows as CSV for download (standard process download values: downloadFileName, storageTableName, storageReference).- Throws:
QException
-
status
Status of a job the current session can see (owner or jobs_admin).- Throws:
QException
-
evaluate
Re-evaluate a job's status from its chunks (finish, pause or cancel it when its chunks allow). Safe to call any time, from any pod.- Throws:
QException
-
runAgain
Run again and return the child id to clients.- Throws:
QException
-