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

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

                Author: ASF GitHub Bot
            Created on: 03/Apr/24 16:52
            Start Date: 03/Apr/24 16:52
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3896:
URL: https://github.com/apache/gobblin/pull/3896#discussion_r1550053760


##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java:
##########
@@ -193,7 +197,18 @@ protected void 
processMessage(DecodeableKafkaRecord<byte[],byte[]> message) {
         org.apache.gobblin.configuration.State jobStatus = 
parseJobStatus(gobblinTrackingEvent);
         if (jobStatus != null) {
           try (Timer.Context context = 
getMetricContext().timer(GET_AND_SET_JOB_STATUS).time()) {
-            addJobStatusToStateStore(jobStatus, this.stateStore, 
this.eventProducer);
+            Optional<org.apache.gobblin.configuration.State> updatedJobStatus 
= addJobStatusToStateStore(jobStatus, this.stateStore);
+            boolean isJobStatusUpdated = updatedJobStatus.isPresent();
+            // todo - retried/resumed jobs *may* not be handled here, we may 
want to create their dag action elsewhere
+            if (isJobStatusUpdated) {
+              jobStatus = updatedJobStatus.get();
+              this.eventProducer.emitObservabilityEvent(jobStatus);
+              String flowName = 
jobStatus.getProp(TimingEvent.FlowEventConstants.FLOW_NAME_FIELD);
+              String flowGroup = 
jobStatus.getProp(TimingEvent.FlowEventConstants.FLOW_GROUP_FIELD);
+              String flowExecutionId = 
jobStatus.getProp(TimingEvent.FlowEventConstants.FLOW_EXECUTION_ID_FIELD);
+              String jobName = 
jobStatus.getProp(TimingEvent.FlowEventConstants.JOB_NAME_FIELD);
+              this.dagActionStore.addJobDagAction(flowGroup, flowName, 
flowExecutionId, jobName, DagActionStore.DagActionType.REEVALUATE);

Review Comment:
   seems like a common pattern.  where could we add a util factory method like:
   ```
   DagAction createFromJobState(State s, DagActionType actionType)
   ```
   ?





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

    Worklog Id:     (was: 912871)
    Time Spent: 11h 50m  (was: 11h 40m)

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




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

Reply via email to