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

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

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


##########
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:
   non-static inner classes are good for tightly-coupled abstractions.  as you 
just found, they have some pitfalls.  in this case, it feels more like a 
`static` inner class.  just give it a `private final DagManagement` member and 
`@RequiredArgsCtor`
   
   the `ReminderJobFactory` would still be non-`static`.  it's the one that 
will take its `DagActionReminderScheduler.this.dagManagement` member and pass 
that along to the job's ctor.



##########
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}.

Review Comment:
   1. nit: in class javadoc, there's no need to note that it's a class.  
instead, just jump in to say sth like, "Stores info about a pending {@link 
DagAction} that needs..."
   
   2. but overall, however, that description is inaccurate - nothing is stored! 
 instead, AFAICT, this merely deserializes a `DagAction` to submit it for 
{@link DagManagement}.
   
   3. hence naming-wise, even though this is a reminder, it might be clearer to 
name it after what it actually does, e.g. `ReaddDagActionJob`





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

    Worklog Id:     (was: 925533)
    Time Spent: 20m  (was: 10m)

> 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: 20m
>  Remaining Estimate: 0h
>




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

Reply via email to