Search in sources :

Example 1 with FeedExecutedSinceSchedule

use of com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceSchedule in project kylo by Teradata.

the class MetadataClientProviderTest method testEnsurePrecondition.

@Test
public void testEnsurePrecondition() {
    Feed feed = this.provider.ensureFeed("category", "test5", "");
    try {
        feed = this.provider.ensurePrecondition(feed.getId(), new DatasourceUpdatedSinceFeedExecuted("ds5", "test5"), new DatasourceUpdatedSinceSchedule("ds5", "0 0 6 * * ? *"), new FeedExecutedSinceFeed("category", "dep5", "category", "test5"), new FeedExecutedSinceSchedule("category", "test5", "0 0 6 * * ? *"), new com.thinkbiganalytics.metadata.api.sla.WithinSchedule("0 0 6 * * ? *", "2 hours"));
    } catch (ParseException e) {
        e.printStackTrace();
        ;
    }
    assertThat(feed).isNotNull();
}
Also used : FeedExecutedSinceSchedule(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceSchedule) DatasourceUpdatedSinceFeedExecuted(com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceFeedExecuted) DatasourceUpdatedSinceSchedule(com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceSchedule) ParseException(java.text.ParseException) FeedExecutedSinceFeed(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed) Feed(com.thinkbiganalytics.metadata.rest.model.feed.Feed) FeedExecutedSinceFeed(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed) Test(org.junit.Test)

Example 2 with FeedExecutedSinceSchedule

use of com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceSchedule 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;
}
Also used : ArrayList(java.util.ArrayList) FeedExecutedSinceSchedule(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceSchedule) Metric(com.thinkbiganalytics.metadata.sla.api.Metric) ParseException(java.text.ParseException) WithinSchedule(com.thinkbiganalytics.metadata.api.sla.WithinSchedule) Path(javax.ws.rs.Path) JcrPath(com.thinkbiganalytics.metadata.modeshape.support.JcrPath) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

FeedExecutedSinceSchedule (com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceSchedule)2 ParseException (java.text.ParseException)2 DatasourceUpdatedSinceFeedExecuted (com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceFeedExecuted)1 DatasourceUpdatedSinceSchedule (com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceSchedule)1 FeedExecutedSinceFeed (com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed)1 WithinSchedule (com.thinkbiganalytics.metadata.api.sla.WithinSchedule)1 JcrPath (com.thinkbiganalytics.metadata.modeshape.support.JcrPath)1 Feed (com.thinkbiganalytics.metadata.rest.model.feed.Feed)1 Metric (com.thinkbiganalytics.metadata.sla.api.Metric)1 ArrayList (java.util.ArrayList)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Test (org.junit.Test)1