Search in sources :

Example 1 with StartAmbariSuccess

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

the class StartAmbariHandler method accept.

@Override
public void accept(Event<StartAmbariRequest> event) {
    Long stackId = event.getData().getStackId();
    Selectable response;
    try {
        ambariClusterCreationService.startAmbari(stackId);
        response = new StartAmbariSuccess(stackId);
    } catch (Exception e) {
        response = new StartAmbariFailed(stackId, e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) StartAmbariSuccess(com.sequenceiq.cloudbreak.reactor.api.event.cluster.StartAmbariSuccess) StartAmbariFailed(com.sequenceiq.cloudbreak.reactor.api.event.cluster.StartAmbariFailed)

Example 2 with StartAmbariSuccess

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

the class ResetFlowEventChainFactory method createFlowTriggerEventQueue.

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

Aggregations

Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)2 StartAmbariSuccess (com.sequenceiq.cloudbreak.reactor.api.event.cluster.StartAmbariSuccess)2 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)1 StartAmbariFailed (com.sequenceiq.cloudbreak.reactor.api.event.cluster.StartAmbariFailed)1 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)1