红联Linux门户
Linux帮助

AutoLoadCache 2.11发布,缓存管理方案

发布时间:2016-01-27 16:30:44来源:红联作者:baihuo
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 变得多余了。

软件详情:https://github.com/qiujiayu/AutoLoadCache/releases

来自:开源中国社区
文章评论

共有 0 条评论