use of com.sequenceiq.cloudbreak.domain.view.ClusterView in project cloudbreak by hortonworks.
the class ClusterStartFlowTriggerCondition method isFlowTriggerable.
@Override
public boolean isFlowTriggerable(Long stackId) {
StackView stackView = stackService.getByIdView(stackId);
ClusterView clusterView = stackView.getClusterView();
boolean result = clusterView != null && clusterView.isStartRequested();
if (!result) {
LOGGER.warn("Cluster start cannot be triggered, because cluster {}", clusterView == null ? "is null" : "not in startRequested status");
}
return result;
}
use of com.sequenceiq.cloudbreak.domain.view.ClusterView in project cloudbreak by hortonworks.
the class ClusterStopService method handleClusterStopFailure.
public void handleClusterStopFailure(StackView stackView, String errorReason) {
ClusterView cluster = stackView.getClusterView();
clusterService.updateClusterStatusByStackId(stackView.getId(), Status.STOP_FAILED);
stackUpdater.updateStackStatus(stackView.getId(), DetailedStackStatus.AVAILABLE, "The Ambari cluster could not be stopped: " + errorReason);
flowMessageService.fireEventAndLog(stackView.getId(), Msg.AMBARI_CLUSTER_STOP_FAILED, Status.STOP_FAILED.name(), errorReason);
if (cluster.getEmailNeeded()) {
emailSenderService.sendStopFailureEmail(stackView.getClusterView().getOwner(), stackView.getClusterView().getEmailTo(), stackUtil.extractAmbariIp(stackView), cluster.getName());
flowMessageService.fireEventAndLog(stackView.getId(), Msg.AMBARI_CLUSTER_NOTIFICATION_EMAIL, Status.STOP_FAILED.name());
}
}
Aggregations