Search in sources :

Example 1 with TerminationEvent

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;
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) ClusterTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent) StackTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent) TerminationEvent(com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)

Example 2 with TerminationEvent

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);
}
Also used : StackTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent) ClusterTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent) TerminationEvent(com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)

Example 3 with TerminationEvent

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));
    }
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) StackTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent) ClusterTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent) TerminationEvent(com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)

Example 4 with TerminationEvent

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;
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) ClusterTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent) StackTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent) TerminationEvent(com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)

Aggregations

ClusterTerminationEvent (com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent)4 StackTerminationEvent (com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent)4 TerminationEvent (com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)4 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)3 Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)2 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)2