use of com.sequenceiq.cloudbreak.event.ResourceEvent.CLUSTER_FAILED_NODES_REPORTED_CLUSTER_EVENT in project cloudbreak by hortonworks.
the class ClusterOperationService method updateFailedNodes.
private void updateFailedNodes(Cluster cluster, Map<InstanceMetaData, Optional<String>> failedHostMetadata) throws TransactionExecutionException {
if (!failedHostMetadata.isEmpty()) {
Map<String, Optional<String>> hostNamesWithReason = failedHostMetadata.entrySet().stream().filter(e -> e.getKey().getDiscoveryFQDN() != null).collect(Collectors.toMap(e -> e.getKey().getDiscoveryFQDN(), e -> e.getValue()));
Set<InstanceStatus> expectedStates = Set.of(SERVICES_HEALTHY, SERVICES_RUNNING);
InstanceStatus newState = SERVICES_UNHEALTHY;
ResourceEvent clusterEvent = CLUSTER_FAILED_NODES_REPORTED_CLUSTER_EVENT;
ResourceEvent hostEvent = CLUSTER_FAILED_NODES_REPORTED_HOST_EVENT;
updateChangedHosts(cluster, hostNamesWithReason, expectedStates, newState, clusterEvent, Optional.of(hostEvent));
}
}
Aggregations