jackylee-ch commented on code in PR #7003:
URL: https://github.com/apache/incubator-gluten/pull/7003#discussion_r1730590814


##########
gluten-core/src/main/scala/org/apache/gluten/softaffinity/SoftAffinityManager.scala:
##########
@@ -56,18 +55,34 @@ abstract class AffinityManager extends LogLevelUtil with 
Logging {
 
   lazy val detectDuplicateReading = true
 
-  lazy val maxDuplicateReadingRecords =
-    
GlutenConfig.GLUTEN_SOFT_AFFINITY_MAX_DUPLICATE_READING_RECORDS_DEFAULT_VALUE
+  lazy val duplicateReadingMaxCacheItems =
+    
GlutenConfig.GLUTEN_SOFT_AFFINITY_DUPLICATE_READING_MAX_CACHE_ITEMS_DEFAULT_VALUE
 
   // rdd id -> patition id, file path, start, length
-  val rddPartitionInfoMap = new ConcurrentHashMap[Int, Array[(Int, String, 
Long, Long)]]()
+  val rddPartitionInfoMap: LoadingCache[Integer, Array[(Int, String, Long, 
Long)]] =
+    CacheBuilder
+      .newBuilder()
+      .maximumSize(duplicateReadingMaxCacheItems)

Review Comment:
   I get. However, I still recommend adding a configuration here so that users 
can adjust it as needed, because for long running jobs, such as Spark Connect, 
old values ​​may fill up the cache, and eventually the cache will not work.



-- 
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