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

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

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


##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java:
##########
@@ -234,17 +248,14 @@ protected void 
processMessage(DecodeableKafkaRecord<byte[],byte[]> message) {
   }
 
   /**
-   * Persist job status to the underlying {@link StateStore}.
-   * It fills missing fields in job status and also merge the fields with the
-   * existing job status in the state store. Merging is required because we
-   * do not want to lose the information sent by other GobblinTrackingEvents.
-   * Returns an absent Optional if adding this state transitions the job 
status of the job to final, otherwise returns
-   * the updated job status wrapped inside an Optional.
-   * It will also return an absent Optional if the job status was already 
final before calling this method.
+   * It fills missing fields in job status and also merge the fields with the 
existing job status in the state store.
+   * Merging is required because we do not want to lose the information sent 
by other GobblinTrackingEvents.
+   * Returns a pair of current job status after update in this method and the 
last previous state for this job wrapped
+   * inside an Optional.
    * @throws IOException
    */
   @VisibleForTesting
-  static Optional<org.apache.gobblin.configuration.State> 
addJobStatusToStateStore(org.apache.gobblin.configuration.State jobStatus,
+  static Pair<org.apache.gobblin.configuration.State, 
Optional<org.apache.gobblin.configuration.State>> 
updateJobStatus(org.apache.gobblin.configuration.State jobStatus,

Review Comment:
   seems better encapsulation to calculate whether `isNewTransitionToFinal` 
within and return `Pair<State, Boolean>`.
   
   whenever previously `Optional.isPresent`, now `Pair<State, true>`
   whenever previously `Optional.empty`, now `Pair<State, false>` 
   
   also, since not actually "updating" the state store, maybe name this 
`recalcJobStatus` or `calcUpdatedJobStatus`?





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

    Worklog Id:     (was: 912951)
    Time Spent: 14.5h  (was: 14h 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: 14.5h
>  Remaining Estimate: 0h
>




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

Reply via email to