use of com.sequenceiq.cloudbreak.common.exception.UpgradeValidationFailedException in project cloudbreak by hortonworks.
the class ClusterUpgradeDiskSpaceValidationHandler method doAccept.
@Override
protected Selectable doAccept(HandlerEvent<ClusterUpgradeValidationEvent> event) {
LOGGER.debug("Accepting Cluster upgrade validation event.");
ClusterUpgradeValidationEvent request = event.getData();
Long stackId = request.getResourceId();
try {
StatedImage targetImage = imageService.getCurrentImage(stackId);
diskSpaceValidationService.validateFreeSpaceForUpgrade(getStack(stackId), targetImage);
return new ClusterUpgradeDiskSpaceValidationFinishedEvent(request.getResourceId());
} catch (UpgradeValidationFailedException e) {
LOGGER.warn("Cluster upgrade validation failed", e);
return new ClusterUpgradeValidationFailureEvent(stackId, e);
} catch (Exception e) {
LOGGER.error("Cluster upgrade validation was unsuccessful due to an internal error", e);
return new ClusterUpgradeDiskSpaceValidationFinishedEvent(request.getResourceId());
}
}
Aggregations