Skip to content

Commit

Permalink
[collector]feature:add GlobalConnectionCache
Browse files Browse the repository at this point in the history
  • Loading branch information
doveLin0818 committed Dec 26, 2024
1 parent ea9bfd3 commit 4b733cb
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ public class GlobalConnectionCache {
*/
private static final int CACHE_TIME_LENGTH = 2;

/**
* cacheMap max size,ConcurrentLinkedHashMap default LRU
*/
private static final int MAX_CACHE_SIZE = 1000;

/**
* Cache timeout map
Expand All @@ -65,7 +61,7 @@ public class GlobalConnectionCache {
*/
private GlobalConnectionCache() {
cacheMap = new ConcurrentLinkedHashMap.Builder<Object, AbstractConnection<?>>()
.maximumWeightedCapacity(MAX_CACHE_SIZE)
.maximumWeightedCapacity(Integer.MAX_VALUE)
.listener((key, value) -> {
timeoutMap.remove(key);
try {
Expand Down

0 comments on commit 4b733cb

Please sign in to comment.