Search in sources :

Example 16 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerStackStart.

public void triggerStackStart(Long stackId) {
    String selector = FlowChainTriggers.FULL_START_TRIGGER_EVENT;
    Acceptable startTriggerEvent = new StackEvent(selector, stackId);
    notify(selector, startTriggerEvent);
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Acceptable(com.sequenceiq.cloudbreak.cloud.Acceptable)

Example 17 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerStackStop.

public void triggerStackStop(Long stackId) {
    String selector = STACK_STOP_EVENT.event();
    notify(selector, new StackEvent(selector, stackId));
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)

Example 18 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerClusterInstall.

public void triggerClusterInstall(Long stackId) {
    String selector = CLUSTER_CREATION_EVENT.event();
    notify(selector, new StackEvent(selector, stackId));
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)

Example 19 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ClusterTerminationActions method terminatingCluster.

@Bean(name = "CLUSTER_TERMINATING_STATE")
public Action<?, ?> terminatingCluster() {
    return new AbstractClusterAction<StackEvent>(StackEvent.class) {

        @Override
        protected void doExecute(ClusterViewContext context, StackEvent payload, Map<Object, Object> variables) {
            clusterTerminationFlowService.terminateCluster(context);
            sendEvent(context);
        }

        @Override
        protected void initPayloadConverterMap(List<PayloadConverter<StackEvent>> payloadConverters) {
            payloadConverters.add(new DisableKerberosResultToStackEventConverter());
        }

        @Override
        protected Selectable createRequest(ClusterViewContext context) {
            return new ClusterTerminationRequest(context.getStackId(), context.getClusterView() != null ? context.getClusterView().getId() : null);
        }
    };
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) DisableKerberosResultToStackEventConverter(com.sequenceiq.cloudbreak.core.flow2.stack.provision.DisableKerberosResultToStackEventConverter) List(java.util.List) ClusterTerminationRequest(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterTerminationRequest) PrepareClusterTerminationRequest(com.sequenceiq.cloudbreak.reactor.api.event.cluster.PrepareClusterTerminationRequest) AbstractClusterAction(com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction) Map(java.util.Map) ClusterViewContext(com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext) Bean(org.springframework.context.annotation.Bean)

Example 20 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class StackRepairFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public Queue<Selectable> createFlowTriggerEventQueue(StackRepairTriggerEvent event) {
    Queue<Selectable> flowChainTriggers = new ConcurrentLinkedDeque<>();
    flowChainTriggers.add(new StackEvent(FlowChainTriggers.FULL_SYNC_TRIGGER_EVENT, event.getStackId(), event.accepted()));
    UnhealthyInstances unhealthyInstances = event.getUnhealthyInstances();
    String fullUpscaleTriggerEvent = FlowChainTriggers.FULL_UPSCALE_TRIGGER_EVENT;
    for (String hostGroupName : unhealthyInstances.getHostGroups()) {
        List<String> instances = unhealthyInstances.getInstancesForGroup(hostGroupName);
        flowChainTriggers.add(new StackAndClusterUpscaleTriggerEvent(fullUpscaleTriggerEvent, event.getStackId(), hostGroupName, instances.size(), ScalingType.UPSCALE_TOGETHER));
    }
    return flowChainTriggers;
}
Also used : StackAndClusterUpscaleTriggerEvent(com.sequenceiq.cloudbreak.core.flow2.event.StackAndClusterUpscaleTriggerEvent) StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) UnhealthyInstances(com.sequenceiq.cloudbreak.service.stack.repair.UnhealthyInstances) ConcurrentLinkedDeque(java.util.concurrent.ConcurrentLinkedDeque)

Aggregations

StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)25 Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)10 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)8 ClusterTerminationEvent (com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent)3 StackTerminationEvent (com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent)3 TerminationEvent (com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)3 Map (java.util.Map)3 Bean (org.springframework.context.annotation.Bean)3 Acceptable (com.sequenceiq.cloudbreak.cloud.Acceptable)1 CreateCredentialRequest (com.sequenceiq.cloudbreak.cloud.event.resource.CreateCredentialRequest)1 Flow (com.sequenceiq.cloudbreak.core.flow2.Flow)1 AbstractClusterAction (com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction)1 ClusterViewContext (com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext)1 StackAndClusterUpscaleTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.StackAndClusterUpscaleTriggerEvent)1 StackSyncTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent)1 AbstractStackFailureAction (com.sequenceiq.cloudbreak.core.flow2.stack.AbstractStackFailureAction)1 StackContext (com.sequenceiq.cloudbreak.core.flow2.stack.StackContext)1 StackFailureContext (com.sequenceiq.cloudbreak.core.flow2.stack.StackFailureContext)1 DisableKerberosResultToStackEventConverter (com.sequenceiq.cloudbreak.core.flow2.stack.provision.DisableKerberosResultToStackEventConverter)1 StackView (com.sequenceiq.cloudbreak.domain.view.StackView)1