Exception on RedissonLocalCachedMap.putAll - Change put local logic

Signed-off-by: Le Thanh <huuthanh.qt.spkt@gmail.com>
pull/6297/head
Le Thanh 2 months ago
parent 585c24e58a
commit 3231852f81

@ -727,16 +727,16 @@ public class RedissonLocalCachedMap<K, V> extends RedissonMap<K, V> implements R
params.add(map.size()*2);
byte[][] hashes = new byte[map.size()][];
int i = 0;
Map<K, V> clonedMap = new HashMap<>();
for (java.util.Map.Entry<? extends K, ? extends V> t : map.entrySet()) {
ByteBuf mapKey = encodeMapKey(t.getKey());
ByteBuf mapValue = encodeMapValue(t.getValue());
params.add(mapKey);
params.add(mapValue);
CacheKey cacheKey = localCacheView.toCacheKey(mapKey);
cachePut(cacheKey, t.getKey(), t.getValue());
hashes[i] = cacheKey.getKeyHash();
i++;
clonedMap.put(t.getKey(), t.getValue());
}
ByteBuf msgEncoded = null;
@ -782,12 +782,7 @@ public class RedissonLocalCachedMap<K, V> extends RedissonMap<K, V> implements R
+ "end;",
Arrays.asList(getRawName(), listener.getInvalidationTopicName(), listener.getUpdatesLogName()),
params.toArray());
CompletionStage<Void> f = future.thenApply(res -> {
cacheMap(clonedMap);
return null;
});
return new CompletableFutureWrapper<>(f);
return new CompletableFutureWrapper<>(future);
}
@Override

Loading…
Cancel
Save