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;
}
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);
}
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"));
}
Aggregations