phet commented on code in PR #3896:
URL: https://github.com/apache/gobblin/pull/3896#discussion_r1538641764


##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java:
##########
@@ -275,6 +279,7 @@ static void 
addJobStatusToStateStore(org.apache.gobblin.configuration.State jobS
       modifyStateIfRetryRequired(jobStatus);
       stateStore.put(storeName, tableName, jobStatus);
       if (isNewStateTransitionToFinal(jobStatus, states)) {
+        dagActionStore.addDagAction(flowGroup, flowName, flowExecutionId, 
jobName, DagActionStore.DagActionType.REEVALUATE);
         eventProducer.emitObservabilityEvent(jobStatus);

Review Comment:
   the fact that you must add mocking for the `DagActionStore` just to keep 
working existing tests that happen call this `static` method, suggests the 
method has too many concerns rolled into one.  instead, how about returning 
`Optional<JobStatus>` that would be present only in cases where 
`isNewStateTransitionToFinal`?
   
   that way `dagActionStore` and `eventProducer` are only called directly 
within `processMessage`



-- 
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]

Reply via email to