Search in sources :

Example 16 with ApiParcelList

use of com.cloudera.api.swagger.model.ApiParcelList in project cloudbreak by hortonworks.

the class ClouderaManagerParcelDeletedListenerTask method doStatusCheck.

@Override
protected boolean doStatusCheck(ClouderaManagerCommandPollerObject pollerObject) throws ApiException {
    ApiClient apiClient = pollerObject.getApiClient();
    Stack stack = pollerObject.getStack();
    ApiParcelList parcels = getClouderaManagerParcels(apiClient, stack.getName());
    List<ApiParcel> existedParcels = collectExistingParcels(parcels);
    if (existedParcels.isEmpty()) {
        LOGGER.debug("Parcels are deleted successfully.");
        return true;
    } else {
        LOGGER.debug("Some parcels are not yet deleted: [{}].", getJoinedParcelStages(existedParcels));
        return false;
    }
}
Also used : ApiParcel(com.cloudera.api.swagger.model.ApiParcel) ApiParcelList(com.cloudera.api.swagger.model.ApiParcelList) ApiClient(com.cloudera.api.swagger.client.ApiClient) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack)

Aggregations

ApiParcelList (com.cloudera.api.swagger.model.ApiParcelList)16 Test (org.junit.jupiter.api.Test)11 ApiParcel (com.cloudera.api.swagger.model.ApiParcel)8 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)8 ParcelOperationStatus (com.sequenceiq.cloudbreak.cluster.model.ParcelOperationStatus)7 ExtendedPollingResult (com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)5 ApiClient (com.cloudera.api.swagger.client.ApiClient)4 ApiException (com.cloudera.api.swagger.client.ApiException)4 ClouderaManagerCommandPollerObject (com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerCommandPollerObject)4 ParcelsResourceApi (com.cloudera.api.swagger.ParcelsResourceApi)2 ParcelResourceApi (com.cloudera.api.swagger.ParcelResourceApi)1 Multimap (com.google.common.collect.Multimap)1 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)1 ParcelStatus (com.sequenceiq.cloudbreak.cm.model.ParcelStatus)1 ClouderaManagerPollingServiceProvider (com.sequenceiq.cloudbreak.cm.polling.ClouderaManagerPollingServiceProvider)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1