Class JobProgress
java.lang.Object
com.kingsrook.qqq.backend.core.jobs.progress.JobProgress
Shared reporting API for durable chunks and ordinary async process steps.
-
Constructor Summary
ConstructorsConstructorDescriptionJobProgress(AsyncJobCallback callback) Construct an inline reporter (a null callback is a safe no-op destination).JobProgress(ChunkContext context) Construct the single reporter for a chunk attempt.JobProgress(DurableJobStore store, Integer jobId) Construct a reporter for a tracking job (JobTracking): no lease, written in its own short transactions like a chunk's. -
Method Summary
Modifier and TypeMethodDescriptionbytesDone(long value) Set bytesDone for the current phase.bytesTotal(long value) Set bytesTotal for the current phase.static JobProgresscurrent()Reporter on the running chunk, or a safe standalone reporter.Append a redacted DEBUG line.done(long value) Set done for the current phase.Append a redacted ERROR line.voidflush()Flush before the chunk completion fence changes, including on exceptions.Current snapshot for adapters and tests.Append a redacted INFO line.log(JobLogLevel level, String message) Append a log line; warnings and errors force a flush.Set a redacted display message.static JobProgressof(RunBackendStepInput input) Never null.Advance to a named phase; a phase transition flushes immediately.Declare phases for this attempt.voidMap an existing async callback update to one consistent snapshot.total(long total) Set current phase total in the existing unit.Set current phase total and its display unit.Append a redacted WARN line.
-
Constructor Details
-
JobProgress
Construct an inline reporter (a null callback is a safe no-op destination). -
JobProgress
Construct the single reporter for a chunk attempt. -
JobProgress
Construct a reporter for a tracking job (JobTracking): no lease, written in its own short transactions like a chunk's.
-
-
Method Details
-
of
Never null. Reuse the callback reporter outside durable execution. -
current
Reporter on the running chunk, or a safe standalone reporter. -
phases
Declare phases for this attempt. -
phase
Advance to a named phase; a phase transition flushes immediately. -
total
Set current phase total and its display unit. -
total
Set current phase total in the existing unit. -
done
Set done for the current phase. -
bytesDone
Set bytesDone for the current phase. -
bytesTotal
Set bytesTotal for the current phase. -
message
Set a redacted display message. -
status
-
debug
Append a redacted DEBUG line. -
info
Append a redacted INFO line. -
warn
Append a redacted WARN line. -
error
Append a redacted ERROR line. -
log
Append a log line; warnings and errors force a flush. -
flush
public void flush()Flush before the chunk completion fence changes, including on exceptions. -
getSnapshot
Current snapshot for adapters and tests.
-