Merge branch 'master' of github.com:redisson/redisson

pull/6312/merge
mrniko 1 week ago
commit 42e00302d3

@ -3,6 +3,62 @@ Redisson Releases History
Upgrade to __[Redisson PRO](https://redisson.pro)__ with **advanced features**.
### 21-Feb-2025 - 3.45.0 released
Feature - added `max-size` setting for Quarkus Cache
Feature - `RedissonSpringCacheV2Manager` and `RedissonSpringLocalCachedCacheV2Manager` support maxSize setting
Feature - `RedissonRegionV2Factory` and `RedissonLocalCachedV2RegionFactory` in Hibernate support eviction.max_entries setting
Feature - `RedissonCacheV2` and `RedissonLocalCachedCacheV2` in MyBatis support `maxSize` settings
Feature - `maxSize` setting support by `redisson.caches-v2.*` and `redisson.local-caches-v2.*` cache configurations in Micronaut
Feature - `RMapCacheV2.setMaxSize()` method added
Feature - `RClusteredLocalCachedMapCacheNative` object added with data partitioning, local cache and native eviction
Feature - `RedissonClusteredSpringLocalCachedCacheNativeManager` object added with data partitioning, local cache and native eviction
Feature - added Micronaut `redisson.clustered-local-caches-native.*` cache with data partitioning, local cache and native eviction
Feature - added Hibernate `RedissonClusteredLocalCachedNativeRegionFactory` cache with data partitioning, local cache and native eviction
Feature - added Quarkus `CLUSTERED_LOCALCACHE_NATIVE` cache with data partitioning, local cache and native eviction
Feature - added MyBatis `RedissonClusteredLocalCachedCacheNative` cache with data partitioning, local cache and native eviction
Feature - added JCache implementation with local cache and advanced eviction
Feature - added JCache implementation with local cache and native eviction
Feature - added JCache implementation with data partitioning, local cache and native eviction
Feature - ability to set eviction mode via Spring `CacheConfig` object (thanks to @JKord)
Feature - RBitSet.get(long...) method added (thanks to @seakider)
Feature - RBlockingQueue.pollLastFromAnyWithName() method added (thanks to @seakider)
Feature - getReferenceCount(), getAccessFrequency(), getInternalEncoding() methods added to RObject interface (thanks to @seakider)
Feature - RExecutorService.deregisterWorkers() method added
Feature - `valuesAsync()` and `entrySetAsync` methods added to `RMap` interface (thanks to @seakider)
Improvement - validate PARAMS in `RSearch.search()` method (thanks to @seakider)
Fixed - delete() method doesn't work in non-clustered mode for `RLocalCachedJsonStore`, `RLocalCachedMapCacheV2` objects
Fixed - clustered local cached JCache doesn't use `storeCacheMiss` setting
Fixed - JCache with native and advanced eviction don't work in cluster mode
Fixed - clustered local cached `JCache.put()` method may throw a CROSSLOT error
Fixed - `put()` method of local cached JCache instance may not update local cache
Fixed - `remove()` and `removeAll()` methods of local cached JCache instance don't update the local cache of other instances
Fixed - `putAll()` and `clear()` methods of JCacheV2 may not work
Fixed - `RedissonClusteredSpringCacheNativeManager` properties validation
Fixed - `RedissonSpringLocalCachedCacheV2Manager` properties validation
Fixed - `RedissonSpringLocalCachedCacheNativeManager` can't be created using a yaml configuration file
Fixed - `RedissonSpringLocalCachedCacheNativeManager` throws an `ClassCastException` if cache wasn't defined in the configuration
Fixed - `RLocalCachedMapCache.getAll()` method may return an incorrect result
Fixed - `RLocalCachedMapCacheNative.getAll()` method may return an incorrect result
Fixed - missed implementation of `expireEntriesIfNotSet()`, `expireEntriesIfLess()` and `expireEntriesIfGreater()` methods of RClusteredMapCacheNative
Fixed - missed implementation of `expireEntriesIfLess()` and `expireEntriesIfGreater()` methods of RLocalCachedMapCacheNative
Fixed - `RJsonStore.isExists()` method doesn't work
Fixed - JCacheV2 entry name generation fixed
Fixed - `RMapCacheV2.isExists()` method optimization
Fixed - `RedissonSpringLocalCachedCacheV2Manager` throws an ClassCastException if cache wasn't defined in the configuration
Fixed - `RedissonSpringLocalCachedCacheV2Manager` can't be created using a yaml configuration file
Fixed - `RLocalCachedMapCacheV2`, `RLocalCachedJsonStore`, `RSetV2`, `RSetCacheV2`, `JCacheV2`, `RMapCacheV2` don't work if `useScriptCache = true`
Fixed - LUA error when `RedissonMapCache.putAll(Map)` is invoked with listeners (thanks to @max.huang)
Fixed - `ProtobufCodec` compatibility with the latest protobuf version (thanks to @zzhlhc)
Fixed - `RFairLock` attempt to compare nil with number (thanks to @seakider)
Fixed - incorrect parsing of `PubSubType.UNSUBSCRIBE` command with non-English locale
Fixed - `RRemoteExecutorService` `expiration` sorted set is growing indefinitely (thanks to @seakider)
Fixed - Quarkus shutdown process fails if version 3.18 or higher
Fixed - `notifyUpdate()` and `notifyInvalidate()` methods of `LocalCacheListener` might throw NPE
Fixed - `RBatchRx` may work incorrectly if `useScriptCache = true`
### 27-Jan-2025 - 3.44.0 released
Feature - native eviction implemented for [JCache](https://redisson.org/docs/cache-api-implementations/#local-cache-and-data-partitioning) API

@ -56,7 +56,7 @@ public class RedissonAsyncCache implements AsyncCache<RMap<Object, Object>> {
return map.getAsync(key)
.thenApply(v -> {
if (v != null) {
return Optional.of((T)conversionService.convert(v, ConversionContext.of(requiredType)));
return conversionService.convert(v, ConversionContext.of(requiredType));
}
return Optional.<T>empty();
})

@ -1,5 +1,6 @@
package org.redisson.micronaut;
import io.micronaut.cache.AsyncCache;
import io.micronaut.context.ApplicationContext;
import io.micronaut.inject.qualifiers.Qualifiers;
import org.junit.jupiter.api.Test;
@ -8,6 +9,9 @@ import org.redisson.micronaut.cache.RedissonSyncCache;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import static org.assertj.core.api.Assertions.assertThat;
@ -42,4 +46,29 @@ public class RedissonCacheTest {
assertThat(cache.get(3, Integer.class).isPresent()).isTrue();
}
@Test
public void testAsyncCache() throws ExecutionException, InterruptedException {
Map<String, Object> map = new HashMap<>();
map.put("redisson.threads", "10");
map.put("redisson.single-server-config.address", "redis://127.0.0.1:6379");
map.put("redisson.caches.test.expire-after-write", "3s");
map.put("redisson.caches.test.expire-after-access", "3s");
ApplicationContext ac = ApplicationContext.run(map);
RedissonClient client = ac.getBean(RedissonClient.class);
assertThat(client).isNotNull();
client.getKeys().flushall();
RedissonSyncCache cache = ac.getBean(RedissonSyncCache.class, Qualifiers.byName("test"));
AsyncCache asyncCache = cache.async();
assertThat(asyncCache.get(3, Integer.class).get()).isEqualTo(Optional.empty());
CompletableFuture f = asyncCache.put(3, 4).toCompletableFuture();
f.join();
assertThat(asyncCache.get(3, Integer.class).get()).isEqualTo(Optional.of(4));
}
}

@ -56,7 +56,7 @@ public class RedissonAsyncCache implements AsyncCache<RMap<Object, Object>> {
return map.getAsync(key)
.thenApply(v -> {
if (v != null) {
return Optional.of((T)conversionService.convert(v, ConversionContext.of(requiredType)));
return conversionService.convert(v, ConversionContext.of(requiredType));
}
return Optional.<T>empty();
})

@ -1,5 +1,6 @@
package org.redisson.micronaut;
import io.micronaut.cache.AsyncCache;
import io.micronaut.context.ApplicationContext;
import io.micronaut.inject.qualifiers.Qualifiers;
import org.junit.jupiter.api.Test;
@ -8,6 +9,9 @@ import org.redisson.micronaut.cache.RedissonSyncCache;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import static org.assertj.core.api.Assertions.assertThat;
@ -42,4 +46,29 @@ public class RedissonCacheTest {
assertThat(cache.get(3, Integer.class).isPresent()).isTrue();
}
@Test
public void testAsyncCache() throws ExecutionException, InterruptedException {
Map<String, Object> map = new HashMap<>();
map.put("redisson.threads", "10");
map.put("redisson.single-server-config.address", "redis://127.0.0.1:6379");
map.put("redisson.caches.test.expire-after-write", "3s");
map.put("redisson.caches.test.expire-after-access", "3s");
ApplicationContext ac = ApplicationContext.run(map);
RedissonClient client = ac.getBean(RedissonClient.class);
assertThat(client).isNotNull();
client.getKeys().flushall();
RedissonSyncCache cache = ac.getBean(RedissonSyncCache.class, Qualifiers.byName("test"));
AsyncCache asyncCache = cache.async();
assertThat(asyncCache.get(3, Integer.class).get()).isEqualTo(Optional.empty());
CompletableFuture f = asyncCache.put(3, 4).toCompletableFuture();
f.join();
assertThat(asyncCache.get(3, Integer.class).get()).isEqualTo(Optional.of(4));
}
}

@ -56,7 +56,7 @@ public class RedissonAsyncCache implements AsyncCache<RMap<Object, Object>> {
return map.getAsync(key)
.thenApply(v -> {
if (v != null) {
return Optional.of((T)conversionService.convert(v, ConversionContext.of(requiredType)));
return conversionService.convert(v, ConversionContext.of(requiredType));
}
return Optional.<T>empty();
})

@ -1,5 +1,6 @@
package org.redisson.micronaut;
import io.micronaut.cache.AsyncCache;
import io.micronaut.context.ApplicationContext;
import io.micronaut.inject.qualifiers.Qualifiers;
import org.junit.jupiter.api.Test;
@ -12,6 +13,9 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import static org.assertj.core.api.Assertions.assertThat;
@ -49,6 +53,30 @@ public class RedissonCacheTest {
cache.get(3, Integer.class);
Thread.sleep(2000);
assertThat(cache.get(3, Integer.class).isPresent()).isTrue();
}
@Test
public void testAsyncCache() throws ExecutionException, InterruptedException {
Map<String, Object> map = new HashMap<>();
map.put("redisson.threads", "10");
map.put("redisson.single-server-config.address", "redis://127.0.0.1:" + REDIS.getFirstMappedPort());
map.put("redisson.caches.test.expire-after-write", "10s");
map.put("redisson.caches.test.expire-after-access", "10s");
ApplicationContext ac = ApplicationContext.run(map);
RedissonClient client = ac.getBean(RedissonClient.class);
assertThat(client).isNotNull();
RedissonSyncCache cache = ac.getBean(RedissonSyncCache.class, Qualifiers.byName("test"));
AsyncCache asyncCache = cache.async();
assertThat(asyncCache.get(3, Integer.class).get()).isEqualTo(Optional.empty());
CompletableFuture f = asyncCache.put(3, 4).toCompletableFuture();
f.join();
assertThat(asyncCache.get(3, Integer.class).get()).isEqualTo(Optional.of(4));
}
@Test

@ -1150,6 +1150,7 @@ public class RedissonExecutorService implements RScheduledExecutorService {
MasterSlaveServersConfig config = commandExecutor.getServiceManager().getConfig();
int timeout = (config.getTimeout() + config.getRetryInterval()) * config.getRetryAttempts();
timeout = Math.max(timeout, 1);
String taskName = tasksLatchName + ":" + id;

@ -632,6 +632,10 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
futures.add(slaveUpFuture);
continue;
}
if (config.isSlaveNotUsed()) {
continue;
}
CompletableFuture<Void> slaveUpFuture = entry.addSlave(uri, configEndpointHostName);
CompletableFuture<Void> f = slaveUpFuture.thenAccept(res -> {

Loading…
Cancel
Save