use of com.thinkbiganalytics.metadata.api.sla.WithinSchedule in project kylo by Teradata.
the class FeedExecutedSinceFeedsOrTime method buildPreconditionObligations.
@Override
public Set<com.thinkbiganalytics.metadata.rest.model.sla.ObligationGroup> buildPreconditionObligations() {
Set<com.thinkbiganalytics.metadata.rest.model.sla.ObligationGroup> preconditionGroups = new HashSet<>();
preconditionGroups.addAll(super.buildPreconditionObligations());
try {
Period p = new Period(0, 0, 1, 0);
String withinPeriod = p.toString();
WithinSchedule metric = new WithinSchedule(cronExpression, withinPeriod);
Obligation obligation = new Obligation();
obligation.setMetrics(Lists.newArrayList(metric));
com.thinkbiganalytics.metadata.rest.model.sla.ObligationGroup group = new com.thinkbiganalytics.metadata.rest.model.sla.ObligationGroup();
group.addObligation(obligation);
group.setCondition(ObligationGroup.Condition.SUFFICIENT.name());
preconditionGroups.add(group);
} catch (ParseException e) {
}
return preconditionGroups;
}
use of com.thinkbiganalytics.metadata.api.sla.WithinSchedule in project kylo by Teradata.
the class DebugController method exampleMetrics.
/**
* returns a list of metrics for debugging
*
* @return a list of metrics
*/
@GET
@Path("metrics")
@Produces(MediaType.APPLICATION_JSON)
public List<Metric> exampleMetrics() {
List<Metric> metrics = new ArrayList<>();
FeedExecutedSinceSchedule feedExecutedSinceSchedule = null;
try {
feedExecutedSinceSchedule = new FeedExecutedSinceSchedule("category", "Feed", "* * * * * ? *");
metrics.add(feedExecutedSinceSchedule);
WithinSchedule withinSchedule = new com.thinkbiganalytics.metadata.api.sla.WithinSchedule("* * * * * ? *", "4 hours");
metrics.add(withinSchedule);
} catch (ParseException e) {
throw new RuntimeException(e);
}
return metrics;
}
Aggregations