Hisoka-X commented on code in PR #9400:
URL: https://github.com/apache/seatunnel/pull/9400#discussion_r2134938338
##########
seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine/core/job/JobStatus.java:
##########
@@ -38,6 +38,9 @@ public enum JobStatus {
*/
SCHEDULED(EndState.NOT_END),
+ /** The job has been started. */
+ STARTED(EndState.NOT_END),
Review Comment:
This alignment is not necessary because the newly added state does not help
the process run at all. We can use the time of the SCHEDULED state.
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/BaseService.java:
##########
@@ -200,6 +202,18 @@ nodeEngine, new GetJobStatusOperation(jobId))
return jobInfoJson;
}
+ private String getJobStartTime(long jobId) {
+ IMap<Object, Long[]> stateTimestamps =
+
nodeEngine.getHazelcastInstance().getMap(Constant.IMAP_STATE_TIMESTAMPS);
+ Long[] jobnStateTimestamps = stateTimestamps.get(jobId);
+ if (jobnStateTimestamps != null) {
+ Long startTimestamp =
jobnStateTimestamps[JobStatus.STARTED.ordinal()];
+ return DateTimeUtils.toString(
+ startTimestamp,
DateTimeUtils.Formatter.YYYY_MM_DD_HH_MM_SS);
+ }
+ return "";
Review Comment:
```suggestion
return null;
```
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlan.java:
##########
@@ -231,6 +231,11 @@ private void updateStateTimestamps(@NonNull JobStatus
targetState) {
runningJobStateTimestampsIMap.set(jobId, stateTimestamps);
}
+ public synchronized Long getStatTimestamp(@NonNull JobStatus jobStatus) {
Review Comment:
```suggestion
public synchronized Long getStateTimestamp(@NonNull JobStatus jobStatus)
{
```
--
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]