ErikFang commented on code in PR #2194:
URL:
https://github.com/apache/incubator-celeborn/pull/2194#discussion_r1439542916
##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionFilesSorter.java:
##########
@@ -127,6 +129,13 @@ public PartitionFilesSorter(
ThreadUtils.newDaemonCachedThreadPool(
"worker-file-sorter-execute", conf.partitionSorterThreads(), 120);
+ indexCache =
+ CacheBuilder.newBuilder()
+ .concurrencyLevel(conf.partitionSorterThreads())
+ .expireAfterAccess(conf.partitionSorterIndexExpire(),
TimeUnit.MILLISECONDS)
+ .maximumSize(indexCacheSize)
Review Comment:
how about using maximumWeight() instead and number of ShuffleBlockInfos as
weight?
```suggestion
.maximumWeight(indexCacheSize)
.weigher(new Weigher<String, Map<Integer,
List<ShuffleBlockInfo>>>() {
@Override
public int weigh(String key, Map<Integer,
List<ShuffleBlockInfo>> infoMap) {
return infoMap.values().stream().mapToInt(List::size).sum();
}
})
```
--
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]