Feature - RJsonBucket object added. #4319

pull/4344/head
Nikita Koksharov 3 years ago
parent 9cb1e76389
commit c2c6eaa90d

@ -17,6 +17,7 @@ package org.redisson;
import org.redisson.api.*;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
import org.redisson.command.CommandAsyncExecutor;
import org.redisson.command.CommandBatchService;
import org.redisson.eviction.EvictionScheduler;
@ -47,6 +48,11 @@ public class RedissonBatch implements RBatch {
return new RedissonBucket<V>(codec, executorService, name);
}
@Override
public <V> RJsonBucket<V> getJsonBucket(String name, JsonCodec<V> codec) {
return new RedissonJsonBucket<>(codec, executorService, name);
}
@Override
public <V> RHyperLogLogAsync<V> getHyperLogLog(String name) {
return new RedissonHyperLogLog<V>(executorService, name);

@ -17,6 +17,7 @@ package org.redisson.api;
import org.redisson.client.RedisException;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
/**
* Interface for using Redis pipeline feature.
@ -190,6 +191,18 @@ public interface RBatch {
<V> RBucketAsync<V> getBucket(String name, Codec codec);
/**
* Returns JSON data holder instance by name using provided codec.
*
* @see org.redisson.codec.JacksonCodec
*
* @param <V> type of value
* @param name name of object
* @param codec codec for values
* @return JsonBucket object
*/
<V> RJsonBucket<V> getJsonBucket(String name, JsonCodec<V> codec);
/**
* Returns HyperLogLog object
*

@ -16,6 +16,7 @@
package org.redisson.api;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
import reactor.core.publisher.Mono;
/**
@ -166,6 +167,18 @@ public interface RBatchReactive {
<V> RBucketReactive<V> getBucket(String name, Codec codec);
/**
* Returns JSON data holder instance by name using provided codec.
*
* @see org.redisson.codec.JacksonCodec
*
* @param <V> type of value
* @param name name of object
* @param codec codec for values
* @return JsonBucket object
*/
<V> RJsonBucketReactive<V> getJsonBucket(String name, JsonCodec<V> codec);
/**
* Returns HyperLogLog object by name
*

@ -18,6 +18,7 @@ package org.redisson.api;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Maybe;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
/**
* RxJava2 interface for Redis pipeline feature.
@ -192,6 +193,18 @@ public interface RBatchRx {
<V> RBucketRx<V> getBucket(String name, Codec codec);
/**
* Returns JSON data holder instance by name using provided codec.
*
* @see org.redisson.codec.JacksonCodec
*
* @param <V> type of value
* @param name name of object
* @param codec codec for values
* @return JsonBucket object
*/
<V> RJsonBucketRx<V> getJsonBucket(String name, JsonCodec<V> codec);
/**
* Returns HyperLogLog object by name
*

@ -18,6 +18,7 @@ package org.redisson.reactive;
import org.redisson.*;
import org.redisson.api.*;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
import org.redisson.connection.ConnectionManager;
import org.redisson.eviction.EvictionScheduler;
import reactor.core.publisher.Mono;
@ -59,6 +60,11 @@ public class RedissonBatchReactive implements RBatchReactive {
return ReactiveProxyBuilder.create(executorService, new RedissonBucket<V>(codec, executorService, name), RBucketReactive.class);
}
@Override
public <V> RJsonBucketReactive<V> getJsonBucket(String name, JsonCodec<V> codec) {
return ReactiveProxyBuilder.create(executorService, new RedissonJsonBucket<>(codec, executorService, name), RJsonBucketReactive.class);
}
@Override
public <V> RHyperLogLogReactive<V> getHyperLogLog(String name) {
return ReactiveProxyBuilder.create(executorService, new RedissonHyperLogLog<V>(executorService, name), RHyperLogLogReactive.class);

@ -20,6 +20,7 @@ import io.reactivex.rxjava3.core.Maybe;
import org.redisson.*;
import org.redisson.api.*;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
import org.redisson.connection.ConnectionManager;
import org.redisson.eviction.EvictionScheduler;
@ -60,6 +61,11 @@ public class RedissonBatchRx implements RBatchRx {
return RxProxyBuilder.create(executorService, new RedissonBucket<V>(codec, executorService, name), RBucketRx.class);
}
@Override
public <V> RJsonBucketRx<V> getJsonBucket(String name, JsonCodec<V> codec) {
return RxProxyBuilder.create(executorService, new RedissonJsonBucket<V>(codec, executorService, name), RJsonBucketRx.class);
}
@Override
public <V> RHyperLogLogRx<V> getHyperLogLog(String name) {
return RxProxyBuilder.create(executorService, new RedissonHyperLogLog<V>(executorService, name), RHyperLogLogRx.class);

Loading…
Cancel
Save