dlmarion commented on code in PR #34:
URL:
https://github.com/apache/accumulo-classloaders/pull/34#discussion_r2624433845
##########
modules/local-caching-classloader/src/main/java/org/apache/accumulo/classloader/lcc/LocalCachingContextClassLoaderFactory.java:
##########
@@ -80,16 +81,24 @@ public class LocalCachingContextClassLoaderFactory
implements ContextClassLoader
private static final Logger LOG =
LoggerFactory.getLogger(LocalCachingContextClassLoaderFactory.class);
- private final Cache<String,LocalCachingContext> contexts =
- Caffeine.newBuilder().expireAfterAccess(24, TimeUnit.HOURS).build();
+ private final DeduplicationCache<String,LocalCachingContext,URLClassLoader>
classloaders =
+ new DeduplicationCache<>((String key, LocalCachingContext lcc) ->
lcc.getClassloader(),
+ Duration.ofHours(24));
private final Map<String,Timer> classloaderFailures = new HashMap<>();
private volatile String baseCacheDir;
private volatile Duration updateFailureGracePeriodMins;
- private ContextDefinition parseContextDefinition(final URL url)
+ private ContextDefinition parseContextDefinition(final String
contextLocation)
throws ContextClassLoaderException {
- LOG.trace("Retrieving context definition file from {}", url);
+ LOG.trace("Retrieving context definition file from {}", contextLocation);
Review Comment:
Might want to move this down to after parsing the URL (before
FileResolver.resolve).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]