use of com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth in project kylo by Teradata.
the class FeedModelTransform method feedHealth.
/**
* Transform the FeedHealth domain object to the REST friendly FeedHealth object
*
* @return the transformed FeedHealth object
*/
public static FeedHealth feedHealth(FeedSummary domain) {
FeedHealth feedHealth = new DefaultFeedHealth();
feedHealth.setUnhealthyCount(domain.getFailedCount());
feedHealth.setHealthyCount(domain.getCompletedCount());
feedHealth.setFeed(domain.getFeedName());
feedHealth.setFeedId(domain.getFeedId() != null ? domain.getFeedId().toString() : null);
feedHealth.setLastOpFeed(executedFeed(domain));
feedHealth.setStream(domain.isStream());
feedHealth.setRunningCount(domain.getRunningCount());
return feedHealth;
}
use of com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth 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;
}
use of com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth in project kylo by Teradata.
the class FeedModelTransform method feedHealth.
/**
* Transforms the feed object to the REST friendly FeedHealth object, assuming the feed has not yet executed.
*
* @param domain the feed object
* @return the transformed FeedHealth object
*/
@Nonnull
public static FeedHealth feedHealth(@Nonnull final OpsManagerFeed domain) {
final FeedHealth feedHealth = new DefaultFeedHealth();
feedHealth.setUnhealthyCount(0L);
feedHealth.setHealthyCount(0L);
feedHealth.setFeed(domain.getName());
feedHealth.setFeedId(domain.getId() != null ? domain.getId().toString() : null);
feedHealth.setStream(domain.isStream());
return feedHealth;
}
use of com.thinkbiganalytics.jobrepo.query.model.DefaultFeedHealth in project kylo by Teradata.
the class FeedModelTransform method feedHealth.
/**
* Transform the FeedHealth domain object to the REST friendly FeedHealth object
*
* @return the transformed FeedHealth object
*/
public static FeedHealth feedHealth(com.thinkbiganalytics.metadata.api.feed.FeedHealth domain) {
FeedHealth feedHealth = new DefaultFeedHealth();
feedHealth.setUnhealthyCount(domain.getFailedCount());
feedHealth.setHealthyCount(domain.getCompletedCount());
feedHealth.setFeed(domain.getFeedName());
feedHealth.setFeedId(domain.getFeedId() != null ? domain.getFeedId().toString() : null);
feedHealth.setLastOpFeed(executedFeed(domain));
feedHealth.setStream(domain.isStream());
feedHealth.setRunningCount(domain.getRunningCount());
return feedHealth;
}
Aggregations