Search in sources :

Example 1 with ExecutedFeed

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;
}
Also used : DefaultFeedHealth(com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth) ExecutedFeed(com.thinkbiganalytics.jobrepo.query.model.ExecutedFeed) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) FeedHealth(com.thinkbiganalytics.jobrepo.query.model.FeedHealth) DefaultFeedHealth(com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth)

Aggregations

DefaultFeedHealth (com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth)1 ExecutedFeed (com.thinkbiganalytics.jobrepo.query.model.ExecutedFeed)1 FeedHealth (com.thinkbiganalytics.jobrepo.query.model.FeedHealth)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1