Class JobProgress

java.lang.Object
com.kingsrook.qqq.backend.core.jobs.progress.JobProgress

public class JobProgress extends Object
Shared reporting API for durable chunks and ordinary async process steps.
  • Constructor Details

    • JobProgress

      public JobProgress(AsyncJobCallback callback)
      Construct an inline reporter (a null callback is a safe no-op destination).
    • JobProgress

      public JobProgress(ChunkContext context)
      Construct the single reporter for a chunk attempt.
    • JobProgress

      public 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 Details

    • of

      public static JobProgress of(RunBackendStepInput input)
      Never null. Reuse the callback reporter outside durable execution.
    • current

      public static JobProgress current()
      Reporter on the running chunk, or a safe standalone reporter.
    • phases

      public JobProgress phases(JobPhase... phases)
      Declare phases for this attempt.
    • phase

      public JobProgress phase(String name)
      Advance to a named phase; a phase transition flushes immediately.
    • total

      public JobProgress total(long total, String unitLabel)
      Set current phase total and its display unit.
    • total

      public JobProgress total(long total)
      Set current phase total in the existing unit.
    • done

      public JobProgress done(long value)
      Set done for the current phase.
    • bytesDone

      public JobProgress bytesDone(long value)
      Set bytesDone for the current phase.
    • bytesTotal

      public JobProgress bytesTotal(long value)
      Set bytesTotal for the current phase.
    • message

      public JobProgress message(String message)
      Set a redacted display message.
    • status

      public void status(String message, Integer current, Integer total)
      Map an existing async callback update to one consistent snapshot.
    • debug

      public JobProgress debug(String message)
      Append a redacted DEBUG line.
    • info

      public JobProgress info(String message)
      Append a redacted INFO line.
    • warn

      public JobProgress warn(String message)
      Append a redacted WARN line.
    • error

      public JobProgress error(String message)
      Append a redacted ERROR line.
    • log

      public JobProgress log(JobLogLevel level, String message)
      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

      public JobProgressSnapshot getSnapshot()
      Current snapshot for adapters and tests.