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
would be a way for the latter to "share" its `DagManagement` with the many
`ReminderJob`s. also there's only one factory.
but, TBH, it would be perfectly fine, and IMO preferable if the
`ReminderJobFactory` were static and also held a `private final DagManagement`
(w/ `@RequiredArgsConstructor`), so it could be created as:
```
this.quartzScheduler.setJobFactory(new
ReminderJobFactory(dagManagement));
```
--
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]