Search in sources :

Example 21 with StackEvent

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

the class StartFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public Queue<Selectable> createFlowTriggerEventQueue(StackEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new StackEvent(STACK_START_EVENT.event(), event.getStackId(), event.accepted()));
    flowEventChain.add(new StackEvent(CLUSTER_START_EVENT.event(), event.getStackId()));
    return flowEventChain;
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue)

Example 22 with StackEvent

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

the class StopFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public Queue<Selectable> createFlowTriggerEventQueue(StackEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new StackEvent(CLUSTER_STOP_EVENT.event(), event.getStackId(), event.accepted()));
    flowEventChain.add(new StackEvent(STACK_STOP_EVENT.event(), event.getStackId()));
    return flowEventChain;
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue)

Example 23 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent 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)

Example 24 with StackEvent

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

the class UpgradeFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public Queue<Selectable> createFlowTriggerEventQueue(StackEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new StackEvent(CLUSTER_STOP_EVENT.event(), event.getStackId()));
    flowEventChain.add(new StackEvent(CLUSTER_UPGRADE_EVENT.event(), event.getStackId()));
    flowEventChain.add(new StackEvent(CLUSTER_START_EVENT.event(), event.getStackId()));
    return flowEventChain;
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue)

Example 25 with StackEvent

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

the class HostMetadataSetupHandler method accept.

@Override
public void accept(Event<HostMetadataSetupRequest> event) {
    StackEvent request = event.getData();
    Selectable response;
    try {
        hostMetadataSetup.setupHostMetadata(request.getStackId());
        response = new HostMetadataSetupSuccess(request.getStackId());
    } catch (Exception e) {
        response = new HostMetadataSetupFailed(request.getStackId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) HostMetadataSetupFailed(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.HostMetadataSetupFailed) HostMetadataSetupSuccess(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.HostMetadataSetupSuccess)

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