提交 cf1404c9 编写于 作者: N Nikita Koksharov

refactoring

上级 3e110e03
......@@ -350,24 +350,6 @@ public class JCache<K, V> extends RedissonObject implements Cache<K, V> {
return getAccessTimeout(System.currentTimeMillis());
}
V load(K key) {
RLock lock = getLockedLock(key);
try {
V value;
if (atomicExecution) {
value = getValue(key);
} else {
value = getValueLocked(key);
}
if (value == null) {
value = loadValue(key);
}
return value;
} finally {
lock.unlock();
}
}
V loadValue(K key) {
V value = null;
try {
......@@ -829,9 +811,9 @@ public class JCache<K, V> extends RedissonObject implements Cache<K, V> {
cacheManager.getStatBean(this).addHits(1);
result.put(entry.getKey(), entry.getValue());
} else {
cacheManager.getStatBean(this).addMisses(1);
if (config.isReadThrough()) {
cacheManager.getStatBean(this).addMisses(1);
V value = load(entry.getKey());
V value = loadValue(entry.getKey());
if (value != null) {
result.put(entry.getKey(), value);
}
......
......@@ -67,7 +67,7 @@ public class JMutableEntry<K, V> implements MutableEntry<K, V> {
if (value != null) {
action = Action.READ;
} else if (isReadThrough) {
value = jCache.load(key);
value = jCache.loadValue(key);
if (value != null) {
action = Action.LOADED;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册