Skip to content

Commit

Permalink
Refresh ZK cache based on insertion time rather than access (apache#2785
Browse files Browse the repository at this point in the history
)
  • Loading branch information
merlimat authored Oct 12, 2018
1 parent c2977be commit 7d2a012
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ public ZooKeeperCache(ZooKeeper zkSession, OrderedExecutor executor) {
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) {
Expand Down

0 comments on commit 7d2a012

Please sign in to comment.