diff --git a/pom.xml b/pom.xml
index 69d56c082c..033a6df716 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,6 +92,12 @@
2.3.2
test
+
+ org.mockito
+ mockito-core
+ 3.7.7
+ test
+
diff --git a/src/main/java/redis/clients/jedis/BinaryJedis.java b/src/main/java/redis/clients/jedis/BinaryJedis.java
index cfedb64e15..2e3046098f 100644
--- a/src/main/java/redis/clients/jedis/BinaryJedis.java
+++ b/src/main/java/redis/clients/jedis/BinaryJedis.java
@@ -292,6 +292,11 @@ public BinaryJedis(final JedisSocketFactory jedisSocketFactory, final JedisClien
initializeFromClientConfig(clientConfig);
}
+ @Override
+ public String toString() {
+ return "BinaryJedis{" + client + '}';
+ }
+
public boolean isConnected() {
return client.isConnected();
}
diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java
index 21575113c2..821248d268 100644
--- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java
+++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java
@@ -12,6 +12,7 @@
import redis.clients.jedis.util.SafeEncoder;
import java.io.Closeable;
+import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -26,11 +27,22 @@ public class BinaryJedisCluster implements BinaryJedisClusterCommands,
MultiKeyBinaryJedisClusterCommands, JedisClusterBinaryScriptingCommands, Closeable {
public static final int HASHSLOTS = 16384;
- protected static final int DEFAULT_TIMEOUT = 2000;
- protected static final int DEFAULT_MAX_ATTEMPTS = 5;
+
+ /**
+ * Default timeout in milliseconds.
+ */
+ public static final int DEFAULT_TIMEOUT = 2000;
+ public static final int DEFAULT_MAX_ATTEMPTS = 5;
protected int maxAttempts;
+ /**
+ * After this amount of time we will do no more retries and report the operation as failed.
+ *
+ * Defaults to {@link #DEFAULT_TIMEOUT} if unset, or {@code soTimeout} if available.
+ */
+ protected Duration maxTotalRetriesDuration;
+
protected JedisClusterConnectionHandler connectionHandler;
public BinaryJedisCluster(Set nodes) {
@@ -69,6 +81,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, user, password, clientName);
this.maxAttempts = maxAttempts;
+ this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout);
}
public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout,
@@ -77,6 +90,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName);
this.maxAttempts = maxAttempts;
+ this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout);
}
public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout,
@@ -129,17 +143,41 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo
String clientName, GenericObjectPoolConfig poolConfig, boolean ssl,
SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
+ this(jedisClusterNode, connectionTimeout, soTimeout, infiniteSoTimeout, maxAttempts, user,
+ password, clientName, poolConfig, ssl, sslSocketFactory, sslParameters, hostnameVerifier,
+ hostAndPortMap, Duration.ofMillis((long) soTimeout * maxAttempts));
+ }
+
+ /**
+ * @param maxTotalRetriesDuration After this amount of time we will do no more retries and report
+ * the operation as failed.
+ * @deprecated This constructor will be removed in future.
+ */
+ @Deprecated
+ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout,
+ int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName,
+ GenericObjectPoolConfig poolConfig, boolean ssl, SSLSocketFactory sslSocketFactory,
+ SSLParameters sslParameters, HostnameVerifier hostnameVerifier,
+ JedisClusterHostAndPortMap hostAndPortMap, Duration maxTotalRetriesDuration) {
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName, ssl,
sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap);
this.maxAttempts = maxAttempts;
+ this.maxTotalRetriesDuration = maxTotalRetriesDuration;
}
public BinaryJedisCluster(Set jedisClusterNode, JedisClientConfig clientConfig,
int maxAttempts, GenericObjectPoolConfig poolConfig) {
+ this(jedisClusterNode, clientConfig, maxAttempts,
+ Duration.ofMillis((long) DEFAULT_TIMEOUT * maxAttempts), poolConfig);
+ }
+
+ public BinaryJedisCluster(Set jedisClusterNode, JedisClientConfig clientConfig,
+ int maxAttempts, Duration maxTotalRetriesDuration, GenericObjectPoolConfig poolConfig) {
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
clientConfig);
this.maxAttempts = maxAttempts;
+ this.maxTotalRetriesDuration = maxTotalRetriesDuration;
}
@Override
@@ -159,7 +197,7 @@ public Jedis getConnectionFromSlot(int slot) {
@Override
public Boolean copy(byte[] srcKey, byte[] dstKey, boolean replace) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Boolean execute(Jedis connection) {
return connection.copy(srcKey, dstKey, replace);
@@ -169,7 +207,7 @@ public Boolean execute(Jedis connection) {
@Override
public String set(final byte[] key, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.set(key, value);
@@ -179,7 +217,7 @@ public String execute(Jedis connection) {
@Override
public String set(final byte[] key, final byte[] value, final SetParams params) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.set(key, value, params);
@@ -189,7 +227,7 @@ public String execute(Jedis connection) {
@Override
public byte[] get(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.get(key);
@@ -199,7 +237,7 @@ public byte[] execute(Jedis connection) {
@Override
public byte[] getDel(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.getDel(key);
@@ -209,7 +247,7 @@ public byte[] execute(Jedis connection) {
@Override
public byte[] getEx(byte[] key, GetExParams params) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.getEx(key, params);
@@ -219,7 +257,7 @@ public byte[] execute(Jedis connection) {
@Override
public Long exists(final byte[]... keys) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.exists(keys);
@@ -229,7 +267,7 @@ public Long execute(Jedis connection) {
@Override
public Boolean exists(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Boolean execute(Jedis connection) {
return connection.exists(key);
@@ -239,7 +277,7 @@ public Boolean execute(Jedis connection) {
@Override
public Long persist(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.persist(key);
@@ -249,7 +287,7 @@ public Long execute(Jedis connection) {
@Override
public String type(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.type(key);
@@ -259,7 +297,7 @@ public String execute(Jedis connection) {
@Override
public byte[] dump(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.dump(key);
@@ -269,7 +307,7 @@ public byte[] execute(Jedis connection) {
@Override
public String restore(final byte[] key, final long ttl, final byte[] serializedValue) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.restore(key, ttl, serializedValue);
@@ -280,7 +318,7 @@ public String execute(Jedis connection) {
@Override
public String restore(final byte[] key, final long ttl, final byte[] serializedValue,
final RestoreParams params) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.restore(key, ttl, serializedValue, params);
@@ -290,7 +328,7 @@ public String execute(Jedis connection) {
@Override
public Long expire(final byte[] key, final int seconds) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.expire(key, seconds);
@@ -300,7 +338,7 @@ public Long execute(Jedis connection) {
@Override
public Long pexpire(final byte[] key, final long milliseconds) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.pexpire(key, milliseconds);
@@ -310,7 +348,7 @@ public Long execute(Jedis connection) {
@Override
public Long expireAt(final byte[] key, final long unixTime) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.expireAt(key, unixTime);
@@ -320,7 +358,7 @@ public Long execute(Jedis connection) {
@Override
public Long pexpireAt(final byte[] key, final long millisecondsTimestamp) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.pexpireAt(key, millisecondsTimestamp);
@@ -330,7 +368,7 @@ public Long execute(Jedis connection) {
@Override
public Long ttl(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.ttl(key);
@@ -340,7 +378,7 @@ public Long execute(Jedis connection) {
@Override
public Long pttl(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.pttl(key);
@@ -350,7 +388,7 @@ public Long execute(Jedis connection) {
@Override
public Long touch(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.touch(key);
@@ -360,7 +398,7 @@ public Long execute(Jedis connection) {
@Override
public Long touch(final byte[]... keys) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.touch(keys);
@@ -370,7 +408,7 @@ public Long execute(Jedis connection) {
@Override
public Boolean setbit(final byte[] key, final long offset, final boolean value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Boolean execute(Jedis connection) {
return connection.setbit(key, offset, value);
@@ -380,7 +418,7 @@ public Boolean execute(Jedis connection) {
@Override
public Boolean setbit(final byte[] key, final long offset, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Boolean execute(Jedis connection) {
return connection.setbit(key, offset, value);
@@ -390,7 +428,7 @@ public Boolean execute(Jedis connection) {
@Override
public Boolean getbit(final byte[] key, final long offset) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Boolean execute(Jedis connection) {
return connection.getbit(key, offset);
@@ -400,7 +438,7 @@ public Boolean execute(Jedis connection) {
@Override
public Long setrange(final byte[] key, final long offset, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.setrange(key, offset, value);
@@ -410,7 +448,7 @@ public Long execute(Jedis connection) {
@Override
public byte[] getrange(final byte[] key, final long startOffset, final long endOffset) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.getrange(key, startOffset, endOffset);
@@ -420,7 +458,7 @@ public byte[] execute(Jedis connection) {
@Override
public byte[] getSet(final byte[] key, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.getSet(key, value);
@@ -430,7 +468,7 @@ public byte[] execute(Jedis connection) {
@Override
public Long setnx(final byte[] key, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.setnx(key, value);
@@ -440,7 +478,7 @@ public Long execute(Jedis connection) {
@Override
public String psetex(final byte[] key, final long milliseconds, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.psetex(key, milliseconds, value);
@@ -450,7 +488,7 @@ public String execute(Jedis connection) {
@Override
public String setex(final byte[] key, final long seconds, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.setex(key, seconds, value);
@@ -460,7 +498,7 @@ public String execute(Jedis connection) {
@Override
public Long decrBy(final byte[] key, final long decrement) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.decrBy(key, decrement);
@@ -470,7 +508,7 @@ public Long execute(Jedis connection) {
@Override
public Long decr(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.decr(key);
@@ -480,7 +518,7 @@ public Long execute(Jedis connection) {
@Override
public Long incrBy(final byte[] key, final long increment) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.incrBy(key, increment);
@@ -490,7 +528,7 @@ public Long execute(Jedis connection) {
@Override
public Double incrByFloat(final byte[] key, final double increment) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Double execute(Jedis connection) {
return connection.incrByFloat(key, increment);
@@ -500,7 +538,7 @@ public Double execute(Jedis connection) {
@Override
public Long incr(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.incr(key);
@@ -510,7 +548,7 @@ public Long execute(Jedis connection) {
@Override
public Long append(final byte[] key, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.append(key, value);
@@ -520,7 +558,7 @@ public Long execute(Jedis connection) {
@Override
public byte[] substr(final byte[] key, final int start, final int end) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.substr(key, start, end);
@@ -530,7 +568,7 @@ public byte[] execute(Jedis connection) {
@Override
public Long hset(final byte[] key, final byte[] field, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.hset(key, field, value);
@@ -540,7 +578,7 @@ public Long execute(Jedis connection) {
@Override
public Long hset(final byte[] key, final Map hash) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.hset(key, hash);
@@ -550,7 +588,7 @@ public Long execute(Jedis connection) {
@Override
public byte[] hget(final byte[] key, final byte[] field) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public byte[] execute(Jedis connection) {
return connection.hget(key, field);
@@ -560,7 +598,7 @@ public byte[] execute(Jedis connection) {
@Override
public Long hsetnx(final byte[] key, final byte[] field, final byte[] value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.hsetnx(key, field, value);
@@ -570,7 +608,7 @@ public Long execute(Jedis connection) {
@Override
public String hmset(final byte[] key, final Map hash) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public String execute(Jedis connection) {
return connection.hmset(key, hash);
@@ -580,7 +618,7 @@ public String execute(Jedis connection) {
@Override
public List hmget(final byte[] key, final byte[]... fields) {
- return new JedisClusterCommand>(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public List execute(Jedis connection) {
return connection.hmget(key, fields);
@@ -590,7 +628,7 @@ public List execute(Jedis connection) {
@Override
public Long hincrBy(final byte[] key, final byte[] field, final long value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.hincrBy(key, field, value);
@@ -600,7 +638,7 @@ public Long execute(Jedis connection) {
@Override
public Double hincrByFloat(final byte[] key, final byte[] field, final double value) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Double execute(Jedis connection) {
return connection.hincrByFloat(key, field, value);
@@ -610,7 +648,7 @@ public Double execute(Jedis connection) {
@Override
public Boolean hexists(final byte[] key, final byte[] field) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Boolean execute(Jedis connection) {
return connection.hexists(key, field);
@@ -620,7 +658,7 @@ public Boolean execute(Jedis connection) {
@Override
public Long hdel(final byte[] key, final byte[]... field) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.hdel(key, field);
@@ -630,7 +668,7 @@ public Long execute(Jedis connection) {
@Override
public Long hlen(final byte[] key) {
- return new JedisClusterCommand(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Long execute(Jedis connection) {
return connection.hlen(key);
@@ -640,7 +678,7 @@ public Long execute(Jedis connection) {
@Override
public Set hkeys(final byte[] key) {
- return new JedisClusterCommand>(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public Set execute(Jedis connection) {
return connection.hkeys(key);
@@ -650,7 +688,7 @@ public Set execute(Jedis connection) {
@Override
public List hvals(final byte[] key) {
- return new JedisClusterCommand>(connectionHandler, maxAttempts) {
+ return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) {
@Override
public List execute(Jedis connection) {
return connection.hvals(key);
@@ -660,7 +698,7 @@ public List execute(Jedis connection) {
@Override
public Map hgetAll(final byte[] key) {
- return new JedisClusterCommand