use of com.sequenceiq.cloudbreak.core.flow2.event.ClusterRecoveryTriggerEvent in project cloudbreak by hortonworks.
the class DatalakeRecoveryBringupActions method datalakeRecoveryRestoreComponents.
@Bean(name = "RECOVERY_RESTORE_COMPONENTS_STATE")
public Action<?, ?> datalakeRecoveryRestoreComponents() {
return new AbstractDatalakeRecoveryBringupAction<>(ClusterRecoveryTriggerEvent.class) {
@Override
protected void doExecute(DatalakeRecoveryBringupContext context, ClusterRecoveryTriggerEvent payload, Map<Object, Object> variables) {
Long stackId = context.getStackId();
try {
Image image = componentConfigProviderService.getImage(stackId);
imageComponentUpdaterService.updateForUpgrade(image.getImageId(), stackId);
} catch (CloudbreakImageNotFoundException e) {
String message = "Image was not found for current stack, it is not possible to continue recovery. " + "Please open a Cloudera support ticket to fix this issue";
LOGGER.warn(message);
throw new CloudbreakServiceException(message);
}
sendEvent(context, RECOVERY_RESTORE_COMPONENTS_FINISHED_EVENT.event(), payload);
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.event.ClusterRecoveryTriggerEvent in project cloudbreak by hortonworks.
the class RecoverDatalakeFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(ClusterRecoveryTriggerEvent event) {
Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
flowEventChain.add(new FlowChainInitPayload(getName(), event.getResourceId(), event.accepted()));
flowEventChain.add(new TerminationEvent(FlowChainTriggers.RECOVERY_TERMINATION_TRIGGER_EVENT, event.getResourceId(), TerminationType.RECOVERY));
flowEventChain.add(new ClusterRecoveryTriggerEvent(RECOVERY_BRINGUP_EVENT.event(), event.getResourceId(), event.accepted()));
flowEventChain.add(new StackEvent(FlowChainTriggers.RECOVERY_PROVISION_TRIGGER_EVENT, event.getResourceId(), event.accepted()));
flowEventChain.add(new FlowChainFinalizePayload(getName(), event.getResourceId(), event.accepted()));
return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Aggregations