CalvinKirs commented on code in PR #56175:
URL: https://github.com/apache/doris/pull/56175#discussion_r2370833487


##########
fe/fe-core/src/main/java/org/apache/doris/job/scheduler/JobScheduler.java:
##########
@@ -144,7 +145,7 @@ public void scheduleOneJob(T job) throws JobException {
     }
 
     public void cycleTimerJobScheduler(T job) {
-        if (!job.getJobStatus().equals(JobStatus.RUNNING)) {
+        if (!JobUtils.checkNeedSchedule(job)) {

Review Comment:
   This is kind of confusing. Maybe you should add a new interface. I’m not 
sure if using a stream fits here, but for now, the current behavior is 
changing, so adding an interface instead of a static class would make more 
sense.



##########
fe/fe-core/src/main/java/org/apache/doris/job/executor/DispatchTaskHandler.java:
##########
@@ -55,7 +55,7 @@ public void onEvent(TimerJobEvent<T> event) {
                 log.info("job is null,may be job is deleted, ignore");
                 return;
             }
-            if (event.getJob().isReadyForScheduling(null) && 
event.getJob().getJobStatus() == JobStatus.RUNNING) {
+            if (event.getJob().isReadyForScheduling(null) && 
JobUtils.checkNeedSchedule(event.getJob())) {

Review Comment:
   Similarly, isReadyForScheduling and checkNeedSchedule are confusing.



##########
fe/fe-core/src/main/java/org/apache/doris/job/executor/TimerJobSchedulerTask.java:
##########
@@ -40,7 +40,7 @@ public TimerJobSchedulerTask(TaskDisruptor dispatchDisruptor, 
T job) {
     @Override
     public void run(Timeout timeout) {
         try {
-            if (!JobStatus.RUNNING.equals(job.getJobStatus())) {
+            if (!JobUtils.checkNeedSchedule(job)) {

Review Comment:
   Similarly...



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to