use of com.yahoo.container.core.ChainsConfig in project vespa by vespa-engine.
the class ChainsModelBuilderTest method chainsModel.
private ChainsModel chainsModel() {
ChainsConfig.Builder builder = new ChainsConfig.Builder().components(new Components.Builder().id("componentA")).components(new Components.Builder().id("componentB")).chains(new Chains.Builder().id("chain1").components("componentA").components("componentB")).chains(new Chains.Builder().id("inheritsChain1").inherits("chain1").excludes("componentA"));
ChainsConfig config = new ChainsConfig(builder);
ChainsModel model = ChainsModelBuilder.buildFromConfig(config);
model.validate();
return model;
}
use of com.yahoo.container.core.ChainsConfig in project vespa by vespa-engine.
the class DomSearchChainsBuilderTest method checkInnerSearcherIdIsNestedInSearchChainId.
@Test
public void checkInnerSearcherIdIsNestedInSearchChainId() {
ChainsConfig.Builder builder = new ChainsConfig.Builder();
searchChains.getConfig(builder);
ChainsConfig config = new ChainsConfig(builder);
checkInnerSearcherIdIsNestedInSearchChainId(config, "federationSearcher", "default");
checkInnerSearcherIdIsNestedInSearchChainId(config, "VespaSearcher", "provider");
}
use of com.yahoo.container.core.ChainsConfig in project vespa by vespa-engine.
the class FilterBindingsProviderTest method requireThatConfigWithUnknownReferenceFails.
@Test
public void requireThatConfigWithUnknownReferenceFails() {
// Set up config.
configBuilder.filter(new ServerConfig.Filter.Builder().id("someFilter").binding("http://*/*"));
// Set up registry.
final FilterChainRepository filterChainRepository = new FilterChainRepository(new ChainsConfig(new ChainsConfig.Builder()), new ComponentRegistry<>(), new ComponentRegistry<>(), new ComponentRegistry<>(), new ComponentRegistry<>());
try {
new FilterBindingsProvider(new ComponentId("foo"), new ServerConfig(configBuilder), filterChainRepository, new ComponentRegistry<>());
fail("Config with unknown filter reference should not be accepted");
} catch (RuntimeException e) {
assertThat(e.getMessage(), containsString("Invalid config"));
}
}
use of com.yahoo.container.core.ChainsConfig in project vespa by vespa-engine.
the class DocprocBuilderTest method setupCluster.
@Before
public void setupCluster() {
ContainerModel model = new ContainerModelBuilder(false, Networking.disable).build(DeployState.createTestState(), null, root, servicesXml());
cluster = model.getCluster();
cluster.getDocproc().getChains().addServersAndClientsForChains();
root.freezeModelTopology();
containerMbusConfig = root.getConfig(ContainerMbusConfig.class, cluster.getContainers().get(0).getConfigId());
componentsConfig = root.getConfig(ComponentsConfig.class, cluster.getConfigId());
chainsConfig = root.getConfig(ChainsConfig.class, cluster.getConfigId() + "/component/com.yahoo.docproc.jdisc.DocumentProcessingHandler");
documentmanagerConfig = root.getConfig(DocumentmanagerConfig.class, cluster.getConfigId());
bundlesConfig = root.getConfig(BundlesConfig.class, cluster.getConfigId());
schemamappingConfig = root.getConfig(SchemamappingConfig.class, cluster.getContainers().get(0).getConfigId());
qrStartConfig = root.getConfig(QrStartConfig.class, cluster.getConfigId());
docprocConfig = root.getConfig(DocprocConfig.class, cluster.getConfigId());
}
use of com.yahoo.container.core.ChainsConfig in project vespa by vespa-engine.
the class SearchChainsTest method subscribe.
@Before
public void subscribe() {
ChainsConfig.Builder chainsBuilder = new ChainsConfig.Builder();
chainsBuilder = (ChainsConfig.Builder) root.getConfig(chainsBuilder, "searchchains");
chainsConfig = new ChainsConfig(chainsBuilder);
ProviderConfig.Builder providerBuilder = new ProviderConfig.Builder();
providerBuilder = (ProviderConfig.Builder) root.getConfig(providerBuilder, "searchchains/chain/provider:1/component/com.yahoo.search.federation.vespa.VespaSearcher");
providerConfig = new ProviderConfig(providerBuilder);
ClusterConfig.Builder clusterBuilder = new ClusterConfig.Builder();
clusterBuilder = (ClusterConfig.Builder) root.getConfig(clusterBuilder, "searchchains/chain/cluster2/component/" + ClusterSearcher.class.getName());
clusterConfig = new ClusterConfig(clusterBuilder);
}
Aggregations