Deprecated methods were removed

pull/2504/head
Nikita Koksharov 5 years ago
parent bb3284ce91
commit 66205e9e77

@ -15,36 +15,7 @@
*/
package org.redisson;
import java.util.concurrent.TimeUnit;
import org.redisson.api.BatchOptions;
import org.redisson.api.BatchResult;
import org.redisson.api.RAtomicDoubleAsync;
import org.redisson.api.RAtomicLongAsync;
import org.redisson.api.RBatch;
import org.redisson.api.RBitSetAsync;
import org.redisson.api.RBlockingDequeAsync;
import org.redisson.api.RBlockingQueueAsync;
import org.redisson.api.RBucketAsync;
import org.redisson.api.RDequeAsync;
import org.redisson.api.RFuture;
import org.redisson.api.RGeoAsync;
import org.redisson.api.RHyperLogLogAsync;
import org.redisson.api.RKeysAsync;
import org.redisson.api.RLexSortedSetAsync;
import org.redisson.api.RListAsync;
import org.redisson.api.RMapAsync;
import org.redisson.api.RMapCacheAsync;
import org.redisson.api.RMultimapAsync;
import org.redisson.api.RMultimapCacheAsync;
import org.redisson.api.RQueueAsync;
import org.redisson.api.RScoredSortedSetAsync;
import org.redisson.api.RScript;
import org.redisson.api.RScriptAsync;
import org.redisson.api.RSetAsync;
import org.redisson.api.RSetCacheAsync;
import org.redisson.api.RStreamAsync;
import org.redisson.api.RTopicAsync;
import org.redisson.api.*;
import org.redisson.client.codec.Codec;
import org.redisson.command.CommandBatchService;
import org.redisson.connection.ConnectionManager;
@ -233,42 +204,6 @@ public class RedissonBatch implements RBatch {
return new RedissonSetCache<V>(codec, evictionScheduler, executorService, name, null);
}
@Override
public RBatch syncSlaves(int slaves, long timeout, TimeUnit unit) {
options.syncSlaves(slaves, timeout, unit);
return this;
}
@Override
public RBatch atomic() {
options.atomic();
return this;
}
@Override
public RBatch skipResult() {
options.skipResult();
return this;
}
@Override
public RBatch retryAttempts(int retryAttempts) {
options.retryAttempts(retryAttempts);
return this;
}
@Override
public RBatch retryInterval(long retryInterval, TimeUnit unit) {
options.retryInterval(retryInterval, unit);
return this;
}
@Override
public RBatch timeout(long timeout, TimeUnit unit) {
options.responseTimeout(timeout, unit);
return this;
}
@Override
public BatchResult<?> execute() {
return executorService.execute(BatchOptions.defaults());

@ -192,16 +192,6 @@ public class RedissonKeys implements RKeys {
return commandExecutor.readRandomAsync(StringCodec.INSTANCE, RedisCommands.RANDOM_KEY);
}
@Override
public Collection<String> findKeysByPattern(String pattern) {
return commandExecutor.get(findKeysByPatternAsync(pattern));
}
@Override
public RFuture<Collection<String>> findKeysByPatternAsync(String pattern) {
return commandExecutor.readAllAsync(RedisCommands.KEYS, pattern);
}
@Override
public long deleteByPattern(String pattern) {
return commandExecutor.get(deleteByPatternAsync(pattern));

@ -15,13 +15,7 @@
*/
package org.redisson;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import io.netty.buffer.ByteBuf;
import org.redisson.api.RFuture;
import org.redisson.api.RScript;
import org.redisson.client.codec.Codec;
@ -30,7 +24,8 @@ import org.redisson.client.protocol.RedisCommand;
import org.redisson.client.protocol.RedisCommands;
import org.redisson.command.CommandAsyncExecutor;
import io.netty.buffer.ByteBuf;
import java.io.IOException;
import java.util.*;
/**
*
@ -87,70 +82,31 @@ public class RedissonScript implements RScript {
return eval(mode, luaScript, returnType, Collections.emptyList());
}
@Override
public <R> R eval(Mode mode, Codec codec, String luaScript, ReturnType returnType) {
RedissonScript script = new RedissonScript(commandExecutor, codec);
return script.eval(mode, luaScript, returnType);
}
@Override
public <R> R eval(Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values) {
return eval(null, mode, luaScript, returnType, keys, values);
}
@Override
public <R> R eval(Mode mode, Codec codec, String luaScript, ReturnType returnType, List<Object> keys, Object... values) {
RedissonScript script = new RedissonScript(commandExecutor, codec);
return script.eval(mode, luaScript, returnType, keys, values);
}
@Override
public <R> RFuture<R> evalAsync(Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values) {
return evalAsync(null, mode, luaScript, returnType, keys, values);
}
@Override
public <R> RFuture<R> evalAsync(Mode mode, Codec codec, String luaScript, ReturnType returnType, List<Object> keys, Object... values) {
RedissonScript script = new RedissonScript(commandExecutor, codec);
return script.evalAsync(mode, luaScript, returnType, keys, values);
}
@Override
public <R> RFuture<R> evalAsync(String key, Mode mode, Codec codec, String luaScript, ReturnType returnType, List<Object> keys, Object... values) {
RedissonScript script = new RedissonScript(commandExecutor, codec);
return script.evalAsync(key, mode, luaScript, returnType, keys, values);
}
@Override
public <R> R evalSha(Mode mode, String shaDigest, ReturnType returnType) {
return evalSha(null, mode, shaDigest, returnType, Collections.emptyList());
}
@Override
public <R> R evalSha(Mode mode, Codec codec, String shaDigest, ReturnType returnType) {
return evalSha(mode, codec, shaDigest, returnType, Collections.emptyList());
}
@Override
public <R> R evalSha(Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values) {
return evalSha(null, mode, shaDigest, returnType, keys, values);
}
@Override
public <R> R evalSha(Mode mode, Codec codec, String shaDigest, ReturnType returnType, List<Object> keys, Object... values) {
return (R) commandExecutor.get(evalShaAsync(null, mode, codec, shaDigest, returnType, keys, values));
}
@Override
public <R> RFuture<R> evalShaAsync(Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values) {
return evalShaAsync(null, mode, codec, shaDigest, returnType, keys, values);
}
@Override
public <R> RFuture<R> evalShaAsync(Mode mode, Codec codec, String shaDigest, ReturnType returnType, List<Object> keys, Object... values) {
return evalShaAsync(null, mode, codec, shaDigest, returnType, keys, values);
}
public <R> RFuture<R> evalShaAsync(String key, Mode mode, Codec codec, String shaDigest, ReturnType returnType, List<Object> keys, Object... values) {
RedissonScript script = new RedissonScript(commandExecutor, codec);
return script.evalShaAsync(key, mode, shaDigest, returnType, keys, values);
@ -231,19 +187,9 @@ public class RedissonScript implements RScript {
return evalShaAsync(null, mode, codec, shaDigest, returnType, Collections.emptyList());
}
@Override
public <R> RFuture<R> evalShaAsync(Mode mode, Codec codec, String shaDigest, ReturnType returnType) {
return evalShaAsync(null, mode, codec, shaDigest, returnType, Collections.emptyList());
}
@Override
public <R> RFuture<R> evalAsync(Mode mode, String luaScript, ReturnType returnType) {
return evalAsync(null, mode, codec, luaScript, returnType, Collections.emptyList());
}
@Override
public <R> RFuture<R> evalAsync(Mode mode, Codec codec, String luaScript, ReturnType returnType) {
return evalAsync(null, mode, codec, luaScript, returnType, Collections.emptyList());
return evalAsync(null, mode, luaScript, returnType, Collections.emptyList());
}
private List<Object> encode(Collection<?> values, Codec codec) {

@ -161,16 +161,6 @@ public final class BatchOptions {
return syncSlaves;
}
/**
* Use {@link #executionMode(ExecutionMode)} setting instead
*
*/
@Deprecated
public BatchOptions atomic() {
executionMode = ExecutionMode.IN_MEMORY_ATOMIC;
return this;
}
/**
* Inform Redis not to send reply. This allows to save network traffic for commands with batch with big response.
* <p>

@ -431,40 +431,4 @@ public interface RBatch {
*/
RFuture<BatchResult<?>> executeAsync();
/*
* Use BatchOptions#atomic
*/
@Deprecated
RBatch atomic();
/*
* Use BatchOptions#skipResult
*/
@Deprecated
RBatch skipResult();
/*
* Use BatchOptions#syncSlaves
*/
@Deprecated
RBatch syncSlaves(int slaves, long timeout, TimeUnit unit);
/*
* Use BatchOptions#responseTimeout
*/
@Deprecated
RBatch timeout(long timeout, TimeUnit unit);
/*
* Use BatchOptions#retryInterval
*/
@Deprecated
RBatch retryInterval(long retryInterval, TimeUnit unit);
/*
* Use BatchOptions#retryAttempts
*/
@Deprecated
RBatch retryAttempts(int retryAttempts);
}

@ -15,10 +15,7 @@
*/
package org.redisson.api;
import java.util.concurrent.TimeUnit;
import org.redisson.client.codec.Codec;
import reactor.core.publisher.Mono;
/**
@ -368,40 +365,4 @@ public interface RBatchReactive {
*/
Mono<BatchResult<?>> execute();
/*
* Use BatchOptions#atomic
*/
@Deprecated
RBatchReactive atomic();
/*
* Use BatchOptions#skipResult
*/
@Deprecated
RBatchReactive skipResult();
/*
* Use BatchOptions#syncSlaves
*/
@Deprecated
RBatchReactive syncSlaves(int slaves, long timeout, TimeUnit unit);
/*
* Use BatchOptions#responseTimeout
*/
@Deprecated
RBatchReactive timeout(long timeout, TimeUnit unit);
/*
* Use BatchOptions#retryInterval
*/
@Deprecated
RBatchReactive retryInterval(long retryInterval, TimeUnit unit);
/*
* Use BatchOptions#retryAttempts
*/
@Deprecated
RBatchReactive retryAttempts(int retryAttempts);
}

