You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2018/10/12 16:11:22 UTC

[pulsar] branch master updated: Refresh ZK cache based on insertion time rather than access (#2785)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d2a012  Refresh ZK cache based on insertion time rather than access (#2785)
7d2a012 is described below

commit 7d2a012719109963cdfe592dcb7e3a145bb7b522
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Fri Oct 12 09:11:18 2018 -0700

    Refresh ZK cache based on insertion time rather than access (#2785)
---
 .../src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java b/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java
index fed55c3..0e69c88 100644
--- a/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java
+++ b/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java
@@ -93,11 +93,11 @@ public abstract class ZooKeeperCache implements Watcher {
         this.zkSession.set(zkSession);
         this.shouldShutdownExecutor = false;
 
-        this.dataCache = Caffeine.newBuilder().expireAfterAccess(1, TimeUnit.HOURS)
+        this.dataCache = Caffeine.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES)
                 .buildAsync((key, executor1) -> null);
 
-        this.childrenCache = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.HOURS).build();
-        this.existsCache = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.HOURS).build();
+        this.childrenCache = CacheBuilder.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES).build();
+        this.existsCache = CacheBuilder.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES).build();
     }
 
     public ZooKeeperCache(ZooKeeper zkSession) {