use of org.sonar.process.cluster.health.SharedHealthState in project sonarqube by SonarSource.
the class HealthCheckerImpl method checkCluster.
@Override
public ClusterHealth checkCluster() {
checkState(!webServer.isStandalone(), "Clustering is not enabled");
checkState(sharedHealthState != null, "HealthState instance can't be null when clustering is enabled");
Set<NodeHealth> nodeHealths = sharedHealthState.readAll();
Health health = clusterHealthChecks.stream().map(clusterHealthCheck -> clusterHealthCheck.check(nodeHealths)).reduce(Health.GREEN, HealthReducer.INSTANCE);
return new ClusterHealth(health, nodeHealths);
}
Aggregations