summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-10-25 17:16:19 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-10-25 17:16:19 +0200
commitf75831b88fcac8e8261dd6f2b09f94052902b421 (patch)
tree487eef067d81355a1481d5eb1d5053592857823a /container-core
parentf0e8ca92a57d1334823e8d3a35c41a8363179bbf (diff)
Truthful constructor signatures
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java b/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java
index 7a244bc94cb..0bd243f57d1 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/VipStatusHandler.java
@@ -158,29 +158,31 @@ public final class VipStatusHandler extends ThreadedHttpRequestHandler {
}
}
+ /**
+ * Create this with a dedicated thread pool to avoid returning an error to VIPs when the regular thread pool is
+ * out of capacity. This is the default behavior.
+ */
+ @Inject
+ public VipStatusHandler(VipStatusConfig vipConfig, Metric metric, VipStatus vipStatus) {
+ // One thread should be enough for status handling - otherwise something else is completely wrong,
+ // in which case this will eventually start returning a 503 (due to work rejection) as the bounded
+ // queue will fill up
+ this(new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<>(100)),
+ vipConfig, metric, vipStatus);
+ }
+
public VipStatusHandler(Executor executor, VipStatusConfig vipConfig, Metric metric) {
this(executor, vipConfig, metric, null);
}
- @Inject
public VipStatusHandler(Executor executor, VipStatusConfig vipConfig, Metric metric, VipStatus vipStatus) {
- super(createDedicatedThreadExecutor(), metric);
+ super(executor, metric);
this.accessDisk = vipConfig.accessdisk();
this.statusFile = new File(Defaults.getDefaults().underVespaHome(vipConfig.statusfile()));
this.noSearchBackendsImpliesOutOfService = vipConfig.noSearchBackendsImpliesOutOfService();
this.vipStatus = vipStatus;
}
- /**
- * Use a dedicated thread pool to avoid returning an error to VIPs when the regular thread pool is out of capacity.
- * One thread should be enough for status handling - otherwise something else is completely wrong,
- * in which case this will eventually start returning a 503 (due to work rejection) as the bounded
- * queue will fill up
- */
- private static Executor createDedicatedThreadExecutor() {
- return new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<>(100));
- }
-
@Override
public HttpResponse handle(HttpRequest request) {
if (metric != null)