Search in sources :

Example 1 with StackSyncTriggerEvent

use of com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerStackSync.

public void triggerStackSync(Long stackId) {
    String selector = STACK_SYNC_EVENT.event();
    notify(selector, new StackSyncTriggerEvent(selector, stackId, true));
}
Also used : StackSyncTriggerEvent(com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent)

Example 2 with StackSyncTriggerEvent

use of com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent in project cloudbreak by hortonworks.

the class SyncFlowEventChainFactory method createFlowTriggerEventQueue.

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

Example 3 with StackSyncTriggerEvent

use of com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent in project cloudbreak by hortonworks.

the class UpscaleFlowEventChainFactory method createFlowTriggerEventQueue.

@Override
public Queue<Selectable> createFlowTriggerEventQueue(StackAndClusterUpscaleTriggerEvent event) {
    StackView stackView = stackService.getByIdView(event.getStackId());
    ClusterView clusterView = stackView.getClusterView();
    Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
    flowEventChain.add(new StackSyncTriggerEvent(STACK_SYNC_EVENT.event(), event.getStackId(), false, event.accepted()));
    flowEventChain.add(new StackScaleTriggerEvent(ADD_INSTANCES_EVENT.event(), event.getStackId(), event.getInstanceGroup(), event.getAdjustment(), event.getHostNames()));
    if (ScalingType.isClusterUpScale(event.getScalingType()) && clusterView != null) {
        HostGroup hostGroup = hostGroupService.getByClusterIdAndInstanceGroupName(clusterView.getId(), event.getInstanceGroup());
        flowEventChain.add(new ClusterScaleTriggerEvent(CLUSTER_UPSCALE_TRIGGER_EVENT.event(), stackView.getId(), hostGroup.getName(), event.getAdjustment()));
    }
    return flowEventChain;
}
Also used : ClusterView(com.sequenceiq.cloudbreak.domain.view.ClusterView) StackScaleTriggerEvent(com.sequenceiq.cloudbreak.core.flow2.event.StackScaleTriggerEvent) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) ClusterScaleTriggerEvent(com.sequenceiq.cloudbreak.core.flow2.event.ClusterScaleTriggerEvent) StackSyncTriggerEvent(com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent) HostGroup(com.sequenceiq.cloudbreak.domain.HostGroup) StackView(com.sequenceiq.cloudbreak.domain.view.StackView) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue)

Aggregations

StackSyncTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent)3 Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)2 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)2 ClusterScaleTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.ClusterScaleTriggerEvent)1 StackScaleTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.StackScaleTriggerEvent)1 HostGroup (com.sequenceiq.cloudbreak.domain.HostGroup)1 ClusterView (com.sequenceiq.cloudbreak.domain.view.ClusterView)1 StackView (com.sequenceiq.cloudbreak.domain.view.StackView)1 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)1