diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-08-31 07:01:38 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-08-31 07:16:53 +0200 |
commit | f8983c8e6309505bf30357b01beb5add06c3fd6e (patch) | |
tree | 45ae597c91531933ea3692399896feb71e10c3ff /configserver/src/main/java/com | |
parent | 555280e7bbd524e1e73f28b48378de4cfb9bba51 (diff) |
Directory cache is not optional.
Diffstat (limited to 'configserver/src/main/java/com')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java | 10 |
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(); |