use of com.thinkbiganalytics.jobrepo.query.model.ExecutedFeed in project kylo by Teradata.
the class FeedHealthUtil method parseToList.
public static List<FeedHealth> parseToList(List<ExecutedFeed> latestOpFeeds, Map<String, Long> avgRunTimes) {
List<FeedHealth> list = new ArrayList<FeedHealth>();
Map<String, FeedHealth> map = new HashMap<String, FeedHealth>();
if (latestOpFeeds != null) {
for (ExecutedFeed feed : latestOpFeeds) {
String feedName = feed.getName();
FeedHealth feedHealth = map.get(feedName);
if (feedHealth == null) {
feedHealth = new DefaultFeedHealth();
feedHealth.setFeed(feedName);
if (avgRunTimes != null) {
feedHealth.setAvgRuntime(avgRunTimes.get(feedName));
}
list.add(feedHealth);
map.put(feedName, feedHealth);
}
feedHealth.setLastOpFeed(feed);
}
}
return list;
}
Aggregations