dlmarion commented on code in PR #4325:
URL: https://github.com/apache/accumulo/pull/4325#discussion_r1511128795


##########
core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionServiceId.java:
##########
@@ -28,11 +31,21 @@
 public class CompactionServiceId extends AbstractId<CompactionServiceId> {
   private static final long serialVersionUID = 1L;
 
+  static final Cache<String,CompactionServiceId> cache = Caches.getInstance()
+      .createNewBuilder(Caches.CacheName.COMPACTION_SERVICE_ID, 
false).weakValues().build();

Review Comment:
   When looking at the 
[documentation](https://github.com/ben-manes/caffeine/wiki/Eviction#reference-based),
 it's unclear to me whether `weakValues` alone will allow for garbage 
collection of the Cache key *and* value. I haven't looked at all the places the 
`CompactionServiceId` is used, I wonder if it's possible that a reference to it 
is held for a long time. Another approach that I mentioned in #4316 is 
[time-based 
eviction](https://github.com/ben-manes/caffeine/wiki/Eviction#time-based).



-- 
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]

Reply via email to