aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-09-06 15:29:01 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-09-13 15:50:54 +0200
commit802231001dbc907f1ad073c7939e4f290cd04dc2 (patch)
treed115bcd83ff8d8f0e18be629ad63cade5056d5ed
parent381beaa378e2bedc2f99077bd8fcf7d160f3bb2f (diff)
downloadsonarqube-802231001dbc907f1ad073c7939e4f290cd04dc2.tar.gz
sonarqube-802231001dbc907f1ad073c7939e4f290cd04dc2.zip
SONAR-9741 put key of SharedHealthState map in ClusterObjectKeys
-rw-r--r--server/sonar-cluster/src/main/java/org/sonar/cluster/ClusterObjectKeys.java5
-rw-r--r--server/sonar-cluster/src/main/java/org/sonar/cluster/health/SharedHealthStateImpl.java4
2 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-cluster/src/main/java/org/sonar/cluster/ClusterObjectKeys.java b/server/sonar-cluster/src/main/java/org/sonar/cluster/ClusterObjectKeys.java
index 16464b6c53e..e3a32e373b7 100644
--- a/server/sonar-cluster/src/main/java/org/sonar/cluster/ClusterObjectKeys.java
+++ b/server/sonar-cluster/src/main/java/org/sonar/cluster/ClusterObjectKeys.java
@@ -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";
}
diff --git a/server/sonar-cluster/src/main/java/org/sonar/cluster/health/SharedHealthStateImpl.java b/server/sonar-cluster/src/main/java/org/sonar/cluster/health/SharedHealthStateImpl.java
index 7286f4de9de..0e4d719d02c 100644
--- a/server/sonar-cluster/src/main/java/org/sonar/cluster/health/SharedHealthStateImpl.java
+++ b/server/sonar-cluster/src/main/java/org/sonar/cluster/health/SharedHealthStateImpl.java
@@ -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);
}
}