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


##########
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ZooCache.java:
##########
@@ -59,16 +66,39 @@ public interface ZooCacheWatcher extends 
Consumer<WatchedEvent> {}
 
   private static final Logger log = LoggerFactory.getLogger(ZooCache.class);
 
-  private final ZCacheWatcher watcher = new ZCacheWatcher();
-  private final Optional<ZooCacheWatcher> externalWatcher;
+  protected static final String[] ALLOWED_PATHS = new String[] 
{Constants.ZCOMPACTORS,
+      Constants.ZDEADTSERVERS, Constants.ZGC_LOCK, Constants.ZMANAGER_LOCK, 
Constants.ZMINI_LOCK,
+      Constants.ZMONITOR_LOCK, Constants.ZNAMESPACES, Constants.ZRECOVERY, 
Constants.ZSSERVERS,
+      Constants.ZTABLES, Constants.ZTSERVERS, Constants.ZUSERS, 
RootTable.ZROOT_TABLET};
+
+  protected final TreeSet<String> watchedPaths = new TreeSet<>();
+  // visible for tests
+  protected final ZCacheWatcher watcher = new ZCacheWatcher();
+  private final List<ZooCacheWatcher> externalWatchers =
+      Collections.synchronizedList(new ArrayList<>());
 
   private static final AtomicLong nextCacheId = new AtomicLong(0);
   private final String cacheId = "ZC" + nextCacheId.incrementAndGet();
 
+  public static final Duration CACHE_DURATION = Duration.ofMinutes(30);
+
+  // public and non-final because this is being set
+  // in tests to test the eviction
+  @SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL",
+      justification = "being set in tests for eviction test")
+  public static Ticker ticker = Ticker.systemTicker();

Review Comment:
   Moving this to a method did not work, but I was able to create an overloaded 
constructor in fb6aaa7 for use in the test that uses the Ticker.



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to