Quantcast
Channel: OSCHINA 社区最新新闻
Viewing all articles
Browse latest Browse all 44787

AutoLoadCache 2.11 发布,缓存管理方案

$
0
0
2.11 @CacheDeleteKey中keyType 设置default,以实现向下兼容。

2.10 修改记录:

优化ConcurrentHashMap 使用,将以下代码:

        Boolean isProcessing=null;
        try {
            lock.lock();
            if(null == (isProcessing=processing.get(cacheKey))) {// 为发减少数据层的并发,增加等待机制。
                processing.put(cacheKey, Boolean.TRUE);
            }
        } finally {
            lock.unlock();
        }
        改为:
        Boolean isProcessing=processing.putIfAbsent(cacheKey, Boolean.TRUE);// 为发减少数据层的并发,增加等待机制。

放弃使用 @CacheDeleteKey中keyType, 直接使用它的value值来判断是自定义缓存Key,还是默认生成的缓存Key。所以keyType 变得多余了。



Viewing all articles
Browse latest Browse all 44787

Trending Articles