aboutsummaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-08-31 07:01:38 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2021-08-31 07:16:53 +0200
commitf8983c8e6309505bf30357b01beb5add06c3fd6e (patch)
tree45ae597c91531933ea3692399896feb71e10c3ff /configserver
parent555280e7bbd524e1e73f28b48378de4cfb9bba51 (diff)
Directory cache is not optional.
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java10
1 files changed, 5 insertions, 5 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 d62e13e9ea9..8641b7dcffe 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
@@ -118,7 +118,7 @@ public class TenantRepository {
private final ExecutorService bootstrapExecutor;
private final ScheduledExecutorService checkForRemovedApplicationsService =
new ScheduledThreadPoolExecutor(1, new DaemonThreadFactory("check for removed applications"));
- private final Optional<Curator.DirectoryCache> directoryCache;
+ private final Curator.DirectoryCache directoryCache;
private final ZookeeperServerConfig zookeeperServerConfig;
/**
@@ -207,9 +207,9 @@ public class TenantRepository {
createPaths();
createSystemTenants(configserverConfig);
- this.directoryCache = Optional.of(curator.createDirectoryCache(tenantsPath.getAbsolute(), false, false, zkCacheExecutor));
- this.directoryCache.get().addListener(this::childEvent);
- this.directoryCache.get().start();
+ this.directoryCache = curator.createDirectoryCache(tenantsPath.getAbsolute(), false, false, zkCacheExecutor);
+ this.directoryCache.addListener(this::childEvent);
+ this.directoryCache.start();
bootstrapTenants();
notifyTenantsLoaded();
checkForRemovedApplicationsService.scheduleWithFixedDelay(this::removeUnusedApplications,
@@ -533,7 +533,7 @@ public class TenantRepository {
}
public void close() {
- directoryCache.ifPresent(com.yahoo.vespa.curator.Curator.DirectoryCache::close);
+ directoryCache.close();
try {
zkCacheExecutor.shutdown();
checkForRemovedApplicationsService.shutdown();