Search in sources :

Example 1 with TenantFileSystemDirs

use of com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs in project vespa by vespa-engine.

the class SessionActiveHandlerTest method addLocalSession.

private LocalSessionRepo addLocalSession(long sessionId, DeployData deployData, SessionZooKeeperClient zkc) {
    writeApplicationId(zkc, deployData.getApplicationName());
    TenantFileSystemDirs tenantFileSystemDirs = TenantFileSystemDirs.createTestDirs(tenant);
    ApplicationPackage app = FilesApplicationPackage.fromFileWithDeployData(testApp, deployData);
    localRepo.addSession(new LocalSession(tenant, sessionId, new SessionTest.MockSessionPreparer(), new SessionContext(app, zkc, new File(tenantFileSystemDirs.sessionsPath(), String.valueOf(sessionId)), applicationRepo, new HostRegistry<>(), new SuperModelGenerationCounter(curator))));
    return localRepo;
}
Also used : TenantFileSystemDirs(com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs) LocalSession(com.yahoo.vespa.config.server.session.LocalSession) SessionContext(com.yahoo.vespa.config.server.session.SessionContext) SuperModelGenerationCounter(com.yahoo.vespa.config.server.SuperModelGenerationCounter) FilesApplicationPackage(com.yahoo.config.model.application.provider.FilesApplicationPackage) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) File(java.io.File)

Example 2 with TenantFileSystemDirs

use of com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs in project vespa by vespa-engine.

the class LocalSessionRepoTest method setupSessions.

private void setupSessions(TenantName tenantName, boolean createInitialSessions) throws Exception {
    GlobalComponentRegistry globalComponentRegistry = new TestComponentRegistry.Builder().curator(curator).build();
    TenantFileSystemDirs tenantFileSystemDirs = TenantFileSystemDirs.createTestDirs(tenantName);
    if (createInitialSessions) {
        IOUtils.copyDirectory(testApp, new File(tenantFileSystemDirs.sessionsPath(), "1"));
        IOUtils.copyDirectory(testApp, new File(tenantFileSystemDirs.sessionsPath(), "2"));
        IOUtils.copyDirectory(testApp, new File(tenantFileSystemDirs.sessionsPath(), "3"));
    }
    clock = new ManualClock(Instant.ofEpochSecond(1));
    LocalSessionLoader loader = new SessionFactoryImpl(globalComponentRegistry, new SessionCounter(globalComponentRegistry.getConfigCurator(), tenantName), new MemoryTenantApplications(), tenantFileSystemDirs, new HostRegistry<>(), tenantName);
    repo = new LocalSessionRepo(tenantFileSystemDirs, loader, clock, 5);
}
Also used : ManualClock(com.yahoo.test.ManualClock) MemoryTenantApplications(com.yahoo.vespa.config.server.application.MemoryTenantApplications) SessionCounter(com.yahoo.vespa.config.server.zookeeper.SessionCounter) TenantFileSystemDirs(com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs) GlobalComponentRegistry(com.yahoo.vespa.config.server.GlobalComponentRegistry) File(java.io.File)

Example 3 with TenantFileSystemDirs

use of com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs in project vespa by vespa-engine.

the class LocalSessionTest method setupTest.

@Before
public void setupTest() throws Exception {
    curator = new MockCurator();
    configCurator = ConfigCurator.create(curator);
    superModelGenerationCounter = new SuperModelGenerationCounter(curator);
    tenantFileSystemDirs = new TenantFileSystemDirs(Files.createTempDir(), TenantName.from("test_tenant"));
}
Also used : TenantFileSystemDirs(com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs) MockCurator(com.yahoo.vespa.curator.mock.MockCurator) Before(org.junit.Before)

Aggregations

TenantFileSystemDirs (com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs)3 File (java.io.File)2 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 FilesApplicationPackage (com.yahoo.config.model.application.provider.FilesApplicationPackage)1 ManualClock (com.yahoo.test.ManualClock)1 GlobalComponentRegistry (com.yahoo.vespa.config.server.GlobalComponentRegistry)1 SuperModelGenerationCounter (com.yahoo.vespa.config.server.SuperModelGenerationCounter)1 MemoryTenantApplications (com.yahoo.vespa.config.server.application.MemoryTenantApplications)1 LocalSession (com.yahoo.vespa.config.server.session.LocalSession)1 SessionContext (com.yahoo.vespa.config.server.session.SessionContext)1 SessionCounter (com.yahoo.vespa.config.server.zookeeper.SessionCounter)1 MockCurator (com.yahoo.vespa.curator.mock.MockCurator)1 Before (org.junit.Before)1