use of com.sequenceiq.environment.exception.DatahubOperationFailedException in project cloudbreak by hortonworks.
the class DatahubDeletionService method waitDatahubClustersDeletion.
private void waitDatahubClustersDeletion(PollingConfig pollingConfig, Environment environment, Collection<StackViewV4Response> list, boolean force) {
DistroXMultiDeleteV1Request multiDeleteRequest = new DistroXMultiDeleteV1Request();
multiDeleteRequest.setCrns(list.stream().map(StackViewV4Response::getCrn).collect(Collectors.toSet()));
LOGGER.debug("Calling distroXV1Endpoint.deleteMultiple with crn [{}]", multiDeleteRequest.getCrns());
datahubService.deleteMultiple(environment.getResourceCrn(), multiDeleteRequest, force);
LOGGER.debug("Starting poller to check all Datahub stacks for environment {} are deleted", environment.getName());
try {
Polling.stopAfterDelay(pollingConfig.getTimeout(), pollingConfig.getTimeoutTimeUnit()).stopIfException(pollingConfig.getStopPollingIfExceptionOccured()).waitPeriodly(pollingConfig.getSleepTime(), pollingConfig.getSleepTimeUnit()).run(() -> periodicCheckForDeletion(environment));
} catch (PollerStoppedException e) {
LOGGER.info("Datahub cluster deletion timed out");
throw new DatahubOperationFailedException("Datahub cluster deletion timed out", e);
}
}
Aggregations