RBatchReactive synced with RBatch interface

pull/1547/head
Nikita 7 years ago
parent 9ea442193d
commit 039aef6bdf

@ -109,7 +109,6 @@ public class RedissonReactive implements RedissonReactiveClient {
protected final Config config;
protected final ReferenceCodecProvider codecProvider;
protected final UUID id = UUID.randomUUID();
protected final SemaphorePubSub semaphorePubSub = new SemaphorePubSub();
protected RedissonReactive(Config config) {
@ -220,22 +219,22 @@ public class RedissonReactive implements RedissonReactiveClient {
@Override
public <K, V> RListMultimapReactive<K, V> getListMultimap(String name) {
return new RedissonListMultimapReactive<K, V>(id, commandExecutor, name);
return new RedissonListMultimapReactive<K, V>(commandExecutor, name);
}
@Override
public <K, V> RListMultimapReactive<K, V> getListMultimap(String name, Codec codec) {
return new RedissonListMultimapReactive<K, V>(id, codec, commandExecutor, name);
return new RedissonListMultimapReactive<K, V>(codec, commandExecutor, name);
}
@Override
public <K, V> RSetMultimapReactive<K, V> getSetMultimap(String name) {
return new RedissonSetMultimapReactive<K, V>(id, commandExecutor, name);
return new RedissonSetMultimapReactive<K, V>(commandExecutor, name);
}
@Override
public <K, V> RSetMultimapReactive<K, V> getSetMultimap(String name, Codec codec) {
return new RedissonSetMultimapReactive<K, V>(id, codec, commandExecutor, name);
return new RedissonSetMultimapReactive<K, V>(codec, commandExecutor, name);
}
@Override

@ -33,6 +33,48 @@ import org.redisson.client.codec.Codec;
*/
public interface RBatchReactive {
/**
* Returns geospatial items holder instance by <code>name</code>.
*
* @param <V> type of value
* @param name - name of object
* @return Geo object
*/
<V> RGeoReactive<V> getGeo(String name);
/**
* Returns geospatial items holder instance by <code>name</code>
* using provided codec for geospatial members.
*
* @param <V> type of value
* @param name - name of object
* @param codec - codec for value
* @return Geo object
*/
<V> RGeoReactive<V> getGeo(String name, Codec codec);
/**
* Returns Set based Multimap instance by name.
*
* @param <K> type of key
* @param <V> type of value
* @param name - name of object
* @return SetMultimap object
*/
<K, V> RSetMultimapReactive<K, V> getSetMultimap(String name);
/**
* Returns Set based Multimap instance by name
* using provided codec for both map keys and values.
*
* @param <K> type of key
* @param <V> type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return SetMultimap object
*/
<K, V> RSetMultimapReactive<K, V> getSetMultimap(String name, Codec codec);
/**
* Returns set-based cache instance by <code>name</code>.
* Uses map (value_hash, value) under the hood for minimal memory consumption.
@ -122,6 +164,28 @@ public interface RBatchReactive {
<V> RListReactive<V> getList(String name, Codec codec);
/**
* Returns List based MultiMap instance by name.
*
* @param <K> type of key
* @param <V> type of value
* @param name - name of object
* @return ListMultimap object
*/
<K, V> RListMultimapReactive<K, V> getListMultimap(String name);
/**
* Returns List based MultiMap instance by name
* using provided codec for both map keys and values.
*
* @param <K> type of key
* @param <V> type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return ListMultimap object
*/
<K, V> RListMultimapReactive<K, V> getListMultimap(String name, Codec codec);
/**
* Returns map instance by name.
*
@ -197,6 +261,14 @@ public interface RBatchReactive {
*/
RAtomicLongReactive getAtomicLongReactive(String name);
/**
* Returns atomicDouble instance by name.
*
* @param name - name of object
* @return AtomicDouble object
*/
RAtomicDoubleReactive getAtomicDouble(String name);
/**
* Returns Redis Sorted Set instance by name
*

@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
import org.reactivestreams.Publisher;
import org.redisson.api.BatchOptions;
import org.redisson.api.BatchResult;
import org.redisson.api.RAtomicDoubleReactive;
import org.redisson.api.RAtomicLongReactive;
import org.redisson.api.RBatchReactive;
import org.redisson.api.RBitSetReactive;
@ -27,9 +28,11 @@ import org.redisson.api.RBlockingQueueReactive;
import org.redisson.api.RBucketReactive;
import org.redisson.api.RDequeReactive;
import org.redisson.api.RFuture;
import org.redisson.api.RGeoReactive;
import org.redisson.api.RHyperLogLogReactive;
import org.redisson.api.RKeysReactive;
import org.redisson.api.RLexSortedSetReactive;
import org.redisson.api.RListMultimapReactive;
import org.redisson.api.RListReactive;
import org.redisson.api.RMapCacheReactive;
import org.redisson.api.RMapReactive;
@ -37,6 +40,7 @@ import org.redisson.api.RQueueReactive;
import org.redisson.api.RScoredSortedSetReactive;
import org.redisson.api.RScriptReactive;
import org.redisson.api.RSetCacheReactive;
import org.redisson.api.RSetMultimapReactive;
import org.redisson.api.RSetReactive;
import org.redisson.api.RTopicReactive;
import org.redisson.api.RedissonReactiveClient;
@ -258,4 +262,39 @@ public class RedissonBatchReactive implements RBatchReactive {
this.executorService.enableRedissonReferenceSupport(redissonReactive);
}
@Override
public <V> RGeoReactive<V> getGeo(String name) {
return new RedissonGeoReactive<V>(executorService, name);
}
@Override
public <V> RGeoReactive<V> getGeo(String name, Codec codec) {
return new RedissonGeoReactive<V>(codec, executorService, name);
}
@Override
public <K, V> RSetMultimapReactive<K, V> getSetMultimap(String name) {
return new RedissonSetMultimapReactive<K, V>(executorService, name);
}
@Override
public <K, V> RSetMultimapReactive<K, V> getSetMultimap(String name, Codec codec) {
return new RedissonSetMultimapReactive<K, V>(codec, executorService, name);
}
@Override
public <K, V> RListMultimapReactive<K, V> getListMultimap(String name) {
return new RedissonListMultimapReactive<K, V>(executorService, name);
}
@Override
public <K, V> RListMultimapReactive<K, V> getListMultimap(String name, Codec codec) {
return new RedissonListMultimapReactive<K, V>(codec, executorService, name);
}
@Override
public RAtomicDoubleReactive getAtomicDouble(String name) {
return new RedissonAtomicDoubleReactive(executorService, name);
}
}

@ -16,7 +16,6 @@
package org.redisson.reactive;
import java.util.List;
import java.util.UUID;
import org.reactivestreams.Publisher;
import org.redisson.RedissonListMultimap;
@ -39,11 +38,11 @@ import reactor.fn.Supplier;
*/
public class RedissonListMultimapReactive<K, V> extends RedissonBaseMultimapReactive<K, V> implements RListMultimapReactive<K, V> {
public RedissonListMultimapReactive(UUID id, CommandReactiveExecutor commandExecutor, String name) {
public RedissonListMultimapReactive(CommandReactiveExecutor commandExecutor, String name) {
super(new RedissonListMultimap<K, V>(commandExecutor, name), commandExecutor, name);
}
public RedissonListMultimapReactive(UUID id, Codec codec, CommandReactiveExecutor commandExecutor, String name) {
public RedissonListMultimapReactive(Codec codec, CommandReactiveExecutor commandExecutor, String name) {
super(new RedissonListMultimap<K, V>(codec, commandExecutor, name), codec, commandExecutor, name);
}

@ -16,7 +16,6 @@
package org.redisson.reactive;
import java.util.Set;
import java.util.UUID;
import org.reactivestreams.Publisher;
import org.redisson.RedissonSetMultimap;
@ -39,11 +38,11 @@ import reactor.fn.Supplier;
*/
public class RedissonSetMultimapReactive<K, V> extends RedissonBaseMultimapReactive<K, V> implements RSetMultimapReactive<K, V> {
public RedissonSetMultimapReactive(UUID id, CommandReactiveExecutor commandExecutor, String name) {
public RedissonSetMultimapReactive(CommandReactiveExecutor commandExecutor, String name) {
super(new RedissonSetMultimap<K, V>(commandExecutor, name), commandExecutor, name);
}
public RedissonSetMultimapReactive(UUID id, Codec codec, CommandReactiveExecutor commandExecutor, String name) {
public RedissonSetMultimapReactive(Codec codec, CommandReactiveExecutor commandExecutor, String name) {
super(new RedissonSetMultimap<K, V>(codec, commandExecutor, name), codec, commandExecutor, name);
}

Loading…
Cancel
Save