use of com.thinkbiganalytics.metadata.api.feed.LatestFeedJobExecution in project kylo by Teradata.
the class DataConfidenceJobsCache method fetchDataConfidenceSummary.
private List<CheckDataJob> fetchDataConfidenceSummary() {
if (latestCache == null || needsRefresh.get()) {
DateTime refrshStart = DateTime.now();
latestCache = metadataAccess.read(() -> {
List<? extends LatestFeedJobExecution> latestCheckDataJobs = opsManagerFeedProvider.findLatestCheckDataJobs();
if (latestCheckDataJobs != null) {
return latestCheckDataJobs.stream().map(latestFeedJobExecution -> JobModelTransform.checkDataJob(latestFeedJobExecution)).collect(Collectors.toList());
// return new DataConfidenceSummary(checkDataJobs, 60);
} else {
return Collections.emptyList();
}
}, MetadataAccess.SERVICE);
// reset the refresh flag including if any updates happened while we were loading
if (needsRefreshAt != null) {
needsRefresh.set(needsRefreshAt.isAfter(refrshStart));
} else {
needsRefresh.set(false);
}
log.debug("Loaded Data Confidence Summary from the database");
return latestCache;
} else {
log.debug("Returning Cached Data Confidence Summary");
return latestCache;
}
}
Aggregations