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

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

                Author: ASF GitHub Bot
            Created on: 27/Mar/24 06:41
            Start Date: 27/Mar/24 06:41
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3896:
URL: https://github.com/apache/gobblin/pull/3896#discussion_r1540527516


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/proc/DagProc.java:
##########
@@ -35,38 +36,39 @@
 
 /**
  * Responsible for performing the actual work for a given {@link DagTask} by 
first initializing its state, performing
- * actions based on the type of {@link DagTask} and finally submitting an 
event to the executor.
+ * actions based on the type of {@link DagTask}. Submitting events in time is 
important (PR#3641), hence initialize and
+ * act methods submit events as they happen.
  */
 @Alpha
 @Slf4j
 @RequiredArgsConstructor
-public abstract class DagProc<S, T> {
+public abstract class DagProc<S> {
   protected final DagTask dagTask;
+  @Getter protected final DagManager.DagId dagId;
+  @Getter protected final DagNodeId dagNodeId;
   protected static final MetricContext metricContext = 
Instrumented.getMetricContext(new State(), DagProc.class);
   protected static final EventSubmitter eventSubmitter = new 
EventSubmitter.Builder(
       metricContext, "org.apache.gobblin.service").build();
 
-  public final void process(DagManagementStateStore dagManagementStateStore) 
throws IOException {
-    S state = initialize(dagManagementStateStore);   // todo - retry
-    T result = act(dagManagementStateStore, state);   // todo - retry
-    commit(dagManagementStateStore, result);   // todo - retry
-    log.info("{} successfully concluded actions for dagId : {}", 
getClass().getSimpleName(), getDagId());
-  }
-
-  protected DagManager.DagId getDagId() {
-    return this.dagTask.getDagId();
+  public DagProc(DagTask dagTask) {
+    this.dagTask = dagTask;
+    this.dagId = this.dagTask.getDagId();
+    this.dagNodeId = this.dagTask.getDagNodeId();
   }
 
-  protected DagNodeId getDagNodeId() {
-    return this.dagTask.getDagNodeId();
+  public final void process(DagManagementStateStore dagManagementStateStore) 
throws IOException {
+    S state = initialize(dagManagementStateStore);   // todo - retry
+    act(dagManagementStateStore, state);   // todo - retry
+    commit(dagManagementStateStore);   // todo - retry
+    log.info("{} successfully concluded actions for dagId : {}", 
getClass().getSimpleName(), this.dagId);

Review Comment:
   I don't believe we need `commit`.  do you see a purpose for it? 
   
   nit: "...concluded *processing* for dagId..." (as `process` is the method 
name)





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

    Worklog Id:     (was: 911736)
    Time Spent: 10.5h  (was: 10h 20m)

> create dag proc for taking actions on job completion
> ----------------------------------------------------
>
>                 Key: GOBBLIN-2022
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2022
>             Project: Apache Gobblin
>          Issue Type: Task
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 10.5h
>  Remaining Estimate: 0h
>




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

Reply via email to