diff options
author | HÃ¥kon Hallingstad <hakon.hallingstad@gmail.com> | 2022-07-11 20:44:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 20:44:01 +0200 |
commit | 7605979957b492e5cb9b7035a3a78c63524757fb (patch) | |
tree | 25a00ec20003c1df513bf430370c6f558f9618c5 /config-model/src/main/java/com/yahoo/vespa/model/container/component/Handler.java | |
parent | daea91c18d4f000c5282ccff2daca7843fc12ab8 (diff) |
Revert "Inject default threadpool to handlers [run-systemtest]"
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/component/Handler.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/component/Handler.java | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/component/Handler.java b/config-model/src/main/java/com/yahoo/vespa/model/container/component/Handler.java index 9f2bfe9251b..8ffdccae896 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/component/Handler.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/component/Handler.java @@ -1,9 +1,8 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.container.component; -import com.yahoo.container.handler.threadpool.ContainerThreadpoolConfig; +import com.yahoo.config.model.producer.AbstractConfigProducer; import com.yahoo.osgi.provider.model.ComponentModel; -import com.yahoo.vespa.model.container.ContainerThreadpool; import java.util.ArrayList; import java.util.Arrays; @@ -16,35 +15,22 @@ import java.util.Set; * Models a jdisc RequestHandler (including ClientProvider). * RequestHandlers always have at least one server binding, * while ClientProviders have at least one client binding. + * <p> + * Note that this is also used to model vespa handlers (which do not have any bindings) * * @author gjoranv */ -public class Handler extends Component<Component<?, ?>, ComponentModel> { +public class Handler<CHILD extends AbstractConfigProducer<?>> extends Component<CHILD, ComponentModel> { private final Set<BindingPattern> serverBindings = new LinkedHashSet<>(); private final List<BindingPattern> clientBindings = new ArrayList<>(); - public final boolean hasCustomThreadPool; - public Handler(ComponentModel model) { - this(model, null); - } - - public Handler(ComponentModel model, ContainerThreadpool threadpool) { super(model); - - // The default threadpool is always added to the cluster, so cannot be added here. - if (threadpool != null) { - hasCustomThreadPool = true; - addComponent(threadpool); - inject(threadpool); - } else { - hasCustomThreadPool = false; - } } - public static Handler fromClassName(String className) { - return new Handler(new ComponentModel(className, null, null, null)); + public static Handler<AbstractConfigProducer<?>> fromClassName(String className) { + return new Handler<>(new ComponentModel(className, null, null, null)); } public void addServerBindings(BindingPattern... bindings) { @@ -67,24 +53,4 @@ public class Handler extends Component<Component<?, ?>, ComponentModel> { return Collections.unmodifiableList(clientBindings); } - - /** - * The default threadpool for all handlers, except those that declare their own, e.g. SearchHandler. - */ - public static class DefaultHandlerThreadpool extends ContainerThreadpool { - - public DefaultHandlerThreadpool() { - super("default-handler-common", null); - } - - @Override - public void setDefaultConfigValues(ContainerThreadpoolConfig.Builder builder) { - builder.maxThreadExecutionTimeSeconds(190) - .keepAliveTime(5.0) - .maxThreads(-2) - .minThreads(-2) - .queueSize(-40); - } - } - } |