Feature - RListMultimapCacheNative and RSetMultimapCacheNative objects added. Requires Redis 7.4+ #6113

pull/6137/head
Nikita Koksharov 5 months ago
parent f4118308d7
commit e3c015eb19

@ -300,12 +300,32 @@ public class RedissonBatch implements RBatch {
@Override
public <K, V> RMultimapCacheAsync<K, V> getListMultimapCache(String name) {
return new RedissonListMultimapCache<K, V>(evictionScheduler, executorService, name);
return new RedissonListMultimapCache<>(evictionScheduler, executorService, name);
}
@Override
public <K, V> RMultimapCacheAsync<K, V> getListMultimapCache(String name, Codec codec) {
return new RedissonListMultimapCache<K, V>(evictionScheduler, codec, executorService, name);
return new RedissonListMultimapCache<>(evictionScheduler, codec, executorService, name);
}
@Override
public <K, V> RMultimapCacheAsync<K, V> getListMultimapCacheNative(String name) {
return new RedissonListMultimapCacheNative<>(executorService, name);
}
@Override
public <K, V> RMultimapCacheAsync<K, V> getListMultimapCacheNative(String name, Codec codec) {
return new RedissonListMultimapCacheNative<>(codec, executorService, name);
}
@Override
public <K, V> RMultimapCacheAsync<K, V> getSetMultimapCacheNative(String name) {
return new RedissonSetMultimapCacheNative<>(executorService, name);
}
@Override
public <K, V> RMultimapCacheAsync<K, V> getSetMultimapCacheNative(String name, Codec codec) {
return new RedissonSetMultimapCacheNative<>(codec, executorService, name);
}
@Override

@ -452,14 +452,14 @@ public class RedissonRx implements RedissonRxClient {
public <K, V> RListMultimapCacheRx<K, V> getListMultimapCache(String name) {
RedissonListMultimapCache<K, V> listMultimap = new RedissonListMultimapCache<>(evictionScheduler, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheRx.class);
}
@Override
public <K, V> RListMultimapCacheRx<K, V> getListMultimapCache(String name, Codec codec) {
RedissonListMultimapCache<K, V> listMultimap = new RedissonListMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheRx.class);
}
@Override
@ -468,21 +468,21 @@ public class RedissonRx implements RedissonRxClient {
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonListMultimapCache<K, V> listMultimap = new RedissonListMultimapCache<>(evictionScheduler, params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, ce), RListMultimapCacheRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, ce), RListMultimapCacheRx.class);
}
@Override
public <K, V> RListMultimapCacheNativeRx<K, V> getListMultimapCacheNative(String name) {
RedissonListMultimapCacheNative<K, V> listMultimap = new RedissonListMultimapCacheNative<>(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
}
@Override
public <K, V> RListMultimapCacheNativeRx<K, V> getListMultimapCacheNative(String name, Codec codec) {
RedissonListMultimapCacheNative<K, V> listMultimap = new RedissonListMultimapCacheNative<>(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
}
@Override
@ -491,7 +491,7 @@ public class RedissonRx implements RedissonRxClient {
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonListMultimapCacheNative<K, V> listMultimap = new RedissonListMultimapCacheNative<>(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, ce), RListMultimapCacheNativeRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, ce), RListMultimapCacheNativeRx.class);
}
@Override
@ -521,14 +521,14 @@ public class RedissonRx implements RedissonRxClient {
public <K, V> RSetMultimapCacheRx<K, V> getSetMultimapCache(String name) {
RedissonSetMultimapCache<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheRx<K, V>(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
new RedissonSetMultimapRx<K, V>(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
}
@Override
public <K, V> RSetMultimapCacheRx<K, V> getSetMultimapCache(String name, Codec codec) {
RedissonSetMultimapCache<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheRx<K, V>(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
new RedissonSetMultimapRx<K, V>(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
}
@Override
@ -537,21 +537,21 @@ public class RedissonRx implements RedissonRxClient {
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonSetMultimapCache<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheRx<>(setMultimap, ce, this), RSetMultimapCacheRx.class);
new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapCacheRx.class);
}
@Override
public <K, V> RSetMultimapCacheNativeRx<K, V> getSetMultimapCacheNative(String name) {
RedissonSetMultimapCacheNative<K, V> setMultimap = new RedissonSetMultimapCacheNative<>(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
new RedissonSetMultimapRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
}
@Override
public <K, V> RSetMultimapCacheNativeRx<K, V> getSetMultimapCacheNative(String name, Codec codec) {
RedissonSetMultimapCacheNative<K, V> setMultimap = new RedissonSetMultimapCacheNative<>(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
new RedissonSetMultimapRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
}
@Override
@ -560,7 +560,7 @@ public class RedissonRx implements RedissonRxClient {
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonSetMultimapCacheNative<K, V> setMultimap = new RedissonSetMultimapCacheNative<>(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheRx<>(setMultimap, ce, this), RSetMultimapCacheNativeRx.class);
new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapCacheNativeRx.class);
}
@Override

@ -302,7 +302,75 @@ public interface RBatch {
* @return ListMultimapCache object
*/
<K, V> RMultimapCacheAsync<K, V> getListMultimapCache(String name, Codec codec);
/**
* Returns List based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Stores insertion order and allows duplicates for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @return ListMultimapCache object
*/
<K, V> RMultimapCacheAsync<K, V> getListMultimapCacheNative(String name);
/**
* Returns List based Multimap instance by name
* using provided codec for both map keys and values.
* Supports key-entry eviction with a given TTL value.
* Stores insertion order and allows duplicates for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @param codec codec for keys and values
* @return ListMultimapCache object
*/
<K, V> RMultimapCacheAsync<K, V> getListMultimapCacheNative(String name, Codec codec);
/**
* Returns Set based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Doesn't allow duplications for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @return SetMultimapCache object
*/
<K, V> RMultimapCacheAsync<K, V> getSetMultimapCacheNative(String name);
/**
* Returns Set based Multimap instance by name
* using provided codec for both map keys and values.
* Supports key-entry eviction with a given TTL value.
* Doesn't allow duplications for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @param codec codec for keys and values
* @return SetMultimapCache object
*/
<K, V> RMultimapCacheAsync<K, V> getSetMultimapCacheNative(String name, Codec codec);
/**
* Returns map instance by name.
*

@ -184,6 +184,74 @@ public interface RBatchReactive {
*/
<K, V> RMapCacheNativeReactive<K, V> getMapCacheNative(String name, Codec codec);
/**
* Returns List based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Stores insertion order and allows duplicates for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @return ListMultimapCache object
*/
<K, V> RListMultimapCacheReactive<K, V> getListMultimapCacheNative(String name);
/**
* Returns List based Multimap instance by name
* using provided codec for both map keys and values.
* Supports key-entry eviction with a given TTL value.
* Stores insertion order and allows duplicates for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @param codec codec for keys and values
* @return ListMultimapCache object
*/
<K, V> RListMultimapCacheReactive<K, V> getListMultimapCacheNative(String name, Codec codec);
/**
* Returns Set based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Doesn't allow duplications for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @return SetMultimapCache object
*/
<K, V> RSetMultimapCacheReactive<K, V> getSetMultimapCacheNative(String name);
/**
* Returns Set based Multimap instance by name
* using provided codec for both map keys and values.
* Supports key-entry eviction with a given TTL value.
* Doesn't allow duplications for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @param codec codec for keys and values
* @return SetMultimapCache object
*/
<K, V> RSetMultimapCacheReactive<K, V> getSetMultimapCacheNative(String name, Codec codec);
/**
* Returns object holder by name
*

@ -210,6 +210,74 @@ public interface RBatchRx {
*/
<K, V> RMapCacheNativeRx<K, V> getMapCacheNative(String name, Codec codec);
/**
* Returns List based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Stores insertion order and allows duplicates for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @return ListMultimapCache object
*/
<K, V> RListMultimapCacheRx<K, V> getListMultimapCacheNative(String name);
/**
* Returns List based Multimap instance by name
* using provided codec for both map keys and values.
* Supports key-entry eviction with a given TTL value.
* Stores insertion order and allows duplicates for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @param codec codec for keys and values
* @return ListMultimapCache object
*/
<K, V> RListMultimapCacheRx<K, V> getListMultimapCacheNative(String name, Codec codec);
/**
* Returns Set based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Doesn't allow duplications for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @return SetMultimapCache object
*/
<K, V> RSetMultimapCacheRx<K, V> getSetMultimapCacheNative(String name);
/**
* Returns Set based Multimap instance by name
* using provided codec for both map keys and values.
* Supports key-entry eviction with a given TTL value.
* Doesn't allow duplications for values mapped to key.
* <p>
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
* <p>
* Requires <b>Redis 7.4.0 and higher.</b>
*
* @param <K> type of key
* @param <V> type of value
* @param name name of object
* @param codec codec for keys and values
* @return SetMultimapCache object
*/
<K, V> RSetMultimapCacheRx<K, V> getSetMultimapCacheNative(String name, Codec codec);
/**
* Returns object holder by name
*

@ -129,6 +129,34 @@ public class RedissonBatchReactive implements RBatchReactive {
new RedissonMapCacheReactive<K, V>(map, commandExecutor), RMapCacheNativeReactive.class);
}
@Override
public <K, V> RListMultimapCacheReactive<K, V> getListMultimapCacheNative(String name) {
RListMultimap<K, V> map = new RedissonListMultimapCacheNative<>(executorService, name);
return ReactiveProxyBuilder.create(executorService, map,
new RedissonListMultimapCacheReactive<>(map, executorService), RListMultimapCacheReactive.class);
}
@Override
public <K, V> RListMultimapCacheReactive<K, V> getListMultimapCacheNative(String name, Codec codec) {
RListMultimap<K, V> map = new RedissonListMultimapCacheNative<>(codec, executorService, name);
return ReactiveProxyBuilder.create(executorService, map,
new RedissonListMultimapCacheReactive<>(map, executorService), RListMultimapCacheReactive.class);
}
@Override
public <K, V> RSetMultimapCacheReactive<K, V> getSetMultimapCacheNative(String name) {
RSetMultimap<K, V> map = new RedissonSetMultimapCacheNative<>(executorService, name);
return ReactiveProxyBuilder.create(executorService, map,
new RedissonSetMultimapCacheReactive<>(map, executorService, null), RSetMultimapCacheReactive.class);
}
@Override
public <K, V> RSetMultimapCacheReactive<K, V> getSetMultimapCacheNative(String name, Codec codec) {
RSetMultimap<K, V> map = new RedissonSetMultimapCacheNative<>(codec, executorService, name);
return ReactiveProxyBuilder.create(executorService, map,
new RedissonSetMultimapCacheReactive<>(map, executorService, null), RSetMultimapCacheReactive.class);
}
@Override
public <V> RSetReactive<V> getSet(String name) {
RedissonSet<V> set = new RedissonSet<V>(executorService, name, null);

@ -132,6 +132,34 @@ public class RedissonBatchRx implements RBatchRx {
new RedissonMapCacheRx<>(map, commandExecutor), RMapCacheNativeRx.class);
}
@Override
public <K, V> RListMultimapCacheRx<K, V> getListMultimapCacheNative(String name) {
RListMultimap<K, V> listMultimap = new RedissonListMultimapCacheNative<>(executorService, name);
return RxProxyBuilder.create(executorService, listMultimap,
new RedissonListMultimapRx<K, V>(listMultimap, executorService), RListMultimapCacheRx.class);
}
@Override
public <K, V> RListMultimapCacheRx<K, V> getListMultimapCacheNative(String name, Codec codec) {
RListMultimap<K, V> listMultimap = new RedissonListMultimapCacheNative<>(codec, executorService, name);
return RxProxyBuilder.create(executorService, listMultimap,
new RedissonListMultimapRx<K, V>(listMultimap, executorService), RListMultimapCacheRx.class);
}
@Override
public <K, V> RSetMultimapCacheRx<K, V> getSetMultimapCacheNative(String name) {
RSetMultimap<K, V> setMultimap = new RedissonSetMultimapCacheNative<>(executorService, name);
return RxProxyBuilder.create(executorService, setMultimap,
new RedissonSetMultimapRx<>(setMultimap, executorService, null), RSetMultimapCacheRx.class);
}
@Override
public <K, V> RSetMultimapCacheRx<K, V> getSetMultimapCacheNative(String name, Codec codec) {
RSetMultimap<K, V> setMultimap = new RedissonSetMultimapCacheNative<>(codec, executorService, name);
return RxProxyBuilder.create(executorService, setMultimap,
new RedissonSetMultimapRx<>(setMultimap, executorService, null), RSetMultimapCacheRx.class);
}
@Override
public <V> RSetRx<V> getSet(String name) {
RedissonSet<V> set = new RedissonSet<V>(executorService, name, null);
@ -319,16 +347,16 @@ public class RedissonBatchRx implements RBatchRx {
@Override
public <K, V> RSetMultimapCacheRx<K, V> getSetMultimapCache(String name) {
RedissonSetMultimapCache<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, executorService, name);
RSetMultimap<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, executorService, name);
return RxProxyBuilder.create(executorService, setMultimap,
new RedissonSetMultimapCacheRx<K, V>(setMultimap, executorService, null), RSetMultimapCacheRx.class);
new RedissonSetMultimapRx<K, V>(setMultimap, executorService, null), RSetMultimapCacheRx.class);
}
@Override
public <K, V> RSetMultimapCacheRx<K, V> getSetMultimapCache(String name, Codec codec) {
RedissonSetMultimapCache<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, codec, executorService, name);
RSetMultimap<K, V> setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, codec, executorService, name);
return RxProxyBuilder.create(executorService, setMultimap,
new RedissonSetMultimapCacheRx<K, V>(setMultimap, executorService, null), RSetMultimapCacheRx.class);
new RedissonSetMultimapRx<K, V>(setMultimap, executorService, null), RSetMultimapCacheRx.class);
}
@Override
@ -349,14 +377,14 @@ public class RedissonBatchRx implements RBatchRx {
public <K, V> RListMultimapCacheRx<K, V> getListMultimapCache(String name) {
RedissonListMultimapCache<K, V> listMultimap = new RedissonListMultimapCache<>(evictionScheduler, executorService, name);
return RxProxyBuilder.create(executorService, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, executorService), RListMultimapCacheRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, executorService), RListMultimapCacheRx.class);
}
@Override
public <K, V> RListMultimapCacheRx<K, V> getListMultimapCache(String name, Codec codec) {
RedissonListMultimapCache<K, V> listMultimap = new RedissonListMultimapCache<>(evictionScheduler, codec, executorService, name);
return RxProxyBuilder.create(executorService, listMultimap,
new RedissonListMultimapCacheRx<K, V>(listMultimap, executorService), RListMultimapCacheRx.class);
new RedissonListMultimapRx<K, V>(listMultimap, executorService), RListMultimapCacheRx.class);
}
@Override

@ -1,43 +0,0 @@
/**
* Copyright (c) 2013-2024 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.rx;
import org.redisson.RedissonList;
import org.redisson.api.RListMultimap;
import org.redisson.api.RListRx;
/**
*
* @author Marnix Kammer
*
* @param <K> key type
* @param <V> value type
*/
public class RedissonListMultimapCacheRx<K, V> {
private final RListMultimap<K, V> instance;
private final CommandRxExecutor commandExecutor;
public RedissonListMultimapCacheRx(RListMultimap<K, V> instance, CommandRxExecutor commandExecutor) {
this.instance = instance;
this.commandExecutor = commandExecutor;
}
public RListRx<V> get(K key) {
RedissonList<V> list = (RedissonList<V>) instance.get(key);
return RxProxyBuilder.create(commandExecutor, list, new RedissonListRx<>(list), RListRx.class);
}
}

@ -16,7 +16,7 @@
package org.redisson.rx;
import org.redisson.RedissonList;
import org.redisson.RedissonListMultimap;
import org.redisson.api.RListMultimap;
import org.redisson.api.RListRx;
/**
@ -29,9 +29,9 @@ import org.redisson.api.RListRx;
public class RedissonListMultimapRx<K, V> {
private final CommandRxExecutor commandExecutor;
private final RedissonListMultimap<K, V> instance;
private final RListMultimap<K, V> instance;
public RedissonListMultimapRx(RedissonListMultimap<K, V> instance, CommandRxExecutor commandExecutor) {
public RedissonListMultimapRx(RListMultimap<K, V> instance, CommandRxExecutor commandExecutor) {
this.instance = instance;
this.commandExecutor = commandExecutor;
}

@ -1,47 +0,0 @@
/**
* Copyright (c) 2013-2024 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.rx;
import org.redisson.RedissonSet;
import org.redisson.api.RSetMultimap;
import org.redisson.api.RSetRx;
import org.redisson.api.RedissonRxClient;
/**
*
* @author Marnix Kammer
*
* @param <K> key type
* @param <V> value type
*/
public class RedissonSetMultimapCacheRx<K, V> {
private final RSetMultimap<K, V> instance;
private final CommandRxExecutor commandExecutor;
private final RedissonRxClient redisson;
public RedissonSetMultimapCacheRx(RSetMultimap<K, V> instance, CommandRxExecutor commandExecutor,
RedissonRxClient redisson) {
this.instance = instance;
this.redisson = redisson;
this.commandExecutor = commandExecutor;
}
public RSetRx<V> get(K key) {
RedissonSet<V> set = (RedissonSet<V>) instance.get(key);
return RxProxyBuilder.create(commandExecutor, set, new RedissonSetRx<>(set, redisson), RSetRx.class);
}
}

@ -16,7 +16,7 @@
package org.redisson.rx;
import org.redisson.RedissonSet;
import org.redisson.RedissonSetMultimap;
import org.redisson.api.RSetMultimap;
import org.redisson.api.RSetRx;
import org.redisson.api.RedissonRxClient;
@ -31,9 +31,9 @@ public class RedissonSetMultimapRx<K, V> {
private final RedissonRxClient redisson;
private final CommandRxExecutor commandExecutor;
private final RedissonSetMultimap<K, V> instance;
private final RSetMultimap<K, V> instance;
public RedissonSetMultimapRx(RedissonSetMultimap<K, V> instance, CommandRxExecutor commandExecutor, RedissonRxClient redisson) {
public RedissonSetMultimapRx(RSetMultimap<K, V> instance, CommandRxExecutor commandExecutor, RedissonRxClient redisson) {
this.instance = instance;
this.redisson = redisson;
this.commandExecutor = commandExecutor;

Loading…
Cancel
Save