summaryrefslogtreecommitdiffstats
path: root/config-proxy
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2019-07-11 14:03:36 +0200
committerHarald Musum <musum@verizonmedia.com>2019-07-11 14:03:36 +0200
commit4fbb67c59556a01352312ca7bd8876a3fc4922fb (patch)
treec0df5f8027eea33c4608f33468d7321655f4067a /config-proxy
parent1c79079945c56fa91de8427fbc8f2170eec9ed8c (diff)
Create DelayedResponses in one place
Diffstat (limited to 'config-proxy')
-rw-r--r--config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java
index 4bf3bd5a786..1f7053e0ad3 100644
--- a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java
+++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java
@@ -28,7 +28,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
/**
* A proxy server that handles RPC config requests. The proxy can run in two modes:
* 'default' and 'memorycache', where the last one will not get config from an upstream
- * config source, but will serve config only from memory cache.
+ * config source, but will serve config from memory cache only.
*
* @author hmusum
*/
@@ -72,11 +72,11 @@ public class ProxyServer implements Runnable {
defaultTimingValues = tv;
}
- private ProxyServer(Spec spec, DelayedResponses delayedResponses, ConfigSourceSet source,
+ private ProxyServer(Spec spec, ConfigSourceSet source,
ConfigProxyStatistics statistics, TimingValues timingValues,
boolean delayedResponseHandling, MemoryCache memoryCache,
ConfigSourceClient configClient) {
- this.delayedResponses = delayedResponses;
+ this.delayedResponses = new DelayedResponses();
this.configSource = source;
log.log(LogLevel.DEBUG, "Using config source '" + source);
this.statistics = statistics;
@@ -97,8 +97,7 @@ public class ProxyServer implements Runnable {
MemoryCache memoryCache,
ConfigProxyStatistics statistics) {
final boolean delayedResponseHandling = false;
- return new ProxyServer(null, new DelayedResponses(),
- source, statistics, defaultTimingValues(), delayedResponseHandling,
+ return new ProxyServer(null, source, statistics, defaultTimingValues(), delayedResponseHandling,
memoryCache, configSourceClient);
}
@@ -209,8 +208,7 @@ public class ProxyServer implements Runnable {
t.start();
ConfigSourceSet configSources = new ConfigSourceSet(properties.configSources);
- DelayedResponses delayedResponses = new DelayedResponses();
- ProxyServer proxyServer = new ProxyServer(new Spec(null, port), delayedResponses, configSources, statistics,
+ ProxyServer proxyServer = new ProxyServer(new Spec(null, port), configSources, statistics,
defaultTimingValues(), true, new MemoryCache(), null);
// catch termination and interrupt signal
proxyServer.setupSignalHandler();
@@ -261,9 +259,7 @@ public class ProxyServer implements Runnable {
if (rpcServer != null) rpcServer.shutdown();
if (delayedResponseScheduler != null) delayedResponseScheduler.cancel(true);
flush();
- if (statistics != null) {
- statistics.stop();
- }
+ if (statistics != null) statistics.stop();
fileDistributionAndUrlDownload.close();
}