use of com.thinkbiganalytics.metadata.rest.model.op.DataOperation in project kylo by Teradata.
the class MetadataClientProvider method completeOperation.
@Override
public DataOperation completeOperation(String id, String string, State state) {
DataOperation op = this.client.getDataOperation(id);
op.setState(state);
return this.client.updateDataOperation(op);
}
use of com.thinkbiganalytics.metadata.rest.model.op.DataOperation in project kylo by Teradata.
the class MetadataClientProvider method completeOperation.
/* (non-Javadoc)
* @see com.thinkbiganalytics.controller.metadata.MetadataProvider#updateOperation(java.lang.String, java.lang.String, com.thinkbiganalytics.metadata.rest.model.data.Datasource)
*/
@Override
public DataOperation completeOperation(String id, String status, Dataset dataset) {
DataOperation op = this.client.getDataOperation(id);
op.setStatus(status);
op.setDataset(dataset);
op.setState(State.SUCCESS);
return this.client.updateDataOperation(op);
}
use of com.thinkbiganalytics.metadata.rest.model.op.DataOperation in project kylo by Teradata.
the class MetadataClientProviderTest method testBeginOperation.
@Test
public void testBeginOperation() {
Feed feed = this.provider.ensureFeed("category", "test9", "");
Datasource ds = this.provider.ensureDirectoryDatasource("test9", "", Paths.get("aaa", "bbb"));
feed = this.provider.ensureFeedDestination(feed.getId(), ds.getId());
FeedDestination dest = feed.getDestination(ds.getId());
DataOperation op = this.provider.beginOperation(dest, new DateTime());
assertThat(op).isNotNull();
assertThat(op.getState()).isEqualTo(State.IN_PROGRESS);
}
use of com.thinkbiganalytics.metadata.rest.model.op.DataOperation in project kylo by Teradata.
the class MetadataClientTest method testBeginOperation.
// @Test
public void testBeginOperation() throws ParseException {
Feed feed = buildFeed("category", "feed1").post();
HiveTableDatasource ds = buildHiveTableDatasource("test-table").post();
feed = client.addDestination(feed.getId(), ds.getId());
String destId = feed.getDestinations().iterator().next().getId();
DataOperation op = client.beginOperation(destId, "");
assertThat(op).isNotNull();
}
use of com.thinkbiganalytics.metadata.rest.model.op.DataOperation in project kylo by Teradata.
the class MetadataClientTest method testCompleteOperation.
// @Test
public void testCompleteOperation() throws ParseException {
Feed feedA = buildFeed("category", "feedA").post();
HiveTableDatasource dsA = buildHiveTableDatasource("test-table").post();
feedA = client.addDestination(feedA.getId(), dsA.getId());
Feed feedB = buildFeed("category", "feedB", "category", "feedA").post();
feedB = client.addSource(feedB.getId(), dsA.getId());
String destA = feedA.getDestinations().iterator().next().getId();
DataOperation op = client.beginOperation(destA, "");
op.setState(State.SUCCESS);
HiveTablePartitions changeSet = new HiveTablePartitions();
changeSet.setPartitions(Arrays.asList(new HiveTablePartition("month", null, "Jan", "Feb"), new HiveTablePartition("year", null, "2015", "2016")));
Dataset dataset = new Dataset(new DateTime(), dsA, ChangeType.UPDATE, ContentType.PARTITIONS, changeSet);
op.setDataset(dataset);
op = client.updateDataOperation(op);
assertThat(op).isNotNull();
}
Aggregations