|
|
|
@ -36,7 +36,7 @@ public class ExecutorRouteLRU extends ExecutorRouter {
|
|
|
|
|
* a、accessOrder:ture=访问顺序排序(get/put时排序);false=插入顺序排期;
|
|
|
|
|
* b、removeEldestEntry:新增元素时将会调用,返回true时会删除最老元素;可封装LinkedHashMap并重写该方法,比如定义最大容量,超出是返回true即可实现固定长度的LRU算法;
|
|
|
|
|
*/
|
|
|
|
|
lruItem = new LinkedHashMap<>(16, 0.75f, true);
|
|
|
|
|
lruItem = new LinkedHashMap<String, String>(16, 0.75f, true);
|
|
|
|
|
jobLRUMap.putIfAbsent(jobId, lruItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|