use of com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent in project cloudbreak by hortonworks.
the class ProperTerminationFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public Queue<Selectable> createFlowTriggerEventQueue(TerminationEvent event) {
Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
flowEventChain.add(new StackEvent(ClusterTerminationEvent.PROPER_TERMINATION_EVENT.event(), event.getStackId(), null));
flowEventChain.add(new TerminationEvent(StackTerminationEvent.TERMINATION_EVENT.event(), event.getStackId(), event.getForced(), event.getDeleteDependencies()));
return flowEventChain;
}
use of com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent in project cloudbreak by hortonworks.
the class ReactorFlowManager method triggerTermination.
public void triggerTermination(Long stackId, Boolean forced, Boolean deleteDependencies) {
String selector = StackTerminationEvent.TERMINATION_EVENT.event();
notify(selector, new TerminationEvent(selector, stackId, forced, deleteDependencies));
cancelRunningFlows(stackId);
}
use of com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent in project cloudbreak by hortonworks.
the class ReactorFlowManager method triggerClusterTermination.
public void triggerClusterTermination(Long stackId, Boolean withStackDelete, Boolean deleteDependencies) {
Boolean secure = stackService.get(stackId).getCluster().isSecure();
if (withStackDelete) {
String selector = secure ? FlowChainTriggers.PROPER_TERMINATION_TRIGGER_EVENT : FlowChainTriggers.TERMINATION_TRIGGER_EVENT;
notify(selector, new TerminationEvent(selector, stackId, false, deleteDependencies));
cancelRunningFlows(stackId);
} else {
String selector = (secure ? ClusterTerminationEvent.PROPER_TERMINATION_EVENT : ClusterTerminationEvent.TERMINATION_EVENT).event();
notify(selector, new StackEvent(selector, stackId));
}
}
use of com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent in project cloudbreak by hortonworks.
the class TerminationFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public Queue<Selectable> createFlowTriggerEventQueue(TerminationEvent event) {
Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
flowEventChain.add(new StackEvent(ClusterTerminationEvent.TERMINATION_EVENT.event(), event.getStackId(), null));
flowEventChain.add(new TerminationEvent(StackTerminationEvent.TERMINATION_EVENT.event(), event.getStackId(), event.getForced(), event.getDeleteDependencies()));
return flowEventChain;
}
Aggregations