|
|
|
@ -15,9 +15,14 @@
|
|
|
|
|
*/
|
|
|
|
|
package org.redisson;
|
|
|
|
|
|
|
|
|
|
import org.redisson.api.LocalCachedMapOptions;
|
|
|
|
|
import org.redisson.api.MapCacheOptions;
|
|
|
|
|
import org.redisson.api.MapOptions;
|
|
|
|
|
import org.redisson.api.*;
|
|
|
|
|
import org.redisson.api.options.*;
|
|
|
|
|
import org.redisson.client.codec.Codec;
|
|
|
|
|
import org.redisson.codec.JsonCodec;
|
|
|
|
|
import org.redisson.command.CommandAsyncService;
|
|
|
|
|
import org.redisson.config.Config;
|
|
|
|
|
import org.redisson.config.ConfigSupport;
|
|
|
|
|
import org.redisson.connection.ConnectionManager;
|
|
|
|
@ -25,6 +30,7 @@ import org.redisson.eviction.EvictionScheduler;
|
|
|
|
|
import org.redisson.liveobject.core.RedissonObjectBuilder;
|
|
|
|
|
import org.redisson.reactive.*;
|
|
|
|
|
|
|
|
|
|
import java.time.Duration;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -68,14 +74,6 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
this.writeBehindService = writeBehindService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EvictionScheduler getEvictionScheduler() {
|
|
|
|
|
return evictionScheduler;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ConnectionManager getConnectionManager() {
|
|
|
|
|
return connectionManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CommandReactiveExecutor getCommandExecutor() {
|
|
|
|
|
return commandExecutor;
|
|
|
|
|
}
|
|
|
|
@ -90,9 +88,17 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonStream<K, V>(codec, commandExecutor, name), RStreamReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RStreamReactive<K, V> getStream(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonStream<K, V>(params.getCodec(), ca, params.getName()), RStreamReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RSearchReactive getSearch() {
|
|
|
|
|
return getSearch(null);
|
|
|
|
|
return getSearch((Codec) null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -100,6 +106,13 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSearch(codec, commandExecutor), RSearchReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RSearchReactive getSearch(OptionalOptions options) {
|
|
|
|
|
OptionalParams params = (OptionalParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSearch(params.getCodec(), ca), RSearchReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RGeoReactive<V> getGeo(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonGeo<V>(commandExecutor, name, null),
|
|
|
|
@ -111,17 +124,40 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonGeo<V>(codec, commandExecutor, name, null),
|
|
|
|
|
new RedissonScoredSortedSetReactive<V>(codec, commandExecutor, name), RGeoReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RGeoReactive<V> getGeo(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonGeo<V>(params.getCodec(), ca, params.getName(), null),
|
|
|
|
|
new RedissonScoredSortedSetReactive<V>(params.getCodec(), ca, params.getName()), RGeoReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLockReactive getFairLock(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFairLock(commandExecutor, name), RLockReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLockReactive getFairLock(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFairLock(ca, params.getName()), RLockReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RRateLimiterReactive getRateLimiter(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRateLimiter(commandExecutor, name), RRateLimiterReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RRateLimiterReactive getRateLimiter(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRateLimiter(ca, params.getName()), RRateLimiterReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RBinaryStreamReactive getBinaryStream(String name) {
|
|
|
|
|
RedissonBinaryStream stream = new RedissonBinaryStream(commandExecutor, name);
|
|
|
|
@ -129,26 +165,64 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonBinaryStreamReactive(commandExecutor, stream), RBinaryStreamReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RBinaryStreamReactive getBinaryStream(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
RedissonBinaryStream stream = new RedissonBinaryStream(ca, params.getName());
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, stream,
|
|
|
|
|
new RedissonBinaryStreamReactive(ca, stream), RBinaryStreamReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RSemaphoreReactive getSemaphore(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSemaphore(commandExecutor, name), RSemaphoreReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RSemaphoreReactive getSemaphore(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSemaphore(ca, params.getName()), RSemaphoreReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RPermitExpirableSemaphoreReactive getPermitExpirableSemaphore(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonPermitExpirableSemaphore(commandExecutor, name), RPermitExpirableSemaphoreReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RPermitExpirableSemaphoreReactive getPermitExpirableSemaphore(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonPermitExpirableSemaphore(ca, params.getName()), RPermitExpirableSemaphoreReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RReadWriteLockReactive getReadWriteLock(String name) {
|
|
|
|
|
return new RedissonReadWriteLockReactive(commandExecutor, name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RReadWriteLockReactive getReadWriteLock(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return new RedissonReadWriteLockReactive(ca, params.getName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLockReactive getLock(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLockReactive getLock(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonLock(ca, params.getName()), RLockReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLockReactive getSpinLock(String name) {
|
|
|
|
|
return getSpinLock(name, LockOptions.defaults());
|
|
|
|
@ -166,6 +240,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, lock, RFencedLockReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFencedLockReactive getFencedLock(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonFencedLock lock = new RedissonFencedLock(ca, params.getName());
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, lock, RFencedLockReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLockReactive getMultiLock(RLockReactive... locks) {
|
|
|
|
|
RLock[] ls = Arrays.stream(locks)
|
|
|
|
@ -189,20 +271,37 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(commandExecutor, name), RCountDownLatchReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RCountDownLatchReactive getCountDownLatch(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(ca, params.getName()), RCountDownLatchReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RMapCacheReactive<K, V> getMapCache(String name, Codec codec) {
|
|
|
|
|
RMapCache<K, V> map = new RedissonMapCache<K, V>(codec, evictionScheduler, commandExecutor, name, null, null, null);
|
|
|
|
|
RMapCache<K, V> map = new RedissonMapCache<K, V>(codec, evictionScheduler, commandExecutor, name, null, null, writeBehindService);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, map,
|
|
|
|
|
new RedissonMapCacheReactive<K, V>(map, commandExecutor), RMapCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RMapCacheReactive<K, V> getMapCache(String name) {
|
|
|
|
|
RMapCache<K, V> map = new RedissonMapCache<K, V>(evictionScheduler, commandExecutor, name, null, null, null);
|
|
|
|
|
RMapCache<K, V> map = new RedissonMapCache<K, V>(evictionScheduler, commandExecutor, name, null, null, writeBehindService);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, map,
|
|
|
|
|
new RedissonMapCacheReactive<K, V>(map, commandExecutor), RMapCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RMapCacheReactive<K, V> getMapCache(org.redisson.api.options.MapCacheOptions<K, V> options) {
|
|
|
|
|
MapCacheParams<K, V> params = (MapCacheParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
RMapCache<K, V> map = new RedissonMapCache<>(params.getCodec(), evictionScheduler, ca,
|
|
|
|
|
params.getName(), null, null, writeBehindService);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, map,
|
|
|
|
|
new RedissonMapCacheReactive<K, V>(map, ca), RMapCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RBucketReactive<V> getBucket(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBucket<V>(commandExecutor, name), RBucketReactive.class);
|
|
|
|
@ -213,6 +312,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBucket<V>(codec, commandExecutor, name), RBucketReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RBucketReactive<V> getBucket(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonBucket<V>(params.getCodec(), ca, params.getName()), RBucketReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RBucketsReactive getBuckets() {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBuckets(commandExecutor), RBucketsReactive.class);
|
|
|
|
@ -223,6 +330,13 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBuckets(codec, commandExecutor), RBucketsReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RBucketsReactive getBuckets(OptionalOptions options) {
|
|
|
|
|
OptionalParams params = (OptionalParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBuckets(params.getCodec(), ca), RBucketsReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> List<RBucketReactive<V>> findBuckets(String pattern) {
|
|
|
|
|
RKeys redissonKeys = new RedissonKeys(commandExecutor);
|
|
|
|
@ -242,6 +356,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonJsonBucket<V>(codec, commandExecutor, name), RJsonBucketReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RJsonBucketReactive<V> getJsonBucket(JsonBucketOptions<V> options) {
|
|
|
|
|
JsonBucketParams<V> params = (JsonBucketParams<V>) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonJsonBucket<V>(params.getCodec(), ca, params.getName()), RJsonBucketReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RHyperLogLogReactive<V> getHyperLogLog(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonHyperLogLog<V>(commandExecutor, name), RHyperLogLogReactive.class);
|
|
|
|
@ -252,11 +374,26 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonHyperLogLog<V>(codec, commandExecutor, name), RHyperLogLogReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RHyperLogLogReactive<V> getHyperLogLog(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonHyperLogLog<V>(params.getCodec(), ca, params.getName()), RHyperLogLogReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RIdGeneratorReactive getIdGenerator(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonIdGenerator(commandExecutor, name), RIdGeneratorReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RIdGeneratorReactive getIdGenerator(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonIdGenerator(ca, params.getName()), RIdGeneratorReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RListReactive<V> getList(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonList<V>(commandExecutor, name, null),
|
|
|
|
@ -269,6 +406,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonListReactive<V>(codec, commandExecutor, name), RListReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RListReactive<V> getList(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonList<V>(params.getCodec(), ca, params.getName(), null),
|
|
|
|
|
new RedissonListReactive<V>(params.getCodec(), ca, params.getName()), RListReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RListMultimapReactive<K, V> getListMultimap(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonListMultimap<K, V>(commandExecutor, name),
|
|
|
|
@ -281,6 +426,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonListMultimapReactive<K, V>(codec, commandExecutor, name), RListMultimapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RListMultimapReactive<K, V> getListMultimap(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonListMultimap<K, V>(params.getCodec(), ca, params.getName()),
|
|
|
|
|
new RedissonListMultimapReactive<K, V>(params.getCodec(), ca, params.getName()), RListMultimapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RSetMultimapReactive<K, V> getSetMultimap(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSetMultimap<K, V>(commandExecutor, name),
|
|
|
|
@ -293,6 +446,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonSetMultimapReactive<K, V>(codec, commandExecutor, name, this), RSetMultimapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RSetMultimapReactive<K, V> getSetMultimap(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSetMultimap<K, V>(params.getCodec(), ca, params.getName()),
|
|
|
|
|
new RedissonSetMultimapReactive<K, V>(params.getCodec(), ca, params.getName(), this), RSetMultimapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RListMultimapCacheReactive<K, V> getListMultimapCache(String name) {
|
|
|
|
|
RedissonListMultimapCache<K, V> listMultimap = new RedissonListMultimapCache<>(evictionScheduler, commandExecutor, name);
|
|
|
|
@ -307,6 +468,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonListMultimapCacheReactive<>(listMultimap, commandExecutor), RListMultimapCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RListMultimapCacheReactive<K, V> getListMultimapCache(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
RedissonListMultimapCache<K, V> listMultimap = new RedissonListMultimapCache<>(evictionScheduler, params.getCodec(), ca, params.getName());
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, listMultimap,
|
|
|
|
|
new RedissonListMultimapCacheReactive<>(listMultimap, ca), RListMultimapCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RSetMultimapCacheReactive<K, V> getSetMultimapCache(String name) {
|
|
|
|
|
RedissonSetMultimapCache<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, commandExecutor, name);
|
|
|
|
@ -321,20 +491,38 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonSetMultimapCacheReactive<K, V>(setMultimap, commandExecutor, this), RSetMultimapCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RSetMultimapCacheReactive<K, V> getSetMultimapCache(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
RedissonSetMultimapCache<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, params.getCodec(), ca, params.getName());
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, setMultimap,
|
|
|
|
|
new RedissonSetMultimapCacheReactive<K, V>(setMultimap, ca, this), RSetMultimapCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RMapReactive<K, V> getMap(String name) {
|
|
|
|
|
RedissonMap<K, V> map = new RedissonMap<K, V>(commandExecutor, name, null, null, null);
|
|
|
|
|
RedissonMap<K, V> map = new RedissonMap<K, V>(commandExecutor, name, null, null, writeBehindService);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, map,
|
|
|
|
|
new RedissonMapReactive<K, V>(map, commandExecutor), RMapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RMapReactive<K, V> getMap(String name, Codec codec) {
|
|
|
|
|
RedissonMap<K, V> map = new RedissonMap<K, V>(codec, commandExecutor, name, null, null, null);
|
|
|
|
|
RedissonMap<K, V> map = new RedissonMap<K, V>(codec, commandExecutor, name, null, null, writeBehindService);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, map,
|
|
|
|
|
new RedissonMapReactive<K, V>(map, commandExecutor), RMapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RMapReactive<K, V> getMap(org.redisson.api.options.MapOptions<K, V> options) {
|
|
|
|
|
MapParams<K, V> params = (MapParams<K, V>) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
RedissonMap<K, V> map = new RedissonMap<>(params.getCodec(), ca, params.getName(), null, null, writeBehindService);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, map,
|
|
|
|
|
new RedissonMapReactive<K, V>(map, ca), RMapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RSetReactive<V> getSet(String name) {
|
|
|
|
|
RedissonSet<V> set = new RedissonSet<V>(commandExecutor, name, null);
|
|
|
|
@ -349,6 +537,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonSetReactive<V>(set, this), RSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RSetReactive<V> getSet(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonSet<V> set = new RedissonSet<V>(params.getCodec(), ca, params.getName(), null);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, set,
|
|
|
|
|
new RedissonSetReactive<V>(set, this), RSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RScoredSortedSetReactive<V> getScoredSortedSet(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScoredSortedSet<V>(commandExecutor, name, null),
|
|
|
|
@ -361,6 +558,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonScoredSortedSetReactive<V>(codec, commandExecutor, name), RScoredSortedSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RScoredSortedSetReactive<V> getScoredSortedSet(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScoredSortedSet<V>(params.getCodec(), ca, params.getName(), null),
|
|
|
|
|
new RedissonScoredSortedSetReactive<V>(params.getCodec(), ca, params.getName()), RScoredSortedSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLexSortedSetReactive getLexSortedSet(String name) {
|
|
|
|
|
RedissonLexSortedSet set = new RedissonLexSortedSet(commandExecutor, name, null);
|
|
|
|
@ -369,6 +574,16 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
RLexSortedSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RLexSortedSetReactive getLexSortedSet(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonLexSortedSet set = new RedissonLexSortedSet(ca, params.getName(), null);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, set,
|
|
|
|
|
new RedissonLexSortedSetReactive(set),
|
|
|
|
|
RLexSortedSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RShardedTopicReactive getShardedTopic(String name) {
|
|
|
|
|
RedissonShardedTopic topic = new RedissonShardedTopic(commandExecutor, name);
|
|
|
|
@ -383,6 +598,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonTopicReactive(topic), RShardedTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RShardedTopicReactive getShardedTopic(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonShardedTopic topic = new RedissonShardedTopic(params.getCodec(), ca, params.getName());
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, topic,
|
|
|
|
|
new RedissonTopicReactive(topic), RShardedTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RTopicReactive getTopic(String name) {
|
|
|
|
|
RedissonTopic topic = new RedissonTopic(commandExecutor, name);
|
|
|
|
@ -397,6 +621,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonTopicReactive(topic), RTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RTopicReactive getTopic(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonTopic topic = new RedissonTopic(params.getCodec(), ca, params.getName());
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, topic,
|
|
|
|
|
new RedissonTopicReactive(topic), RTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RReliableTopicReactive getReliableTopic(String name) {
|
|
|
|
|
RedissonReliableTopic topic = new RedissonReliableTopic(commandExecutor, name, null);
|
|
|
|
@ -411,6 +644,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonReliableTopicReactive(topic), RReliableTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RReliableTopicReactive getReliableTopic(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonReliableTopic topic = new RedissonReliableTopic(params.getCodec(), ca, params.getName(), null);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, topic,
|
|
|
|
|
new RedissonReliableTopicReactive(topic), RReliableTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RPatternTopicReactive getPatternTopic(String pattern) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonPatternTopic(commandExecutor, pattern), RPatternTopicReactive.class);
|
|
|
|
@ -421,6 +663,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonPatternTopic(codec, commandExecutor, pattern), RPatternTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RPatternTopicReactive getPatternTopic(PatternTopicOptions options) {
|
|
|
|
|
PatternTopicParams params = (PatternTopicParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonPatternTopic(params.getCodec(), ca, params.getPattern()), RPatternTopicReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RQueueReactive<V> getQueue(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonQueue<V>(commandExecutor, name, null),
|
|
|
|
@ -432,7 +682,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonQueue<V>(codec, commandExecutor, name, null),
|
|
|
|
|
new RedissonListReactive<V>(codec, commandExecutor, name), RQueueReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RQueueReactive<V> getQueue(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonQueue<V>(params.getCodec(), ca, params.getName(), null),
|
|
|
|
|
new RedissonListReactive<V>(params.getCodec(), ca, params.getName()), RQueueReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RRingBufferReactive<V> getRingBuffer(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRingBuffer<V>(commandExecutor, name, null), RRingBufferReactive.class);
|
|
|
|
@ -443,6 +701,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRingBuffer<V>(codec, commandExecutor, name, null), RRingBufferReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RRingBufferReactive<V> getRingBuffer(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonRingBuffer<V>(params.getCodec(), ca, params.getName(), null), RRingBufferReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RBlockingQueueReactive<V> getBlockingQueue(String name) {
|
|
|
|
|
RedissonBlockingQueue<V> queue = new RedissonBlockingQueue<V>(commandExecutor, name, null);
|
|
|
|
@ -457,6 +723,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonBlockingQueueReactive<V>(queue), RBlockingQueueReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RBlockingQueueReactive<V> getBlockingQueue(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonBlockingQueue<V> queue = new RedissonBlockingQueue<V>(params.getCodec(), ca, params.getName(), null);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, queue,
|
|
|
|
|
new RedissonBlockingQueueReactive<V>(queue), RBlockingQueueReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RDequeReactive<V> getDeque(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonDeque<V>(commandExecutor, name, null),
|
|
|
|
@ -469,6 +744,14 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonListReactive<V>(codec, commandExecutor, name), RDequeReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RDequeReactive<V> getDeque(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonDeque<V>(params.getCodec(), ca, params.getName(), null),
|
|
|
|
|
new RedissonListReactive<V>(params.getCodec(), ca, params.getName()), RDequeReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V, L> RTimeSeriesReactive<V, L> getTimeSeries(String name) {
|
|
|
|
|
RTimeSeries<V, L> timeSeries = new RedissonTimeSeries<V, L>(evictionScheduler, commandExecutor, name);
|
|
|
|
@ -483,6 +766,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonTimeSeriesReactive<V, L>(timeSeries, this), RTimeSeriesReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V, L> RTimeSeriesReactive<V, L> getTimeSeries(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RTimeSeries<V, L> timeSeries = new RedissonTimeSeries<>(params.getCodec(), evictionScheduler, ca, params.getName());
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, timeSeries,
|
|
|
|
|
new RedissonTimeSeriesReactive<V, L>(timeSeries, this), RTimeSeriesReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RSetCacheReactive<V> getSetCache(String name) {
|
|
|
|
|
RSetCache<V> set = new RedissonSetCache<V>(evictionScheduler, commandExecutor, name, null);
|
|
|
|
@ -497,16 +789,40 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonSetCacheReactive<V>(set, this), RSetCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RSetCacheReactive<V> getSetCache(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RSetCache<V> set = new RedissonSetCache<V>(params.getCodec(), evictionScheduler, ca, params.getName(), null);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, set,
|
|
|
|
|
new RedissonSetCacheReactive<V>(set, this), RSetCacheReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RAtomicLongReactive getAtomicLong(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonAtomicLong(commandExecutor, name), RAtomicLongReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RAtomicLongReactive getAtomicLong(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor,
|
|
|
|
|
new RedissonAtomicLong(ca, params.getName()), RAtomicLongReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RAtomicDoubleReactive getAtomicDouble(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonAtomicDouble(commandExecutor, name), RAtomicDoubleReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RAtomicDoubleReactive getAtomicDouble(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonAtomicDouble(ca, params.getName()), RAtomicDoubleReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RRemoteService getRemoteService() {
|
|
|
|
|
return getRemoteService("redisson_rs", connectionManager.getServiceManager().getCfg().getCodec());
|
|
|
|
@ -531,11 +847,29 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return new RedissonRemoteService(codec, name, commandExecutor, executorId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RRemoteService getRemoteService(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
String executorId = connectionManager.getServiceManager().getId();
|
|
|
|
|
if (params.getCodec() != null && params.getCodec() != connectionManager.getServiceManager().getCfg().getCodec()) {
|
|
|
|
|
executorId = executorId + ":" + params.getName();
|
|
|
|
|
}
|
|
|
|
|
return new RedissonRemoteService(params.getCodec(), params.getName(), ca, executorId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RBitSetReactive getBitSet(String name) {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBitSet(commandExecutor, name), RBitSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RBitSetReactive getBitSet(CommonOptions options) {
|
|
|
|
|
CommonParams params = (CommonParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBitSet(ca, params.getName()), RBitSetReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFunctionReactive getFunction() {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFuction(commandExecutor), RFunctionReactive.class);
|
|
|
|
@ -546,6 +880,13 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFuction(commandExecutor, codec), RFunctionReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFunctionReactive getFunction(OptionalOptions options) {
|
|
|
|
|
OptionalParams params = (OptionalParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFuction(ca, params.getCodec()), RFunctionReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RScriptReactive getScript() {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScript(commandExecutor), RScriptReactive.class);
|
|
|
|
@ -556,6 +897,13 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScript(commandExecutor, codec), RScriptReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RScriptReactive getScript(OptionalOptions options) {
|
|
|
|
|
OptionalParams params = (OptionalParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScript(ca, params.getCodec()), RScriptReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RBatchReactive createBatch(BatchOptions options) {
|
|
|
|
|
return new RedissonBatchReactive(evictionScheduler, connectionManager, commandExecutor, options);
|
|
|
|
@ -571,6 +919,13 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonKeys(commandExecutor), new RedissonKeysReactive(commandExecutor), RKeysReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RKeysReactive getKeys(KeysOptions options) {
|
|
|
|
|
KeysParams params = (KeysParams) options;
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, new RedissonKeys(ca), new RedissonKeysReactive(ca), RKeysReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Config getConfig() {
|
|
|
|
|
return connectionManager.getServiceManager().getCfg();
|
|
|
|
@ -650,6 +1005,38 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonMapReactive<>(map, commandExecutor), RLocalCachedMapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <K, V> RLocalCachedMapReactive<K, V> getLocalCachedMap(org.redisson.api.options.LocalCachedMapOptions<K, V> options) {
|
|
|
|
|
LocalCachedMapParams<K, V> params = (LocalCachedMapParams) options;
|
|
|
|
|
|
|
|
|
|
LocalCachedMapOptions<K, V> ops = LocalCachedMapOptions.<K, V>defaults()
|
|
|
|
|
.cacheProvider(LocalCachedMapOptions.CacheProvider.valueOf(params.getCacheProvider().toString()))
|
|
|
|
|
.cacheSize(params.getCacheSize())
|
|
|
|
|
.storeMode(LocalCachedMapOptions.StoreMode.valueOf(params.getStoreMode().toString()))
|
|
|
|
|
.evictionPolicy(LocalCachedMapOptions.EvictionPolicy.valueOf(params.getEvictionPolicy().toString()))
|
|
|
|
|
.maxIdle(params.getMaxIdleInMillis())
|
|
|
|
|
.loader(params.getLoader())
|
|
|
|
|
.loaderAsync(params.getLoaderAsync())
|
|
|
|
|
.reconnectionStrategy(LocalCachedMapOptions.ReconnectionStrategy.valueOf(params.getReconnectionStrategy().toString()))
|
|
|
|
|
.storeCacheMiss(params.isStoreCacheMiss())
|
|
|
|
|
.timeToLive(params.getTimeToLiveInMillis())
|
|
|
|
|
.syncStrategy(LocalCachedMapOptions.SyncStrategy.valueOf(params.getSyncStrategy().toString()))
|
|
|
|
|
.useKeyEventsPattern(params.isUseKeyEventsPattern())
|
|
|
|
|
.writer(params.getWriter())
|
|
|
|
|
.writerAsync(params.getWriterAsync())
|
|
|
|
|
.writeMode(MapOptions.WriteMode.valueOf(params.getWriteMode().toString()))
|
|
|
|
|
.writeBehindDelay(params.getWriteBehindDelay())
|
|
|
|
|
.writeBehindBatchSize(params.getWriteBehindBatchSize())
|
|
|
|
|
.writerRetryAttempts(params.getWriteRetryAttempts())
|
|
|
|
|
.writerRetryInterval(Duration.ofMillis(params.getWriteRetryInterval()));
|
|
|
|
|
|
|
|
|
|
CommandReactiveService ca = new CommandReactiveService(commandExecutor, params);
|
|
|
|
|
RMap<K, V> map = new RedissonLocalCachedMap<>(params.getCodec(), ca, params.getName(),
|
|
|
|
|
ops, evictionScheduler, null, writeBehindService);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, map,
|
|
|
|
|
new RedissonMapReactive<>(map, ca), RLocalCachedMapReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RTransactionReactive createTransaction(TransactionOptions options) {
|
|
|
|
|
return new RedissonTransactionReactive(commandExecutor, options);
|
|
|
|
@ -669,6 +1056,15 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonBlockingDequeReactive<V>(deque), RBlockingDequeReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RBlockingDequeReactive<V> getBlockingDeque(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
RedissonBlockingDeque<V> deque = new RedissonBlockingDeque<V>(params.getCodec(), ca, params.getName(), null);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, deque,
|
|
|
|
|
new RedissonBlockingDequeReactive<V>(deque), RBlockingDequeReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RTransferQueueReactive<V> getTransferQueue(String name) {
|
|
|
|
|
String remoteName = RedissonObject.suffixName(name, "remoteService");
|
|
|
|
@ -687,6 +1083,17 @@ public class RedissonReactive implements RedissonReactiveClient {
|
|
|
|
|
new RedissonTransferQueueReactive<V>(queue), RTransferQueueReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <V> RTransferQueueReactive<V> getTransferQueue(PlainOptions options) {
|
|
|
|
|
PlainParams params = (PlainParams) options;
|
|
|
|
|
CommandAsyncService ca = new CommandAsyncService(commandExecutor, params);
|
|
|
|
|
String remoteName = RedissonObject.suffixName(params.getName(), "remoteService");
|
|
|
|
|
RRemoteService service = getRemoteService(remoteName);
|
|
|
|
|
RedissonTransferQueue<V> queue = new RedissonTransferQueue<V>(params.getCodec(), ca, params.getName(), service);
|
|
|
|
|
return ReactiveProxyBuilder.create(commandExecutor, queue,
|
|
|
|
|
new RedissonTransferQueueReactive<V>(queue), RTransferQueueReactive.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getId() {
|
|
|
|
|
return commandExecutor.getServiceManager().getId();
|
|
|
|
|