use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmFailedEvent in project cloudbreak by hortonworks.
the class ReconfigureNginxHandler method doAccept.
@Override
public Selectable doAccept(HandlerEvent<UpgradeCcmReconfigureNginxRequest> event) {
UpgradeCcmReconfigureNginxRequest request = event.getData();
Long stackId = request.getResourceId();
LOGGER.info("NGINX reconfiguration is needed for previous CCM tunnel type");
try {
upgradeCcmService.reconfigureNginx(stackId);
} catch (CloudbreakOrchestratorException e) {
LOGGER.debug("Failed reconfiguring NGINX with salt state");
return new UpgradeCcmFailedEvent(stackId, request.getOldTunnel(), e);
}
return new UpgradeCcmReconfigureNginxResult(stackId, request.getClusterId(), request.getOldTunnel());
}
use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmFailedEvent in project cloudbreak by hortonworks.
the class RemoveAgentHandler method doAccept.
@Override
protected Selectable doAccept(HandlerEvent<UpgradeCcmRemoveAgentRequest> event) {
UpgradeCcmRemoveAgentRequest request = event.getData();
Long stackId = request.getResourceId();
LOGGER.info("Remove agent for CCM upgrade...");
try {
upgradeCcmService.removeAgent(stackId, request.getOldTunnel());
} catch (CloudbreakOrchestratorException e) {
LOGGER.debug("Failed removing agent with a salt state");
return new UpgradeCcmFailedEvent(stackId, request.getOldTunnel(), e);
}
return new UpgradeCcmRemoveAgentResult(stackId, request.getClusterId(), request.getOldTunnel());
}
use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.ccm.UpgradeCcmFailedEvent in project cloudbreak by hortonworks.
the class UpgradeCcmActions method upgradeCcmFailed.
@Bean(name = "UPGRADE_CCM_FAILED_STATE")
public Action<?, ?> upgradeCcmFailed() {
return new AbstractStackFailureAction<UpgradeCcmState, UpgradeCcmEvent>() {
@Override
protected void doExecute(StackFailureContext context, StackFailureEvent payload, Map<Object, Object> variables) {
UpgradeCcmFailedEvent concretePayload = (UpgradeCcmFailedEvent) payload;
upgradeCcmService.ccmUpgradeFailed(concretePayload.getResourceId(), Optional.ofNullable(context.getStackView().getClusterView()).map(ClusterView::getId).orElse(null), concretePayload.getOldTunnel());
sendEvent(context);
}
@Override
protected Selectable createRequest(StackFailureContext context) {
return new StackEvent(UpgradeCcmEvent.FAIL_HANDLED_EVENT.event(), context.getStackView().getId());
}
};
}
Aggregations