refactoring

pull/6406/head
Nikita Koksharov 1 week ago
parent f7f0bd8750
commit c836b0a093

@ -70,7 +70,7 @@ public class JCache<K, V> extends RedissonObject implements Cache<K, V>, CacheAs
final JCacheManager cacheManager; final JCacheManager cacheManager;
final JCacheConfiguration<K, V> config; final JCacheConfiguration<K, V> config;
private final ConcurrentMap<CacheEntryListenerConfiguration<K, V>, Map<Integer, String>> listeners = new ConcurrentHashMap<>(); final ConcurrentMap<CacheEntryListenerConfiguration<K, V>, Map<Integer, String>> listeners = new ConcurrentHashMap<>();
final Redisson redisson; final Redisson redisson;
private CacheLoader<K, V> cacheLoader; private CacheLoader<K, V> cacheLoader;
@ -350,7 +350,7 @@ public class JCache<K, V> extends RedissonObject implements Cache<K, V>, CacheAs
+ "end; " + "end; "
+ "return value; ", + "return value; ",
Arrays.<Object>asList(name, getTimeoutSetName(name)), Arrays.asList(name, getTimeoutSetName(name)),
accessTimeout, System.currentTimeMillis(), encodeMapKey(key)); accessTimeout, System.currentTimeMillis(), encodeMapKey(key));
} }
@ -2766,7 +2766,7 @@ public class JCache<K, V> extends RedissonObject implements Cache<K, V>, CacheAs
return oldValue; return oldValue;
} }
private void incrementOldValueListenerCounter(String counterName) { void incrementOldValueListenerCounter(String counterName) {
evalWrite(getRawName(), codec, RedisCommands.EVAL_INTEGER, evalWrite(getRawName(), codec, RedisCommands.EVAL_INTEGER,
"return redis.call('incr', KEYS[1]);", "return redis.call('incr', KEYS[1]);",
Arrays.<Object>asList(counterName)); Arrays.<Object>asList(counterName));
@ -3167,9 +3167,9 @@ public class JCache<K, V> extends RedissonObject implements Cache<K, V>, CacheAs
registerCacheEntryListener(cacheEntryListenerConfiguration, true); registerCacheEntryListener(cacheEntryListenerConfiguration, true);
} }
private JCacheEventCodec.OSType osType; JCacheEventCodec.OSType osType;
private void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration, boolean addToConfig) { void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration, boolean addToConfig) {
if (osType == null) { if (osType == null) {
RFuture<Map<String, String>> serverFuture = commandExecutor.readAsync((String) null, StringCodec.INSTANCE, RedisCommands.INFO_SERVER); RFuture<Map<String, String>> serverFuture = commandExecutor.readAsync((String) null, StringCodec.INSTANCE, RedisCommands.INFO_SERVER);
String os = serverFuture.toCompletableFuture().join().get("os"); String os = serverFuture.toCompletableFuture().join().get("os");
@ -3296,7 +3296,7 @@ public class JCache<K, V> extends RedissonObject implements Cache<K, V>, CacheAs
} }
} }
private void sendSync(boolean sync, List<Object> msg) { void sendSync(boolean sync, List<Object> msg) {
if (sync) { if (sync) {
Object syncId = msg.get(msg.size() - 1); Object syncId = msg.get(msg.size() - 1);
RSemaphore semaphore = redisson.getSemaphore(getSyncName(syncId)); RSemaphore semaphore = redisson.getSemaphore(getSyncName(syncId));

Loading…
Cancel
Save