summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2019-05-07 19:05:02 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2019-05-07 19:05:02 +0200
commit6d2cdb1dd8a6f2a52c86e0c0ea6c14a06c6ca12d (patch)
treebdfb003ac5bdb88bb7f07e7f9c8ffd8de479a4a1 /configserver
parent3d55a9b100c2272fc9aae376722d1d02c53769c3 (diff)
Move locks to sub-tree not under the tenant path
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java
index c37db0e0df5..53d01fdf933 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java
@@ -62,6 +62,7 @@ public class TenantRepository {
private static final TenantName DEFAULT_TENANT = TenantName.defaultName();
private static final Path tenantsPath = Path.fromString("/config/v2/tenants/");
+ private static final Path locksPath = Path.fromString("/config/v2/locks/");
private static final Path vespaPath = Path.fromString("/vespa");
private static final Duration checkForRemovedApplicationsInterval = Duration.ofMinutes(1);
private static final Logger log = Logger.getLogger(TenantRepository.class.getName());
@@ -106,6 +107,7 @@ public class TenantRepository {
curator.framework().getConnectionStateListenable().addListener(this::stateChanged);
curator.create(tenantsPath);
+ curator.create(locksPath);
createSystemTenants(configserverConfig);
curator.create(vespaPath);
@@ -261,11 +263,10 @@ public class TenantRepository {
* @param name name of the tenant
*/
private synchronized void writeTenantPath(TenantName name) {
- Path tenantPath = getTenantPath(name);
- curator.createAtomically(tenantPath,
- tenantPath.append(Tenant.SESSIONS),
- tenantPath.append(Tenant.APPLICATIONS),
- tenantPath.append(Tenant.LOCKS));
+ curator.createAtomically(TenantRepository.getTenantPath(name),
+ TenantRepository.getSessionsPath(name),
+ TenantRepository.getApplicationsPath(name),
+ TenantRepository.getLocksPath(name));
}
/**
@@ -410,10 +411,10 @@ public class TenantRepository {
}
/**
- * Gets zookeeper path for locks for a tenant's applications
+ * Gets zookeeper path for locks for a tenant's applications. This is never cleaned, but shouldn't be a problem.
*/
public static Path getLocksPath(TenantName tenantName) {
- return getTenantPath(tenantName).append(Tenant.LOCKS);
+ return locksPath.append(tenantName.value());
}
}