Search in sources :

Example 1 with ParcelResource

use of com.sequenceiq.cloudbreak.cm.model.ParcelResource in project cloudbreak by hortonworks.

the class ClouderaManagerParcelManagementService method downloadParcels.

public void downloadParcels(Set<ClouderaManagerProduct> products, ParcelResourceApi parcelResourceApi, Stack stack, ApiClient apiClient) throws ApiException, CloudbreakException {
    for (ClouderaManagerProduct product : products) {
        LOGGER.info("Downloading {} parcel.", product.getName());
        ApiCommand apiCommand = parcelResourceApi.startDownloadCommand(stack.getName(), product.getName(), product.getVersion());
        ExtendedPollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCdpRuntimeParcelDownload(stack, apiClient, apiCommand.getId(), new ParcelResource(stack.getName(), product.getName(), product.getVersion()));
        handlePollingResult(pollingResult.getPollingResult(), "Cluster was terminated while waiting for CDP Runtime Parcel to be downloaded", "Timeout during the updated CDP Runtime Parcel download.");
    }
}
Also used : ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ParcelResource(com.sequenceiq.cloudbreak.cm.model.ParcelResource) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)

Example 2 with ParcelResource

use of com.sequenceiq.cloudbreak.cm.model.ParcelResource in project cloudbreak by hortonworks.

the class ClouderaManagerParcelManagementService method distributeParcels.

public void distributeParcels(Set<ClouderaManagerProduct> products, ParcelResourceApi parcelResourceApi, Stack stack, ApiClient apiClient) throws ApiException, CloudbreakException {
    for (ClouderaManagerProduct product : products) {
        LOGGER.info("Distributing downloaded {} parcel", product.getName());
        ApiCommand apiCommand = parcelResourceApi.startDistributionCommand(stack.getName(), product.getName(), product.getVersion());
        ExtendedPollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCdpRuntimeParcelDistribute(stack, apiClient, apiCommand.getId(), new ParcelResource(stack.getName(), product.getName(), product.getVersion()));
        handlePollingResult(pollingResult.getPollingResult(), "Cluster was terminated while waiting for CDP Runtime Parcel to be distributed", "Timeout during the updated CDP Runtime Parcel distribution.");
    }
}
Also used : ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ParcelResource(com.sequenceiq.cloudbreak.cm.model.ParcelResource) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)

Aggregations

ApiCommand (com.cloudera.api.swagger.model.ApiCommand)2 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)2 ParcelResource (com.sequenceiq.cloudbreak.cm.model.ParcelResource)2 ExtendedPollingResult (com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)2