jerryshao opened a new pull request, #12497:
URL: https://github.com/apache/gravitino/pull/12497

   ### What changes were proposed in this pull request?
   
   Expose the job's finished-execution time (already tracked internally by 
`JobEntity`/`JobPO`/storage) through the public surface:
   
   - `JobHandle.finishedAt()` (Java `default` method) / `finished_at()` 
(Python) — non-abstract, raising 
`UnsupportedOperationException`/`NotImplementedError` by default so existing 
external implementers don't break.
   - `JobDTO.finishedAt` (Java `Instant`, Python `datetime`), matching the 
existing `Audit.createTime` convention.
   - `finishedAt` added to the `Job` schema in `docs/open-api/jobs.yaml`.
   - `JobEntity.finishedAtAsInstant()` — single conversion point from the 
storage layer's raw epoch-millis + "not finished" sentinel to `Instant`, used 
by `JobOperations.toDTO` and `JobInfo.fromJobEntity`.
   - `GenericJobHandle` (Java + Python) delegate to the DTO.
   - `JobManager.pullAndUpdateJobStatus` now stamps `finishedAt` at the moment 
a job transitions to a terminal state (`SUCCEEDED`/`FAILED`/`CANCELLED`).
   - `JobEntity.FINISHED_AT` is now a required field, enforced at build time, 
so every construction site must decide the value explicitly; 
`equals()`/`hashCode()` now include it.
   
   ### Why are the changes needed?
   
   Callers could observe a job's status but had no way to know *when* it 
actually finished, failed, or was cancelled — only the storage layer tracked 
this internally.
   
   Fix: #12495
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes:
   - New `finishedAt` field on the `Job` REST API response / OpenAPI schema.
   - New `JobHandle.finishedAt()` (Java) / `finished_at()` (Python) client API, 
returning `null`/`None` if the job hasn't finished yet.
   - `JobHandle` implementers outside this repo will get a default that raises 
`UnsupportedOperationException`/`NotImplementedError` unless they override it.
   
   ### How was this patch tested?
   
   Unit tests across `common`, `core`, `server`, `clients/client-java`, and 
`clients/client-python` (DTO ser/de, `JobEntity` builder/equality, `JobManager` 
status-polling, `JobOperations`/`JobPO` conversion), plus Java and Python 
integration tests (`JobIT`, `tests/integration/test_supports_jobs.py`) running 
real jobs to completion/failure/cancellation and asserting `finishedAt`.


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