Search in sources :

Example 1 with NotEnoughNodeException

use of com.sequenceiq.cloudbreak.service.cluster.NotEnoughNodeException in project cloudbreak by hortonworks.

the class ClusterDownscaleService method handleClusterDownscaleFailure.

public void handleClusterDownscaleFailure(long stackId, Exception error) {
    String errorDetailes = error.getMessage();
    LOGGER.error("Error during Cluster downscale flow: ", error);
    Status status = UPDATE_FAILED;
    if (error instanceof NotEnoughNodeException) {
        status = AVAILABLE;
    }
    clusterService.updateClusterStatusByStackId(stackId, status, errorDetailes);
    stackUpdater.updateStackStatus(stackId, DetailedStackStatus.AVAILABLE, "Node(s) could not be removed from the cluster: " + errorDetailes);
    flowMessageService.fireEventAndLog(stackId, Msg.AMBARI_CLUSTER_SCALING_FAILED, UPDATE_FAILED.name(), "removed from", errorDetailes);
}
Also used : Status(com.sequenceiq.cloudbreak.api.model.Status) DetailedStackStatus(com.sequenceiq.cloudbreak.api.model.DetailedStackStatus) InstanceStatus(com.sequenceiq.cloudbreak.api.model.InstanceStatus) NotEnoughNodeException(com.sequenceiq.cloudbreak.service.cluster.NotEnoughNodeException)

Aggregations

DetailedStackStatus (com.sequenceiq.cloudbreak.api.model.DetailedStackStatus)1 InstanceStatus (com.sequenceiq.cloudbreak.api.model.InstanceStatus)1 Status (com.sequenceiq.cloudbreak.api.model.Status)1 NotEnoughNodeException (com.sequenceiq.cloudbreak.service.cluster.NotEnoughNodeException)1