Merge branch 'master' into 3.0.0

pull/1833/head
Nikita Koksharov 6 years ago
commit 9624610be7

@ -92,6 +92,10 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
public ClusterConnectionManager(ClusterServersConfig cfg, Config config, UUID id) { public ClusterConnectionManager(ClusterServersConfig cfg, Config config, UUID id) {
super(config, id); super(config, id);
if (cfg.getNodeAddresses().isEmpty()) {
throw new IllegalArgumentException("At least one cluster node should be defined!");
}
this.config = create(cfg); this.config = create(cfg);
initTimer(this.config); initTimer(this.config);

@ -754,7 +754,7 @@ public class CommandAsyncService implements CommandAsyncExecutor {
int count = details.getAttempt() + 1; int count = details.getAttempt() + 1;
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("attempt {} for command {} and params {}", log.debug("attempt {} for command {} and params {}",
count, details.getCommand(), Arrays.toString(details.getParams())); count, details.getCommand(), LogHelper.toString(details.getParams()));
} }
details.removeMainPromiseListener(); details.removeMainPromiseListener();
async(details.isReadOnlyMode(), details.getSource(), details.getCodec(), details.getCommand(), details.getParams(), details.getMainPromise(), count, ignoreRedirect, connFuture); async(details.isReadOnlyMode(), details.getSource(), details.getCodec(), details.getCommand(), details.getParams(), details.getMainPromise(), count, ignoreRedirect, connFuture);
@ -973,7 +973,7 @@ public class CommandAsyncService implements CommandAsyncExecutor {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("connection released for command {} and params {} from slot {} using connection {}", log.debug("connection released for command {} and params {} from slot {} using connection {}",
details.getCommand(), Arrays.toString(details.getParams()), details.getSource(), connection); details.getCommand(), LogHelper.toString(details.getParams()), details.getSource(), connection);
} }
} }
}); });
@ -1207,7 +1207,7 @@ public class CommandAsyncService implements CommandAsyncExecutor {
} else { } else {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}", log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}",
details.getCommand(), Arrays.toString(details.getParams()), details.getSource(), connection.getRedisClient().getAddr(), connection); details.getCommand(), LogHelper.toString(details.getParams()), details.getSource(), connection.getRedisClient().getAddr(), connection);
} }
ChannelFuture future = connection.send(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams())); ChannelFuture future = connection.send(new CommandData<V, R>(details.getAttemptPromise(), details.getCodec(), details.getCommand(), details.getParams()));
details.setWriteFuture(future); details.setWriteFuture(future);

@ -16,7 +16,6 @@
package org.redisson.command; package org.redisson.command;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Deque; import java.util.Deque;
import java.util.Iterator; import java.util.Iterator;
@ -55,6 +54,7 @@ import org.redisson.connection.MasterSlaveEntry;
import org.redisson.connection.NodeSource; import org.redisson.connection.NodeSource;
import org.redisson.connection.NodeSource.Redirect; import org.redisson.connection.NodeSource.Redirect;
import org.redisson.misc.CountableListener; import org.redisson.misc.CountableListener;
import org.redisson.misc.LogHelper;
import org.redisson.misc.RPromise; import org.redisson.misc.RPromise;
import org.redisson.misc.RedissonPromise; import org.redisson.misc.RedissonPromise;
import org.redisson.pubsub.AsyncSemaphore; import org.redisson.pubsub.AsyncSemaphore;
@ -281,7 +281,7 @@ public class CommandBatchService extends CommandAsyncService {
} else { } else {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}", log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}",
details.getCommand(), Arrays.toString(details.getParams()), details.getSource(), connection.getRedisClient().getAddr(), connection); details.getCommand(), LogHelper.toString(details.getParams()), details.getSource(), connection.getRedisClient().getAddr(), connection);
} }
if (connectionEntry.isFirstCommand()) { if (connectionEntry.isFirstCommand()) {

@ -78,6 +78,9 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
if (cfg.getMasterName() == null) { if (cfg.getMasterName() == null) {
throw new IllegalArgumentException("masterName parameter is not defined!"); throw new IllegalArgumentException("masterName parameter is not defined!");
} }
if (cfg.getSentinelAddresses().isEmpty()) {
throw new IllegalArgumentException("At least one sentinel node should be defined!");
}
this.config = create(cfg); this.config = create(cfg);
initTimer(this.config); initTimer(this.config);

Loading…
Cancel
Save