Class DurableJobsMetaDataProvider
java.lang.Object
com.kingsrook.qqq.backend.core.jobs.DurableJobsMetaDataProvider
Defines the durable-jobs tables (jobs_job, jobs_chunk, jobs_row_error,
jobs_event, jobs_worker), their possible-value sources, joins, the record
lock, and the job control processes. Same pattern as
SavedBulkLoadProfileMetaDataProvider:
new DurableJobsMetaDataProvider().defineAll(instance, "rdbms", enricher);Without the qbit-jobs app the tables still get standard screens. Security: a record lock on jobs_job.userId (key type jobs_user) - users see their own jobs; the jobs_user_all_access key (granted for the jobs_admin permission by DurableJobsSecurity.applyToSession) sees all. Child tables are locked through their join to jobs_job.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringchildJoinName(String childTable) Name of the join from jobs_job to a child table.voiddefineAll(QInstance instance, String backendName, Consumer<QTableMetaData> backendDetailEnricher) Add every durable-jobs table, join, possible-value source, security key type and control process to the instance.defineChunkTable(String backendName) jobs_chunk: the unit of work a worker leases.defineEffectTable(String backendName) jobs_effect: the transactional outbox of side effects outside the job's database (spec section 2.13).defineEventTable(String backendName) jobs_event: the timeline of a job.defineJobTable(String backendName) jobs_job: one row per durable job.defineLogTable(String backendName) Append-only redacted log, secured through the parent job.defineRowErrorTable(String backendName) jobs_row_error: which rows failed and why.defineUploadTable(String backendName) jobs_upload: files uploaded through POST /uploads (the bytes live in the uploads storage table; this row is the opaque ref, its owner and expiry).defineWorkerTable(String backendName) jobs_worker: which pods run jobs.Names of the main tables a host may wire into its ESB (each main table publishes table events).static Consumer<QTableMetaData> A backend-detail enricher that maps every field to a snake_case column (rowsDone -> rows_done), for databases whose schema uses snake_case.
-
Constructor Details
-
DurableJobsMetaDataProvider
public DurableJobsMetaDataProvider()
-
-
Method Details
-
defineAll
public void defineAll(QInstance instance, String backendName, Consumer<QTableMetaData> backendDetailEnricher) throws QException Add every durable-jobs table, join, possible-value source, security key type and control process to the instance.- Throws:
QException
-
esbTableNames
-
snakeCaseColumnNames
A backend-detail enricher that maps every field to a snake_case column (rowsDone -> rows_done), for databases whose schema uses snake_case. Pass it as defineAll's enricher, or compose it with your own. -
childJoinName
-
defineJobTable
jobs_job: one row per durable job. -
defineChunkTable
jobs_chunk: the unit of work a worker leases. -
defineRowErrorTable
jobs_row_error: which rows failed and why. -
defineEffectTable
jobs_effect: the transactional outbox of side effects outside the job's database (spec section 2.13). Written in the chunk's transaction; delivered by the dispatcher; idempotencyKey is unique (jobId:chunkSeq:rowKey:effect). -
defineEventTable
jobs_event: the timeline of a job. Type leads the fields: most events are job-level, so a (usually empty) chunk column first would leave lists, such as the job's Events child list, without a readable first column. -
defineWorkerTable
jobs_worker: which pods run jobs. Leases never depend on it. -
defineUploadTable
jobs_upload: files uploaded through POST /uploads (the bytes live in the uploads storage table; this row is the opaque ref, its owner and expiry). -
defineLogTable
Append-only redacted log, secured through the parent job.
-