use of com.amazonaws.services.personalize.model.DeleteDatasetRequest in project knime-cloud by knime.
the class AbstractAmazonPersonalizeDataUploadNodeModel method deleteDataset.
private void deleteDataset(final AmazonPersonalize personalizeClient, final String datasetGroupArn, final String datasetARN) throws InterruptedException {
personalizeClient.deleteDataset(new DeleteDatasetRequest().withDatasetArn(datasetARN));
final ListDatasetsRequest listDatasetsRequest = new ListDatasetsRequest().withDatasetGroupArn(datasetGroupArn);
AmazonPersonalizeUtils.waitUntilActive(() -> {
final List<DatasetSummary> datasets = personalizeClient.listDatasets(listDatasetsRequest).getDatasets();
return !datasets.stream().anyMatch(e -> e.getDatasetType().equals(m_datasetType));
}, 500);
}
Aggregations