Search in sources :

Example 1 with ClusterStartPillarConfigUpdateResult

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

the class ClusterStartPillarConfigUpdateHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<ClusterStartPillarConfigUpdateRequest> event) {
    ClusterStartPillarConfigUpdateRequest request = event.getData();
    Selectable response;
    try {
        pillarConfigUpdateService.doConfigUpdate(request.getResourceId());
        response = new ClusterStartPillarConfigUpdateResult(request);
    } catch (Exception e) {
        LOGGER.warn("Pillar configuration update failed.", e);
        response = new PillarConfigUpdateFailed(request.getResourceId(), e);
    }
    return response;
}
Also used : ClusterStartPillarConfigUpdateRequest(com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStartPillarConfigUpdateRequest) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ClusterStartPillarConfigUpdateResult(com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStartPillarConfigUpdateResult) PillarConfigUpdateFailed(com.sequenceiq.cloudbreak.core.flow2.cluster.config.update.event.PillarConfigUpdateFailed)

Example 2 with ClusterStartPillarConfigUpdateResult

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

the class ClusterStartActions method updateClusterDnsEntriesInPem.

@Bean(name = "UPDATING_DNS_IN_PEM_STATE")
public Action<?, ?> updateClusterDnsEntriesInPem() {
    return new AbstractClusterAction<>(ClusterStartPillarConfigUpdateResult.class) {

        @Override
        protected void doExecute(ClusterViewContext context, ClusterStartPillarConfigUpdateResult payload, Map<Object, Object> variables) {
            Stack stack = getStackService().getByIdWithListsInTransaction(payload.getResourceId());
            clusterStartService.updateDnsEntriesInPem(stack);
            sendEvent(context);
        }

        @Override
        protected Selectable createRequest(ClusterViewContext context) {
            return new DnsUpdateFinished(context.getStackId());
        }
    };
}
Also used : ClusterStartPillarConfigUpdateResult(com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStartPillarConfigUpdateResult) AbstractClusterAction(com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction) Map(java.util.Map) ClusterViewContext(com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext) DnsUpdateFinished(com.sequenceiq.cloudbreak.reactor.api.event.cluster.DnsUpdateFinished) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) Bean(org.springframework.context.annotation.Bean)

Aggregations

ClusterStartPillarConfigUpdateResult (com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStartPillarConfigUpdateResult)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 AbstractClusterAction (com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction)1 ClusterViewContext (com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext)1 PillarConfigUpdateFailed (com.sequenceiq.cloudbreak.core.flow2.cluster.config.update.event.PillarConfigUpdateFailed)1 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)1 ClusterStartPillarConfigUpdateRequest (com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStartPillarConfigUpdateRequest)1 DnsUpdateFinished (com.sequenceiq.cloudbreak.reactor.api.event.cluster.DnsUpdateFinished)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1