oxsean commented on code in PR #13607:
URL: https://github.com/apache/dubbo/pull/13607#discussion_r1451147130
##########
dubbo-common/src/main/java/org/apache/dubbo/common/utils/LRU2Cache.java:
##########
@@ -19,22 +19,23 @@
import java.util.LinkedHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+import java.util.function.Function;
/**
* LRU-2
- * </p>
+ * <p>
* When the data accessed for the first time, add it to history list. If the
size of history list reaches max capacity, eliminate the earliest data (first
in first out).
* When the data already exists in the history list, and be accessed for the
second time, then it will be put into cache.
- *
+ * </p>
* TODO, consider replacing with ConcurrentHashMap to improve performance
under concurrency
*/
public class LRU2Cache<K, V> extends LinkedHashMap<K, V> {
Review Comment:
Ok,只是加了一个computeIfAbsent,这个之前没重写缺了锁
--
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]