jack-moseley commented on a change in pull request #3225:
URL: https://github.com/apache/gobblin/pull/3225#discussion_r574170242
##########
File path:
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobContext.java
##########
@@ -547,4 +548,21 @@ public String toString() {
return
Objects.toStringHelper(JobContext.class.getSimpleName()).add("jobName",
getJobName())
.add("jobId", getJobId()).add("jobState", getJobState()).toString();
}
+
+ /**
+ * Get all of the failures from the datasetStates stored in the jobContext
to determine if
+ * email notification should be sent or not. Previously job context only
looked at jobStates, where
+ * failures from datasetStates were not propagated from
+ * Failures are tracked using {@link ConfigurationKeys#JOB_FAILURES_KEY}
+ */
+ public int getDatasetStateFailures() {
+ if (!this.datasetStatesByUrns.isPresent()) {
+ return 0;
+ }
Review comment:
You could just use `getDatasetStatesByUrns` from this class, and it will
return an empty map if not present, so this method would still correctly return
0.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]