Search in sources :

Example 6 with HiveTableDatasource

use of com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource in project kylo by Teradata.

the class MetadataClientTest method testBuildHiveTableDatasource.

// @Test
public void testBuildHiveTableDatasource() {
    HiveTableDatasource ds = buildHiveTableDatasource("test-table").post();
    assertThat(ds).isNotNull();
}
Also used : HiveTableDatasource(com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource)

Example 7 with HiveTableDatasource

use of com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource in project kylo by Teradata.

the class MetadataClientTest method testAddFeedDestination.

// @Test
public void testAddFeedDestination() throws ParseException {
    Feed feed = buildFeed("category", "feed1").post();
    HiveTableDatasource ds = buildHiveTableDatasource("test-table").post();
    Feed result = client.addDestination(feed.getId(), ds.getId());
    assertThat(result).isNotNull();
}
Also used : Feed(com.thinkbiganalytics.metadata.rest.model.feed.Feed) FeedExecutedSinceFeed(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed) HiveTableDatasource(com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource)

Example 8 with HiveTableDatasource

use of com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource in project kylo by Teradata.

the class MetadataClientTest method testCheckPrecondition.

// @Test
public void testCheckPrecondition() throws ParseException {
    Feed feedA = buildFeed("category", "feedA").post();
    Feed feedB = buildFeed("category", "feedB", "category", "feedA").post();
    HiveTableDatasource dsA = buildHiveTableDatasource("test-table").post();
    feedA = client.addDestination(feedA.getId(), dsA.getId());
    String destIdA = feedA.getDestinations().iterator().next().getId();
    DataOperation op = client.beginOperation(destIdA, "");
    op.setState(State.SUCCESS);
    op.setDataset(new Dataset(new DateTime(), dsA, ChangeType.UPDATE, ContentType.PARTITIONS));
    op = client.updateDataOperation(op);
    ServiceLevelAssessment assmt = client.assessPrecondition(feedB.getId());
    assertThat(assmt).isNotNull();
}
Also used : ServiceLevelAssessment(com.thinkbiganalytics.metadata.rest.model.sla.ServiceLevelAssessment) DataOperation(com.thinkbiganalytics.metadata.rest.model.op.DataOperation) Dataset(com.thinkbiganalytics.metadata.rest.model.op.Dataset) DateTime(org.joda.time.DateTime) Feed(com.thinkbiganalytics.metadata.rest.model.feed.Feed) FeedExecutedSinceFeed(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed) HiveTableDatasource(com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource)

Aggregations

HiveTableDatasource (com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource)8 FeedExecutedSinceFeed (com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed)5 Feed (com.thinkbiganalytics.metadata.rest.model.feed.Feed)5 DataOperation (com.thinkbiganalytics.metadata.rest.model.op.DataOperation)3 Dataset (com.thinkbiganalytics.metadata.rest.model.op.Dataset)3 DateTime (org.joda.time.DateTime)2 Datasource (com.thinkbiganalytics.metadata.rest.model.data.Datasource)1 DirectoryDatasource (com.thinkbiganalytics.metadata.rest.model.data.DirectoryDatasource)1 HiveTablePartition (com.thinkbiganalytics.metadata.rest.model.data.HiveTablePartition)1 HiveTablePartitions (com.thinkbiganalytics.metadata.rest.model.op.HiveTablePartitions)1 ServiceLevelAssessment (com.thinkbiganalytics.metadata.rest.model.sla.ServiceLevelAssessment)1 MetadataProvider (com.thinkbiganalytics.nifi.core.api.metadata.MetadataProvider)1 Test (org.junit.Test)1