Search in sources :

Example 1 with FileServer

use of com.yahoo.vespa.config.server.filedistribution.FileServer 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);
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) HostRegistries(com.yahoo.vespa.config.server.host.HostRegistries) HostProvisionerProvider(com.yahoo.vespa.config.server.provision.HostProvisionerProvider) ModelFactoryRegistry(com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry) ConfigRequestHostLivenessTracker(com.yahoo.vespa.config.server.host.ConfigRequestHostLivenessTracker) VespaModelFactory(com.yahoo.vespa.model.VespaModelFactory) NullConfigModelRegistry(com.yahoo.config.model.NullConfigModelRegistry) ConfigCurator(com.yahoo.vespa.config.server.zookeeper.ConfigCurator) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest) RpcServer(com.yahoo.vespa.config.server.rpc.RpcServer) PermanentApplicationPackage(com.yahoo.vespa.config.server.application.PermanentApplicationPackage) FileServer(com.yahoo.vespa.config.server.filedistribution.FileServer) MockCurator(com.yahoo.vespa.curator.mock.MockCurator) Before(org.junit.Before)

Example 2 with FileServer

use of com.yahoo.vespa.config.server.filedistribution.FileServer 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();
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) Supervisor(com.yahoo.jrt.Supervisor) HostRegistries(com.yahoo.vespa.config.server.host.HostRegistries) Transport(com.yahoo.jrt.Transport) FileServer(com.yahoo.vespa.config.server.filedistribution.FileServer)

Aggregations

ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)2 FileServer (com.yahoo.vespa.config.server.filedistribution.FileServer)2 HostRegistries (com.yahoo.vespa.config.server.host.HostRegistries)2 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)1 Supervisor (com.yahoo.jrt.Supervisor)1 Transport (com.yahoo.jrt.Transport)1 PermanentApplicationPackage (com.yahoo.vespa.config.server.application.PermanentApplicationPackage)1 ConfigRequestHostLivenessTracker (com.yahoo.vespa.config.server.host.ConfigRequestHostLivenessTracker)1 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)1 ModelFactoryRegistry (com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry)1 HostProvisionerProvider (com.yahoo.vespa.config.server.provision.HostProvisionerProvider)1 RpcServer (com.yahoo.vespa.config.server.rpc.RpcServer)1 ConfigCurator (com.yahoo.vespa.config.server.zookeeper.ConfigCurator)1 MockCurator (com.yahoo.vespa.curator.mock.MockCurator)1 VespaModelFactory (com.yahoo.vespa.model.VespaModelFactory)1 Before (org.junit.Before)1