arjun4084346 commented on code in PR #4023:
URL: https://github.com/apache/gobblin/pull/4023#discussion_r1713129157


##########
gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java:
##########
@@ -412,20 +411,19 @@ protected void logNewlyScheduledJob(JobDetail job, 
Trigger trigger) {
 
   /**
    * Unschedule and delete a job.
+   * Returns true is job was scheduled and is successfully unscheduled, false 
otherwise
    *
    * @param jobName Job name
    * @throws JobException when there is anything wrong unschedule the job
    */
-  public void unscheduleJob(String jobName)
+  public boolean unscheduleJob(String jobName)

Review Comment:
   yes, RC is that it throws exception in GobblinServiceJobScheduler when the 
job does not exist in the map.
   If we ignore when the scheduledJobs does not contain the key and return 
normally (return void, instead of throwing exception like it is doing now), 
then the next line `this.orchestrator.remove(deletedSpec, headers)` will get 
executed, which I want to avoid.
   Basically, right now we are throwing exceptions to avoid running 
`this.orchestrator.remove(deletedSpec, headers)`, the only other way to tell 
the caller not to run further statements is return a flag.
   



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