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);
}
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));
}
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));
}
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);
}
};
}
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;
}
Aggregations