@ -368,40 +368,4 @@ public interface RBatchRx {
*/
Maybe<BatchResult<?>> execute();
/*
* Use BatchOptions#atomic
*/
@Deprecated
RBatchRx atomic();
/*
* Use BatchOptions#skipResult
*/
@Deprecated
RBatchRx skipResult();
/*
* Use BatchOptions#syncSlaves
*/
@Deprecated
RBatchRx syncSlaves(int slaves, long timeout, TimeUnit unit);
/*
* Use BatchOptions#responseTimeout
*/
@Deprecated
RBatchRx timeout(long timeout, TimeUnit unit);
/*
* Use BatchOptions#retryInterval
*/
@Deprecated
RBatchRx retryInterval(long retryInterval, TimeUnit unit);
/*
* Use BatchOptions#retryAttempts
*/
@Deprecated
RBatchRx retryAttempts(int retryAttempts);
}

@ -15,7 +15,6 @@
*/
package org.redisson.api;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
@ -263,12 +262,6 @@ public interface RKeys extends RKeysAsync {
*/
String randomKey();
/*
* Use getKeysByPattern method instead
*/
@Deprecated
Collection<String> findKeysByPattern(String pattern);
/**
* Delete multiple objects by a key pattern.
* <p>

@ -15,7 +15,6 @@
*/
package org.redisson.api;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
/**
@ -158,12 +157,6 @@ public interface RKeysAsync {
*/
RFuture<String> randomKeyAsync();
/*
* Use getKeysByPattern method instead
*/
@Deprecated
RFuture<Collection<String>> findKeysByPatternAsync(String pattern);
/**
* Delete multiple objects by a key pattern.
* <p>

@ -209,9 +209,6 @@ public interface RKeysRx {
*/
Single<Integer> getSlot(String key);
@Deprecated
Single<Collection<String>> findKeysByPattern(String pattern);
/**
* Get random key
*

@ -15,12 +15,11 @@
*/
package org.redisson.api;
import java.util.List;
import org.redisson.client.codec.Codec;
import org.redisson.client.protocol.RedisCommand;
import org.redisson.client.protocol.RedisCommands;
import java.util.List;
/**
* Interface for Redis Script feature
*
@ -79,12 +78,6 @@ public interface RScript extends RScriptAsync {
*/
<R> R evalSha(String key, Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> R evalSha(Mode mode, Codec codec, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
/**
* Executes Lua script stored in Redis scripts cache by SHA-1 digest
*
@ -96,12 +89,6 @@ public interface RScript extends RScriptAsync {
*/
<R> R evalSha(Mode mode, String shaDigest, ReturnType returnType);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> R evalSha(Mode mode, Codec codec, String shaDigest, ReturnType returnType);
/**
* Executes Lua script
*
@ -129,12 +116,6 @@ public interface RScript extends RScriptAsync {
*/
<R> R eval(Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> R eval(Mode mode, Codec codec, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
/**
* Executes Lua script
*
@ -146,12 +127,6 @@ public interface RScript extends RScriptAsync {
*/
<R> R eval(Mode mode, String luaScript, ReturnType returnType);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> R eval(Mode mode, Codec codec, String luaScript, ReturnType returnType);
/**
* Loads Lua script into Redis scripts cache and returns its SHA-1 digest
*

@ -15,11 +15,10 @@
*/
package org.redisson.api;
import java.util.List;
import org.redisson.api.RScript.Mode;
import org.redisson.api.RScript.ReturnType;
import org.redisson.client.codec.Codec;
import java.util.List;
/**
* Async interface for Redis Script feature
@ -49,12 +48,6 @@ public interface RScriptAsync {
*/
<R> RFuture<R> evalShaAsync(Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> RFuture<R> evalShaAsync(Mode mode, Codec codec, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
/**
* Executes Lua script stored in Redis scripts cache by SHA-1 digest
*
@ -69,12 +62,6 @@ public interface RScriptAsync {
*/
<R> RFuture<R> evalShaAsync(String key, Mode mode, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> RFuture<R> evalShaAsync(String key, Mode mode, Codec codec, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
/**
* Executes Lua script stored in Redis scripts cache by SHA-1 digest
*
@ -85,12 +72,6 @@ public interface RScriptAsync {
* @return result object
*/
<R> RFuture<R> evalShaAsync(Mode mode, String shaDigest, ReturnType returnType);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> RFuture<R> evalShaAsync(Mode mode, Codec codec, String shaDigest, ReturnType returnType);
/**
* Executes Lua script
@ -104,18 +85,6 @@ public interface RScriptAsync {
* @return result object
*/
<R> RFuture<R> evalAsync(Mode mode, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> RFuture<R> evalAsync(Mode mode, Codec codec, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> RFuture<R> evalAsync(String key, Mode mode, Codec codec, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
/**
* Executes Lua script
@ -142,12 +111,6 @@ public interface RScriptAsync {
*/
<R> RFuture<R> evalAsync(Mode mode, String luaScript, ReturnType returnType);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> RFuture<R> evalAsync(Mode mode, Codec codec, String luaScript, ReturnType returnType);
/**
* Loads Lua script into Redis scripts cache and returns its SHA-1 digest
*

@ -15,14 +15,12 @@
*/
package org.redisson.api;
import java.util.List;
import org.redisson.api.RScript.Mode;
import org.redisson.api.RScript.ReturnType;
import org.redisson.client.codec.Codec;
import reactor.core.publisher.Mono;
import java.util.List;
/**
* Reactive interface for Redis Script feature
*
@ -136,29 +134,5 @@ public interface RScriptReactive {
* @return void
*/
Mono<Void> scriptKill();
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> Mono<R> evalSha(Mode mode, Codec codec, String shaDigest, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> Mono<R> evalSha(Mode mode, Codec codec, String shaDigest, ReturnType returnType);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> Mono<R> eval(Mode mode, Codec codec, String luaScript, ReturnType returnType, List<Object> keys, Object... values);
/*
* Use getScript(Codec) instead
*/
@Deprecated
<R> Mono<R> eval(Mode mode, Codec codec, String luaScript, ReturnType returnType);
}

@ -94,7 +94,7 @@ public final class WorkerOptions {
}
/**
* Defines task timeout since moment of task execution start
* Defines task timeout since task execution start moment
*
* @param timeout - timeout of task
* @param unit - time unit

@ -1,137 +0,0 @@
/**
* Copyright (c) 2013-2019 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.client.codec;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder;
import org.redisson.client.protocol.Encoder;
import org.redisson.codec.JsonJacksonCodec;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
/**
* @deprecated Use org.redisson.codec.TypedJsonJacksonCodec instead
*
* @author Nikita Koksharov
* @author Andrej Kazakov
*
*/
public class JsonJacksonMapCodec extends JsonJacksonCodec {
private Class<?> keyClass;
private Class<?> valueClass;
private TypeReference<?> keyTypeReference;
private TypeReference<?> valueTypeReference;
private final Encoder encoder = new Encoder() {
@Override
public ByteBuf encode(Object in) throws IOException {
ByteBuf out = ByteBufAllocator.DEFAULT.buffer();
try {
ByteBufOutputStream os = new ByteBufOutputStream(out);
mapObjectMapper.writeValue((OutputStream) os, in);
return os.buffer();
} catch (IOException e) {
out.release();
throw e;
}
}
};
private final Decoder<Object> valueDecoder = new Decoder<Object>() {
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
if (valueClass != null) {
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), valueClass);
}
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), valueTypeReference);
}
};
private final Decoder<Object> keyDecoder = new Decoder<Object>() {
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
if (keyClass != null) {
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), keyClass);
}
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), keyTypeReference);
}
};
public JsonJacksonMapCodec(Class<?> keyClass, Class<?> valueClass) {
this(null, null, keyClass, valueClass, new ObjectMapper());
}
public JsonJacksonMapCodec(Class<?> keyClass, Class<?> valueClass, ObjectMapper mapper) {
this(null, null, keyClass, valueClass, mapper);
}
public JsonJacksonMapCodec(TypeReference<?> keyTypeReference, TypeReference<?> valueTypeReference) {
this(keyTypeReference, valueTypeReference, null, null, new ObjectMapper());
}
public JsonJacksonMapCodec(TypeReference<?> keyTypeReference, TypeReference<?> valueTypeReference, ObjectMapper mapper) {
this(keyTypeReference, valueTypeReference, null, null, mapper);
}
public JsonJacksonMapCodec(ClassLoader classLoader, JsonJacksonMapCodec codec) {
this(codec.keyTypeReference, codec.valueTypeReference, codec.keyClass, codec.valueClass, createObjectMapper(classLoader, codec.mapObjectMapper.copy()));
}
JsonJacksonMapCodec(TypeReference<?> keyTypeReference, TypeReference<?> valueTypeReference, Class<?> keyClass, Class<?> valueClass, ObjectMapper mapper) {
super(mapper);
this.keyTypeReference = keyTypeReference;
this.valueTypeReference = valueTypeReference;
this.keyClass = keyClass;
this.valueClass = valueClass;
}
@Override
protected void initTypeInclusion(ObjectMapper mapObjectMapper) {
// avoid type inclusion
}
@Override
public Decoder<Object> getMapKeyDecoder() {
return keyDecoder;
}
@Override
public Encoder getMapValueEncoder() {
return encoder;
}
@Override
public Encoder getMapKeyEncoder() {
return encoder;
}
@Override
public Decoder<Object> getMapValueDecoder() {
return valueDecoder;
}
}

@ -15,64 +15,11 @@
*/
package org.redisson.reactive;
import java.util.concurrent.TimeUnit;
import org.redisson.RedissonAtomicDouble;
import org.redisson.RedissonAtomicLong;
import org.redisson.RedissonBitSet;
import org.redisson.RedissonBlockingDeque;
import org.redisson.RedissonBlockingQueue;
import org.redisson.RedissonBucket;
import org.redisson.RedissonDeque;
import org.redisson.RedissonGeo;
import org.redisson.RedissonHyperLogLog;
import org.redisson.RedissonKeys;
import org.redisson.RedissonLexSortedSet;
import org.redisson.RedissonList;
import org.redisson.RedissonListMultimap;
import org.redisson.RedissonMap;
import org.redisson.RedissonMapCache;
import org.redisson.RedissonQueue;
import org.redisson.RedissonScoredSortedSet;
import org.redisson.RedissonScript;
import org.redisson.RedissonSet;
import org.redisson.RedissonSetCache;
import org.redisson.RedissonSetMultimap;
import org.redisson.RedissonStream;
import org.redisson.RedissonTopic;
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;
import org.redisson.api.RBlockingDequeReactive;
import org.redisson.api.RBlockingQueueReactive;
import org.redisson.api.RBucketReactive;
import org.redisson.api.RDequeReactive;
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.RMapCache;
import org.redisson.api.RMapCacheReactive;
import org.redisson.api.RMapReactive;
import org.redisson.api.RQueueReactive;
import org.redisson.api.RScoredSortedSetReactive;
import org.redisson.api.RScriptReactive;
import org.redisson.api.RSetCache;
import org.redisson.api.RSetCacheReactive;
import org.redisson.api.RSetMultimapReactive;
import org.redisson.api.RSetReactive;
import org.redisson.api.RStreamReactive;
import org.redisson.api.RTopicReactive;
import org.redisson.api.RedissonReactiveClient;
import org.redisson.*;
import org.redisson.api.*;
import org.redisson.client.codec.Codec;
import org.redisson.connection.ConnectionManager;
import org.redisson.eviction.EvictionScheduler;
import reactor.core.publisher.Mono;
/**
@ -288,41 +235,6 @@ public class RedissonBatchReactive implements RBatchReactive {
return commandExecutor.reactive(() -> executorService.executeAsync(options));
}
public RBatchReactive atomic() {
options.atomic();
return this;
}
@Override
public RBatchReactive syncSlaves(int slaves, long timeout, TimeUnit unit) {
options.syncSlaves(slaves, timeout, unit);
return this;
}
@Override
public RBatchReactive skipResult() {
options.skipResult();
return this;
}
@Override
public RBatchReactive retryAttempts(int retryAttempts) {
options.retryAttempts(retryAttempts);
return this;
}
@Override
public RBatchReactive retryInterval(long retryInterval, TimeUnit unit) {
options.retryInterval(retryInterval, unit);
return this;
}
@Override
public RBatchReactive timeout(long timeout, TimeUnit unit) {
options.responseTimeout(timeout, unit);
return this;
}
public void enableRedissonReferenceSupport(RedissonReactiveClient redissonReactive) {
this.executorService.enableRedissonReferenceSupport(redissonReactive);
}

@ -15,66 +15,13 @@
*/
package org.redisson.rx;
import java.util.concurrent.TimeUnit;
import org.redisson.RedissonAtomicDouble;
import org.redisson.RedissonAtomicLong;
import org.redisson.RedissonBitSet;
import org.redisson.RedissonBlockingDeque;
import org.redisson.RedissonBlockingQueue;
import org.redisson.RedissonBucket;
import org.redisson.RedissonDeque;
import org.redisson.RedissonGeo;
import org.redisson.RedissonHyperLogLog;
import org.redisson.RedissonKeys;
import org.redisson.RedissonLexSortedSet;
import org.redisson.RedissonList;
import org.redisson.RedissonListMultimap;
import org.redisson.RedissonMap;
import org.redisson.RedissonMapCache;
import org.redisson.RedissonQueue;
import org.redisson.RedissonScoredSortedSet;
import org.redisson.RedissonScript;
import org.redisson.RedissonSet;
import org.redisson.RedissonSetCache;
import org.redisson.RedissonSetMultimap;
import org.redisson.RedissonStream;
import org.redisson.RedissonTopic;
import org.redisson.api.BatchOptions;
import org.redisson.api.BatchResult;
import org.redisson.api.RAtomicDoubleRx;
import org.redisson.api.RAtomicLongRx;
import org.redisson.api.RBatchRx;
import org.redisson.api.RBitSetRx;
import org.redisson.api.RBlockingDequeRx;
import org.redisson.api.RBlockingQueueRx;
import org.redisson.api.RBucketRx;
import org.redisson.api.RDequeRx;
import org.redisson.api.RGeoRx;
import org.redisson.api.RHyperLogLogRx;
import org.redisson.api.RKeysRx;
import org.redisson.api.RLexSortedSetRx;
import org.redisson.api.RListMultimapRx;
import org.redisson.api.RListRx;
import org.redisson.api.RMapCache;
import org.redisson.api.RMapCacheRx;
import org.redisson.api.RMapRx;
import org.redisson.api.RQueueRx;
import org.redisson.api.RScoredSortedSetRx;
import org.redisson.api.RScriptRx;
import org.redisson.api.RSetCache;
import org.redisson.api.RSetCacheRx;
import org.redisson.api.RSetMultimapRx;
import org.redisson.api.RSetRx;
import org.redisson.api.RStreamRx;
import org.redisson.api.RTopicRx;
import org.redisson.api.RedissonRxClient;
import io.reactivex.Maybe;
import org.redisson.*;
import org.redisson.api.*;
import org.redisson.client.codec.Codec;
import org.redisson.connection.ConnectionManager;
import org.redisson.eviction.EvictionScheduler;
import io.reactivex.Maybe;
/**
*
* @author Nikita Koksharov
@ -298,41 +245,6 @@ public class RedissonBatchRx implements RBatchRx {
return commandExecutor.flowable(() -> executorService.executeAsync(options)).singleElement();
}
public RBatchRx atomic() {
options.atomic();
return this;
}
@Override
public RBatchRx syncSlaves(int slaves, long timeout, TimeUnit unit) {
options.syncSlaves(slaves, timeout, unit);
return this;
}
@Override
public RBatchRx skipResult() {
options.skipResult();
return this;
}
@Override
public RBatchRx retryAttempts(int retryAttempts) {
options.retryAttempts(retryAttempts);
return this;
}
@Override
public RBatchRx retryInterval(long retryInterval, TimeUnit unit) {
options.retryInterval(retryInterval, unit);
return this;
}
@Override
public RBatchRx timeout(long timeout, TimeUnit unit) {
options.responseTimeout(timeout, unit);
return this;
}
public void enableRedissonReferenceSupport(RedissonRxClient redissonRx) {
this.executorService.enableRedissonReferenceSupport(redissonRx);
}

@ -252,7 +252,7 @@ public class RedissonTransaction implements RTransaction {
.responseTimeout(options.getResponseTimeout(), TimeUnit.MILLISECONDS)
.retryAttempts(options.getRetryAttempts())
.retryInterval(options.getRetryInterval(), TimeUnit.MILLISECONDS)
.atomic();
.executionMode(BatchOptions.ExecutionMode.IN_MEMORY_ATOMIC);
return batchOptions;
}

@ -107,7 +107,7 @@ public class RedissonBatchTest extends BaseTest {
assertThat(b2f2.get()).isEqualTo(2d);
}
@Test(timeout = 15000)
@Test(timeout = 20000)
public void testPerformance() {
RMap<String, String> map = redisson.getMap("map");
Map<String, String> m = new HashMap<String, String>();
@ -168,7 +168,7 @@ public class RedissonBatchTest extends BaseTest {
@Test
public void testBigRequestAtomic() {
batchOptions
.atomic()
.executionMode(ExecutionMode.IN_MEMORY_ATOMIC)
.responseTimeout(15, TimeUnit.SECONDS)
.retryInterval(1, TimeUnit.SECONDS)
.retryAttempts(5);
@ -284,7 +284,7 @@ public class RedissonBatchTest extends BaseTest {
@Test
public void testAtomic() {
batchOptions
.atomic();
.executionMode(ExecutionMode.IN_MEMORY_ATOMIC);
RBatch batch = redisson.createBatch(batchOptions);
RFuture<Long> f1 = batch.getAtomicLong("A1").addAndGetAsync(1);
@ -324,7 +324,7 @@ public class RedissonBatchTest extends BaseTest {
RedissonClient redisson = Redisson.create(config);
batchOptions
.atomic()
.executionMode(ExecutionMode.IN_MEMORY_ATOMIC)
.syncSlaves(1, 1, TimeUnit.SECONDS);
RBatch batch = redisson.createBatch(batchOptions);
@ -359,7 +359,7 @@ public class RedissonBatchTest extends BaseTest {
@Test
public void testDifferentCodecsAtomic() {
RBatch b = redisson.createBatch(batchOptions.atomic());
RBatch b = redisson.createBatch(batchOptions.executionMode(ExecutionMode.IN_MEMORY_ATOMIC));
b.getMap("test1").putAsync("1", "2");
b.getMap("test2", StringCodec.INSTANCE).putAsync("21", "3");
RFuture<Object> val1 = b.getMap("test1").getAsync("1");

@ -16,17 +16,7 @@ import org.redisson.api.RBucket;
import org.redisson.api.RMap;
import org.redisson.api.RedissonClient;
import org.redisson.client.codec.Codec;
import org.redisson.client.codec.JsonJacksonMapCodec;
import org.redisson.codec.AvroJacksonCodec;
import org.redisson.codec.CborJacksonCodec;
import org.redisson.codec.FstCodec;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.codec.KryoCodec;
import org.redisson.codec.LZ4Codec;
import org.redisson.codec.SerializationCodec;
import org.redisson.codec.SmileJacksonCodec;
import org.redisson.codec.SnappyCodec;
import org.redisson.codec.SnappyCodecV2;
import org.redisson.codec.*;
import org.redisson.config.Config;
import com.fasterxml.jackson.core.type.TypeReference;
@ -47,7 +37,7 @@ public class RedissonCodecTest extends BaseTest {
private Codec snappyCodecV2 = new SnappyCodecV2();
// private Codec msgPackCodec = new MsgPackJacksonCodec();
private Codec lz4Codec = new LZ4Codec();
private Codec jsonListOfStringCodec = new JsonJacksonMapCodec(
private Codec jsonListOfStringCodec = new TypedJsonJacksonCodec(
new TypeReference<String>() {}, new TypeReference<List<String>>() {});
@Test

@ -259,10 +259,10 @@ public class RedissonKeysTest extends BaseTest {
RMap<String, String> map = redisson.getMap("test2");
map.fastPut("1", "2");
Collection<String> keys = redisson.getKeys().findKeysByPattern("test?");
Iterable<String> keys = redisson.getKeys().getKeysByPattern("test?");
assertThat(keys).containsOnly("test1", "test2");
Collection<String> keys2 = redisson.getKeys().findKeysByPattern("test");
Iterable<String> keys2 = redisson.getKeys().getKeysByPattern("test");
assertThat(keys2).isEmpty();
}

@ -171,7 +171,7 @@ public class RedissonBatchRxTest extends BaseRxTest {
@Test
public void testBigRequestAtomic() {
batchOptions
.atomic()
.executionMode(ExecutionMode.IN_MEMORY_ATOMIC)
.responseTimeout(15, TimeUnit.SECONDS)
.retryInterval(1, TimeUnit.SECONDS)
.retryAttempts(5);
@ -288,7 +288,7 @@ public class RedissonBatchRxTest extends BaseRxTest {
@Test
public void testAtomic() {
batchOptions.atomic();
batchOptions.executionMode(ExecutionMode.IN_MEMORY_ATOMIC);
RBatchRx batch = redisson.createBatch(batchOptions);
Single<Long> f1 = batch.getAtomicLong("A1").addAndGet(1);
@ -328,7 +328,7 @@ public class RedissonBatchRxTest extends BaseRxTest {
RedissonRxClient redisson = Redisson.createRx(config);
batchOptions
.atomic()
.executionMode(ExecutionMode.IN_MEMORY_ATOMIC)
.syncSlaves(1, 1, TimeUnit.SECONDS);
RBatchRx batch = redisson.createBatch(batchOptions);
@ -363,7 +363,7 @@ public class RedissonBatchRxTest extends BaseRxTest {
@Test
public void testDifferentCodecsAtomic() {
RBatchRx b = redisson.createBatch(batchOptions.atomic());
RBatchRx b = redisson.createBatch(batchOptions.executionMode(ExecutionMode.IN_MEMORY_ATOMIC));
b.getMap("test1").put("1", "2");
b.getMap("test2", StringCodec.INSTANCE).put("21", "3");
Maybe<Object> val1 = b.getMap("test1").get("1");

Loading…
Cancel
Save