Search in sources :

Example 1 with SessionCounter

use of com.yahoo.vespa.config.server.zookeeper.SessionCounter 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)

Aggregations

ManualClock (com.yahoo.test.ManualClock)1 GlobalComponentRegistry (com.yahoo.vespa.config.server.GlobalComponentRegistry)1 MemoryTenantApplications (com.yahoo.vespa.config.server.application.MemoryTenantApplications)1 TenantFileSystemDirs (com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs)1 SessionCounter (com.yahoo.vespa.config.server.zookeeper.SessionCounter)1 File (java.io.File)1