Browse Source

SONAR-9741 put key of SharedHealthState map in ClusterObjectKeys

tags/6.6-RC1
Sébastien Lesaint 6 years ago
parent
commit
802231001d

+ 4
- 1
server/sonar-cluster/src/main/java/org/sonar/cluster/ClusterObjectKeys.java View File

@@ -70,10 +70,13 @@ public final class ClusterObjectKeys {
* The key of replicated map holding the CeWorker UUIDs
*/
public static final String WORKER_UUIDS = "WORKER_UUIDS";

/**
* The key of the lock for executing CE_CLEANING_JOB
* {@link CeCleaningSchedulerImpl}
*/
public static final String CE_CLEANING_JOB_LOCK = "CE_CLEANING_JOB_LOCK";
/**
* THe key of the replicated map holding the health state information of all SQ nodes.
*/
public static final String SQ_HEALTH_STATE = "sq_health_state";
}

+ 2
- 2
server/sonar-cluster/src/main/java/org/sonar/cluster/health/SharedHealthStateImpl.java View File

@@ -27,12 +27,12 @@ import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.cluster.ClusterObjectKeys;
import org.sonar.cluster.localclient.HazelcastClient;

import static java.util.Objects.requireNonNull;

public class SharedHealthStateImpl implements SharedHealthState {
private static final String SQ_HEALTH_STATE_REPLICATED_MAP_IDENTIFIER = "sq_health_state";
private static final Logger LOG = Loggers.get(SharedHealthStateImpl.class);
private static final int TIMEOUT_30_SECONDS = 30 * 1000;

@@ -101,7 +101,7 @@ public class SharedHealthStateImpl implements SharedHealthState {
}

private Map<String, TimestampedNodeHealth> readReplicatedMap() {
return hazelcastClient.getReplicatedMap(SQ_HEALTH_STATE_REPLICATED_MAP_IDENTIFIER);
return hazelcastClient.getReplicatedMap(ClusterObjectKeys.SQ_HEALTH_STATE);
}

}

Loading…
Cancel
Save