From f948727c73c0f5c417395106d48b35e4f79b747f Mon Sep 17 00:00:00 2001 From: Lukas Mansour Date: Thu, 5 Oct 2023 08:41:06 +0200 Subject: [PATCH] Fix bean in 'srmmanager.xml'. Signed-off-by: Lukas Mansour --- .../doors/NettyLineBasedDoorFactory.java | 4 ++-- .../java/org/dcache/space/ReservationCaches.java | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/dcache/src/main/java/diskCacheV111/doors/NettyLineBasedDoorFactory.java b/modules/dcache/src/main/java/diskCacheV111/doors/NettyLineBasedDoorFactory.java index 9eddf7d8396..0912e58f88f 100644 --- a/modules/dcache/src/main/java/diskCacheV111/doors/NettyLineBasedDoorFactory.java +++ b/modules/dcache/src/main/java/diskCacheV111/doors/NettyLineBasedDoorFactory.java @@ -138,8 +138,8 @@ protected void doStart() { CellStub spaceManager = new CellStub(parentEndpoint, spaceManagerPath, 30_000); spaceDescriptionCache = ReservationCaches.buildOwnerDescriptionLookupCache(spaceManager, - executor).synchronous(); - spaceLookupCache = ReservationCaches.buildSpaceLookupCache(spaceManager, executor).synchronous(); + executor); + spaceLookupCache = ReservationCaches.buildSpaceLookupCache(spaceManager, executor); LoginStrategy loginStrategy = new RemoteLoginStrategy( new CellStub(parentEndpoint, gPlazma, 30_000)); diff --git a/modules/dcache/src/main/java/org/dcache/space/ReservationCaches.java b/modules/dcache/src/main/java/org/dcache/space/ReservationCaches.java index 8ad1f2ee735..e8ee82cbb2c 100644 --- a/modules/dcache/src/main/java/org/dcache/space/ReservationCaches.java +++ b/modules/dcache/src/main/java/org/dcache/space/ReservationCaches.java @@ -72,6 +72,7 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING import com.github.benmanes.caffeine.cache.AsyncCacheLoader; import com.github.benmanes.caffeine.cache.AsyncLoadingCache; import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; import diskCacheV111.services.space.Space; import diskCacheV111.services.space.message.GetSpaceMetaData; import diskCacheV111.services.space.message.GetSpaceTokens; @@ -150,11 +151,11 @@ private ReservationCaches() { /** * Builds a loading cache for looking up space tokens by owner and description. */ - public static AsyncLoadingCache buildOwnerDescriptionLookupCache( + public static LoadingCache buildOwnerDescriptionLookupCache( CellStub spaceManager, Executor executor) { return Caffeine.newBuilder().maximumSize(1000).expireAfterWrite(30, SECONDS) .refreshAfterWrite(10, SECONDS).recordStats().executor(executor) - .buildAsync(new AsyncCacheLoader<>() { + .buildAsync(new AsyncCacheLoader() { private GetSpaceTokens createRequest(GetSpaceTokensKey key) { GetSpaceTokens message = new GetSpaceTokens(key.description); message.setSubject(new Subject(true, key.principals, Collections.emptySet(), @@ -203,13 +204,13 @@ public void failure(int rc, Object error) { }, executor); return future; } - }); + }).synchronous(); } /** * Build a loading cache for looking up space reservations by space token. */ - public static AsyncLoadingCache> buildSpaceLookupCache( + public static LoadingCache> buildSpaceLookupCache( CellStub spaceManager, Executor executor) { return Caffeine.newBuilder() @@ -218,7 +219,7 @@ public static AsyncLoadingCache> buildSpaceLookupCache( .refreshAfterWrite(30, SECONDS) .recordStats() .executor(executor) - .buildAsync(new AsyncCacheLoader<>() { + .buildAsync(new AsyncCacheLoader>() { @Override public CompletableFuture> asyncLoad(String token, Executor executor) @@ -253,7 +254,7 @@ public void failure(int rc, Object error) { }, executor); return future; } - }); + }).synchronous(); } /**