Search in sources :

Example 1 with DatasourceUpdatedSinceFeedExecuted

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

the class BeginFeed method ensurePreconditon.

private void ensurePreconditon(ProcessContext context, Feed feed, String[] dsNames) {
    MetadataProvider provider = getProviderService(context).getProvider();
    // If no precondition exits yet install one that depends on the datasources.
    if (feed.getPrecondition() == null) {
        getLog().debug("Setting default feed preconditions for: " + dsNames);
        Metric[] metrics = new Metric[dsNames.length];
        for (int idx = 0; idx < metrics.length; idx++) {
            DatasourceUpdatedSinceFeedExecuted metric = new DatasourceUpdatedSinceFeedExecuted(dsNames[idx], feed.getSystemName());
            metrics[idx] = metric;
        }
    // provider.ensurePrecondition(feed.getId(), metrics);
    }
}
Also used : MetadataProvider(com.thinkbiganalytics.nifi.core.api.metadata.MetadataProvider) Metric(com.thinkbiganalytics.metadata.sla.api.Metric) DatasourceUpdatedSinceFeedExecuted(com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceFeedExecuted)

Example 2 with DatasourceUpdatedSinceFeedExecuted

use of com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceFeedExecuted 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)

Aggregations

DatasourceUpdatedSinceFeedExecuted (com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceFeedExecuted)2 DatasourceUpdatedSinceSchedule (com.thinkbiganalytics.metadata.api.sla.DatasourceUpdatedSinceSchedule)1 FeedExecutedSinceFeed (com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed)1 FeedExecutedSinceSchedule (com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceSchedule)1 Feed (com.thinkbiganalytics.metadata.rest.model.feed.Feed)1 Metric (com.thinkbiganalytics.metadata.sla.api.Metric)1 MetadataProvider (com.thinkbiganalytics.nifi.core.api.metadata.MetadataProvider)1 ParseException (java.text.ParseException)1 Test (org.junit.Test)1