refactoring

pull/1253/merge
Nikita 7 years ago
parent 5f69136517
commit eb86e27fab

@ -69,7 +69,7 @@ public class RedissonBatch implements RBatch {
private boolean skipResult;
private boolean atomic;
protected RedissonBatch(UUID id, EvictionScheduler evictionScheduler, ConnectionManager connectionManager) {
public RedissonBatch(UUID id, EvictionScheduler evictionScheduler, ConnectionManager connectionManager) {
this.executorService = new CommandBatchService(connectionManager);
this.evictionScheduler = evictionScheduler;
this.id = id;

@ -77,7 +77,7 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
final RedissonClient redisson;
final MapOptions<K, V> options;
protected RedissonMap(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options) {
public RedissonMap(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options) {
super(commandExecutor, name);
this.redisson = redisson;
this.options = options;
@ -327,12 +327,8 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
List<Object> params = new ArrayList<Object>(map.size()*2 + 1);
params.add(getName());
for (java.util.Map.Entry<? extends K, ? extends V> t : map.entrySet()) {
if (t.getKey() == null) {
throw new NullPointerException("map key can't be null");
}
if (t.getValue() == null) {
throw new NullPointerException("map value can't be null");
}
checkKey(t.getKey());
checkValue(t.getValue());
params.add(encodeMapKey(t.getKey()));
params.add(encodeMapValue(t.getValue()));

@ -449,8 +449,6 @@ public class RedissonMapCache<K, V> extends RedissonMap<K, V> implements RMapCac
@Override
protected RFuture<V> getOperationAsync(K key) {
checkKey(key);
return commandExecutor.evalWriteAsync(getName(key), codec, RedisCommands.EVAL_MAP_VALUE,
"local value = redis.call('hget', KEYS[1], ARGV[2]); "
+ "if value == false then "

@ -129,7 +129,7 @@ public class RedissonNode {
redisson = Redisson.create(config);
}
retrieveAdresses();
retrieveAddresses();
if (config.getRedissonNodeInitializer() != null) {
config.getRedissonNodeInitializer().onStartup(this);
@ -154,7 +154,7 @@ public class RedissonNode {
log.info("Redisson node started!");
}
private void retrieveAdresses() {
private void retrieveAddresses() {
ConnectionManager connectionManager = ((Redisson)redisson).getConnectionManager();
for (MasterSlaveEntry entry : connectionManager.getEntrySet()) {
RFuture<RedisConnection> readFuture = entry.connectionReadOp(null);

@ -19,6 +19,7 @@ import java.util.concurrent.TimeUnit;
import org.redisson.client.codec.Codec;
import org.redisson.config.Config;
import org.redisson.transaction.RTransaction;
/**
* Main Redisson interface for access
@ -908,6 +909,8 @@ public interface RedissonClient {
* @return Batch object
*/
RBatch createBatch();
RTransaction createTransaction();
/**
* Returns interface with methods for Redis keys.

Loading…
Cancel
Save