Search in sources :

Example 6 with Selectable

use of com.sequenceiq.cloudbreak.common.event.Selectable in project cloudbreak by hortonworks.

the class ProperTerminationFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(TerminationEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new TerminationEvent(ClusterTerminationEvent.PROPER_TERMINATION_EVENT.event(), event.getResourceId(), event.getTerminationType()));
    flowEventChain.add(new TerminationEvent(START_EXTERNAL_DATABASE_TERMINATION_EVENT.event(), event.getResourceId(), event.getTerminationType()));
    flowEventChain.add(new TerminationEvent(StackTerminationEvent.TERMINATION_EVENT.event(), event.getResourceId(), event.getTerminationType(), event.accepted()));
    return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Also used : FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) Selectable(com.sequenceiq.cloudbreak.common.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 7 with Selectable

use of com.sequenceiq.cloudbreak.common.event.Selectable in project cloudbreak by hortonworks.

the class ProvisionFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(StackEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new StackEvent(VALIDATE_CLOUD_CONFIG_EVENT.event(), event.getResourceId(), event.accepted()));
    flowEventChain.add(new StackEvent(VALIDATE_KERBEROS_CONFIG_EVENT.event(), event.getResourceId(), event.accepted()));
    flowEventChain.add(new StackEvent(START_EXTERNAL_DATABASE_CREATION_EVENT.event(), event.getResourceId(), event.accepted()));
    flowEventChain.add(new ProvisionEvent(START_CREATION_EVENT.event(), event.getResourceId(), ProvisionType.REGULAR, event.accepted()));
    flowEventChain.add(new ProvisionEvent(CLUSTER_CREATION_EVENT.event(), event.getResourceId(), ProvisionType.REGULAR));
    return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ProvisionEvent(com.sequenceiq.cloudbreak.reactor.api.event.stack.ProvisionEvent) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue)

Example 8 with Selectable

use of com.sequenceiq.cloudbreak.common.event.Selectable in project cloudbreak by hortonworks.

the class RecoveryBringupFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(StackEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new ProvisionEvent(START_CREATION_EVENT.event(), event.getResourceId(), ProvisionType.RECOVERY, event.accepted()));
    flowEventChain.add(new ProvisionEvent(CLUSTER_CREATION_EVENT.event(), event.getResourceId(), ProvisionType.RECOVERY));
    return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Also used : FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ProvisionEvent(com.sequenceiq.cloudbreak.reactor.api.event.stack.ProvisionEvent) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue)

Example 9 with Selectable

use of com.sequenceiq.cloudbreak.common.event.Selectable in project cloudbreak by hortonworks.

the class ResetFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(StackEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new StackEvent(CLUSTER_RESET_EVENT.event(), event.getResourceId(), event.accepted()));
    flowEventChain.add(new StartClusterSuccess(CLUSTER_INSTALL_EVENT.event(), event.getResourceId()));
    return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) StartClusterSuccess(com.sequenceiq.cloudbreak.reactor.api.event.cluster.StartClusterSuccess) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue)

Example 10 with Selectable

use of com.sequenceiq.cloudbreak.common.event.Selectable in project cloudbreak by hortonworks.

the class RotateClusterCertificatesFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(ClusterCertificatesRotationTriggerEvent event) {
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new StackEvent(SaltUpdateEvent.SALT_UPDATE_EVENT.event(), event.getResourceId(), event.accepted()));
    flowEventChain.add(new ClusterCertificatesRotationTriggerEvent(ClusterCertificatesRotationEvent.CLUSTER_CMCA_ROTATION_EVENT.event(), event.getResourceId(), event.accepted(), event.getCertificateRotationType()));
    return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) FlowTriggerEventQueue(com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) ClusterCertificatesRotationTriggerEvent(com.sequenceiq.cloudbreak.core.flow2.event.ClusterCertificatesRotationTriggerEvent)

Aggregations

Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)283 Test (org.junit.jupiter.api.Test)93 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)48 Map (java.util.Map)47 List (java.util.List)36 FlowTriggerEventQueue (com.sequenceiq.flow.core.chain.config.FlowTriggerEventQueue)35 Collectors (java.util.stream.Collectors)35 PollerException (com.dyngr.exception.PollerException)32 PollerStoppedException (com.dyngr.exception.PollerStoppedException)32 UserBreakException (com.dyngr.exception.UserBreakException)32 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)30 Optional (java.util.Optional)30 Set (java.util.Set)30 Bean (org.springframework.context.annotation.Bean)28 Event (reactor.bus.Event)28 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)27 HandlerEvent (com.sequenceiq.flow.reactor.api.handler.HandlerEvent)27 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)27 Inject (javax.inject.Inject)24 PollingConfig (com.sequenceiq.datalake.service.sdx.PollingConfig)23