[ 
https://issues.apache.org/jira/browse/GOBBLIN-2108?focusedWorklogId=925601&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-925601
 ]

ASF GitHub Bot logged work on GOBBLIN-2108:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Jul/24 06:02
            Start Date: 12/Jul/24 06:02
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3998:
URL: https://github.com/apache/gobblin/pull/3998#discussion_r1675358208


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagActionReminderScheduler.java:
##########
@@ -192,4 +171,44 @@ public static Trigger 
createReminderJobTrigger(DagActionStore.LeaseParams leaseP
         .startAt(new Date(getCurrentTimeMillis.get() + reminderDurationMillis))
         .build();
   }
+
+  public class ReminderJobFactory implements JobFactory {
+    @Override
+    public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) {
+      return new ReminderJob();
+    }
+  }
+
+  /**
+   * Class used to store information regarding a pending dagAction that needs 
to be revisited at a later time
+   * by {@link DagManagement} interface to re-attempt a lease on if it has not 
been completed by the previous owner.
+   * These jobs are scheduled and used by the {@link 
DagActionReminderScheduler}.
+   */
+  public class ReminderJob implements Job {

Review Comment:
   I'm not convinced the factory is actually that related to the 
`DagActionReminderScheduler`.  I was more accepting the compromise that it 
could be one way for the latter to "share" its `DagManagement` with the many 
`ReminderJob`s.  I was more inclined as well, given there's only one factory 
instance.
   
   but, TBH I do find it preferable for the `ReminderJobFactory` also to be 
`static` and with a `private final DagManagement` (initialized by 
`@RequiredArgsConstructor`).  that would be created as:
   ```
       this.quartzScheduler.setJobFactory(new 
ReminderJobFactory(dagManagement));
   ```





Issue Time Tracking
-------------------

    Worklog Id:     (was: 925601)
    Time Spent: 1.5h  (was: 1h 20m)

> fix bug for quartz scheduler instantiate ReminderJob
> ----------------------------------------------------
>
>                 Key: GOBBLIN-2108
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2108
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to