ISSUE 78: Removed logic that waits forever till all shards are connected in ShardedJedisPool

Ensuered that all commands connect at the beginning if necessary.
This commit is contained in:
Dmytro
2011-03-25 11:19:17 +00:00
parent cb0d76051d
commit 604615d228
4 changed files with 128 additions and 158 deletions

View File

@@ -27,6 +27,8 @@ public class BinaryClient extends Connection {
}
private boolean isInMulti;
private String password;
public boolean isInMulti() {
return isInMulti;
@@ -39,6 +41,21 @@ public class BinaryClient extends Connection {
public BinaryClient(final String host, final int port) {
super(host, port);
}
public void setPassword(final String password) {
this.password = password;
}
@Override
public void connect() {
if (!isConnected()) {
super.connect();
if (password != null) {
sendCommand(AUTH, password);
getStatusCodeReply();
}
}
}
public void ping() {
sendCommand(PING);
@@ -438,6 +455,7 @@ public class BinaryClient extends Connection {
}
public void auth(final String password) {
setPassword(password);
sendCommand(AUTH, password);
}