use of com.yahoo.vespa.config.server.host.HostRegistries in project vespa by vespa-engine.
the class InjectedGlobalComponentRegistryTest method setupRegistry.
@Before
public void setupRegistry() {
curator = new MockCurator();
ConfigCurator configCurator = ConfigCurator.create(curator);
metrics = Metrics.createTestMetrics();
modelFactoryRegistry = new ModelFactoryRegistry(Collections.singletonList(new VespaModelFactory(new NullConfigModelRegistry())));
configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder().configServerDBDir(Files.createTempDir().getAbsolutePath()).configDefinitionsDir(Files.createTempDir().getAbsolutePath()));
serverDB = new ConfigServerDB(configserverConfig);
sessionPreparer = new SessionTest.MockSessionPreparer();
rpcServer = new RpcServer(configserverConfig, null, Metrics.createTestMetrics(), new HostRegistries(), new ConfigRequestHostLivenessTracker(), new FileServer(FileDistribution.getDefaultFileDBPath()));
generationCounter = new SuperModelGenerationCounter(curator);
defRepo = new StaticConfigDefinitionRepo();
permanentApplicationPackage = new PermanentApplicationPackage(configserverConfig);
hostRegistries = new HostRegistries();
HostProvisionerProvider hostProvisionerProvider = HostProvisionerProvider.withProvisioner(new SessionHandlerTest.MockProvisioner());
zone = Zone.defaultZone();
globalComponentRegistry = new InjectedGlobalComponentRegistry(curator, configCurator, metrics, modelFactoryRegistry, serverDB, sessionPreparer, rpcServer, configserverConfig, generationCounter, defRepo, permanentApplicationPackage, hostRegistries, hostProvisionerProvider, zone);
}
use of com.yahoo.vespa.config.server.host.HostRegistries in project vespa by vespa-engine.
the class TenantRequestHandlerTest method setUp.
@Before
public void setUp() throws IOException, SAXException {
feedApp(app1, 1);
Metrics sh = Metrics.createTestMetrics();
List<ReloadListener> listeners = new ArrayList<>();
listeners.add(listener);
server = new TenantRequestHandler(sh, tenant, listeners, new UncompressedConfigResponseFactory(), new HostRegistries());
componentRegistry = new TestComponentRegistry.Builder().curator(curator).modelFactoryRegistry(createRegistry()).build();
}
use of com.yahoo.vespa.config.server.host.HostRegistries in project vespa by vespa-engine.
the class TestWithRpc method createAndStartRpcServer.
protected void createAndStartRpcServer(boolean hostedVespa) {
ConfigserverConfig configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder());
rpcServer = new RpcServer(new ConfigserverConfig(new ConfigserverConfig.Builder().rpcport(port).numRpcThreads(1).maxgetconfigclients(1).hostedVespa(hostedVespa)), new SuperModelRequestHandler(new TestConfigDefinitionRepo(), configserverConfig, new SuperModelManager(configserverConfig, emptyNodeFlavors(), generationCounter)), Metrics.createTestMetrics(), new HostRegistries(), hostLivenessTracker, new FileServer(FileDistribution.getDefaultFileDBPath()));
rpcServer.onTenantCreate(TenantName.from("default"), tenantProvider);
t = new Thread(rpcServer);
t.start();
sup = new Supervisor(new Transport());
pingServer();
}
Aggregations