Search in sources :

Example 1 with AutoConfigureClusterManagerFailed

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

the class AutoConfigureClusterManagerHandler method accept.

@Override
public void accept(Event<AutoConfigureClusterManagerRequest> event) {
    Long stackId = event.getData().getResourceId();
    Selectable response;
    try {
        clusterBuilderService.autoConfigureCluster(stackId);
        response = new AutoConfigureClusterManagerSuccess(stackId);
    } catch (RuntimeException | ClusterClientInitException | CloudbreakException e) {
        LOGGER.error("Failed to autoconfigure Cloudera Manager cluster: {}", e.getMessage());
        response = new AutoConfigureClusterManagerFailed(stackId, e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ClusterClientInitException(com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException) AutoConfigureClusterManagerSuccess(com.sequenceiq.cloudbreak.reactor.api.event.cluster.AutoConfigureClusterManagerSuccess) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) AutoConfigureClusterManagerFailed(com.sequenceiq.cloudbreak.reactor.api.event.cluster.AutoConfigureClusterManagerFailed)

Aggregations

ClusterClientInitException (com.sequenceiq.cloudbreak.cluster.service.ClusterClientInitException)1 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 AutoConfigureClusterManagerFailed (com.sequenceiq.cloudbreak.reactor.api.event.cluster.AutoConfigureClusterManagerFailed)1 AutoConfigureClusterManagerSuccess (com.sequenceiq.cloudbreak.reactor.api.event.cluster.AutoConfigureClusterManagerSuccess)1 CloudbreakException (com.sequenceiq.cloudbreak.service.CloudbreakException)1