jerryshao opened a new issue, #12508:
URL: https://github.com/apache/gravitino/issues/12508

   ### Describe the feature
   
   Expose two additional job execution timestamps — `queuedAt` (when the job 
was submitted) and `startedAt` (when execution began) — through the public 
surface: `JobDTO`, the REST API/OpenAPI spec, the Java client (`JobHandle`), 
and the Python client, alongside the existing `finishedAt`.
   
   ### Motivation
   
   Callers could already see when a job finished (`finishedAt`, from a prior 
change) but had no way to see when it was queued or when execution actually 
started — useful for measuring queue wait time and execution duration.
   
   ### Describe the solution
   
   - `queuedAt` — derived from the job's existing audit `createTime`; no 
storage schema change needed.
   - `startedAt` — genuinely new state, requiring a `job_started_at` column in 
`job_run_meta` (MySQL/PostgreSQL/H2 fresh-install schemas and the 1.3.0→2.0.0 
upgrade scripts), following the same sentinel convention as `job_finished_at`.
   - `JobHandle.queuedAt()`/`startedAt()` (Java `default` methods / Python) — 
non-abstract, raising by default so existing external implementers don't break.
   - `JobDTO.queuedAt`/`startedAt`, `JobEntity.startedAtAsInstant()`, wired 
through `JobOperations.toDTO`, `JobInfo`, and `GenericJobHandle` (Java + 
Python).
   - `JobManager.pullAndUpdateJobStatus` stamps `startedAt` at the 
`QUEUED`/`CANCELLING`→`STARTED` transition, and falls back to `queuedAt` if a 
job reaches `SUCCEEDED`/`FAILED` without ever being observed as `STARTED` 
(since reaching those states proves it ran). `CANCELLED` is excluded from that 
fallback, since a cancelled job may have been killed while still `QUEUED` and 
genuinely never started.
   - OpenAPI schema and examples updated.
   - Unit tests across 
`common`/`core`/`server`/`clients/client-java`/`clients/client-python`, plus 
Java and Python integration tests.
   
   ### Additional context
   
   Builds on the `finishedAt` work (#12495). No behavior change to existing 
fields.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to