aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerClusterVerifier.java
blob: 5ab16037957c72ecf01e729f975c78e686f2a33e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin.clustercontroller;

import com.yahoo.component.ComponentSpecification;
import com.yahoo.container.handler.ThreadpoolConfig;
import com.yahoo.vespa.model.container.Container;
import com.yahoo.vespa.model.container.ContainerCluster;
import com.yahoo.vespa.model.container.ContainerClusterVerifier;
import com.yahoo.vespa.model.container.component.Component;
import com.yahoo.vespa.model.container.component.SimpleComponent;

import java.util.Collections;
import java.util.Set;

/**
 * @author baldersheim
 * Verifies that all containers added are ClusterControllerContainers and that filters away Linguistics components.
 */
public class ClusterControllerClusterVerifier implements ContainerClusterVerifier {
    static final Set<ComponentSpecification> unwantedComponents = Collections.singleton(new SimpleComponent(ContainerCluster.SIMPLE_LINGUISTICS_PROVIDER).getClassId());
    @Override
    public boolean acceptComponent(Component component) {
        return ! unwantedComponents.contains(component.getClassId());
    }

    @Override
    public boolean acceptContainer(Container container) {
        return container instanceof ClusterControllerContainer;
    }

    @Override
    public void getConfig(ThreadpoolConfig.Builder builder) {
        builder.maxthreads(10);
    }
}