weixiuli commented on code in PR #36088:
URL: https://github.com/apache/spark/pull/36088#discussion_r847269984


##########
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java:
##########
@@ -118,11 +119,18 @@ public ShuffleIndexInformation load(String filePath) 
throws IOException {
             return new ShuffleIndexInformation(filePath);
           }
         };
-    shuffleIndexCache = CacheBuilder.newBuilder()
-      .maximumWeight(JavaUtils.byteStringAsBytes(indexCacheSize))
-      .weigher((Weigher<String, ShuffleIndexInformation>)
-        (filePath, indexInfo) -> indexInfo.getRetainedMemorySize())
-      .build(indexCacheLoader);
+    CacheBuilder cacheBuilder = CacheBuilder.newBuilder()
+        .maximumWeight(JavaUtils.byteStringAsBytes(indexCacheSize))
+        .weigher((Weigher<String, ShuffleIndexInformation>)
+            (filePath, indexInfo) -> indexInfo.getRetainedMemorySize());
+    int expireTimeSeconds = conf.shuffleIndexCacheExpireTimeSeconds();
+    if (expireTimeSeconds > 0) {
+      shuffleIndexCache = cacheBuilder.expireAfterAccess(expireTimeSeconds, 
TimeUnit.SECONDS)

Review Comment:
   A small value of expireTimeSeconds is not what we want, and we can make sure 
it is greater than a fixed value (such as 300s)?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to