@Autowired
private StackRepository stackRepository;
@Override
public void accept(Event<UpdateAmbariHostsRequest> event) {
UpdateAmbariHostsRequest request = event.getData();
Stack stack = stackRepository.findById(request.getStackId());
MDCBuilder.buildMdcContext(stack);
LOGGER.info("Accepted {} event.", ReactorConfig.UPDATE_AMBARI_HOSTS_REQUEST_EVENT);
if (request.isDecommision()) {
ambariClusterConnector.decommisionAmbariNodes(request.getStackId(), request.getHosts());
} else {
ambariClusterConnector.installAmbariNode(request.getStackId(), request.getHosts());
}
}