zhli1142015 commented on code in PR #7003:
URL: https://github.com/apache/incubator-gluten/pull/7003#discussion_r1730826341
##########
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 think the default eviction behavior is least recently used eviction, which
match the expected behavior, we don't need additional settings to ensure it.

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