use of com.yahoo.cloud.config.RoutingConfig in project vespa by vespa-engine.
the class SuperModelConfigProvider method getConfig.
public ConfigPayload getConfig(ConfigKey<?> configKey) {
// TODO: Override not applied, but not really necessary here
if (configKey.equals(new ConfigKey<>(LbServicesConfig.class, configKey.getConfigId()))) {
LbServicesConfig.Builder builder = new LbServicesConfig.Builder();
getConfig(builder);
return ConfigPayload.fromInstance(new LbServicesConfig(builder));
} else if (configKey.equals(new ConfigKey<>(RoutingConfig.class, configKey.getConfigId()))) {
RoutingConfig.Builder builder = new RoutingConfig.Builder();
getConfig(builder);
return ConfigPayload.fromInstance(new RoutingConfig(builder));
} else {
throw new ConfigurationRuntimeException(configKey + " is not valid when asking for config from SuperModel");
}
}
use of com.yahoo.cloud.config.RoutingConfig in project vespa by vespa-engine.
the class RoutingProducerTest method testNodesFromRoutingAppOnly.
@Test
public void testNodesFromRoutingAppOnly() throws Exception {
Map<TenantName, Map<ApplicationId, ApplicationInfo>> testModel = createTestModel(new DeployState.Builder());
RoutingProducer producer = new RoutingProducer(testModel);
RoutingConfig.Builder builder = new RoutingConfig.Builder();
producer.getConfig(builder);
RoutingConfig config = new RoutingConfig(builder);
assertThat(config.hosts().size(), is(2));
assertThat(config.hosts(0), is("hosted-vespa.routing.yahoo.com"));
assertThat(config.hosts(1), is("hosted-vespa.routing2.yahoo.com"));
}
Aggregations