use of com.sequenceiq.cloudbreak.core.flow2.stack.StackFailureContext in project cloudbreak by hortonworks.
the class StackTerminationFailureAction method createFlowContext.
@Override
protected StackFailureContext createFlowContext(String flowId, StateContext<StackTerminationState, StackTerminationEvent> stateContext, StackFailureEvent payload) {
Flow flow = getFlow(flowId);
StackView stackView = stackService.getByIdView(payload.getStackId());
MDCBuilder.buildMdcContext(stackView);
flow.setFlowFailed(payload.getException());
return new StackFailureContext(flowId, stackView);
}
use of com.sequenceiq.cloudbreak.core.flow2.stack.StackFailureContext in project cloudbreak by hortonworks.
the class StackCreationActions method stackCreationFailureAction.
@Bean(name = "STACK_CREATION_FAILED_STATE")
public Action<?, ?> stackCreationFailureAction() {
return new AbstractStackFailureAction<StackCreationState, StackCreationEvent>() {
@Override
protected StackFailureContext createFlowContext(String flowId, StateContext<StackCreationState, StackCreationEvent> stateContext, StackFailureEvent payload) {
Flow flow = getFlow(flowId);
StackView stackView = stackService.getByIdView(payload.getStackId());
MDCBuilder.buildMdcContext(stackView);
flow.setFlowFailed(payload.getException());
return new StackFailureContext(flowId, stackView);
}
@Override
protected void doExecute(StackFailureContext context, StackFailureEvent payload, Map<Object, Object> variables) {
stackCreationService.handleStackCreationFailure(context.getStackView(), payload.getException());
metricService.incrementMetricCounter(MetricType.STACK_CREATION_FAILED, context.getStackView());
sendEvent(context);
}
@Override
protected Selectable createRequest(StackFailureContext context) {
return new StackEvent(StackCreationEvent.STACKCREATION_FAILURE_HANDLED_EVENT.event(), context.getStackView().getId());
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.stack.StackFailureContext in project cloudbreak by hortonworks.
the class AbstractStackFailureAction method createFlowContext.
@Override
protected StackFailureContext createFlowContext(String flowId, StateContext<S, E> stateContext, StackFailureEvent payload) {
Flow flow = getFlow(flowId);
StackView stack = stackService.getByIdView(payload.getStackId());
MDCBuilder.buildMdcContext(stack);
flow.setFlowFailed(payload.getException());
return new StackFailureContext(flowId, stack);
}
Aggregations