aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-08-28 23:21:51 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-08-28 23:21:51 +0200
commit4bfd08cd2386e6d87fb9d9e3131e9933920c45d5 (patch)
tree29760f62c28ad2c48cff9a4940e4dfbfbfa77a6e /server/sonar-server
parent280dd92d16abf50d613fb8a5570bf6445fa84a80 (diff)
downloadsonarqube-4bfd08cd2386e6d87fb9d9e3131e9933920c45d5.tar.gz
sonarqube-4bfd08cd2386e6d87fb9d9e3131e9933920c45d5.zip
Remove unused fields in SearchClient
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java27
1 files changed, 6 insertions, 21 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java b/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java
index eef7012c67f..29b2fc86f29 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/search/SearchClient.java
@@ -20,12 +20,10 @@
package org.sonar.server.search;
-import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.action.ActionRequestBuilder;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
-import org.elasticsearch.action.admin.cluster.stats.ClusterStatsNodes;
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.logging.ESLoggerFactory;
@@ -48,30 +46,17 @@ public class SearchClient extends TransportClient {
private static final Logger LOGGER = LoggerFactory.getLogger(SearchClient.class);
- private static final String DEFAULT_HEALTH_TIMEOUT = "30s";
-
- private final Settings settings;
- private final String healthTimeout;
-
- protected final Profiling profiling;
+ private final Profiling profiling;
public SearchClient(Settings settings) {
- this(settings, DEFAULT_HEALTH_TIMEOUT);
- }
-
- @VisibleForTesting
- SearchClient(Settings settings, String healthTimeout) {
super(ImmutableSettings.settingsBuilder()
- .put("network.bind_host", "localhost")
- .put("node.rack_id", StringUtils.defaultIfEmpty(settings.getString(IndexProperties.NODE_NAME), "unknown"))
- .put("cluster.name", StringUtils.defaultIfBlank(settings.getString(IndexProperties.CLUSTER_NAME), "sonarqube"))
- .build()
- );
+ .put("network.bind_host", "localhost")
+ .put("node.rack_id", StringUtils.defaultIfEmpty(settings.getString(IndexProperties.NODE_NAME), "unknown"))
+ .put("cluster.name", StringUtils.defaultIfBlank(settings.getString(IndexProperties.CLUSTER_NAME), "sonarqube"))
+ .build());
initLogging();
this.addTransportAddress(new InetSocketTransportAddress("localhost",
settings.getInt(IndexProperties.NODE_PORT)));
- this.settings = settings;
- this.healthTimeout = healthTimeout;
this.profiling = new Profiling(settings);
}
@@ -124,7 +109,7 @@ public class SearchClient extends TransportClient {
}
return response;
} catch (Exception e) {
- LOGGER.error("could not execute request: " + response);
+ LOGGER.error("could not execute request: " + response);
throw new IllegalStateException("ES error: ", e);
}