This is an automated email from the ASF dual-hosted git repository. edcoleman pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new ed5e188a92 Update documentation with purpose of the "cache" (#2714) ed5e188a92 is described below commit ed5e188a92bcd8d0be191b2d1a2380b72b2c998b Author: EdColeman <d...@etcoleman.com> AuthorDate: Tue May 17 16:58:03 2022 -0400 Update documentation with purpose of the "cache" (#2714) * Update documentation with purpose of the "cache" - Remove the TODO with an explanation that the class supports legacy clients. * Update core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java Co-authored-by: Christopher Tubbs <ctubb...@apache.org> * Fix formatting Co-authored-by: Ed Coleman etcoleman <edcole...@apache.org> Co-authored-by: Christopher Tubbs <ctubb...@apache.org> --- .../java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java b/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java index 76bb3f09c8..c2957b9b32 100644 --- a/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java +++ b/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java @@ -26,9 +26,14 @@ import org.apache.accumulo.core.singletons.SingletonService; /** * A factory for {@link ZooCache} instances. + * <p> + * Implementation note: We are using the instances map to track all the instances that have been + * created, so we can explicitly close them when the last legacy client has gone away. This is part + * of the "SingletonManager" code, and it is likely that ZooCacheFactory and ZooKeeperInstance can + * be removed when legacy client code support is no longer required. */ public class ZooCacheFactory { - // TODO: make this better - LRU, soft references, ... + private static Map<String,ZooCache> instances = new HashMap<>(); private static boolean enabled = true;