From 95b1981ba64f1cd37ef680eeec539a793305c4a7 Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Fri, 22 Sep 2017 18:03:42 +0200 Subject: [PATCH] dropped marvel property "sonar.search.marvelHosts" was an internal property, used to enable marvel managing of the embedded Elasticsearch process. --- .../org/sonar/process/ProcessProperties.java | 1 - .../java/org/sonar/process/es/EsSettings.java | 18 ------------------ .../org/sonar/process/es/EsSettingsTest.java | 9 --------- 3 files changed, 28 deletions(-) diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java index a0eb3bd6ea7..e5358d4bc29 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java @@ -57,7 +57,6 @@ public class ProcessProperties { public static final String SEARCH_REPLICAS = "sonar.search.replicas"; public static final String SEARCH_MINIMUM_MASTER_NODES = "sonar.search.minimumMasterNodes"; public static final String SEARCH_INITIAL_STATE_TIMEOUT = "sonar.search.initialStateTimeout"; - public static final String SEARCH_MARVEL_HOSTS = "sonar.search.marvelHosts"; public static final String WEB_JAVA_OPTS = "sonar.web.javaOpts"; public static final String WEB_JAVA_ADDITIONAL_OPTS = "sonar.web.javaAdditionalOpts"; diff --git a/server/sonar-process/src/main/java/org/sonar/process/es/EsSettings.java b/server/sonar-process/src/main/java/org/sonar/process/es/EsSettings.java index 223bae8c239..42eac51eea0 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/es/EsSettings.java +++ b/server/sonar-process/src/main/java/org/sonar/process/es/EsSettings.java @@ -21,13 +21,9 @@ package org.sonar.process.es; import java.net.InetAddress; import java.net.UnknownHostException; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.Set; -import java.util.TreeSet; import java.util.UUID; -import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.process.ProcessProperties; @@ -39,7 +35,6 @@ import static org.sonar.cluster.ClusterProperties.CLUSTER_ENABLED; import static org.sonar.cluster.ClusterProperties.CLUSTER_NAME; import static org.sonar.cluster.ClusterProperties.CLUSTER_NODE_NAME; import static org.sonar.cluster.ClusterProperties.CLUSTER_SEARCH_HOSTS; -import static org.sonar.process.ProcessProperties.SEARCH_MARVEL_HOSTS; public class EsSettings { @@ -76,7 +71,6 @@ public class EsSettings { configureFileSystem(builder); configureNetwork(builder); configureCluster(builder); - configureMarvel(builder); configureAction(builder); return builder; } @@ -148,18 +142,6 @@ public class EsSettings { builder.put("node.master", valueOf(true)); } - private void configureMarvel(Map builder) { - Set marvels = new TreeSet<>(); - marvels.addAll(Arrays.asList(StringUtils.split(props.value(SEARCH_MARVEL_HOSTS, ""), ","))); - - // If we're collecting indexing data send them to the Marvel host(s) - if (!marvels.isEmpty()) { - String hosts = StringUtils.join(marvels, ","); - LOGGER.info("Elasticsearch Marvel is enabled for %s", hosts); - builder.put("marvel.agent.exporter.es.hosts", hosts); - } - } - private static void configureAction(Map builder) { builder.put("action.auto_create_index", String.valueOf(false)); } diff --git a/server/sonar-process/src/test/java/org/sonar/process/es/EsSettingsTest.java b/server/sonar-process/src/test/java/org/sonar/process/es/EsSettingsTest.java index 2185051df69..d8bc647ae7c 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/es/EsSettingsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/es/EsSettingsTest.java @@ -268,15 +268,6 @@ public class EsSettingsTest { assertThat(settings.get("discovery.zen.minimum_master_nodes")).isEqualTo("1"); } - @Test - public void enable_marvel() throws Exception { - Props props = minProps(CLUSTER_DISABLED); - props.set("sonar.search.marvelHosts", "127.0.0.2,127.0.0.3"); - Map settings = new EsSettings(props, new EsFileSystem(props), System2.INSTANCE).build(); - - assertThat(settings.get("marvel.agent.exporter.es.hosts")).isEqualTo("127.0.0.2,127.0.0.3"); - } - @Test public void enable_http_connector() throws Exception { Props props = minProps(CLUSTER_DISABLED); -- 2.39.5