Browse Source

java: adjust cache expiration policy for long running java processes

pull/2380/head
Chris Lu 3 years ago
parent
commit
5ca0a551ac
  1. 2
      other/java/client/src/main/java/seaweedfs/client/ChunkCache.java
  2. 2
      other/java/client/src/main/java/seaweedfs/client/VolumeIdCache.java

2
other/java/client/src/main/java/seaweedfs/client/ChunkCache.java

@ -15,7 +15,7 @@ public class ChunkCache {
} }
this.cache = CacheBuilder.newBuilder() this.cache = CacheBuilder.newBuilder()
.maximumSize(maxEntries) .maximumSize(maxEntries)
.expireAfterAccess(1, TimeUnit.HOURS)
.expireAfterWrite(1, TimeUnit.HOURS)
.build(); .build();
} }

2
other/java/client/src/main/java/seaweedfs/client/VolumeIdCache.java

@ -15,7 +15,7 @@ public class VolumeIdCache {
} }
this.cache = CacheBuilder.newBuilder() this.cache = CacheBuilder.newBuilder()
.maximumSize(maxEntries) .maximumSize(maxEntries)
.expireAfterAccess(5, TimeUnit.MINUTES)
.expireAfterWrite(5, TimeUnit.MINUTES)
.build(); .build();
} }

Loading…
Cancel
Save