From 6e2f3123f35d4227a17c77387180cf2af0c2355d Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Mon, 25 Jan 2021 09:11:08 +0100 Subject: [PATCH 01/35] Split JedisClusterCommand into multiple methods No behavior changes, just a refactoring. Changes: * Replaces recursion with a for loop * Extract redirection handling into its own method * Extract connection-failed handling into its own method Note that `tryWithRandomNode` is gone, it was never `true` so it and its code didn't survive the refactoring. --- .../clients/jedis/JedisClusterCommand.java | 123 +++++++++++------- 1 file changed, 74 insertions(+), 49 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 0aa1055df4..2255bde510 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -22,7 +22,7 @@ public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int public abstract T execute(Jedis connection); public T run(String key) { - return runWithRetries(JedisClusterCRC16.getSlot(key), this.maxAttempts, false, null); + return runWithRetries(JedisClusterCRC16.getSlot(key)); } public T run(int keyCount, String... keys) { @@ -42,11 +42,11 @@ public T run(int keyCount, String... keys) { } } - return runWithRetries(slot, this.maxAttempts, false, null); + return runWithRetries(slot); } public T runBinary(byte[] key) { - return runWithRetries(JedisClusterCRC16.getSlot(key), this.maxAttempts, false, null); + return runWithRetries(JedisClusterCRC16.getSlot(key)); } public T runBinary(int keyCount, byte[]... keys) { @@ -66,7 +66,7 @@ public T runBinary(int keyCount, byte[]... keys) { } } - return runWithRetries(slot, this.maxAttempts, false, null); + return runWithRetries(slot); } public T runWithAnyNode() { @@ -79,62 +79,87 @@ public T runWithAnyNode() { } } - private T runWithRetries(final int slot, int attempts, boolean tryRandomNode, JedisRedirectionException redirect) { - if (attempts <= 0) { - throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); - } + private interface ConnectionGetter { + Jedis getConnection(); + } - Jedis connection = null; - try { + private T runWithRetries(final int slot) { + ConnectionGetter connectionGetter = new ConnectionGetter() { + @Override + public Jedis getConnection() { + return connectionHandler.getConnectionFromSlot(slot); + } + }; - if (redirect != null) { - connection = this.connectionHandler.getConnectionFromNode(redirect.getTargetNode()); - if (redirect instanceof JedisAskDataException) { - // TODO: Pipeline asking with the original command to make it faster.... - connection.asking(); - } - } else { - if (tryRandomNode) { - connection = connectionHandler.getConnection(); + // If we got one redirection, stick with that and don't try anything else + ConnectionGetter redirected = null; + + for (int currentAttempt = 0; currentAttempt < this.maxAttempts; currentAttempt++) { + Jedis connection = null; + try { + if (redirected != null) { + connection = redirected.getConnection(); } else { - connection = connectionHandler.getConnectionFromSlot(slot); + connection = connectionGetter.getConnection(); + } + return execute(connection); + } catch (JedisNoReachableClusterNodeException e) { + throw e; + } catch (JedisConnectionException e) { + connectionGetter = handleConnectionProblem(slot, currentAttempt); + } catch (JedisRedirectionException e) { + redirected = handleRedirection(connection, e); + } finally { + if (connection != null) { + releaseConnection(connection); } } + } - return execute(connection); + throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); + } - } catch (JedisNoReachableClusterNodeException jnrcne) { - throw jnrcne; - } catch (JedisConnectionException jce) { - // release current connection before recursion - releaseConnection(connection); - connection = null; - - if (attempts <= 1) { - //We need this because if node is not reachable anymore - we need to finally initiate slots - //renewing, or we can stuck with cluster state without one node in opposite case. - //But now if maxAttempts = [1 or 2] we will do it too often. - //TODO make tracking of successful/unsuccessful operations for node - do renewing only - //if there were no successful responses from this node last few seconds - this.connectionHandler.renewSlotCache(); - } + private ConnectionGetter handleConnectionProblem(final int slot, int currentAttempt) { + int attemptsLeft = (maxAttempts - currentAttempt) - 1; + if (attemptsLeft <= 1) { + //We need this because if node is not reachable anymore - we need to finally initiate slots + //renewing, or we can stuck with cluster state without one node in opposite case. + //But now if maxAttempts = [1 or 2] we will do it too often. + //TODO make tracking of successful/unsuccessful operations for node - do renewing only + //if there were no successful responses from this node last few seconds + this.connectionHandler.renewSlotCache(); + } - return runWithRetries(slot, attempts - 1, tryRandomNode, redirect); - } catch (JedisRedirectionException jre) { - // if MOVED redirection occurred, - if (jre instanceof JedisMovedDataException) { - // it rebuilds cluster's slot cache recommended by Redis cluster specification - this.connectionHandler.renewSlotCache(connection); + return new ConnectionGetter() { + @Override + public Jedis getConnection() { + return connectionHandler.getConnectionFromSlot(slot); } + }; + } - // release current connection before recursion - releaseConnection(connection); - connection = null; - - return runWithRetries(slot, attempts - 1, false, jre); - } finally { - releaseConnection(connection); + private ConnectionGetter handleRedirection(Jedis connection, final JedisRedirectionException jre) { + // if MOVED redirection occurred, + if (jre instanceof JedisMovedDataException) { + // it rebuilds cluster's slot cache recommended by Redis cluster specification + this.connectionHandler.renewSlotCache(connection); } + + // release current connection before iteration + releaseConnection(connection); + + return new ConnectionGetter() { + @Override + public Jedis getConnection() { + Jedis connection = connectionHandler.getConnectionFromNode(jre.getTargetNode()); + if (jre instanceof JedisAskDataException) { + // TODO: Pipeline asking with the original command to make it faster.... + connection.asking(); + } + + return connection; + } + }; } private void releaseConnection(Jedis connection) { From 5a4fdbd3d7b6e28d9aabc00932b40a993be0c51f Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Mon, 25 Jan 2021 10:17:08 +0100 Subject: [PATCH 02/35] Drop redundant null check --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 2255bde510..95f67a1bb9 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -110,9 +110,7 @@ public Jedis getConnection() { } catch (JedisRedirectionException e) { redirected = handleRedirection(connection, e); } finally { - if (connection != null) { - releaseConnection(connection); - } + releaseConnection(connection); } } From fc3728ae7fe7c54f29f0df16204c713ca211a814 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Mon, 25 Jan 2021 11:02:36 +0100 Subject: [PATCH 03/35] Bump JDK version to 1.8 Inspired by #1334 where this went real easy :). Would have made #2355 shorter. Free public updates for JDK 7 ended in 2015: For JDK 8, free public support is available from non-Orace vendors until at least 2026 according to the same table. And JDK 8 is what Jedis is being tested on anyway: --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1f0d73253d..b063505409 100644 --- a/pom.xml +++ b/pom.xml @@ -129,8 +129,8 @@ maven-compiler-plugin 3.8.1 - 1.7 - 1.7 + 1.8 + 1.8 From cdf56b2161f02fd7d3b77feb0fc17cf241e963d6 Mon Sep 17 00:00:00 2001 From: Jens Green Olander Date: Mon, 25 Jan 2021 13:12:24 +0100 Subject: [PATCH 04/35] Replace ConnectionGetters with lambdas --- .../clients/jedis/JedisClusterCommand.java | 52 +++++++------------ 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 95f67a1bb9..e7f51bbe82 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -1,5 +1,6 @@ package redis.clients.jedis; +import java.util.function.Supplier; import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; @@ -79,36 +80,27 @@ public T runWithAnyNode() { } } - private interface ConnectionGetter { - Jedis getConnection(); - } - private T runWithRetries(final int slot) { - ConnectionGetter connectionGetter = new ConnectionGetter() { - @Override - public Jedis getConnection() { - return connectionHandler.getConnectionFromSlot(slot); - } - }; + Supplier connectionSupplier = () -> connectionHandler.getConnectionFromSlot(slot); // If we got one redirection, stick with that and don't try anything else - ConnectionGetter redirected = null; + Supplier redirectionSupplier = null; for (int currentAttempt = 0; currentAttempt < this.maxAttempts; currentAttempt++) { Jedis connection = null; try { - if (redirected != null) { - connection = redirected.getConnection(); + if (redirectionSupplier != null) { + connection = redirectionSupplier.get(); } else { - connection = connectionGetter.getConnection(); + connection = connectionSupplier.get(); } return execute(connection); } catch (JedisNoReachableClusterNodeException e) { throw e; } catch (JedisConnectionException e) { - connectionGetter = handleConnectionProblem(slot, currentAttempt); + connectionSupplier = handleConnectionProblem(slot, currentAttempt); } catch (JedisRedirectionException e) { - redirected = handleRedirection(connection, e); + redirectionSupplier = handleRedirection(connection, e); } finally { releaseConnection(connection); } @@ -117,7 +109,7 @@ public Jedis getConnection() { throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); } - private ConnectionGetter handleConnectionProblem(final int slot, int currentAttempt) { + private Supplier handleConnectionProblem(final int slot, int currentAttempt) { int attemptsLeft = (maxAttempts - currentAttempt) - 1; if (attemptsLeft <= 1) { //We need this because if node is not reachable anymore - we need to finally initiate slots @@ -128,15 +120,10 @@ private ConnectionGetter handleConnectionProblem(final int slot, int currentAtte this.connectionHandler.renewSlotCache(); } - return new ConnectionGetter() { - @Override - public Jedis getConnection() { - return connectionHandler.getConnectionFromSlot(slot); - } - }; + return () -> connectionHandler.getConnectionFromSlot(slot); } - private ConnectionGetter handleRedirection(Jedis connection, final JedisRedirectionException jre) { + private Supplier handleRedirection(Jedis connection, final JedisRedirectionException jre) { // if MOVED redirection occurred, if (jre instanceof JedisMovedDataException) { // it rebuilds cluster's slot cache recommended by Redis cluster specification @@ -146,17 +133,14 @@ private ConnectionGetter handleRedirection(Jedis connection, final JedisRedirect // release current connection before iteration releaseConnection(connection); - return new ConnectionGetter() { - @Override - public Jedis getConnection() { - Jedis connection = connectionHandler.getConnectionFromNode(jre.getTargetNode()); - if (jre instanceof JedisAskDataException) { - // TODO: Pipeline asking with the original command to make it faster.... - connection.asking(); - } - - return connection; + return () -> { + Jedis redirectedConnection = connectionHandler.getConnectionFromNode(jre.getTargetNode()); + if (jre instanceof JedisAskDataException) { + // TODO: Pipeline asking with the original command to make it faster.... + redirectedConnection.asking(); } + + return redirectedConnection; }; } From d99ef7b921c6e4030bce1eff4a4d4ced932d8c97 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Mon, 25 Jan 2021 15:26:22 +0100 Subject: [PATCH 05/35] Retrigger CI From 8978ca5268313f7031c57da5e25314554612a5b9 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Thu, 28 Jan 2021 08:56:51 +0100 Subject: [PATCH 06/35] Add backoff to Redis connections --- .../clients/jedis/JedisClusterCommand.java | 93 ++++++++++++++++--- .../clients/jedis/tests/JedisClusterTest.java | 6 +- .../jedis/tests/SSLJedisClusterTest.java | 4 +- ...disClusterWithCompleteCredentialsTest.java | 5 +- 4 files changed, 91 insertions(+), 17 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index e7f51bbe82..97af2713a6 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -1,5 +1,8 @@ package redis.clients.jedis; +import java.time.Duration; +import java.time.Instant; +import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; @@ -12,12 +15,33 @@ public abstract class JedisClusterCommand { + /** + * Default cluster-node-timeout is 15s according to + * https://www.programmersought.com/article/40076100313/, + * add some on top of that and we get to 20. + * + * @see #JedisClusterCommand(JedisClusterConnectionHandler, int, Duration) + */ + private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(20); + private final JedisClusterConnectionHandler connectionHandler; private final int maxAttempts; + private final Duration timeout; - public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts) { + public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts, + Duration timeout) { this.connectionHandler = connectionHandler; this.maxAttempts = maxAttempts; + this.timeout = timeout; + } + + /** + * Create a cluster command with a default timeout of {@link #DEFAULT_TIMEOUT}. To override the + * timeout, call {@link #JedisClusterCommand(JedisClusterConnectionHandler, int, Duration)} + * instead. + */ + public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts) { + this(connectionHandler, maxAttempts, DEFAULT_TIMEOUT); } public abstract T execute(Jedis connection); @@ -80,7 +104,26 @@ public T runWithAnyNode() { } } + private boolean shouldBackOff(int attemptsLeft) { + int attemptsDone = maxAttempts - attemptsLeft; + return attemptsDone >= maxAttempts / 3; + } + + private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { + if (attemptsLeft <= 0) { + return 0; + } + + long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); + if (millisLeft < 0) { + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + } + + return millisLeft / (attemptsLeft * attemptsLeft); + } + private T runWithRetries(final int slot) { + Instant deadline = Instant.now().plus(timeout); Supplier connectionSupplier = () -> connectionHandler.getConnectionFromSlot(slot); // If we got one redirection, stick with that and don't try anything else @@ -94,11 +137,19 @@ private T runWithRetries(final int slot) { } else { connection = connectionSupplier.get(); } + + if (shouldBackOff(maxAttempts - currentAttempt)) { + // Don't just stick to this any more, start asking around + redirectionSupplier = null; + } + return execute(connection); } catch (JedisNoReachableClusterNodeException e) { throw e; } catch (JedisConnectionException e) { - connectionSupplier = handleConnectionProblem(slot, currentAttempt); + // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet + int attemptsLeft = maxAttempts - currentAttempt - 1; + connectionSupplier = handleConnectionProblem(connection, slot, attemptsLeft, deadline); } catch (JedisRedirectionException e) { redirectionSupplier = handleRedirection(connection, e); } finally { @@ -109,18 +160,36 @@ private T runWithRetries(final int slot) { throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); } - private Supplier handleConnectionProblem(final int slot, int currentAttempt) { - int attemptsLeft = (maxAttempts - currentAttempt) - 1; - if (attemptsLeft <= 1) { - //We need this because if node is not reachable anymore - we need to finally initiate slots - //renewing, or we can stuck with cluster state without one node in opposite case. - //But now if maxAttempts = [1 or 2] we will do it too often. - //TODO make tracking of successful/unsuccessful operations for node - do renewing only - //if there were no successful responses from this node last few seconds - this.connectionHandler.renewSlotCache(); + protected void sleep(long sleepMillis) { + try { + TimeUnit.MILLISECONDS.sleep(sleepMillis); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + private Supplier handleConnectionProblem(Jedis failedConnection, final int slot, int attemptsLeft, + Instant doneDeadline) { + if (!shouldBackOff(attemptsLeft)) { + return () -> connectionHandler.getConnectionFromSlot(slot); } - return () -> connectionHandler.getConnectionFromSlot(slot); + // Must release current connection before renewing the slot cache below. If we fail to do this, + // then JedisClusterTest.testReturnConnectionOnJedisClusterConnection will start failing + // intermittently. + releaseConnection(failedConnection); + + //We need this because if node is not reachable anymore - we need to finally initiate slots + //renewing, or we can stuck with cluster state without one node in opposite case. + //TODO make tracking of successful/unsuccessful operations for node - do renewing only + //if there were no successful responses from this node last few seconds + this.connectionHandler.renewSlotCache(); + + return () -> { + sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); + // Get a random connection, it will redirect us if it's not the right one + return connectionHandler.getConnection(); + }; } private Supplier handleRedirection(Jedis connection, final JedisRedirectionException jre) { diff --git a/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java b/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java index de58c76c42..4e3aa69f14 100644 --- a/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java @@ -583,7 +583,11 @@ public void testReturnConnectionOnJedisConnectionException() throws InterruptedE jedisClusterNode.add(new HostAndPort("127.0.0.1", 7379)); JedisPoolConfig config = new JedisPoolConfig(); config.setMaxTotal(1); - JedisCluster jc = new JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT, + + // Otherwise the test can time out before we are done + int shorterThanTheTestTimeoutMs = DEFAULT_TIMEOUT / 2; + + JedisCluster jc = new JedisCluster(jedisClusterNode, shorterThanTheTestTimeoutMs, shorterThanTheTestTimeoutMs, DEFAULT_REDIRECTIONS, "cluster", config); Jedis j = jc.getClusterNodes().get("127.0.0.1:7380").getResource(); diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java index ab2f41134a..ae6be79579 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java @@ -114,7 +114,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -159,7 +159,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java index 0941bd90ee..1b14981243 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java @@ -4,6 +4,7 @@ import redis.clients.jedis.*; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisConnectionException; +import redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException; import redis.clients.jedis.tests.SSLJedisTest.BasicHostnameVerifier; import redis.clients.jedis.tests.utils.RedisVersionUtil; @@ -103,7 +104,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -147,7 +148,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } From 85fa21ce2e43e8b64aae68354935339a2b3728a9 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Fri, 22 Jan 2021 10:24:56 +0100 Subject: [PATCH 07/35] Add unit tests for backoff logic --- pom.xml | 6 + .../commands/JedisClusterCommandTest.java | 357 ++++++++++++++++++ 2 files changed, 363 insertions(+) create mode 100644 src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java diff --git a/pom.xml b/pom.xml index b063505409..7a52fa565c 100644 --- a/pom.xml +++ b/pom.xml @@ -91,6 +91,12 @@ 2.3.2 test + + org.mockito + mockito-core + 3.7.7 + test + diff --git a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java new file mode 100644 index 0000000000..a908beab96 --- /dev/null +++ b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java @@ -0,0 +1,357 @@ +package redis.clients.jedis.tests.commands; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.time.Duration; +import java.util.function.LongConsumer; +import org.junit.Test; +import org.mockito.InOrder; +import redis.clients.jedis.HostAndPort; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.JedisClusterCommand; +import redis.clients.jedis.JedisClusterConnectionHandler; +import redis.clients.jedis.JedisSlotBasedConnectionHandler; +import redis.clients.jedis.exceptions.JedisAskDataException; +import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; +import redis.clients.jedis.exceptions.JedisConnectionException; +import redis.clients.jedis.exceptions.JedisMovedDataException; +import redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException; + +public class JedisClusterCommandTest { + + @Test(expected = JedisClusterMaxAttemptsException.class) + public void runZeroAttempts() { + JedisClusterCommand testMe = new JedisClusterCommand(null, 0, Duration.ZERO) { + @Override + public String execute(Jedis connection) { + return null; + } + + @Override + protected void sleep(long ignored) { + throw new RuntimeException("This test should never sleep"); + } + }; + + testMe.run(""); + } + + @Test + public void runSuccessfulExecute() { + JedisClusterConnectionHandler connectionHandler = mock(JedisClusterConnectionHandler.class); + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, + Duration.ZERO) { + @Override + public String execute(Jedis connection) { + return "foo"; + } + + @Override + protected void sleep(long ignored) { + throw new RuntimeException("This test should never sleep"); + } + }; + String actual = testMe.run(""); + assertEquals("foo", actual); + } + + @Test + public void runFailOnFirstExecSuccessOnSecondExec() { + JedisClusterConnectionHandler connectionHandler = mock(JedisClusterConnectionHandler.class); + + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, + Duration.ZERO) { + boolean isFirstCall = true; + + @Override + public String execute(Jedis connection) { + if (isFirstCall) { + isFirstCall = false; + throw new JedisConnectionException("Borkenz"); + } + + return "foo"; + } + + @Override + protected void sleep(long ignored) { + throw new RuntimeException("This test should never sleep"); + } + }; + + String actual = testMe.run(""); + assertEquals("foo", actual); + } + + @Test + public void runAlwaysFailing() { + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + + final LongConsumer sleep = mock(LongConsumer.class); + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 3, + Duration.ofSeconds(1)) { + @Override + public String execute(Jedis connection) { + throw new JedisConnectionException("Connection failed"); + } + + @Override + protected void sleep(long sleepMillis) { + sleep.accept(sleepMillis); + } + }; + + try { + testMe.run(""); + fail("cluster command did not fail"); + } catch (JedisClusterMaxAttemptsException e) { + // expected + } + InOrder inOrder = inOrder(connectionHandler, sleep); + inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); + inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verify(sleep).accept(anyLong()); + inOrder.verify(connectionHandler).getConnection(); + inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verify(sleep).accept(anyLong()); + inOrder.verify(connectionHandler).getConnection(); + inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verifyNoMoreInteractions(); + } + + @Test + public void runMovedSuccess() { + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + + final HostAndPort movedTarget = new HostAndPort(null, 0); + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, + Duration.ZERO) { + boolean isFirstCall = true; + + @Override + public String execute(Jedis connection) { + if (isFirstCall) { + isFirstCall = false; + + // Slot 0 moved + throw new JedisMovedDataException("", movedTarget, 0); + } + + return "foo"; + } + + @Override + protected void sleep(long ignored) { + throw new RuntimeException("This test should never sleep"); + } + }; + + String actual = testMe.run(""); + assertEquals("foo", actual); + + InOrder inOrder = inOrder(connectionHandler); + inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); + inOrder.verify(connectionHandler).renewSlotCache(any()); + inOrder.verify(connectionHandler).getConnectionFromNode(movedTarget); + inOrder.verifyNoMoreInteractions(); + } + + @Test + public void runAskSuccess() { + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + Jedis connection = mock(Jedis.class); + final HostAndPort askTarget = new HostAndPort(null, 0); + when(connectionHandler.getConnectionFromNode(askTarget)).thenReturn(connection); + + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, + Duration.ZERO) { + boolean isFirstCall = true; + + @Override + public String execute(Jedis connection) { + if (isFirstCall) { + isFirstCall = false; + + // Slot 0 moved + throw new JedisAskDataException("", askTarget, 0); + } + + return "foo"; + } + + @Override + protected void sleep(long ignored) { + throw new RuntimeException("This test should never sleep"); + } + }; + + String actual = testMe.run(""); + assertEquals("foo", actual); + + InOrder inOrder = inOrder(connectionHandler, connection); + inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); + inOrder.verify(connectionHandler).getConnectionFromNode(askTarget); + inOrder.verify(connection).asking(); + inOrder.verify(connection).close(); // From the finally clause in runWithRetries() + inOrder.verifyNoMoreInteractions(); + } + + @Test + public void runMovedThenAllNodesFailing() { + // Test: + // First attempt is a JedisMovedDataException() move, because we asked the wrong node. + // All subsequent attempts are JedisConnectionExceptions, because all nodes are now down. + // In response to the JedisConnectionExceptions, run() retries random nodes until maxAttempts is + // reached. + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + + final Jedis redirecter = mock(Jedis.class); + when(connectionHandler.getConnectionFromSlot(anyInt())).thenReturn(redirecter); + + final Jedis failer = mock(Jedis.class); + when(connectionHandler.getConnectionFromNode(any(HostAndPort.class))).thenReturn(failer); + when(connectionHandler.getConnection()).thenReturn(failer); + + final LongConsumer sleep = mock(LongConsumer.class); + final HostAndPort movedTarget = new HostAndPort(null, 0); + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 3, + Duration.ofSeconds(1)) { + @Override + public String execute(Jedis connection) { + if (redirecter == connection) { + // First attempt, report moved + throw new JedisMovedDataException("Moved", movedTarget, 0); + } + + if (failer == connection) { + // Second attempt in response to the move, report failure + throw new JedisConnectionException("Connection failed"); + } + + throw new IllegalStateException("Should have thrown jedis exception"); + } + + @Override + protected void sleep(long sleepMillis) { + sleep.accept(sleepMillis); + } + }; + + try { + testMe.run(""); + fail("cluster command did not fail"); + } catch (JedisClusterMaxAttemptsException e) { + // expected + } + InOrder inOrder = inOrder(connectionHandler, sleep); + inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); + inOrder.verify(connectionHandler).renewSlotCache(redirecter); + inOrder.verify(connectionHandler).getConnectionFromNode(movedTarget); + inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verify(sleep).accept(anyLong()); + inOrder.verify(connectionHandler).getConnection(); + inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verifyNoMoreInteractions(); + } + + @Test(expected = JedisNoReachableClusterNodeException.class) + public void runRethrowsJedisNoReachableClusterNodeException() { + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + when(connectionHandler.getConnectionFromSlot(anyInt())).thenThrow( + JedisNoReachableClusterNodeException.class); + + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, + Duration.ZERO) { + @Override + public String execute(Jedis connection) { + return null; + } + + @Override + protected void sleep(long ignored) { + throw new RuntimeException("This test should never sleep"); + } + }; + + testMe.run(""); + } + + @Test + public void runStopsRetryingAfterTimeout() { + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + + final LongConsumer sleep = mock(LongConsumer.class); + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 3, + Duration.ZERO) { + @Override + public String execute(Jedis connection) { + try { + // exceed deadline + Thread.sleep(100L); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + throw new JedisConnectionException("Connection failed"); + } + + @Override + protected void sleep(long sleepMillis) { + sleep.accept(sleepMillis); + } + }; + + try { + testMe.run(""); + fail("cluster command did not fail"); + } catch (JedisClusterMaxAttemptsException e) { + // expected + } + InOrder inOrder = inOrder(connectionHandler, sleep); + inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); + inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verifyNoMoreInteractions(); + } + + @Test + public void runClosesConnectionBeforeRenewingSlotsCache() { + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + + Jedis connection = mock(Jedis.class); + when(connectionHandler.getConnectionFromSlot(anyInt())).thenReturn(connection); + + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 1, Duration.ZERO) { + @Override + public String execute(Jedis connection) { + throw new JedisConnectionException("Connection failure"); + } + }; + + try { + testMe.run(""); + fail("Didn't get the expected exception"); + } catch (JedisClusterMaxAttemptsException e) { + // Expected case, do nothing + } + + InOrder inOrder = inOrder(connectionHandler, connection); + // Must close connection before renewing slot cache, otherwise + // JedisClusterTest.testReturnConnectionOnJedisClusterConnection + // will start failing intermittently. + inOrder.verify(connection).close(); + inOrder.verify(connectionHandler).renewSlotCache(); + + // This one is because of a finally block, and isn't needed but doesn't hurt. + // If you rewrite the code so this close() call goes away, fell free to + // update this test as well to match! + inOrder.verify(connection).close(); + + inOrder.verifyNoMoreInteractions(); + } +} From f8d09c289c697fe773fc2798903b6541831252d4 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Fri, 29 Jan 2021 10:12:50 +0100 Subject: [PATCH 08/35] Add retries logging --- .../java/redis/clients/jedis/BinaryJedis.java | 5 ++++ .../java/redis/clients/jedis/Connection.java | 5 ++++ .../jedis/DefaultJedisSocketFactory.java | 5 ++++ .../clients/jedis/JedisClusterCommand.java | 28 +++++++++++++++++-- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedis.java b/src/main/java/redis/clients/jedis/BinaryJedis.java index 6e73d8864a..20096b9127 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedis.java +++ b/src/main/java/redis/clients/jedis/BinaryJedis.java @@ -189,6 +189,11 @@ public BinaryJedis(final JedisSocketFactory jedisSocketFactory) { client = new Client(jedisSocketFactory); } + @Override + public String toString() { + return "BinaryJedis{" + client + '}'; + } + private void initializeClientFromURI(URI uri) { initializeClientFromURI(uri, null, null, null); } diff --git a/src/main/java/redis/clients/jedis/Connection.java b/src/main/java/redis/clients/jedis/Connection.java index 6d533c549a..c8b3e38cc1 100644 --- a/src/main/java/redis/clients/jedis/Connection.java +++ b/src/main/java/redis/clients/jedis/Connection.java @@ -57,6 +57,11 @@ public Connection(final JedisSocketFactory jedisSocketFactory) { this.jedisSocketFactory = jedisSocketFactory; } + @Override + public String toString() { + return "Connection{" + jedisSocketFactory + "}"; + } + public Socket getSocket() { return socket; } diff --git a/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java b/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java index 1c914962a9..c74b8d6e0b 100644 --- a/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java +++ b/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java @@ -121,4 +121,9 @@ public int getSoTimeout() { public void setSoTimeout(int soTimeout) { this.soTimeout = soTimeout; } + + @Override + public String toString() { + return "DefaultJedisSocketFactory{" + host + ":" + +port + "}"; + } } diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 97af2713a6..7a76635a67 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -4,6 +4,8 @@ import java.time.Instant; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; @@ -24,6 +26,8 @@ public abstract class JedisClusterCommand { */ private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(20); + private static final Logger LOG = LoggerFactory.getLogger(JedisClusterCommand.class); + private final JedisClusterConnectionHandler connectionHandler; private final int maxAttempts; private final Duration timeout; @@ -143,10 +147,15 @@ private T runWithRetries(final int slot) { redirectionSupplier = null; } - return execute(connection); + final T result = execute(connection); + if (currentAttempt > 0) { + LOG.info("Success after {} attempts", currentAttempt + 1); + } + return result; } catch (JedisNoReachableClusterNodeException e) { throw e; } catch (JedisConnectionException e) { + LOG.warn("Failed connecting to Redis: {}", connection, e); // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet int attemptsLeft = maxAttempts - currentAttempt - 1; connectionSupplier = handleConnectionProblem(connection, slot, attemptsLeft, deadline); @@ -155,6 +164,8 @@ private T runWithRetries(final int slot) { } finally { releaseConnection(connection); } + + LOG.info("{} retries left...", maxAttempts - currentAttempt - 1); } throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); @@ -162,6 +173,7 @@ private T runWithRetries(final int slot) { protected void sleep(long sleepMillis) { try { + LOG.info("Backing off, sleeping {}ms before trying again...", sleepMillis); TimeUnit.MILLISECONDS.sleep(sleepMillis); } catch (InterruptedException e) { throw new RuntimeException(e); @@ -171,7 +183,11 @@ protected void sleep(long sleepMillis) { private Supplier handleConnectionProblem(Jedis failedConnection, final int slot, int attemptsLeft, Instant doneDeadline) { if (!shouldBackOff(attemptsLeft)) { - return () -> connectionHandler.getConnectionFromSlot(slot); + return () -> { + Jedis connection = connectionHandler.getConnectionFromSlot(slot); + LOG.info("Retrying with {}", connection); + return connection; + }; } // Must release current connection before renewing the slot cache below. If we fail to do this, @@ -188,11 +204,16 @@ private Supplier handleConnectionProblem(Jedis failedConnection, final in return () -> { sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); // Get a random connection, it will redirect us if it's not the right one - return connectionHandler.getConnection(); + LOG.info("Retrying with a random node..."); + Jedis connection = connectionHandler.getConnection(); + LOG.info("Retrying with random pick: {}", connection); + return connection; }; } private Supplier handleRedirection(Jedis connection, final JedisRedirectionException jre) { + LOG.debug("Redirected by server to {}", jre.getTargetNode()); + // if MOVED redirection occurred, if (jre instanceof JedisMovedDataException) { // it rebuilds cluster's slot cache recommended by Redis cluster specification @@ -204,6 +225,7 @@ private Supplier handleRedirection(Jedis connection, final JedisRedirecti return () -> { Jedis redirectedConnection = connectionHandler.getConnectionFromNode(jre.getTargetNode()); + LOG.info("Retrying with redirection target {}", connection); if (jre instanceof JedisAskDataException) { // TODO: Pipeline asking with the original command to make it faster.... redirectedConnection.asking(); From 9c7ef1daf4433d28b0e39ca3440fc062b1c02ccb Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Thu, 28 Jan 2021 11:25:15 +0100 Subject: [PATCH 09/35] Always use the user requested timeout --- .../clients/jedis/BinaryJedisCluster.java | 448 +++++++++--------- .../redis/clients/jedis/JedisCluster.java | 441 ++++++++--------- .../clients/jedis/JedisClusterCommand.java | 18 - 3 files changed, 449 insertions(+), 458 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index c7973d4c88..65bd389904 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -15,6 +15,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.Set; @@ -32,6 +33,7 @@ public class BinaryJedisCluster implements BinaryJedisClusterCommands, protected static final int DEFAULT_MAX_ATTEMPTS = 5; protected int maxAttempts; + protected final Duration timeout; protected JedisClusterConnectionHandler connectionHandler; @@ -65,6 +67,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, user, password, clientName); this.maxAttempts = maxAttempts; + this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); } public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout, @@ -72,6 +75,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName); this.maxAttempts = maxAttempts; + this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); } public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig poolConfig, @@ -97,6 +101,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, user, password, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap); this.maxAttempts = maxAttempts; + this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); } public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout, @@ -105,6 +110,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap); this.maxAttempts = maxAttempts; + this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); } @Override @@ -124,7 +130,7 @@ public Jedis getConnectionFromSlot(int slot) { @Override public String set(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.set(key, value); @@ -134,7 +140,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, this.timeout) { @Override public String execute(Jedis connection) { return connection.set(key, value, params); @@ -144,7 +150,7 @@ public String execute(Jedis connection) { @Override public byte[] get(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.get(key); @@ -154,7 +160,7 @@ public byte[] execute(Jedis connection) { @Override public Long exists(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.exists(keys); @@ -164,7 +170,7 @@ public Long execute(Jedis connection) { @Override public Boolean exists(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.exists(key); @@ -174,7 +180,7 @@ public Boolean execute(Jedis connection) { @Override public Long persist(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.persist(key); @@ -184,7 +190,7 @@ public Long execute(Jedis connection) { @Override public String type(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.type(key); @@ -194,7 +200,7 @@ public String execute(Jedis connection) { @Override public byte[] dump(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.dump(key); @@ -204,7 +210,7 @@ public byte[] execute(Jedis connection) { @Override public String restore(final byte[] key, final int ttl, final byte[] serializedValue) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.restore(key, ttl, serializedValue); @@ -214,7 +220,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.expire(key, seconds); @@ -224,7 +230,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pexpire(key, milliseconds); @@ -234,7 +240,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.expireAt(key, unixTime); @@ -244,7 +250,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pexpireAt(key, millisecondsTimestamp); @@ -254,7 +260,7 @@ public Long execute(Jedis connection) { @Override public Long ttl(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.ttl(key); @@ -264,7 +270,7 @@ public Long execute(Jedis connection) { @Override public Long pttl(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pttl(key); @@ -274,7 +280,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.touch(key); @@ -284,7 +290,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.touch(keys); @@ -294,7 +300,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, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -304,7 +310,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, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -314,7 +320,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, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.getbit(key, offset); @@ -324,7 +330,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.setrange(key, offset, value); @@ -334,7 +340,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, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.getrange(key, startOffset, endOffset); @@ -344,7 +350,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, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.getSet(key, value); @@ -354,7 +360,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.setnx(key, value); @@ -364,7 +370,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, this.timeout) { @Override public String execute(Jedis connection) { return connection.psetex(key, milliseconds, value); @@ -374,7 +380,7 @@ public String execute(Jedis connection) { @Override public String setex(final byte[] key, final int seconds, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.setex(key, seconds, value); @@ -384,7 +390,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.decrBy(key, decrement); @@ -394,7 +400,7 @@ public Long execute(Jedis connection) { @Override public Long decr(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.decr(key); @@ -404,7 +410,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.incrBy(key, increment); @@ -414,7 +420,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, this.timeout) { @Override public Double execute(Jedis connection) { return connection.incrByFloat(key, increment); @@ -424,7 +430,7 @@ public Double execute(Jedis connection) { @Override public Long incr(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.incr(key); @@ -434,7 +440,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.append(key, value); @@ -444,7 +450,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, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.substr(key, start, end); @@ -454,7 +460,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hset(key, field, value); @@ -464,7 +470,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hset(key, hash); @@ -474,7 +480,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, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.hget(key, field); @@ -484,7 +490,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hsetnx(key, field, value); @@ -494,7 +500,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, this.timeout) { @Override public String execute(Jedis connection) { return connection.hmset(key, hash); @@ -504,7 +510,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, this.timeout) { @Override public List execute(Jedis connection) { return connection.hmget(key, fields); @@ -514,7 +520,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hincrBy(key, field, value); @@ -524,7 +530,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, this.timeout) { @Override public Double execute(Jedis connection) { return connection.hincrByFloat(key, field, value); @@ -534,7 +540,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, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.hexists(key, field); @@ -544,7 +550,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, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hdel(key, field); @@ -554,7 +560,7 @@ public Long execute(Jedis connection) { @Override public Long hlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hlen(key); @@ -564,7 +570,7 @@ public Long execute(Jedis connection) { @Override public Set hkeys(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.hkeys(key); @@ -574,7 +580,7 @@ public Set execute(Jedis connection) { @Override public List hvals(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.hvals(key); @@ -584,7 +590,7 @@ public List execute(Jedis connection) { @Override public Map hgetAll(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Map execute(Jedis connection) { return connection.hgetAll(key); @@ -594,7 +600,7 @@ public Map execute(Jedis connection) { @Override public Long rpush(final byte[] key, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.rpush(key, args); @@ -604,7 +610,7 @@ public Long execute(Jedis connection) { @Override public Long lpush(final byte[] key, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpush(key, args); @@ -614,7 +620,7 @@ public Long execute(Jedis connection) { @Override public Long llen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.llen(key); @@ -624,7 +630,7 @@ public Long execute(Jedis connection) { @Override public List lrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.lrange(key, start, stop); @@ -634,7 +640,7 @@ public List execute(Jedis connection) { @Override public String ltrim(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.ltrim(key, start, stop); @@ -644,7 +650,7 @@ public String execute(Jedis connection) { @Override public byte[] lindex(final byte[] key, final long index) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.lindex(key, index); @@ -654,7 +660,7 @@ public byte[] execute(Jedis connection) { @Override public String lset(final byte[] key, final long index, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.lset(key, index, value); @@ -664,7 +670,7 @@ public String execute(Jedis connection) { @Override public Long lrem(final byte[] key, final long count, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lrem(key, count, value); @@ -674,7 +680,7 @@ public Long execute(Jedis connection) { @Override public byte[] lpop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.lpop(key); @@ -684,7 +690,7 @@ public byte[] execute(Jedis connection) { @Override public List lpop(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.lpop(key, count); @@ -694,7 +700,7 @@ public List execute(Jedis connection) { @Override public Long lpos(final byte[] key, final byte[] element) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element); @@ -704,7 +710,7 @@ public Long execute(Jedis connection) { @Override public Long lpos(final byte[] key, final byte[] element, final LPosParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element, params); @@ -714,7 +720,7 @@ public Long execute(Jedis connection) { @Override public List lpos(final byte[] key, final byte[] element, final LPosParams params, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.lpos(key, element, params, count); @@ -724,7 +730,7 @@ public List execute(Jedis connection) { @Override public byte[] rpop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.rpop(key); @@ -734,7 +740,7 @@ public byte[] execute(Jedis connection) { @Override public List rpop(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.rpop(key, count); @@ -744,7 +750,7 @@ public List execute(Jedis connection) { @Override public Long sadd(final byte[] key, final byte[]... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sadd(key, member); @@ -754,7 +760,7 @@ public Long execute(Jedis connection) { @Override public Set smembers(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.smembers(key); @@ -764,7 +770,7 @@ public Set execute(Jedis connection) { @Override public Long srem(final byte[] key, final byte[]... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.srem(key, member); @@ -774,7 +780,7 @@ public Long execute(Jedis connection) { @Override public byte[] spop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.spop(key); @@ -784,7 +790,7 @@ public byte[] execute(Jedis connection) { @Override public Set spop(final byte[] key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.spop(key, count); @@ -794,7 +800,7 @@ public Set execute(Jedis connection) { @Override public Long scard(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.scard(key); @@ -804,7 +810,7 @@ public Long execute(Jedis connection) { @Override public Boolean sismember(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.sismember(key, member); @@ -814,7 +820,7 @@ public Boolean execute(Jedis connection) { @Override public List smismember(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.smismember(key, members); @@ -824,7 +830,7 @@ public List execute(Jedis connection) { @Override public byte[] srandmember(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.srandmember(key); @@ -834,7 +840,7 @@ public byte[] execute(Jedis connection) { @Override public Long strlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.strlen(key); @@ -844,7 +850,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final double score, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member); @@ -855,7 +861,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final double score, final byte[] member, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member, params); @@ -865,7 +871,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final Map scoreMembers) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers); @@ -875,7 +881,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final Map scoreMembers, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers, params); @@ -885,7 +891,7 @@ public Long execute(Jedis connection) { @Override public Set zrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrange(key, start, stop); @@ -895,7 +901,7 @@ public Set execute(Jedis connection) { @Override public Long zrem(final byte[] key, final byte[]... members) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zrem(key, members); @@ -905,7 +911,7 @@ public Long execute(Jedis connection) { @Override public Double zincrby(final byte[] key, final double increment, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member); @@ -916,7 +922,7 @@ public Double execute(Jedis connection) { @Override public Double zincrby(final byte[] key, final double increment, final byte[] member, final ZIncrByParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member, params); @@ -926,7 +932,7 @@ public Double execute(Jedis connection) { @Override public Long zrank(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zrank(key, member); @@ -936,7 +942,7 @@ public Long execute(Jedis connection) { @Override public Long zrevrank(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zrevrank(key, member); @@ -946,7 +952,7 @@ public Long execute(Jedis connection) { @Override public Set zrevrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrange(key, start, stop); @@ -956,7 +962,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeWithScores(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeWithScores(key, start, stop); @@ -966,7 +972,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeWithScores(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeWithScores(key, start, stop); @@ -976,7 +982,7 @@ public Set execute(Jedis connection) { @Override public Long zcard(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zcard(key); @@ -986,7 +992,7 @@ public Long execute(Jedis connection) { @Override public Double zscore(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.zscore(key, member); @@ -996,7 +1002,7 @@ public Double execute(Jedis connection) { @Override public List zmscore(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.zmscore(key, members); @@ -1006,7 +1012,7 @@ public List execute(Jedis connection) { @Override public Tuple zpopmax(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Tuple execute(Jedis connection) { return connection.zpopmax(key); @@ -1016,7 +1022,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmax(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zpopmax(key, count); @@ -1026,7 +1032,7 @@ public Set execute(Jedis connection) { @Override public Tuple zpopmin(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Tuple execute(Jedis connection) { return connection.zpopmin(key); @@ -1036,7 +1042,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmin(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zpopmin(key, count); @@ -1046,7 +1052,7 @@ public Set execute(Jedis connection) { @Override public List sort(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.sort(key); @@ -1056,7 +1062,7 @@ public List execute(Jedis connection) { @Override public List sort(final byte[] key, final SortingParams sortingParameters) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.sort(key, sortingParameters); @@ -1066,7 +1072,7 @@ public List execute(Jedis connection) { @Override public Long zcount(final byte[] key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1076,7 +1082,7 @@ public Long execute(Jedis connection) { @Override public Long zcount(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1086,7 +1092,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1096,7 +1102,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1106,7 +1112,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1117,7 +1123,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1127,7 +1133,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1138,7 +1144,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1149,7 +1155,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1159,7 +1165,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1169,7 +1175,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1180,7 +1186,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1191,7 +1197,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1201,7 +1207,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1211,7 +1217,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1222,7 +1228,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1233,7 +1239,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1244,7 +1250,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1254,7 +1260,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByRank(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByRank(key, start, stop); @@ -1264,7 +1270,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final byte[] key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1274,7 +1280,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1285,7 +1291,7 @@ public Long execute(Jedis connection) { @Override public Long linsert(final byte[] key, final ListPosition where, final byte[] pivot, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.linsert(key, where, pivot, value); @@ -1295,7 +1301,7 @@ public Long execute(Jedis connection) { @Override public Long lpushx(final byte[] key, final byte[]... arg) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpushx(key, arg); @@ -1305,7 +1311,7 @@ public Long execute(Jedis connection) { @Override public Long rpushx(final byte[] key, final byte[]... arg) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.rpushx(key, arg); @@ -1315,7 +1321,7 @@ public Long execute(Jedis connection) { @Override public Long del(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.del(key); @@ -1325,7 +1331,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.unlink(key); @@ -1335,7 +1341,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.unlink(keys); @@ -1346,7 +1352,7 @@ public Long execute(Jedis connection) { @Override public byte[] echo(final byte[] arg) { // note that it'll be run from arbitary node - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.echo(arg); @@ -1356,7 +1362,7 @@ public byte[] execute(Jedis connection) { @Override public Long bitcount(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.bitcount(key); @@ -1366,7 +1372,7 @@ public Long execute(Jedis connection) { @Override public Long bitcount(final byte[] key, final long start, final long end) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.bitcount(key, start, end); @@ -1376,7 +1382,7 @@ public Long execute(Jedis connection) { @Override public Long pfadd(final byte[] key, final byte[]... elements) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pfadd(key, elements); @@ -1386,7 +1392,7 @@ public Long execute(Jedis connection) { @Override public long pfcount(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pfcount(key); @@ -1396,7 +1402,7 @@ public Long execute(Jedis connection) { @Override public List srandmember(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.srandmember(key, count); @@ -1406,7 +1412,7 @@ public List execute(Jedis connection) { @Override public Long zlexcount(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zlexcount(key, min, max); @@ -1416,7 +1422,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByLex(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max); @@ -1427,7 +1433,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByLex(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max, offset, count); @@ -1437,7 +1443,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min); @@ -1448,7 +1454,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min, offset, count); @@ -1458,7 +1464,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByLex(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByLex(key, min, max); @@ -1468,7 +1474,7 @@ public Long execute(Jedis connection) { @Override public Object eval(final byte[] script, final byte[] keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1478,7 +1484,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final int keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1488,7 +1494,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.eval(script, keys, args); @@ -1498,7 +1504,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.eval(script); @@ -1508,7 +1514,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1); @@ -1518,7 +1524,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keys, args); @@ -1528,7 +1534,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final int keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keyCount, params); @@ -1538,7 +1544,7 @@ public Object execute(Jedis connection) { @Override public List scriptExists(final byte[] sampleKey, final byte[]... sha1) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.scriptExists(sha1); @@ -1548,7 +1554,7 @@ public List execute(Jedis connection) { @Override public byte[] scriptLoad(final byte[] script, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.scriptLoad(script); @@ -1558,7 +1564,7 @@ public byte[] execute(Jedis connection) { @Override public String scriptFlush(final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.scriptFlush(); @@ -1568,7 +1574,7 @@ public String execute(Jedis connection) { @Override public String scriptKill(final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.scriptKill(); @@ -1578,7 +1584,7 @@ public String execute(Jedis connection) { @Override public Long del(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.del(keys); @@ -1588,7 +1594,7 @@ public Long execute(Jedis connection) { @Override public List blpop(final int timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1598,7 +1604,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, keys); @@ -1608,7 +1614,7 @@ public List execute(Jedis connection) { @Override public List mget(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.mget(keys); @@ -1624,7 +1630,7 @@ public String mset(final byte[]... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.mset(keysvalues); @@ -1640,7 +1646,7 @@ public Long msetnx(final byte[]... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.msetnx(keysvalues); @@ -1650,7 +1656,7 @@ public Long execute(Jedis connection) { @Override public String rename(final byte[] oldkey, final byte[] newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.rename(oldkey, newkey); @@ -1660,7 +1666,7 @@ public String execute(Jedis connection) { @Override public Long renamenx(final byte[] oldkey, final byte[] newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.renamenx(oldkey, newkey); @@ -1670,7 +1676,7 @@ public Long execute(Jedis connection) { @Override public byte[] rpoplpush(final byte[] srckey, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.rpoplpush(srckey, dstkey); @@ -1680,7 +1686,7 @@ public byte[] execute(Jedis connection) { @Override public Set sdiff(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.sdiff(keys); @@ -1692,7 +1698,7 @@ public Set execute(Jedis connection) { public Long sdiffstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sdiffstore(dstkey, keys); @@ -1702,7 +1708,7 @@ public Long execute(Jedis connection) { @Override public Set sinter(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.sinter(keys); @@ -1714,7 +1720,7 @@ public Set execute(Jedis connection) { public Long sinterstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sinterstore(dstkey, keys); @@ -1724,7 +1730,7 @@ public Long execute(Jedis connection) { @Override public Long smove(final byte[] srckey, final byte[] dstkey, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.smove(srckey, dstkey, member); @@ -1734,7 +1740,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final byte[] key, final SortingParams sortingParameters, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sort(key, sortingParameters, dstkey); @@ -1744,7 +1750,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final byte[] key, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sort(key, dstkey); @@ -1754,7 +1760,7 @@ public Long execute(Jedis connection) { @Override public Set sunion(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.sunion(keys); @@ -1766,7 +1772,7 @@ public Set execute(Jedis connection) { public Long sunionstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sunionstore(dstkey, keys); @@ -1778,7 +1784,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final byte[] dstkey, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, sets); @@ -1790,7 +1796,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final byte[] dstkey, final ZParams params, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, params, sets); @@ -1802,7 +1808,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final byte[] dstkey, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, sets); @@ -1814,7 +1820,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final byte[] dstkey, final ZParams params, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, params, sets); @@ -1824,7 +1830,7 @@ public Long execute(Jedis connection) { @Override public byte[] brpoplpush(final byte[] source, final byte[] destination, final int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.brpoplpush(source, destination, timeout); @@ -1834,7 +1840,7 @@ public byte[] execute(Jedis connection) { @Override public Long publish(final byte[] channel, final byte[] message) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.publish(channel, message); @@ -1844,7 +1850,7 @@ public Long execute(Jedis connection) { @Override public void subscribe(final BinaryJedisPubSub jedisPubSub, final byte[]... channels) { - new JedisClusterCommand(connectionHandler, maxAttempts) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Integer execute(Jedis connection) { connection.subscribe(jedisPubSub, channels); @@ -1855,7 +1861,7 @@ public Integer execute(Jedis connection) { @Override public void psubscribe(final BinaryJedisPubSub jedisPubSub, final byte[]... patterns) { - new JedisClusterCommand(connectionHandler, maxAttempts) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Integer execute(Jedis connection) { connection.psubscribe(jedisPubSub, patterns); @@ -1868,7 +1874,7 @@ public Integer execute(Jedis connection) { public Long bitop(final BitOP op, final byte[] destKey, final byte[]... srcKeys) { byte[][] wholeKeys = KeyMergeUtil.merge(destKey, srcKeys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.bitop(op, destKey, srcKeys); @@ -1880,7 +1886,7 @@ public Long execute(Jedis connection) { public String pfmerge(final byte[] destkey, final byte[]... sourcekeys) { byte[][] wholeKeys = KeyMergeUtil.merge(destkey, sourcekeys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.pfmerge(destkey, sourcekeys); @@ -1890,7 +1896,7 @@ public String execute(Jedis connection) { @Override public Long pfcount(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pfcount(keys); @@ -1901,7 +1907,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final byte[] key, final double longitude, final double latitude, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, longitude, latitude, member); @@ -1911,7 +1917,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final byte[] key, final Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, memberCoordinateMap); @@ -1921,7 +1927,7 @@ public Long execute(Jedis connection) { @Override public Double geodist(final byte[] key, final byte[] member1, final byte[] member2) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2); @@ -1932,7 +1938,7 @@ public Double execute(Jedis connection) { @Override public Double geodist(final byte[] key, final byte[] member1, final byte[] member2, final GeoUnit unit) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2, unit); @@ -1942,7 +1948,7 @@ public Double execute(Jedis connection) { @Override public List geohash(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.geohash(key, members); @@ -1952,7 +1958,7 @@ public List execute(Jedis connection) { @Override public List geopos(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.geopos(key, members); @@ -1963,7 +1969,7 @@ public List execute(Jedis connection) { @Override public List georadius(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit); @@ -1974,7 +1980,7 @@ public List execute(Jedis connection) { @Override public List georadiusReadonly(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit); @@ -1985,7 +1991,7 @@ public List execute(Jedis connection) { @Override public List georadius(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit, param); @@ -1997,7 +2003,7 @@ public List execute(Jedis connection) { public Long georadiusStore(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { byte[][] keys = storeParam.getByteKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.georadiusStore(key, longitude, latitude, radius, unit, param, storeParam); @@ -2008,7 +2014,7 @@ public Long execute(Jedis connection) { @Override public List georadiusReadonly(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit, param); @@ -2019,7 +2025,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final byte[] key, final byte[] member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit); @@ -2030,7 +2036,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final byte[] key, final byte[] member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit); @@ -2041,7 +2047,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit, param); @@ -2053,7 +2059,7 @@ public List execute(Jedis connection) { public Long georadiusByMemberStore(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { byte[][] keys = storeParam.getByteKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.georadiusByMemberStore(key, member, radius, unit, param, storeParam); @@ -2064,7 +2070,7 @@ public Long execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit, param); @@ -2082,7 +2088,7 @@ public Set keys(final byte[] pattern) { throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports KEYS commands with patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.keys(pattern); @@ -2105,7 +2111,7 @@ public ScanResult scan(final byte[] cursor, final ScanParams params) { + " only supports SCAN commands with MATCH patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts) { + return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.scan(cursor, params); @@ -2116,7 +2122,8 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult> hscan(final byte[] key, final byte[] cursor) { return new JedisClusterCommand>>(connectionHandler, - maxAttempts) { + maxAttempts, + this.timeout) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor); @@ -2128,7 +2135,8 @@ public ScanResult> execute(Jedis connection) { public ScanResult> hscan(final byte[] key, final byte[] cursor, final ScanParams params) { return new JedisClusterCommand>>(connectionHandler, - maxAttempts) { + maxAttempts, + this.timeout) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor, params); @@ -2138,7 +2146,7 @@ public ScanResult> execute(Jedis connection) { @Override public ScanResult sscan(final byte[] key, final byte[] cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor); @@ -2148,7 +2156,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult sscan(final byte[] key, final byte[] cursor, final ScanParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor, params); @@ -2158,7 +2166,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final byte[] key, final byte[] cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor); @@ -2168,7 +2176,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final byte[] key, final byte[] cursor, final ScanParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor, params); @@ -2178,7 +2186,7 @@ public ScanResult execute(Jedis connection) { @Override public List bitfield(final byte[] key, final byte[]... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.bitfield(key, arguments); @@ -2188,7 +2196,7 @@ public List execute(Jedis connection) { @Override public List bitfieldReadonly(final byte[] key, final byte[]... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.bitfieldReadonly(key, arguments); @@ -2198,7 +2206,7 @@ public List execute(Jedis connection) { @Override public Long hstrlen(final byte[] key, final byte[] field) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hstrlen(key, field); @@ -2208,7 +2216,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key); @@ -2218,7 +2226,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final byte[] key, final int samples) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key, samples); @@ -2228,7 +2236,7 @@ public Long execute(Jedis connection) { @Override public byte[] xadd(final byte[] key, final byte[] id, final Map hash, final long maxLen, final boolean approximateLength){ - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.xadd(key, id, hash, maxLen, approximateLength); @@ -2238,7 +2246,7 @@ public byte[] execute(Jedis connection) { @Override public Long xlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xlen(key); @@ -2248,7 +2256,7 @@ public Long execute(Jedis connection) { @Override public List xrange(final byte[] key, final byte[] start, final byte[] end, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end, count); @@ -2258,7 +2266,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start, count); @@ -2270,7 +2278,7 @@ public List execute(Jedis connection) { public List xread(final int count, final long block, final Map streams) { byte[][] keys = streams.keySet().toArray(new byte[streams.size()][]); - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xread(count, block, streams); @@ -2280,7 +2288,7 @@ public List execute(Jedis connection) { @Override public Long xack(final byte[] key, final byte[] group, final byte[]... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xack(key, group, ids); @@ -2290,7 +2298,7 @@ public Long execute(Jedis connection) { @Override public String xgroupCreate(final byte[] key, final byte[] consumer, final byte[] id, final boolean makeStream) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.xgroupCreate(key, consumer, id, makeStream); @@ -2300,7 +2308,7 @@ public String execute(Jedis connection) { @Override public String xgroupSetID(final byte[] key, final byte[] consumer, final byte[] id) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.xgroupSetID(key, consumer, id); @@ -2310,7 +2318,7 @@ public String execute(Jedis connection) { @Override public Long xgroupDestroy(final byte[] key, final byte[] consumer) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xgroupDestroy(key, consumer); @@ -2320,7 +2328,7 @@ public Long execute(Jedis connection) { @Override public Long xgroupDelConsumer(final byte[] key, final byte[] consumer, final byte[] consumerName) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xgroupDelConsumer(key, consumer, consumerName); @@ -2334,7 +2342,7 @@ public List xreadGroup(final byte[] groupname, final byte[] consumer, byte[][] keys = streams.keySet().toArray(new byte[streams.size()][]); - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xreadGroup(groupname, consumer, count, block, noAck, streams); @@ -2344,7 +2352,7 @@ public List execute(Jedis connection) { @Override public Long xdel(final byte[] key, final byte[]... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xdel(key, ids); @@ -2354,7 +2362,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final byte[] key, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, maxLen, approximateLength); @@ -2365,7 +2373,7 @@ public Long execute(Jedis connection) { @Override public List xpending(final byte[] key, final byte[] groupname, final byte[] start, final byte[] end, final int count, final byte[] consumername) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, start, end, count, consumername); @@ -2376,7 +2384,7 @@ public List execute(Jedis connection) { @Override public List xclaim(final byte[] key, final byte[] groupname, final byte[] consumername, final long minIdleTime, final long newIdleTime, final int retries, final boolean force, final byte[][] ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xclaim(key, groupname, consumername, minIdleTime, newIdleTime, retries, force, ids); @@ -2386,7 +2394,7 @@ public List execute(Jedis connection) { @Override public Long waitReplicas(final byte[] key, final int replicas, final long timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.waitReplicas(replicas, timeout); @@ -2395,7 +2403,7 @@ public Long execute(Jedis connection) { } public Object sendCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection){ return connection.sendCommand(cmd, args); @@ -2404,7 +2412,7 @@ public Object execute(Jedis connection){ } public Object sendBlockingCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection){ return connection.sendBlockingCommand(cmd, args); diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 7f9d6e3921..9ac116568a 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -195,7 +195,7 @@ public JedisCluster(Set jedisClusterNode, int connectionTimeout, in @Override public String set(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.set(key, value); @@ -205,7 +205,7 @@ public String execute(Jedis connection) { @Override public String set(final String key, final String value, final SetParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.set(key, value, params); @@ -215,7 +215,7 @@ public String execute(Jedis connection) { @Override public String get(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.get(key); @@ -225,7 +225,7 @@ public String execute(Jedis connection) { @Override public Boolean exists(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.exists(key); @@ -235,7 +235,7 @@ public Boolean execute(Jedis connection) { @Override public Long exists(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.exists(keys); @@ -245,7 +245,7 @@ public Long execute(Jedis connection) { @Override public Long persist(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.persist(key); @@ -255,7 +255,7 @@ public Long execute(Jedis connection) { @Override public String type(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.type(key); @@ -265,7 +265,7 @@ public String execute(Jedis connection) { @Override public byte[] dump(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public byte[] execute(Jedis connection) { return connection.dump(key); @@ -275,7 +275,7 @@ public byte[] execute(Jedis connection) { @Override public String restore(final String key, final int ttl, final byte[] serializedValue) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.restore(key, ttl, serializedValue); @@ -285,7 +285,7 @@ public String execute(Jedis connection) { @Override public Long expire(final String key, final int seconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.expire(key, seconds); @@ -295,7 +295,7 @@ public Long execute(Jedis connection) { @Override public Long pexpire(final String key, final long milliseconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pexpire(key, milliseconds); @@ -305,7 +305,7 @@ public Long execute(Jedis connection) { @Override public Long expireAt(final String key, final long unixTime) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.expireAt(key, unixTime); @@ -315,7 +315,7 @@ public Long execute(Jedis connection) { @Override public Long pexpireAt(final String key, final long millisecondsTimestamp) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pexpireAt(key, millisecondsTimestamp); @@ -325,7 +325,7 @@ public Long execute(Jedis connection) { @Override public Long ttl(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.ttl(key); @@ -335,7 +335,7 @@ public Long execute(Jedis connection) { @Override public Long pttl(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pttl(key); @@ -345,7 +345,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.touch(key); @@ -355,7 +355,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.touch(keys); @@ -365,7 +365,7 @@ public Long execute(Jedis connection) { @Override public Boolean setbit(final String key, final long offset, final boolean value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -375,7 +375,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean setbit(final String key, final long offset, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -385,7 +385,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean getbit(final String key, final long offset) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.getbit(key, offset); @@ -395,7 +395,7 @@ public Boolean execute(Jedis connection) { @Override public Long setrange(final String key, final long offset, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.setrange(key, offset, value); @@ -405,7 +405,7 @@ public Long execute(Jedis connection) { @Override public String getrange(final String key, final long startOffset, final long endOffset) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.getrange(key, startOffset, endOffset); @@ -415,7 +415,7 @@ public String execute(Jedis connection) { @Override public String getSet(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.getSet(key, value); @@ -425,7 +425,7 @@ public String execute(Jedis connection) { @Override public Long setnx(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.setnx(key, value); @@ -435,7 +435,7 @@ public Long execute(Jedis connection) { @Override public String setex(final String key, final int seconds, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.setex(key, seconds, value); @@ -445,7 +445,7 @@ public String execute(Jedis connection) { @Override public String psetex(final String key, final long milliseconds, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.psetex(key, milliseconds, value); @@ -455,7 +455,7 @@ public String execute(Jedis connection) { @Override public Long decrBy(final String key, final long decrement) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.decrBy(key, decrement); @@ -465,7 +465,7 @@ public Long execute(Jedis connection) { @Override public Long decr(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.decr(key); @@ -475,7 +475,7 @@ public Long execute(Jedis connection) { @Override public Long incrBy(final String key, final long increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.incrBy(key, increment); @@ -485,7 +485,7 @@ public Long execute(Jedis connection) { @Override public Double incrByFloat(final String key, final double increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.incrByFloat(key, increment); @@ -495,7 +495,7 @@ public Double execute(Jedis connection) { @Override public Long incr(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.incr(key); @@ -505,7 +505,7 @@ public Long execute(Jedis connection) { @Override public Long append(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.append(key, value); @@ -515,7 +515,7 @@ public Long execute(Jedis connection) { @Override public String substr(final String key, final int start, final int end) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.substr(key, start, end); @@ -525,7 +525,7 @@ public String execute(Jedis connection) { @Override public Long hset(final String key, final String field, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hset(key, field, value); @@ -535,7 +535,7 @@ public Long execute(Jedis connection) { @Override public Long hset(final String key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hset(key, hash); @@ -545,7 +545,7 @@ public Long execute(Jedis connection) { @Override public String hget(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.hget(key, field); @@ -555,7 +555,7 @@ public String execute(Jedis connection) { @Override public Long hsetnx(final String key, final String field, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hsetnx(key, field, value); @@ -565,7 +565,7 @@ public Long execute(Jedis connection) { @Override public String hmset(final String key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.hmset(key, hash); @@ -575,7 +575,7 @@ public String execute(Jedis connection) { @Override public List hmget(final String key, final String... fields) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.hmget(key, fields); @@ -585,7 +585,7 @@ public List execute(Jedis connection) { @Override public Long hincrBy(final String key, final String field, final long value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hincrBy(key, field, value); @@ -595,7 +595,7 @@ public Long execute(Jedis connection) { @Override public Double hincrByFloat(final String key, final String field, final double value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.hincrByFloat(key, field, value); @@ -605,7 +605,7 @@ public Double execute(Jedis connection) { @Override public Boolean hexists(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.hexists(key, field); @@ -615,7 +615,7 @@ public Boolean execute(Jedis connection) { @Override public Long hdel(final String key, final String... field) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hdel(key, field); @@ -625,7 +625,7 @@ public Long execute(Jedis connection) { @Override public Long hlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hlen(key); @@ -635,7 +635,7 @@ public Long execute(Jedis connection) { @Override public Set hkeys(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.hkeys(key); @@ -645,7 +645,7 @@ public Set execute(Jedis connection) { @Override public List hvals(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.hvals(key); @@ -655,7 +655,7 @@ public List execute(Jedis connection) { @Override public Map hgetAll(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Map execute(Jedis connection) { return connection.hgetAll(key); @@ -665,7 +665,7 @@ public Map execute(Jedis connection) { @Override public Long rpush(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.rpush(key, string); @@ -675,7 +675,7 @@ public Long execute(Jedis connection) { @Override public Long lpush(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpush(key, string); @@ -685,7 +685,7 @@ public Long execute(Jedis connection) { @Override public Long llen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.llen(key); @@ -695,7 +695,7 @@ public Long execute(Jedis connection) { @Override public List lrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.lrange(key, start, stop); @@ -705,7 +705,7 @@ public List execute(Jedis connection) { @Override public String ltrim(final String key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.ltrim(key, start, stop); @@ -715,7 +715,7 @@ public String execute(Jedis connection) { @Override public String lindex(final String key, final long index) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.lindex(key, index); @@ -725,7 +725,7 @@ public String execute(Jedis connection) { @Override public String lset(final String key, final long index, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.lset(key, index, value); @@ -735,7 +735,7 @@ public String execute(Jedis connection) { @Override public Long lrem(final String key, final long count, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lrem(key, count, value); @@ -745,7 +745,7 @@ public Long execute(Jedis connection) { @Override public String lpop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.lpop(key); @@ -755,7 +755,7 @@ public String execute(Jedis connection) { @Override public List lpop(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.lpop(key, count); @@ -765,7 +765,7 @@ public List execute(Jedis connection) { @Override public Long lpos(final String key, final String element) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element); @@ -775,7 +775,7 @@ public Long execute(Jedis connection) { @Override public Long lpos(final String key, final String element, final LPosParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element, params); @@ -785,7 +785,7 @@ public Long execute(Jedis connection) { @Override public List lpos(final String key, final String element, final LPosParams params, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.lpos(key, element, params, count); @@ -795,7 +795,7 @@ public List execute(Jedis connection) { @Override public String rpop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.rpop(key); @@ -805,7 +805,7 @@ public String execute(Jedis connection) { @Override public List rpop(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.rpop(key, count); @@ -815,7 +815,7 @@ public List execute(Jedis connection) { @Override public Long sadd(final String key, final String... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sadd(key, member); @@ -825,7 +825,7 @@ public Long execute(Jedis connection) { @Override public Set smembers(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.smembers(key); @@ -835,7 +835,7 @@ public Set execute(Jedis connection) { @Override public Long srem(final String key, final String... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.srem(key, member); @@ -845,7 +845,7 @@ public Long execute(Jedis connection) { @Override public String spop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.spop(key); @@ -855,7 +855,7 @@ public String execute(Jedis connection) { @Override public Set spop(final String key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.spop(key, count); @@ -865,7 +865,7 @@ public Set execute(Jedis connection) { @Override public Long scard(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.scard(key); @@ -875,7 +875,7 @@ public Long execute(Jedis connection) { @Override public Boolean sismember(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.sismember(key, member); @@ -885,7 +885,7 @@ public Boolean execute(Jedis connection) { @Override public List smismember(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.smismember(key, members); @@ -895,7 +895,7 @@ public List execute(Jedis connection) { @Override public String srandmember(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.srandmember(key); @@ -905,7 +905,7 @@ public String execute(Jedis connection) { @Override public List srandmember(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.srandmember(key, count); @@ -915,7 +915,7 @@ public List execute(Jedis connection) { @Override public Long strlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.strlen(key); @@ -925,7 +925,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final double score, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member); @@ -936,7 +936,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final double score, final String member, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member, params); @@ -946,7 +946,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final Map scoreMembers) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers); @@ -956,7 +956,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final Map scoreMembers, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers, params); @@ -966,7 +966,7 @@ public Long execute(Jedis connection) { @Override public Set zrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrange(key, start, stop); @@ -976,7 +976,7 @@ public Set execute(Jedis connection) { @Override public Long zrem(final String key, final String... members) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zrem(key, members); @@ -986,7 +986,7 @@ public Long execute(Jedis connection) { @Override public Double zincrby(final String key, final double increment, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member); @@ -997,7 +997,7 @@ public Double execute(Jedis connection) { @Override public Double zincrby(final String key, final double increment, final String member, final ZIncrByParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member, params); @@ -1007,7 +1007,7 @@ public Double execute(Jedis connection) { @Override public Long zrank(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zrank(key, member); @@ -1017,7 +1017,7 @@ public Long execute(Jedis connection) { @Override public Long zrevrank(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zrevrank(key, member); @@ -1027,7 +1027,7 @@ public Long execute(Jedis connection) { @Override public Set zrevrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrange(key, start, stop); @@ -1037,7 +1037,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeWithScores(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeWithScores(key, start, stop); @@ -1047,7 +1047,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeWithScores(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeWithScores(key, start, stop); @@ -1057,7 +1057,7 @@ public Set execute(Jedis connection) { @Override public Long zcard(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zcard(key); @@ -1067,7 +1067,7 @@ public Long execute(Jedis connection) { @Override public Double zscore(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.zscore(key, member); @@ -1077,7 +1077,7 @@ public Double execute(Jedis connection) { @Override public List zmscore(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.zmscore(key, members); @@ -1087,7 +1087,7 @@ public List execute(Jedis connection) { @Override public Tuple zpopmax(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Tuple execute(Jedis connection) { return connection.zpopmax(key); @@ -1097,7 +1097,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmax(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zpopmax(key, count); @@ -1107,7 +1107,7 @@ public Set execute(Jedis connection) { @Override public Tuple zpopmin(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Tuple execute(Jedis connection) { return connection.zpopmin(key); @@ -1117,7 +1117,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmin(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zpopmin(key, count); @@ -1127,7 +1127,7 @@ public Set execute(Jedis connection) { @Override public List sort(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.sort(key); @@ -1137,7 +1137,7 @@ public List execute(Jedis connection) { @Override public List sort(final String key, final SortingParams sortingParameters) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.sort(key, sortingParameters); @@ -1147,7 +1147,7 @@ public List execute(Jedis connection) { @Override public Long zcount(final String key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1157,7 +1157,7 @@ public Long execute(Jedis connection) { @Override public Long zcount(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1167,7 +1167,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1177,7 +1177,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1187,7 +1187,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1198,7 +1198,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1208,7 +1208,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1219,7 +1219,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1230,7 +1230,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1240,7 +1240,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1250,7 +1250,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1261,7 +1261,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1272,7 +1272,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1282,7 +1282,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1292,7 +1292,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1303,7 +1303,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1314,7 +1314,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1325,7 +1325,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1335,7 +1335,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByRank(final String key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByRank(key, start, stop); @@ -1345,7 +1345,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final String key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1355,7 +1355,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1365,7 +1365,7 @@ public Long execute(Jedis connection) { @Override public Long zlexcount(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zlexcount(key, min, max); @@ -1375,7 +1375,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByLex(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max); @@ -1386,7 +1386,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByLex(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max, offset, count); @@ -1396,7 +1396,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min); @@ -1407,7 +1407,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min, offset, count); @@ -1417,7 +1417,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByLex(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zremrangeByLex(key, min, max); @@ -1428,7 +1428,7 @@ public Long execute(Jedis connection) { @Override public Long linsert(final String key, final ListPosition where, final String pivot, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.linsert(key, where, pivot, value); @@ -1438,7 +1438,7 @@ public Long execute(Jedis connection) { @Override public Long lpushx(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.lpushx(key, string); @@ -1448,7 +1448,7 @@ public Long execute(Jedis connection) { @Override public Long rpushx(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.rpushx(key, string); @@ -1458,7 +1458,7 @@ public Long execute(Jedis connection) { @Override public Long del(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.del(key); @@ -1468,7 +1468,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.unlink(key); @@ -1478,7 +1478,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.unlink(keys); @@ -1489,7 +1489,7 @@ public Long execute(Jedis connection) { @Override public String echo(final String string) { // note that it'll be run from arbitrary node - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.echo(string); @@ -1499,7 +1499,7 @@ public String execute(Jedis connection) { @Override public Long bitcount(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.bitcount(key); @@ -1509,7 +1509,7 @@ public Long execute(Jedis connection) { @Override public Long bitcount(final String key, final long start, final long end) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.bitcount(key, start, end); @@ -1527,7 +1527,7 @@ public Set keys(final String pattern) { throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports KEYS commands with patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.keys(pattern); @@ -1550,7 +1550,7 @@ public ScanResult scan(final String cursor, final ScanParams params) { + " only supports SCAN commands with MATCH patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts) { + return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.scan(cursor, params); @@ -1561,7 +1561,8 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult> hscan(final String key, final String cursor) { return new JedisClusterCommand>>(connectionHandler, - maxAttempts) { + maxAttempts, + this.timeout) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor); @@ -1571,7 +1572,7 @@ public ScanResult> execute(Jedis connection) { @Override public ScanResult sscan(final String key, final String cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor); @@ -1581,7 +1582,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final String key, final String cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor); @@ -1591,7 +1592,7 @@ public ScanResult execute(Jedis connection) { @Override public Long pfadd(final String key, final String... elements) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pfadd(key, elements); @@ -1601,7 +1602,7 @@ public Long execute(Jedis connection) { @Override public long pfcount(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pfcount(key); @@ -1611,7 +1612,7 @@ public Long execute(Jedis connection) { @Override public List blpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, key); @@ -1621,7 +1622,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, key); @@ -1631,7 +1632,7 @@ public List execute(Jedis connection) { @Override public Long del(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.del(keys); @@ -1641,7 +1642,7 @@ public Long execute(Jedis connection) { @Override public List blpop(final int timeout, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1652,7 +1653,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, keys); @@ -1662,7 +1663,7 @@ public List execute(Jedis connection) { @Override public List mget(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.mget(keys); @@ -1678,7 +1679,7 @@ public String mset(final String... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.mset(keysvalues); @@ -1694,7 +1695,7 @@ public Long msetnx(final String... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.msetnx(keysvalues); @@ -1704,7 +1705,7 @@ public Long execute(Jedis connection) { @Override public String rename(final String oldkey, final String newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.rename(oldkey, newkey); @@ -1714,7 +1715,7 @@ public String execute(Jedis connection) { @Override public Long renamenx(final String oldkey, final String newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.renamenx(oldkey, newkey); @@ -1724,7 +1725,7 @@ public Long execute(Jedis connection) { @Override public String rpoplpush(final String srckey, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.rpoplpush(srckey, dstkey); @@ -1734,7 +1735,7 @@ public String execute(Jedis connection) { @Override public Set sdiff(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.sdiff(keys); @@ -1746,7 +1747,7 @@ public Set execute(Jedis connection) { public Long sdiffstore(final String dstkey, final String... keys) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sdiffstore(dstkey, keys); @@ -1756,7 +1757,7 @@ public Long execute(Jedis connection) { @Override public Set sinter(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.sinter(keys); @@ -1768,7 +1769,7 @@ public Set execute(Jedis connection) { public Long sinterstore(final String dstkey, final String... keys) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sinterstore(dstkey, keys); @@ -1778,7 +1779,7 @@ public Long execute(Jedis connection) { @Override public Long smove(final String srckey, final String dstkey, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.smove(srckey, dstkey, member); @@ -1788,7 +1789,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final String key, final SortingParams sortingParameters, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sort(key, sortingParameters, dstkey); @@ -1798,7 +1799,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final String key, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sort(key, dstkey); @@ -1808,7 +1809,7 @@ public Long execute(Jedis connection) { @Override public Set sunion(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public Set execute(Jedis connection) { return connection.sunion(keys); @@ -1820,7 +1821,7 @@ public Set execute(Jedis connection) { public Long sunionstore(final String dstkey, final String... keys) { String[] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.sunionstore(dstkey, keys); @@ -1832,7 +1833,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final String dstkey, final String... sets) { String[] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, sets); @@ -1844,7 +1845,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final String dstkey, final ZParams params, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, params, sets); @@ -1856,7 +1857,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final String dstkey, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, sets); @@ -1868,7 +1869,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final String dstkey, final ZParams params, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, params, sets); @@ -1878,7 +1879,7 @@ public Long execute(Jedis connection) { @Override public String brpoplpush(final String source, final String destination, final int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.brpoplpush(source, destination, timeout); @@ -1888,7 +1889,7 @@ public String execute(Jedis connection) { @Override public Long publish(final String channel, final String message) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.publish(channel, message); @@ -1898,7 +1899,7 @@ public Long execute(Jedis connection) { @Override public void subscribe(final JedisPubSub jedisPubSub, final String... channels) { - new JedisClusterCommand(connectionHandler, maxAttempts) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Integer execute(Jedis connection) { connection.subscribe(jedisPubSub, channels); @@ -1909,7 +1910,7 @@ public Integer execute(Jedis connection) { @Override public void psubscribe(final JedisPubSub jedisPubSub, final String... patterns) { - new JedisClusterCommand(connectionHandler, maxAttempts) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Integer execute(Jedis connection) { connection.psubscribe(jedisPubSub, patterns); @@ -1922,7 +1923,7 @@ public Integer execute(Jedis connection) { public Long bitop(final BitOP op, final String destKey, final String... srcKeys) { String[] mergedKeys = KeyMergeUtil.merge(destKey, srcKeys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.bitop(op, destKey, srcKeys); @@ -1934,7 +1935,7 @@ public Long execute(Jedis connection) { public String pfmerge(final String destkey, final String... sourcekeys) { String[] mergedKeys = KeyMergeUtil.merge(destkey, sourcekeys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.pfmerge(destkey, sourcekeys); @@ -1944,7 +1945,7 @@ public String execute(Jedis connection) { @Override public long pfcount(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.pfcount(keys); @@ -1954,7 +1955,7 @@ public Long execute(Jedis connection) { @Override public Object eval(final String script, final int keyCount, final String... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1964,7 +1965,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final String script, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.eval(script); @@ -1974,7 +1975,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final String script, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.eval(script, keys, args); @@ -1984,7 +1985,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final int keyCount, final String... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keyCount, params); @@ -1994,7 +1995,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keys, args); @@ -2004,7 +2005,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1); @@ -2014,7 +2015,7 @@ public Object execute(Jedis connection) { @Override public Boolean scriptExists(final String sha1, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Boolean execute(Jedis connection) { return connection.scriptExists(sha1); @@ -2024,7 +2025,7 @@ public Boolean execute(Jedis connection) { @Override public List scriptExists(final String sampleKey, final String... sha1) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.scriptExists(sha1); @@ -2034,7 +2035,7 @@ public List execute(Jedis connection) { @Override public String scriptLoad(final String script, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.scriptLoad(script); @@ -2044,7 +2045,7 @@ public String execute(Jedis connection) { @Override public String scriptFlush(final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.scriptFlush(); @@ -2054,7 +2055,7 @@ public String execute(Jedis connection) { @Override public String scriptKill(final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.scriptKill(); @@ -2065,7 +2066,7 @@ public String execute(Jedis connection) { @Override public Long geoadd(final String key, final double longitude, final double latitude, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, longitude, latitude, member); @@ -2075,7 +2076,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final String key, final Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, memberCoordinateMap); @@ -2085,7 +2086,7 @@ public Long execute(Jedis connection) { @Override public Double geodist(final String key, final String member1, final String member2) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2); @@ -2096,7 +2097,7 @@ public Double execute(Jedis connection) { @Override public Double geodist(final String key, final String member1, final String member2, final GeoUnit unit) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2, unit); @@ -2106,7 +2107,7 @@ public Double execute(Jedis connection) { @Override public List geohash(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.geohash(key, members); @@ -2116,7 +2117,7 @@ public List execute(Jedis connection) { @Override public List geopos(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.geopos(key, members); @@ -2127,7 +2128,7 @@ public List execute(Jedis connection) { @Override public List georadius(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit); @@ -2138,7 +2139,7 @@ public List execute(Jedis connection) { @Override public List georadiusReadonly(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit); @@ -2149,7 +2150,7 @@ public List execute(Jedis connection) { @Override public List georadius(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit, param); @@ -2161,7 +2162,7 @@ public List execute(Jedis connection) { public Long georadiusStore(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { String[] keys = storeParam.getStringKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.georadiusStore(key, longitude, latitude, radius, unit, param, storeParam); @@ -2172,7 +2173,7 @@ public Long execute(Jedis connection) { @Override public List georadiusReadonly(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit, param); @@ -2183,7 +2184,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final String key, final String member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit); @@ -2194,7 +2195,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final String key, final String member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit); @@ -2205,7 +2206,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit, param); @@ -2217,7 +2218,7 @@ public List execute(Jedis connection) { public Long georadiusByMemberStore(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { String[] keys = storeParam.getStringKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.georadiusByMemberStore(key, member, radius, unit, param, storeParam); @@ -2228,7 +2229,7 @@ public Long execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit, param); @@ -2238,7 +2239,7 @@ public List execute(Jedis connection) { @Override public List bitfield(final String key, final String... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.bitfield(key, arguments); @@ -2248,7 +2249,7 @@ public List execute(Jedis connection) { @Override public List bitfieldReadonly(final String key, final String... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.bitfieldReadonly(key, arguments); @@ -2258,7 +2259,7 @@ public List execute(Jedis connection) { @Override public Long hstrlen(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.hstrlen(key, field); @@ -2269,7 +2270,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key); @@ -2279,7 +2280,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final String key, final int samples) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key, samples); @@ -2289,7 +2290,7 @@ public Long execute(Jedis connection) { @Override public StreamEntryID xadd(final String key, final StreamEntryID id, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public StreamEntryID execute(Jedis connection) { return connection.xadd(key, id, hash); @@ -2299,7 +2300,7 @@ public StreamEntryID execute(Jedis connection) { @Override public StreamEntryID xadd(final String key, final StreamEntryID id, final Map hash, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public StreamEntryID execute(Jedis connection) { return connection.xadd(key, id, hash, maxLen, approximateLength); @@ -2309,7 +2310,7 @@ public StreamEntryID execute(Jedis connection) { @Override public Long xlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xlen(key); @@ -2319,7 +2320,7 @@ public Long execute(Jedis connection) { @Override public List xrange(final String key, final StreamEntryID start, final StreamEntryID end, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end, count); @@ -2329,7 +2330,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final String key, final StreamEntryID end, final StreamEntryID start, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start, count); @@ -2344,7 +2345,7 @@ public List>> xread(final int count, final long keys[i] = streams[i].getKey(); } - return new JedisClusterCommand>>>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>>>(connectionHandler, maxAttempts, this.timeout) { @Override public List>> execute(Jedis connection) { return connection.xread(count, block, streams); @@ -2354,7 +2355,7 @@ public List>> execute(Jedis connection) { @Override public Long xack(final String key, final String group, final StreamEntryID... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xack(key, group, ids); @@ -2364,7 +2365,7 @@ public Long execute(Jedis connection) { @Override public String xgroupCreate(final String key, final String groupname, final StreamEntryID id, final boolean makeStream) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.xgroupCreate(key, groupname, id, makeStream); @@ -2374,7 +2375,7 @@ public String execute(Jedis connection) { @Override public String xgroupSetID(final String key, final String groupname, final StreamEntryID id) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public String execute(Jedis connection) { return connection.xgroupSetID(key, groupname, id); @@ -2384,7 +2385,7 @@ public String execute(Jedis connection) { @Override public Long xgroupDestroy(final String key, final String groupname) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xgroupDestroy(key, groupname); @@ -2394,7 +2395,7 @@ public Long execute(Jedis connection) { @Override public Long xgroupDelConsumer(final String key, final String groupname, final String consumername) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xgroupDelConsumer(key, groupname, consumername); @@ -2411,7 +2412,7 @@ public List>> xreadGroup(final String groupname, keys[i] = streams[i].getKey(); } - return new JedisClusterCommand>>>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>>>(connectionHandler, maxAttempts, this.timeout) { @Override public List>> execute(Jedis connection) { return connection.xreadGroup(groupname, consumer, count, block, noAck, streams); @@ -2422,7 +2423,7 @@ public List>> execute(Jedis connection) { @Override public List xpending(final String key, final String groupname, final StreamEntryID start, final StreamEntryID end, final int count, final String consumername) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, start, end, count, consumername); @@ -2432,7 +2433,7 @@ public List execute(Jedis connection) { @Override public Long xdel(final String key, final StreamEntryID... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xdel(key, ids); @@ -2442,7 +2443,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final String key, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, maxLen, approximateLength); @@ -2453,7 +2454,7 @@ public Long execute(Jedis connection) { @Override public List xclaim(final String key, final String group, final String consumername, final long minIdleTime, final long newIdleTime, final int retries, final boolean force, final StreamEntryID... ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { @Override public List execute(Jedis connection) { return connection.xclaim(key, group, consumername, minIdleTime, newIdleTime, retries, force, ids); @@ -2462,7 +2463,7 @@ public List execute(Jedis connection) { } public Long waitReplicas(final String key, final int replicas, final long timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Long execute(Jedis connection) { return connection.waitReplicas(replicas, timeout); @@ -2471,7 +2472,7 @@ public Long execute(Jedis connection) { } public Object sendCommand(final String sampleKey, final ProtocolCommand cmd, final String... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection){ return connection.sendCommand(cmd, args); @@ -2480,7 +2481,7 @@ public Object execute(Jedis connection){ } public Object sendBlockingCommand(final String sampleKey, final ProtocolCommand cmd, final String... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { @Override public Object execute(Jedis connection){ return connection.sendBlockingCommand(cmd, args); diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 7a76635a67..14d510ab78 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -17,15 +17,6 @@ public abstract class JedisClusterCommand { - /** - * Default cluster-node-timeout is 15s according to - * https://www.programmersought.com/article/40076100313/, - * add some on top of that and we get to 20. - * - * @see #JedisClusterCommand(JedisClusterConnectionHandler, int, Duration) - */ - private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(20); - private static final Logger LOG = LoggerFactory.getLogger(JedisClusterCommand.class); private final JedisClusterConnectionHandler connectionHandler; @@ -39,15 +30,6 @@ public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int this.timeout = timeout; } - /** - * Create a cluster command with a default timeout of {@link #DEFAULT_TIMEOUT}. To override the - * timeout, call {@link #JedisClusterCommand(JedisClusterConnectionHandler, int, Duration)} - * instead. - */ - public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts) { - this(connectionHandler, maxAttempts, DEFAULT_TIMEOUT); - } - public abstract T execute(Jedis connection); public T run(String key) { From 9bce8ebd89820b56b22829c7d7152c05bbc1b887 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Tue, 2 Feb 2021 13:56:31 +0100 Subject: [PATCH 10/35] Remedy review feedback --- .../clients/jedis/BinaryJedisCluster.java | 478 +++++++++--------- .../redis/clients/jedis/JedisCluster.java | 440 ++++++++-------- .../clients/jedis/JedisClusterCommand.java | 18 +- 3 files changed, 485 insertions(+), 451 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index 65bd389904..d58adb1362 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -29,11 +29,21 @@ 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; - protected final Duration timeout; + + /** + * 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 final Duration maxTotalRetriesDuration; protected JedisClusterConnectionHandler connectionHandler; @@ -67,7 +77,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, user, password, clientName); this.maxAttempts = maxAttempts; - this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); + this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout); } public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout, @@ -75,7 +85,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName); this.maxAttempts = maxAttempts; - this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); + this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout); } public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout, int maxAttempts, String password, String clientName, GenericObjectPoolConfig poolConfig, @@ -101,7 +111,7 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, user, password, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap); this.maxAttempts = maxAttempts; - this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); + this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout); } public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout, @@ -110,7 +120,21 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName, ssl, sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap); this.maxAttempts = maxAttempts; - this.timeout = Duration.ofMillis(Math.max(connectionTimeout, soTimeout)); + this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout); + } + + /** + * @param maxTotalRetriesDuration After this amount of time we will do no more retries and report + * the operation as failed. + */ + 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; } @Override @@ -130,7 +154,7 @@ public Jedis getConnectionFromSlot(int slot) { @Override public String set(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value); @@ -140,7 +164,7 @@ public String execute(Jedis connection) { @Override public String set(final byte[] key, final byte[] value, final SetParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value, params); @@ -150,7 +174,7 @@ public String execute(Jedis connection) { @Override public byte[] get(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.get(key); @@ -160,7 +184,7 @@ public byte[] execute(Jedis connection) { @Override public Long exists(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.exists(keys); @@ -170,7 +194,7 @@ public Long execute(Jedis connection) { @Override public Boolean exists(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.exists(key); @@ -180,7 +204,7 @@ public Boolean execute(Jedis connection) { @Override public Long persist(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.persist(key); @@ -190,7 +214,7 @@ public Long execute(Jedis connection) { @Override public String type(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.type(key); @@ -200,7 +224,7 @@ public String execute(Jedis connection) { @Override public byte[] dump(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.dump(key); @@ -210,7 +234,7 @@ public byte[] execute(Jedis connection) { @Override public String restore(final byte[] key, final int ttl, final byte[] serializedValue) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.restore(key, ttl, serializedValue); @@ -220,7 +244,7 @@ public String execute(Jedis connection) { @Override public Long expire(final byte[] key, final int seconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expire(key, seconds); @@ -230,7 +254,7 @@ public Long execute(Jedis connection) { @Override public Long pexpire(final byte[] key, final long milliseconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpire(key, milliseconds); @@ -240,7 +264,7 @@ public Long execute(Jedis connection) { @Override public Long expireAt(final byte[] key, final long unixTime) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expireAt(key, unixTime); @@ -250,7 +274,7 @@ public Long execute(Jedis connection) { @Override public Long pexpireAt(final byte[] key, final long millisecondsTimestamp) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpireAt(key, millisecondsTimestamp); @@ -260,7 +284,7 @@ public Long execute(Jedis connection) { @Override public Long ttl(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.ttl(key); @@ -270,7 +294,7 @@ public Long execute(Jedis connection) { @Override public Long pttl(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pttl(key); @@ -280,7 +304,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(key); @@ -290,7 +314,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(keys); @@ -300,7 +324,7 @@ public Long execute(Jedis connection) { @Override public Boolean setbit(final byte[] key, final long offset, final boolean value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -310,7 +334,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean setbit(final byte[] key, final long offset, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -320,7 +344,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean getbit(final byte[] key, final long offset) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.getbit(key, offset); @@ -330,7 +354,7 @@ public Boolean execute(Jedis connection) { @Override public Long setrange(final byte[] key, final long offset, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setrange(key, offset, value); @@ -340,7 +364,7 @@ public Long execute(Jedis connection) { @Override public byte[] getrange(final byte[] key, final long startOffset, final long endOffset) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.getrange(key, startOffset, endOffset); @@ -350,7 +374,7 @@ public byte[] execute(Jedis connection) { @Override public byte[] getSet(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.getSet(key, value); @@ -360,7 +384,7 @@ public byte[] execute(Jedis connection) { @Override public Long setnx(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setnx(key, value); @@ -370,7 +394,7 @@ public Long execute(Jedis connection) { @Override public String psetex(final byte[] key, final long milliseconds, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.psetex(key, milliseconds, value); @@ -380,7 +404,7 @@ public String execute(Jedis connection) { @Override public String setex(final byte[] key, final int seconds, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.setex(key, seconds, value); @@ -390,7 +414,7 @@ public String execute(Jedis connection) { @Override public Long decrBy(final byte[] key, final long decrement) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decrBy(key, decrement); @@ -400,7 +424,7 @@ public Long execute(Jedis connection) { @Override public Long decr(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decr(key); @@ -410,7 +434,7 @@ public Long execute(Jedis connection) { @Override public Long incrBy(final byte[] key, final long increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incrBy(key, increment); @@ -420,7 +444,7 @@ public Long execute(Jedis connection) { @Override public Double incrByFloat(final byte[] key, final double increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.incrByFloat(key, increment); @@ -430,7 +454,7 @@ public Double execute(Jedis connection) { @Override public Long incr(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incr(key); @@ -440,7 +464,7 @@ public Long execute(Jedis connection) { @Override public Long append(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.append(key, value); @@ -450,7 +474,7 @@ public Long execute(Jedis connection) { @Override public byte[] substr(final byte[] key, final int start, final int end) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.substr(key, start, end); @@ -460,7 +484,7 @@ public byte[] execute(Jedis connection) { @Override public Long hset(final byte[] key, final byte[] field, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, field, value); @@ -470,7 +494,7 @@ public Long execute(Jedis connection) { @Override public Long hset(final byte[] key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, hash); @@ -480,7 +504,7 @@ public Long execute(Jedis connection) { @Override public byte[] hget(final byte[] key, final byte[] field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.hget(key, field); @@ -490,7 +514,7 @@ public byte[] execute(Jedis connection) { @Override public Long hsetnx(final byte[] key, final byte[] field, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hsetnx(key, field, value); @@ -500,7 +524,7 @@ public Long execute(Jedis connection) { @Override public String hmset(final byte[] key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.hmset(key, hash); @@ -510,7 +534,7 @@ public String execute(Jedis connection) { @Override public List hmget(final byte[] key, final byte[]... fields) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hmget(key, fields); @@ -520,7 +544,7 @@ public List execute(Jedis connection) { @Override public Long hincrBy(final byte[] key, final byte[] field, final long value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hincrBy(key, field, value); @@ -530,7 +554,7 @@ public Long execute(Jedis connection) { @Override public Double hincrByFloat(final byte[] key, final byte[] field, final double value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.hincrByFloat(key, field, value); @@ -540,7 +564,7 @@ public Double execute(Jedis connection) { @Override public Boolean hexists(final byte[] key, final byte[] field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.hexists(key, field); @@ -550,7 +574,7 @@ public Boolean execute(Jedis connection) { @Override public Long hdel(final byte[] key, final byte[]... field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hdel(key, field); @@ -560,7 +584,7 @@ public Long execute(Jedis connection) { @Override public Long hlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hlen(key); @@ -570,7 +594,7 @@ public Long execute(Jedis connection) { @Override public Set hkeys(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.hkeys(key); @@ -580,7 +604,7 @@ public Set execute(Jedis connection) { @Override public List hvals(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hvals(key); @@ -590,7 +614,7 @@ public List execute(Jedis connection) { @Override public Map hgetAll(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Map execute(Jedis connection) { return connection.hgetAll(key); @@ -600,7 +624,7 @@ public Map execute(Jedis connection) { @Override public Long rpush(final byte[] key, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpush(key, args); @@ -610,7 +634,7 @@ public Long execute(Jedis connection) { @Override public Long lpush(final byte[] key, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpush(key, args); @@ -620,7 +644,7 @@ public Long execute(Jedis connection) { @Override public Long llen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.llen(key); @@ -630,7 +654,7 @@ public Long execute(Jedis connection) { @Override public List lrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lrange(key, start, stop); @@ -640,7 +664,7 @@ public List execute(Jedis connection) { @Override public String ltrim(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.ltrim(key, start, stop); @@ -650,7 +674,7 @@ public String execute(Jedis connection) { @Override public byte[] lindex(final byte[] key, final long index) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.lindex(key, index); @@ -660,7 +684,7 @@ public byte[] execute(Jedis connection) { @Override public String lset(final byte[] key, final long index, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lset(key, index, value); @@ -670,7 +694,7 @@ public String execute(Jedis connection) { @Override public Long lrem(final byte[] key, final long count, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lrem(key, count, value); @@ -680,7 +704,7 @@ public Long execute(Jedis connection) { @Override public byte[] lpop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.lpop(key); @@ -690,7 +714,7 @@ public byte[] execute(Jedis connection) { @Override public List lpop(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpop(key, count); @@ -700,7 +724,7 @@ public List execute(Jedis connection) { @Override public Long lpos(final byte[] key, final byte[] element) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element); @@ -710,7 +734,7 @@ public Long execute(Jedis connection) { @Override public Long lpos(final byte[] key, final byte[] element, final LPosParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element, params); @@ -720,7 +744,7 @@ public Long execute(Jedis connection) { @Override public List lpos(final byte[] key, final byte[] element, final LPosParams params, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpos(key, element, params, count); @@ -730,7 +754,7 @@ public List execute(Jedis connection) { @Override public byte[] rpop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.rpop(key); @@ -740,7 +764,7 @@ public byte[] execute(Jedis connection) { @Override public List rpop(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.rpop(key, count); @@ -750,7 +774,7 @@ public List execute(Jedis connection) { @Override public Long sadd(final byte[] key, final byte[]... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sadd(key, member); @@ -760,7 +784,7 @@ public Long execute(Jedis connection) { @Override public Set smembers(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.smembers(key); @@ -770,7 +794,7 @@ public Set execute(Jedis connection) { @Override public Long srem(final byte[] key, final byte[]... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.srem(key, member); @@ -780,7 +804,7 @@ public Long execute(Jedis connection) { @Override public byte[] spop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.spop(key); @@ -790,7 +814,7 @@ public byte[] execute(Jedis connection) { @Override public Set spop(final byte[] key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.spop(key, count); @@ -800,7 +824,7 @@ public Set execute(Jedis connection) { @Override public Long scard(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.scard(key); @@ -810,7 +834,7 @@ public Long execute(Jedis connection) { @Override public Boolean sismember(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.sismember(key, member); @@ -820,7 +844,7 @@ public Boolean execute(Jedis connection) { @Override public List smismember(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.smismember(key, members); @@ -830,7 +854,7 @@ public List execute(Jedis connection) { @Override public byte[] srandmember(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.srandmember(key); @@ -840,7 +864,7 @@ public byte[] execute(Jedis connection) { @Override public Long strlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.strlen(key); @@ -850,7 +874,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final double score, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member); @@ -861,7 +885,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final double score, final byte[] member, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member, params); @@ -871,7 +895,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final Map scoreMembers) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers); @@ -881,7 +905,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final Map scoreMembers, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers, params); @@ -891,7 +915,7 @@ public Long execute(Jedis connection) { @Override public Set zrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrange(key, start, stop); @@ -901,7 +925,7 @@ public Set execute(Jedis connection) { @Override public Long zrem(final byte[] key, final byte[]... members) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrem(key, members); @@ -911,7 +935,7 @@ public Long execute(Jedis connection) { @Override public Double zincrby(final byte[] key, final double increment, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member); @@ -922,7 +946,7 @@ public Double execute(Jedis connection) { @Override public Double zincrby(final byte[] key, final double increment, final byte[] member, final ZIncrByParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member, params); @@ -932,7 +956,7 @@ public Double execute(Jedis connection) { @Override public Long zrank(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrank(key, member); @@ -942,7 +966,7 @@ public Long execute(Jedis connection) { @Override public Long zrevrank(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrevrank(key, member); @@ -952,7 +976,7 @@ public Long execute(Jedis connection) { @Override public Set zrevrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrange(key, start, stop); @@ -962,7 +986,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeWithScores(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeWithScores(key, start, stop); @@ -972,7 +996,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeWithScores(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeWithScores(key, start, stop); @@ -982,7 +1006,7 @@ public Set execute(Jedis connection) { @Override public Long zcard(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcard(key); @@ -992,7 +1016,7 @@ public Long execute(Jedis connection) { @Override public Double zscore(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zscore(key, member); @@ -1002,7 +1026,7 @@ public Double execute(Jedis connection) { @Override public List zmscore(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.zmscore(key, members); @@ -1012,7 +1036,7 @@ public List execute(Jedis connection) { @Override public Tuple zpopmax(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmax(key); @@ -1022,7 +1046,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmax(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmax(key, count); @@ -1032,7 +1056,7 @@ public Set execute(Jedis connection) { @Override public Tuple zpopmin(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmin(key); @@ -1042,7 +1066,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmin(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmin(key, count); @@ -1052,7 +1076,7 @@ public Set execute(Jedis connection) { @Override public List sort(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key); @@ -1062,7 +1086,7 @@ public List execute(Jedis connection) { @Override public List sort(final byte[] key, final SortingParams sortingParameters) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key, sortingParameters); @@ -1072,7 +1096,7 @@ public List execute(Jedis connection) { @Override public Long zcount(final byte[] key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1082,7 +1106,7 @@ public Long execute(Jedis connection) { @Override public Long zcount(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1092,7 +1116,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1102,7 +1126,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1112,7 +1136,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1123,7 +1147,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1133,7 +1157,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1144,7 +1168,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1155,7 +1179,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1165,7 +1189,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1175,7 +1199,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1186,7 +1210,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1197,7 +1221,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1207,7 +1231,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1217,7 +1241,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1228,7 +1252,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1239,7 +1263,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1250,7 +1274,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1260,7 +1284,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByRank(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByRank(key, start, stop); @@ -1270,7 +1294,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final byte[] key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1280,7 +1304,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1291,7 +1315,7 @@ public Long execute(Jedis connection) { @Override public Long linsert(final byte[] key, final ListPosition where, final byte[] pivot, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.linsert(key, where, pivot, value); @@ -1301,7 +1325,7 @@ public Long execute(Jedis connection) { @Override public Long lpushx(final byte[] key, final byte[]... arg) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpushx(key, arg); @@ -1311,7 +1335,7 @@ public Long execute(Jedis connection) { @Override public Long rpushx(final byte[] key, final byte[]... arg) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpushx(key, arg); @@ -1321,7 +1345,7 @@ public Long execute(Jedis connection) { @Override public Long del(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(key); @@ -1331,7 +1355,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(key); @@ -1341,7 +1365,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(keys); @@ -1352,7 +1376,7 @@ public Long execute(Jedis connection) { @Override public byte[] echo(final byte[] arg) { // note that it'll be run from arbitary node - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.echo(arg); @@ -1362,7 +1386,7 @@ public byte[] execute(Jedis connection) { @Override public Long bitcount(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key); @@ -1372,7 +1396,7 @@ public Long execute(Jedis connection) { @Override public Long bitcount(final byte[] key, final long start, final long end) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key, start, end); @@ -1382,7 +1406,7 @@ public Long execute(Jedis connection) { @Override public Long pfadd(final byte[] key, final byte[]... elements) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfadd(key, elements); @@ -1392,7 +1416,7 @@ public Long execute(Jedis connection) { @Override public long pfcount(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(key); @@ -1402,7 +1426,7 @@ public Long execute(Jedis connection) { @Override public List srandmember(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.srandmember(key, count); @@ -1412,7 +1436,7 @@ public List execute(Jedis connection) { @Override public Long zlexcount(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zlexcount(key, min, max); @@ -1422,7 +1446,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByLex(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max); @@ -1433,7 +1457,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByLex(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max, offset, count); @@ -1443,7 +1467,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min); @@ -1454,7 +1478,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min, offset, count); @@ -1464,7 +1488,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByLex(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByLex(key, min, max); @@ -1474,7 +1498,7 @@ public Long execute(Jedis connection) { @Override public Object eval(final byte[] script, final byte[] keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1484,7 +1508,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final int keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1494,7 +1518,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keys, args); @@ -1504,7 +1528,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script); @@ -1514,7 +1538,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1); @@ -1524,7 +1548,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keys, args); @@ -1534,7 +1558,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final int keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keyCount, params); @@ -1544,7 +1568,7 @@ public Object execute(Jedis connection) { @Override public List scriptExists(final byte[] sampleKey, final byte[]... sha1) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.scriptExists(sha1); @@ -1554,7 +1578,7 @@ public List execute(Jedis connection) { @Override public byte[] scriptLoad(final byte[] script, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.scriptLoad(script); @@ -1564,7 +1588,7 @@ public byte[] execute(Jedis connection) { @Override public String scriptFlush(final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptFlush(); @@ -1574,7 +1598,7 @@ public String execute(Jedis connection) { @Override public String scriptKill(final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptKill(); @@ -1584,7 +1608,7 @@ public String execute(Jedis connection) { @Override public Long del(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(keys); @@ -1594,7 +1618,7 @@ public Long execute(Jedis connection) { @Override public List blpop(final int timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1604,7 +1628,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, keys); @@ -1614,7 +1638,7 @@ public List execute(Jedis connection) { @Override public List mget(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.mget(keys); @@ -1630,7 +1654,7 @@ public String mset(final byte[]... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.mset(keysvalues); @@ -1646,7 +1670,7 @@ public Long msetnx(final byte[]... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.msetnx(keysvalues); @@ -1656,7 +1680,7 @@ public Long execute(Jedis connection) { @Override public String rename(final byte[] oldkey, final byte[] newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rename(oldkey, newkey); @@ -1666,7 +1690,7 @@ public String execute(Jedis connection) { @Override public Long renamenx(final byte[] oldkey, final byte[] newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.renamenx(oldkey, newkey); @@ -1676,7 +1700,7 @@ public Long execute(Jedis connection) { @Override public byte[] rpoplpush(final byte[] srckey, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.rpoplpush(srckey, dstkey); @@ -1686,7 +1710,7 @@ public byte[] execute(Jedis connection) { @Override public Set sdiff(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sdiff(keys); @@ -1698,7 +1722,7 @@ public Set execute(Jedis connection) { public Long sdiffstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sdiffstore(dstkey, keys); @@ -1708,7 +1732,7 @@ public Long execute(Jedis connection) { @Override public Set sinter(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sinter(keys); @@ -1720,7 +1744,7 @@ public Set execute(Jedis connection) { public Long sinterstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sinterstore(dstkey, keys); @@ -1730,7 +1754,7 @@ public Long execute(Jedis connection) { @Override public Long smove(final byte[] srckey, final byte[] dstkey, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.smove(srckey, dstkey, member); @@ -1740,7 +1764,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final byte[] key, final SortingParams sortingParameters, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, sortingParameters, dstkey); @@ -1750,7 +1774,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final byte[] key, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, dstkey); @@ -1760,7 +1784,7 @@ public Long execute(Jedis connection) { @Override public Set sunion(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sunion(keys); @@ -1772,7 +1796,7 @@ public Set execute(Jedis connection) { public Long sunionstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sunionstore(dstkey, keys); @@ -1784,7 +1808,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final byte[] dstkey, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, sets); @@ -1796,7 +1820,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final byte[] dstkey, final ZParams params, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, params, sets); @@ -1808,7 +1832,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final byte[] dstkey, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, sets); @@ -1820,7 +1844,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final byte[] dstkey, final ZParams params, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, params, sets); @@ -1830,7 +1854,7 @@ public Long execute(Jedis connection) { @Override public byte[] brpoplpush(final byte[] source, final byte[] destination, final int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.brpoplpush(source, destination, timeout); @@ -1840,7 +1864,7 @@ public byte[] execute(Jedis connection) { @Override public Long publish(final byte[] channel, final byte[] message) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.publish(channel, message); @@ -1850,7 +1874,7 @@ public Long execute(Jedis connection) { @Override public void subscribe(final BinaryJedisPubSub jedisPubSub, final byte[]... channels) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.subscribe(jedisPubSub, channels); @@ -1861,7 +1885,7 @@ public Integer execute(Jedis connection) { @Override public void psubscribe(final BinaryJedisPubSub jedisPubSub, final byte[]... patterns) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.psubscribe(jedisPubSub, patterns); @@ -1874,7 +1898,7 @@ public Integer execute(Jedis connection) { public Long bitop(final BitOP op, final byte[] destKey, final byte[]... srcKeys) { byte[][] wholeKeys = KeyMergeUtil.merge(destKey, srcKeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitop(op, destKey, srcKeys); @@ -1886,7 +1910,7 @@ public Long execute(Jedis connection) { public String pfmerge(final byte[] destkey, final byte[]... sourcekeys) { byte[][] wholeKeys = KeyMergeUtil.merge(destkey, sourcekeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.pfmerge(destkey, sourcekeys); @@ -1896,7 +1920,7 @@ public String execute(Jedis connection) { @Override public Long pfcount(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(keys); @@ -1907,7 +1931,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final byte[] key, final double longitude, final double latitude, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, longitude, latitude, member); @@ -1917,7 +1941,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final byte[] key, final Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, memberCoordinateMap); @@ -1927,7 +1951,7 @@ public Long execute(Jedis connection) { @Override public Double geodist(final byte[] key, final byte[] member1, final byte[] member2) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2); @@ -1938,7 +1962,7 @@ public Double execute(Jedis connection) { @Override public Double geodist(final byte[] key, final byte[] member1, final byte[] member2, final GeoUnit unit) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2, unit); @@ -1948,7 +1972,7 @@ public Double execute(Jedis connection) { @Override public List geohash(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geohash(key, members); @@ -1958,7 +1982,7 @@ public List execute(Jedis connection) { @Override public List geopos(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geopos(key, members); @@ -1969,7 +1993,7 @@ public List execute(Jedis connection) { @Override public List georadius(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit); @@ -1980,7 +2004,7 @@ public List execute(Jedis connection) { @Override public List georadiusReadonly(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit); @@ -1991,7 +2015,7 @@ public List execute(Jedis connection) { @Override public List georadius(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit, param); @@ -2003,7 +2027,7 @@ public List execute(Jedis connection) { public Long georadiusStore(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { byte[][] keys = storeParam.getByteKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusStore(key, longitude, latitude, radius, unit, param, storeParam); @@ -2014,7 +2038,7 @@ public Long execute(Jedis connection) { @Override public List georadiusReadonly(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit, param); @@ -2025,7 +2049,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final byte[] key, final byte[] member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit); @@ -2036,7 +2060,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final byte[] key, final byte[] member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit); @@ -2047,7 +2071,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit, param); @@ -2059,7 +2083,7 @@ public List execute(Jedis connection) { public Long georadiusByMemberStore(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { byte[][] keys = storeParam.getByteKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusByMemberStore(key, member, radius, unit, param, storeParam); @@ -2070,7 +2094,7 @@ public Long execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit, param); @@ -2088,7 +2112,7 @@ public Set keys(final byte[] pattern) { throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports KEYS commands with patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.keys(pattern); @@ -2111,7 +2135,7 @@ public ScanResult scan(final byte[] cursor, final ScanParams params) { + " only supports SCAN commands with MATCH patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.scan(cursor, params); @@ -2123,7 +2147,7 @@ public ScanResult execute(Jedis connection) { public ScanResult> hscan(final byte[] key, final byte[] cursor) { return new JedisClusterCommand>>(connectionHandler, maxAttempts, - this.timeout) { + this.maxTotalRetriesDuration) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor); @@ -2136,7 +2160,7 @@ public ScanResult> hscan(final byte[] key, final byte[ final ScanParams params) { return new JedisClusterCommand>>(connectionHandler, maxAttempts, - this.timeout) { + this.maxTotalRetriesDuration) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor, params); @@ -2146,7 +2170,7 @@ public ScanResult> execute(Jedis connection) { @Override public ScanResult sscan(final byte[] key, final byte[] cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor); @@ -2156,7 +2180,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult sscan(final byte[] key, final byte[] cursor, final ScanParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor, params); @@ -2166,7 +2190,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final byte[] key, final byte[] cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor); @@ -2176,7 +2200,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final byte[] key, final byte[] cursor, final ScanParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor, params); @@ -2186,7 +2210,7 @@ public ScanResult execute(Jedis connection) { @Override public List bitfield(final byte[] key, final byte[]... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfield(key, arguments); @@ -2196,7 +2220,7 @@ public List execute(Jedis connection) { @Override public List bitfieldReadonly(final byte[] key, final byte[]... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfieldReadonly(key, arguments); @@ -2206,7 +2230,7 @@ public List execute(Jedis connection) { @Override public Long hstrlen(final byte[] key, final byte[] field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hstrlen(key, field); @@ -2216,7 +2240,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key); @@ -2226,7 +2250,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final byte[] key, final int samples) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key, samples); @@ -2236,7 +2260,7 @@ public Long execute(Jedis connection) { @Override public byte[] xadd(final byte[] key, final byte[] id, final Map hash, final long maxLen, final boolean approximateLength){ - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.xadd(key, id, hash, maxLen, approximateLength); @@ -2246,7 +2270,7 @@ public byte[] execute(Jedis connection) { @Override public Long xlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xlen(key); @@ -2256,7 +2280,7 @@ public Long execute(Jedis connection) { @Override public List xrange(final byte[] key, final byte[] start, final byte[] end, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end, count); @@ -2266,7 +2290,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start, count); @@ -2278,7 +2302,7 @@ public List execute(Jedis connection) { public List xread(final int count, final long block, final Map streams) { byte[][] keys = streams.keySet().toArray(new byte[streams.size()][]); - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xread(count, block, streams); @@ -2288,7 +2312,7 @@ public List execute(Jedis connection) { @Override public Long xack(final byte[] key, final byte[] group, final byte[]... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xack(key, group, ids); @@ -2298,7 +2322,7 @@ public Long execute(Jedis connection) { @Override public String xgroupCreate(final byte[] key, final byte[] consumer, final byte[] id, final boolean makeStream) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupCreate(key, consumer, id, makeStream); @@ -2308,7 +2332,7 @@ public String execute(Jedis connection) { @Override public String xgroupSetID(final byte[] key, final byte[] consumer, final byte[] id) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupSetID(key, consumer, id); @@ -2318,7 +2342,7 @@ public String execute(Jedis connection) { @Override public Long xgroupDestroy(final byte[] key, final byte[] consumer) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDestroy(key, consumer); @@ -2328,7 +2352,7 @@ public Long execute(Jedis connection) { @Override public Long xgroupDelConsumer(final byte[] key, final byte[] consumer, final byte[] consumerName) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDelConsumer(key, consumer, consumerName); @@ -2342,7 +2366,7 @@ public List xreadGroup(final byte[] groupname, final byte[] consumer, byte[][] keys = streams.keySet().toArray(new byte[streams.size()][]); - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xreadGroup(groupname, consumer, count, block, noAck, streams); @@ -2352,7 +2376,7 @@ public List execute(Jedis connection) { @Override public Long xdel(final byte[] key, final byte[]... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xdel(key, ids); @@ -2362,7 +2386,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final byte[] key, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, maxLen, approximateLength); @@ -2373,7 +2397,7 @@ public Long execute(Jedis connection) { @Override public List xpending(final byte[] key, final byte[] groupname, final byte[] start, final byte[] end, final int count, final byte[] consumername) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, start, end, count, consumername); @@ -2384,7 +2408,7 @@ public List execute(Jedis connection) { @Override public List xclaim(final byte[] key, final byte[] groupname, final byte[] consumername, final long minIdleTime, final long newIdleTime, final int retries, final boolean force, final byte[][] ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaim(key, groupname, consumername, minIdleTime, newIdleTime, retries, force, ids); @@ -2394,7 +2418,7 @@ public List execute(Jedis connection) { @Override public Long waitReplicas(final byte[] key, final int replicas, final long timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.waitReplicas(replicas, timeout); @@ -2403,7 +2427,7 @@ public Long execute(Jedis connection) { } public Object sendCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection){ return connection.sendCommand(cmd, args); @@ -2412,7 +2436,7 @@ public Object execute(Jedis connection){ } public Object sendBlockingCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection){ return connection.sendBlockingCommand(cmd, args); diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 9ac116568a..9f3337f7b9 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -195,7 +195,7 @@ public JedisCluster(Set jedisClusterNode, int connectionTimeout, in @Override public String set(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value); @@ -205,7 +205,7 @@ public String execute(Jedis connection) { @Override public String set(final String key, final String value, final SetParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value, params); @@ -215,7 +215,7 @@ public String execute(Jedis connection) { @Override public String get(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.get(key); @@ -225,7 +225,7 @@ public String execute(Jedis connection) { @Override public Boolean exists(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.exists(key); @@ -235,7 +235,7 @@ public Boolean execute(Jedis connection) { @Override public Long exists(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.exists(keys); @@ -245,7 +245,7 @@ public Long execute(Jedis connection) { @Override public Long persist(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.persist(key); @@ -255,7 +255,7 @@ public Long execute(Jedis connection) { @Override public String type(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.type(key); @@ -265,7 +265,7 @@ public String execute(Jedis connection) { @Override public byte[] dump(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.dump(key); @@ -275,7 +275,7 @@ public byte[] execute(Jedis connection) { @Override public String restore(final String key, final int ttl, final byte[] serializedValue) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.restore(key, ttl, serializedValue); @@ -285,7 +285,7 @@ public String execute(Jedis connection) { @Override public Long expire(final String key, final int seconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expire(key, seconds); @@ -295,7 +295,7 @@ public Long execute(Jedis connection) { @Override public Long pexpire(final String key, final long milliseconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpire(key, milliseconds); @@ -305,7 +305,7 @@ public Long execute(Jedis connection) { @Override public Long expireAt(final String key, final long unixTime) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expireAt(key, unixTime); @@ -315,7 +315,7 @@ public Long execute(Jedis connection) { @Override public Long pexpireAt(final String key, final long millisecondsTimestamp) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpireAt(key, millisecondsTimestamp); @@ -325,7 +325,7 @@ public Long execute(Jedis connection) { @Override public Long ttl(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.ttl(key); @@ -335,7 +335,7 @@ public Long execute(Jedis connection) { @Override public Long pttl(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pttl(key); @@ -345,7 +345,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(key); @@ -355,7 +355,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(keys); @@ -365,7 +365,7 @@ public Long execute(Jedis connection) { @Override public Boolean setbit(final String key, final long offset, final boolean value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -375,7 +375,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean setbit(final String key, final long offset, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -385,7 +385,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean getbit(final String key, final long offset) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.getbit(key, offset); @@ -395,7 +395,7 @@ public Boolean execute(Jedis connection) { @Override public Long setrange(final String key, final long offset, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setrange(key, offset, value); @@ -405,7 +405,7 @@ public Long execute(Jedis connection) { @Override public String getrange(final String key, final long startOffset, final long endOffset) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.getrange(key, startOffset, endOffset); @@ -415,7 +415,7 @@ public String execute(Jedis connection) { @Override public String getSet(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.getSet(key, value); @@ -425,7 +425,7 @@ public String execute(Jedis connection) { @Override public Long setnx(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setnx(key, value); @@ -435,7 +435,7 @@ public Long execute(Jedis connection) { @Override public String setex(final String key, final int seconds, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.setex(key, seconds, value); @@ -445,7 +445,7 @@ public String execute(Jedis connection) { @Override public String psetex(final String key, final long milliseconds, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.psetex(key, milliseconds, value); @@ -455,7 +455,7 @@ public String execute(Jedis connection) { @Override public Long decrBy(final String key, final long decrement) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decrBy(key, decrement); @@ -465,7 +465,7 @@ public Long execute(Jedis connection) { @Override public Long decr(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decr(key); @@ -475,7 +475,7 @@ public Long execute(Jedis connection) { @Override public Long incrBy(final String key, final long increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incrBy(key, increment); @@ -485,7 +485,7 @@ public Long execute(Jedis connection) { @Override public Double incrByFloat(final String key, final double increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.incrByFloat(key, increment); @@ -495,7 +495,7 @@ public Double execute(Jedis connection) { @Override public Long incr(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incr(key); @@ -505,7 +505,7 @@ public Long execute(Jedis connection) { @Override public Long append(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.append(key, value); @@ -515,7 +515,7 @@ public Long execute(Jedis connection) { @Override public String substr(final String key, final int start, final int end) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.substr(key, start, end); @@ -525,7 +525,7 @@ public String execute(Jedis connection) { @Override public Long hset(final String key, final String field, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, field, value); @@ -535,7 +535,7 @@ public Long execute(Jedis connection) { @Override public Long hset(final String key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, hash); @@ -545,7 +545,7 @@ public Long execute(Jedis connection) { @Override public String hget(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.hget(key, field); @@ -555,7 +555,7 @@ public String execute(Jedis connection) { @Override public Long hsetnx(final String key, final String field, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hsetnx(key, field, value); @@ -565,7 +565,7 @@ public Long execute(Jedis connection) { @Override public String hmset(final String key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.hmset(key, hash); @@ -575,7 +575,7 @@ public String execute(Jedis connection) { @Override public List hmget(final String key, final String... fields) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hmget(key, fields); @@ -585,7 +585,7 @@ public List execute(Jedis connection) { @Override public Long hincrBy(final String key, final String field, final long value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hincrBy(key, field, value); @@ -595,7 +595,7 @@ public Long execute(Jedis connection) { @Override public Double hincrByFloat(final String key, final String field, final double value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.hincrByFloat(key, field, value); @@ -605,7 +605,7 @@ public Double execute(Jedis connection) { @Override public Boolean hexists(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.hexists(key, field); @@ -615,7 +615,7 @@ public Boolean execute(Jedis connection) { @Override public Long hdel(final String key, final String... field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hdel(key, field); @@ -625,7 +625,7 @@ public Long execute(Jedis connection) { @Override public Long hlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hlen(key); @@ -635,7 +635,7 @@ public Long execute(Jedis connection) { @Override public Set hkeys(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.hkeys(key); @@ -645,7 +645,7 @@ public Set execute(Jedis connection) { @Override public List hvals(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hvals(key); @@ -655,7 +655,7 @@ public List execute(Jedis connection) { @Override public Map hgetAll(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Map execute(Jedis connection) { return connection.hgetAll(key); @@ -665,7 +665,7 @@ public Map execute(Jedis connection) { @Override public Long rpush(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpush(key, string); @@ -675,7 +675,7 @@ public Long execute(Jedis connection) { @Override public Long lpush(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpush(key, string); @@ -685,7 +685,7 @@ public Long execute(Jedis connection) { @Override public Long llen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.llen(key); @@ -695,7 +695,7 @@ public Long execute(Jedis connection) { @Override public List lrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lrange(key, start, stop); @@ -705,7 +705,7 @@ public List execute(Jedis connection) { @Override public String ltrim(final String key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.ltrim(key, start, stop); @@ -715,7 +715,7 @@ public String execute(Jedis connection) { @Override public String lindex(final String key, final long index) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lindex(key, index); @@ -725,7 +725,7 @@ public String execute(Jedis connection) { @Override public String lset(final String key, final long index, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lset(key, index, value); @@ -735,7 +735,7 @@ public String execute(Jedis connection) { @Override public Long lrem(final String key, final long count, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lrem(key, count, value); @@ -745,7 +745,7 @@ public Long execute(Jedis connection) { @Override public String lpop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lpop(key); @@ -755,7 +755,7 @@ public String execute(Jedis connection) { @Override public List lpop(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpop(key, count); @@ -765,7 +765,7 @@ public List execute(Jedis connection) { @Override public Long lpos(final String key, final String element) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element); @@ -775,7 +775,7 @@ public Long execute(Jedis connection) { @Override public Long lpos(final String key, final String element, final LPosParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element, params); @@ -785,7 +785,7 @@ public Long execute(Jedis connection) { @Override public List lpos(final String key, final String element, final LPosParams params, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpos(key, element, params, count); @@ -795,7 +795,7 @@ public List execute(Jedis connection) { @Override public String rpop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rpop(key); @@ -805,7 +805,7 @@ public String execute(Jedis connection) { @Override public List rpop(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.rpop(key, count); @@ -815,7 +815,7 @@ public List execute(Jedis connection) { @Override public Long sadd(final String key, final String... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sadd(key, member); @@ -825,7 +825,7 @@ public Long execute(Jedis connection) { @Override public Set smembers(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.smembers(key); @@ -835,7 +835,7 @@ public Set execute(Jedis connection) { @Override public Long srem(final String key, final String... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.srem(key, member); @@ -845,7 +845,7 @@ public Long execute(Jedis connection) { @Override public String spop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.spop(key); @@ -855,7 +855,7 @@ public String execute(Jedis connection) { @Override public Set spop(final String key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.spop(key, count); @@ -865,7 +865,7 @@ public Set execute(Jedis connection) { @Override public Long scard(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.scard(key); @@ -875,7 +875,7 @@ public Long execute(Jedis connection) { @Override public Boolean sismember(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.sismember(key, member); @@ -885,7 +885,7 @@ public Boolean execute(Jedis connection) { @Override public List smismember(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.smismember(key, members); @@ -895,7 +895,7 @@ public List execute(Jedis connection) { @Override public String srandmember(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.srandmember(key); @@ -905,7 +905,7 @@ public String execute(Jedis connection) { @Override public List srandmember(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.srandmember(key, count); @@ -915,7 +915,7 @@ public List execute(Jedis connection) { @Override public Long strlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.strlen(key); @@ -925,7 +925,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final double score, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member); @@ -936,7 +936,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final double score, final String member, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member, params); @@ -946,7 +946,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final Map scoreMembers) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers); @@ -956,7 +956,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final Map scoreMembers, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers, params); @@ -966,7 +966,7 @@ public Long execute(Jedis connection) { @Override public Set zrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrange(key, start, stop); @@ -976,7 +976,7 @@ public Set execute(Jedis connection) { @Override public Long zrem(final String key, final String... members) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrem(key, members); @@ -986,7 +986,7 @@ public Long execute(Jedis connection) { @Override public Double zincrby(final String key, final double increment, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member); @@ -997,7 +997,7 @@ public Double execute(Jedis connection) { @Override public Double zincrby(final String key, final double increment, final String member, final ZIncrByParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member, params); @@ -1007,7 +1007,7 @@ public Double execute(Jedis connection) { @Override public Long zrank(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrank(key, member); @@ -1017,7 +1017,7 @@ public Long execute(Jedis connection) { @Override public Long zrevrank(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrevrank(key, member); @@ -1027,7 +1027,7 @@ public Long execute(Jedis connection) { @Override public Set zrevrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrange(key, start, stop); @@ -1037,7 +1037,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeWithScores(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeWithScores(key, start, stop); @@ -1047,7 +1047,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeWithScores(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeWithScores(key, start, stop); @@ -1057,7 +1057,7 @@ public Set execute(Jedis connection) { @Override public Long zcard(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcard(key); @@ -1067,7 +1067,7 @@ public Long execute(Jedis connection) { @Override public Double zscore(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zscore(key, member); @@ -1077,7 +1077,7 @@ public Double execute(Jedis connection) { @Override public List zmscore(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.zmscore(key, members); @@ -1087,7 +1087,7 @@ public List execute(Jedis connection) { @Override public Tuple zpopmax(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmax(key); @@ -1097,7 +1097,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmax(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmax(key, count); @@ -1107,7 +1107,7 @@ public Set execute(Jedis connection) { @Override public Tuple zpopmin(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmin(key); @@ -1117,7 +1117,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmin(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmin(key, count); @@ -1127,7 +1127,7 @@ public Set execute(Jedis connection) { @Override public List sort(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key); @@ -1137,7 +1137,7 @@ public List execute(Jedis connection) { @Override public List sort(final String key, final SortingParams sortingParameters) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key, sortingParameters); @@ -1147,7 +1147,7 @@ public List execute(Jedis connection) { @Override public Long zcount(final String key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1157,7 +1157,7 @@ public Long execute(Jedis connection) { @Override public Long zcount(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1167,7 +1167,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1177,7 +1177,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1187,7 +1187,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1198,7 +1198,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1208,7 +1208,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1219,7 +1219,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1230,7 +1230,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1240,7 +1240,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1250,7 +1250,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1261,7 +1261,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1272,7 +1272,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1282,7 +1282,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1292,7 +1292,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1303,7 +1303,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1314,7 +1314,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1325,7 +1325,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1335,7 +1335,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByRank(final String key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByRank(key, start, stop); @@ -1345,7 +1345,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final String key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1355,7 +1355,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1365,7 +1365,7 @@ public Long execute(Jedis connection) { @Override public Long zlexcount(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zlexcount(key, min, max); @@ -1375,7 +1375,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByLex(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max); @@ -1386,7 +1386,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByLex(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max, offset, count); @@ -1396,7 +1396,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min); @@ -1407,7 +1407,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min, offset, count); @@ -1417,7 +1417,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByLex(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByLex(key, min, max); @@ -1428,7 +1428,7 @@ public Long execute(Jedis connection) { @Override public Long linsert(final String key, final ListPosition where, final String pivot, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.linsert(key, where, pivot, value); @@ -1438,7 +1438,7 @@ public Long execute(Jedis connection) { @Override public Long lpushx(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpushx(key, string); @@ -1448,7 +1448,7 @@ public Long execute(Jedis connection) { @Override public Long rpushx(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpushx(key, string); @@ -1458,7 +1458,7 @@ public Long execute(Jedis connection) { @Override public Long del(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(key); @@ -1468,7 +1468,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(key); @@ -1478,7 +1478,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(keys); @@ -1489,7 +1489,7 @@ public Long execute(Jedis connection) { @Override public String echo(final String string) { // note that it'll be run from arbitrary node - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.echo(string); @@ -1499,7 +1499,7 @@ public String execute(Jedis connection) { @Override public Long bitcount(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key); @@ -1509,7 +1509,7 @@ public Long execute(Jedis connection) { @Override public Long bitcount(final String key, final long start, final long end) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key, start, end); @@ -1527,7 +1527,7 @@ public Set keys(final String pattern) { throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports KEYS commands with patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.keys(pattern); @@ -1550,7 +1550,7 @@ public ScanResult scan(final String cursor, final ScanParams params) { + " only supports SCAN commands with MATCH patterns containing hash-tags ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.scan(cursor, params); @@ -1562,7 +1562,7 @@ public ScanResult execute(Jedis connection) { public ScanResult> hscan(final String key, final String cursor) { return new JedisClusterCommand>>(connectionHandler, maxAttempts, - this.timeout) { + this.maxTotalRetriesDuration) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor); @@ -1572,7 +1572,7 @@ public ScanResult> execute(Jedis connection) { @Override public ScanResult sscan(final String key, final String cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor); @@ -1582,7 +1582,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final String key, final String cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor); @@ -1592,7 +1592,7 @@ public ScanResult execute(Jedis connection) { @Override public Long pfadd(final String key, final String... elements) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfadd(key, elements); @@ -1602,7 +1602,7 @@ public Long execute(Jedis connection) { @Override public long pfcount(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(key); @@ -1612,7 +1612,7 @@ public Long execute(Jedis connection) { @Override public List blpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, key); @@ -1622,7 +1622,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, key); @@ -1632,7 +1632,7 @@ public List execute(Jedis connection) { @Override public Long del(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(keys); @@ -1642,7 +1642,7 @@ public Long execute(Jedis connection) { @Override public List blpop(final int timeout, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1653,7 +1653,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, keys); @@ -1663,7 +1663,7 @@ public List execute(Jedis connection) { @Override public List mget(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.mget(keys); @@ -1679,7 +1679,7 @@ public String mset(final String... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.mset(keysvalues); @@ -1695,7 +1695,7 @@ public Long msetnx(final String... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.msetnx(keysvalues); @@ -1705,7 +1705,7 @@ public Long execute(Jedis connection) { @Override public String rename(final String oldkey, final String newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rename(oldkey, newkey); @@ -1715,7 +1715,7 @@ public String execute(Jedis connection) { @Override public Long renamenx(final String oldkey, final String newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.renamenx(oldkey, newkey); @@ -1725,7 +1725,7 @@ public Long execute(Jedis connection) { @Override public String rpoplpush(final String srckey, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rpoplpush(srckey, dstkey); @@ -1735,7 +1735,7 @@ public String execute(Jedis connection) { @Override public Set sdiff(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sdiff(keys); @@ -1747,7 +1747,7 @@ public Set execute(Jedis connection) { public Long sdiffstore(final String dstkey, final String... keys) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sdiffstore(dstkey, keys); @@ -1757,7 +1757,7 @@ public Long execute(Jedis connection) { @Override public Set sinter(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sinter(keys); @@ -1769,7 +1769,7 @@ public Set execute(Jedis connection) { public Long sinterstore(final String dstkey, final String... keys) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sinterstore(dstkey, keys); @@ -1779,7 +1779,7 @@ public Long execute(Jedis connection) { @Override public Long smove(final String srckey, final String dstkey, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.smove(srckey, dstkey, member); @@ -1789,7 +1789,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final String key, final SortingParams sortingParameters, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, sortingParameters, dstkey); @@ -1799,7 +1799,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final String key, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, dstkey); @@ -1809,7 +1809,7 @@ public Long execute(Jedis connection) { @Override public Set sunion(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sunion(keys); @@ -1821,7 +1821,7 @@ public Set execute(Jedis connection) { public Long sunionstore(final String dstkey, final String... keys) { String[] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sunionstore(dstkey, keys); @@ -1833,7 +1833,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final String dstkey, final String... sets) { String[] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, sets); @@ -1845,7 +1845,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final String dstkey, final ZParams params, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, params, sets); @@ -1857,7 +1857,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final String dstkey, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, sets); @@ -1869,7 +1869,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final String dstkey, final ZParams params, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, params, sets); @@ -1879,7 +1879,7 @@ public Long execute(Jedis connection) { @Override public String brpoplpush(final String source, final String destination, final int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.brpoplpush(source, destination, timeout); @@ -1889,7 +1889,7 @@ public String execute(Jedis connection) { @Override public Long publish(final String channel, final String message) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.publish(channel, message); @@ -1899,7 +1899,7 @@ public Long execute(Jedis connection) { @Override public void subscribe(final JedisPubSub jedisPubSub, final String... channels) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.subscribe(jedisPubSub, channels); @@ -1910,7 +1910,7 @@ public Integer execute(Jedis connection) { @Override public void psubscribe(final JedisPubSub jedisPubSub, final String... patterns) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.psubscribe(jedisPubSub, patterns); @@ -1923,7 +1923,7 @@ public Integer execute(Jedis connection) { public Long bitop(final BitOP op, final String destKey, final String... srcKeys) { String[] mergedKeys = KeyMergeUtil.merge(destKey, srcKeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitop(op, destKey, srcKeys); @@ -1935,7 +1935,7 @@ public Long execute(Jedis connection) { public String pfmerge(final String destkey, final String... sourcekeys) { String[] mergedKeys = KeyMergeUtil.merge(destkey, sourcekeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.pfmerge(destkey, sourcekeys); @@ -1945,7 +1945,7 @@ public String execute(Jedis connection) { @Override public long pfcount(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(keys); @@ -1955,7 +1955,7 @@ public Long execute(Jedis connection) { @Override public Object eval(final String script, final int keyCount, final String... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1965,7 +1965,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final String script, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script); @@ -1975,7 +1975,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final String script, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keys, args); @@ -1985,7 +1985,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final int keyCount, final String... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keyCount, params); @@ -1995,7 +1995,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keys, args); @@ -2005,7 +2005,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1); @@ -2015,7 +2015,7 @@ public Object execute(Jedis connection) { @Override public Boolean scriptExists(final String sha1, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.scriptExists(sha1); @@ -2025,7 +2025,7 @@ public Boolean execute(Jedis connection) { @Override public List scriptExists(final String sampleKey, final String... sha1) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.scriptExists(sha1); @@ -2035,7 +2035,7 @@ public List execute(Jedis connection) { @Override public String scriptLoad(final String script, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptLoad(script); @@ -2045,7 +2045,7 @@ public String execute(Jedis connection) { @Override public String scriptFlush(final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptFlush(); @@ -2055,7 +2055,7 @@ public String execute(Jedis connection) { @Override public String scriptKill(final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptKill(); @@ -2066,7 +2066,7 @@ public String execute(Jedis connection) { @Override public Long geoadd(final String key, final double longitude, final double latitude, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, longitude, latitude, member); @@ -2076,7 +2076,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final String key, final Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, memberCoordinateMap); @@ -2086,7 +2086,7 @@ public Long execute(Jedis connection) { @Override public Double geodist(final String key, final String member1, final String member2) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2); @@ -2097,7 +2097,7 @@ public Double execute(Jedis connection) { @Override public Double geodist(final String key, final String member1, final String member2, final GeoUnit unit) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2, unit); @@ -2107,7 +2107,7 @@ public Double execute(Jedis connection) { @Override public List geohash(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geohash(key, members); @@ -2117,7 +2117,7 @@ public List execute(Jedis connection) { @Override public List geopos(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geopos(key, members); @@ -2128,7 +2128,7 @@ public List execute(Jedis connection) { @Override public List georadius(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit); @@ -2139,7 +2139,7 @@ public List execute(Jedis connection) { @Override public List georadiusReadonly(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit); @@ -2150,7 +2150,7 @@ public List execute(Jedis connection) { @Override public List georadius(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit, param); @@ -2162,7 +2162,7 @@ public List execute(Jedis connection) { public Long georadiusStore(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { String[] keys = storeParam.getStringKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusStore(key, longitude, latitude, radius, unit, param, storeParam); @@ -2173,7 +2173,7 @@ public Long execute(Jedis connection) { @Override public List georadiusReadonly(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit, param); @@ -2184,7 +2184,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final String key, final String member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit); @@ -2195,7 +2195,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final String key, final String member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit); @@ -2206,7 +2206,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit, param); @@ -2218,7 +2218,7 @@ public List execute(Jedis connection) { public Long georadiusByMemberStore(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { String[] keys = storeParam.getStringKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusByMemberStore(key, member, radius, unit, param, storeParam); @@ -2229,7 +2229,7 @@ public Long execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit, param); @@ -2239,7 +2239,7 @@ public List execute(Jedis connection) { @Override public List bitfield(final String key, final String... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfield(key, arguments); @@ -2249,7 +2249,7 @@ public List execute(Jedis connection) { @Override public List bitfieldReadonly(final String key, final String... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfieldReadonly(key, arguments); @@ -2259,7 +2259,7 @@ public List execute(Jedis connection) { @Override public Long hstrlen(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hstrlen(key, field); @@ -2270,7 +2270,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key); @@ -2280,7 +2280,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final String key, final int samples) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key, samples); @@ -2290,7 +2290,7 @@ public Long execute(Jedis connection) { @Override public StreamEntryID xadd(final String key, final StreamEntryID id, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public StreamEntryID execute(Jedis connection) { return connection.xadd(key, id, hash); @@ -2300,7 +2300,7 @@ public StreamEntryID execute(Jedis connection) { @Override public StreamEntryID xadd(final String key, final StreamEntryID id, final Map hash, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public StreamEntryID execute(Jedis connection) { return connection.xadd(key, id, hash, maxLen, approximateLength); @@ -2310,7 +2310,7 @@ public StreamEntryID execute(Jedis connection) { @Override public Long xlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xlen(key); @@ -2320,7 +2320,7 @@ public Long execute(Jedis connection) { @Override public List xrange(final String key, final StreamEntryID start, final StreamEntryID end, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end, count); @@ -2330,7 +2330,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final String key, final StreamEntryID end, final StreamEntryID start, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start, count); @@ -2345,7 +2345,7 @@ public List>> xread(final int count, final long keys[i] = streams[i].getKey(); } - return new JedisClusterCommand>>>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>>>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List>> execute(Jedis connection) { return connection.xread(count, block, streams); @@ -2355,7 +2355,7 @@ public List>> execute(Jedis connection) { @Override public Long xack(final String key, final String group, final StreamEntryID... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xack(key, group, ids); @@ -2365,7 +2365,7 @@ public Long execute(Jedis connection) { @Override public String xgroupCreate(final String key, final String groupname, final StreamEntryID id, final boolean makeStream) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupCreate(key, groupname, id, makeStream); @@ -2375,7 +2375,7 @@ public String execute(Jedis connection) { @Override public String xgroupSetID(final String key, final String groupname, final StreamEntryID id) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupSetID(key, groupname, id); @@ -2385,7 +2385,7 @@ public String execute(Jedis connection) { @Override public Long xgroupDestroy(final String key, final String groupname) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDestroy(key, groupname); @@ -2395,7 +2395,7 @@ public Long execute(Jedis connection) { @Override public Long xgroupDelConsumer(final String key, final String groupname, final String consumername) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDelConsumer(key, groupname, consumername); @@ -2412,7 +2412,7 @@ public List>> xreadGroup(final String groupname, keys[i] = streams[i].getKey(); } - return new JedisClusterCommand>>>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>>>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List>> execute(Jedis connection) { return connection.xreadGroup(groupname, consumer, count, block, noAck, streams); @@ -2423,7 +2423,7 @@ public List>> execute(Jedis connection) { @Override public List xpending(final String key, final String groupname, final StreamEntryID start, final StreamEntryID end, final int count, final String consumername) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, start, end, count, consumername); @@ -2433,7 +2433,7 @@ public List execute(Jedis connection) { @Override public Long xdel(final String key, final StreamEntryID... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xdel(key, ids); @@ -2443,7 +2443,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final String key, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, maxLen, approximateLength); @@ -2454,7 +2454,7 @@ public Long execute(Jedis connection) { @Override public List xclaim(final String key, final String group, final String consumername, final long minIdleTime, final long newIdleTime, final int retries, final boolean force, final StreamEntryID... ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaim(key, group, consumername, minIdleTime, newIdleTime, retries, force, ids); @@ -2463,7 +2463,7 @@ public List execute(Jedis connection) { } public Long waitReplicas(final String key, final int replicas, final long timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.waitReplicas(replicas, timeout); @@ -2472,7 +2472,7 @@ public Long execute(Jedis connection) { } public Object sendCommand(final String sampleKey, final ProtocolCommand cmd, final String... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection){ return connection.sendCommand(cmd, args); @@ -2481,7 +2481,7 @@ public Object execute(Jedis connection){ } public Object sendBlockingCommand(final String sampleKey, final ProtocolCommand cmd, final String... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.timeout) { + return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { @Override public Object execute(Jedis connection){ return connection.sendBlockingCommand(cmd, args); diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 14d510ab78..e9af44ee46 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -19,15 +19,25 @@ public abstract class JedisClusterCommand { private static final Logger LOG = LoggerFactory.getLogger(JedisClusterCommand.class); + private static final Duration DEFAULT_MAX_TOTAL_RETRIES_DURATION = Duration.ofMillis( + BinaryJedisCluster.DEFAULT_TIMEOUT * BinaryJedisCluster.DEFAULT_MAX_ATTEMPTS); + private final JedisClusterConnectionHandler connectionHandler; private final int maxAttempts; - private final Duration timeout; + private final Duration maxTotalRetriesDuration; + + public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts) { + this(connectionHandler, maxAttempts, DEFAULT_MAX_TOTAL_RETRIES_DURATION); + } + /** + * @param maxTotalRetriesDuration No more attempts after we have been trying for this long. + */ public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts, - Duration timeout) { + Duration maxTotalRetriesDuration) { this.connectionHandler = connectionHandler; this.maxAttempts = maxAttempts; - this.timeout = timeout; + this.maxTotalRetriesDuration = maxTotalRetriesDuration; } public abstract T execute(Jedis connection); @@ -109,7 +119,7 @@ private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { } private T runWithRetries(final int slot) { - Instant deadline = Instant.now().plus(timeout); + Instant deadline = Instant.now().plus(maxTotalRetriesDuration); Supplier connectionSupplier = () -> connectionHandler.getConnectionFromSlot(slot); // If we got one redirection, stick with that and don't try anything else From 67a062aa231b24f9f6d0b5baa7f555e83b73e961 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 11 Feb 2021 19:00:18 +0600 Subject: [PATCH 11/35] Consider connection exceptions and disregard random nodes * consider connection exceptions and disregard random nodes * reset redirection --- .../clients/jedis/JedisClusterCommand.java | 150 +++++++----------- .../jedis/tests/SSLJedisClusterTest.java | 4 +- ...disClusterWithCompleteCredentialsTest.java | 4 +- 3 files changed, 61 insertions(+), 97 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index e9af44ee46..3b084b5dfd 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -3,9 +3,9 @@ import java.time.Duration; import java.time.Instant; import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; @@ -100,131 +100,95 @@ public T runWithAnyNode() { } } - private boolean shouldBackOff(int attemptsLeft) { - int attemptsDone = maxAttempts - attemptsLeft; - return attemptsDone >= maxAttempts / 3; - } - - private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { - if (attemptsLeft <= 0) { - return 0; - } - - long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); - if (millisLeft < 0) { - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); - } - - return millisLeft / (attemptsLeft * attemptsLeft); - } - private T runWithRetries(final int slot) { Instant deadline = Instant.now().plus(maxTotalRetriesDuration); - Supplier connectionSupplier = () -> connectionHandler.getConnectionFromSlot(slot); - - // If we got one redirection, stick with that and don't try anything else - Supplier redirectionSupplier = null; - for (int currentAttempt = 0; currentAttempt < this.maxAttempts; currentAttempt++) { + JedisRedirectionException redirect = null; + int consecutiveConnectionFailures = 0; + for (int attemptsLeft = this.maxAttempts; attemptsLeft > 0; attemptsLeft--) { Jedis connection = null; try { - if (redirectionSupplier != null) { - connection = redirectionSupplier.get(); + if (redirect != null) { + connection = connectionHandler.getConnectionFromNode(redirect.getTargetNode()); + if (redirect instanceof JedisAskDataException) { + // TODO: Pipeline asking with the original command to make it faster.... + connection.asking(); + } } else { - connection = connectionSupplier.get(); + connection = connectionHandler.getConnectionFromSlot(slot); } - if (shouldBackOff(maxAttempts - currentAttempt)) { - // Don't just stick to this any more, start asking around - redirectionSupplier = null; - } + return execute(connection); - final T result = execute(connection); - if (currentAttempt > 0) { - LOG.info("Success after {} attempts", currentAttempt + 1); - } - return result; - } catch (JedisNoReachableClusterNodeException e) { - throw e; - } catch (JedisConnectionException e) { - LOG.warn("Failed connecting to Redis: {}", connection, e); + } catch (JedisNoReachableClusterNodeException jnrcne) { + throw jnrcne; + } catch (JedisConnectionException jce) { + ++consecutiveConnectionFailures; + LOG.debug("Failed connecting to Redis: {}", connection, jce); // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet - int attemptsLeft = maxAttempts - currentAttempt - 1; - connectionSupplier = handleConnectionProblem(connection, slot, attemptsLeft, deadline); - } catch (JedisRedirectionException e) { - redirectionSupplier = handleRedirection(connection, e); + boolean reset = handleConnectionProblem(attemptsLeft - 1, consecutiveConnectionFailures, deadline); + if (reset) { + consecutiveConnectionFailures = 0; + redirect = null; + } + } catch (JedisRedirectionException jre) { + LOG.debug("Redirected by server to {}", jre.getTargetNode()); + consecutiveConnectionFailures = 0; + redirect = jre; + // if MOVED redirection occurred, + if (jre instanceof JedisMovedDataException) { + // it rebuilds cluster's slot cache recommended by Redis cluster specification + this.connectionHandler.renewSlotCache(connection); + } } finally { releaseConnection(connection); } - - LOG.info("{} retries left...", maxAttempts - currentAttempt - 1); } throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); } - protected void sleep(long sleepMillis) { - try { - LOG.info("Backing off, sleeping {}ms before trying again...", sleepMillis); - TimeUnit.MILLISECONDS.sleep(sleepMillis); - } catch (InterruptedException e) { - throw new RuntimeException(e); + private boolean handleConnectionProblem(int attemptsLeft, int consecutiveConnectionFailures, Instant doneDeadline) { + if (this.maxAttempts < 3) { + // keep the old implementations as is? + if (attemptsLeft <= 1) { + this.connectionHandler.renewSlotCache(); + } + return false; } - } - private Supplier handleConnectionProblem(Jedis failedConnection, final int slot, int attemptsLeft, - Instant doneDeadline) { - if (!shouldBackOff(attemptsLeft)) { - return () -> { - Jedis connection = connectionHandler.getConnectionFromSlot(slot); - LOG.info("Retrying with {}", connection); - return connection; - }; + if (consecutiveConnectionFailures < 2) { + return false; } - // Must release current connection before renewing the slot cache below. If we fail to do this, - // then JedisClusterTest.testReturnConnectionOnJedisClusterConnection will start failing - // intermittently. - releaseConnection(failedConnection); - + sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); //We need this because if node is not reachable anymore - we need to finally initiate slots //renewing, or we can stuck with cluster state without one node in opposite case. //TODO make tracking of successful/unsuccessful operations for node - do renewing only //if there were no successful responses from this node last few seconds this.connectionHandler.renewSlotCache(); - - return () -> { - sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); - // Get a random connection, it will redirect us if it's not the right one - LOG.info("Retrying with a random node..."); - Jedis connection = connectionHandler.getConnection(); - LOG.info("Retrying with random pick: {}", connection); - return connection; - }; + return true; } - private Supplier handleRedirection(Jedis connection, final JedisRedirectionException jre) { - LOG.debug("Redirected by server to {}", jre.getTargetNode()); - - // if MOVED redirection occurred, - if (jre instanceof JedisMovedDataException) { - // it rebuilds cluster's slot cache recommended by Redis cluster specification - this.connectionHandler.renewSlotCache(connection); + private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { + if (attemptsLeft <= 0) { + return 0; } - // release current connection before iteration - releaseConnection(connection); + long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); + if (millisLeft < 0) { + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + } - return () -> { - Jedis redirectedConnection = connectionHandler.getConnectionFromNode(jre.getTargetNode()); - LOG.info("Retrying with redirection target {}", connection); - if (jre instanceof JedisAskDataException) { - // TODO: Pipeline asking with the original command to make it faster.... - redirectedConnection.asking(); - } + return millisLeft / (attemptsLeft * attemptsLeft); + } - return redirectedConnection; - }; + protected void sleep(long sleepMillis) { + try { + TimeUnit.MILLISECONDS.sleep(sleepMillis); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } } private void releaseConnection(Jedis connection) { diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java index ae6be79579..ab2f41134a 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java @@ -114,7 +114,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -159,7 +159,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java index 1b14981243..8a666de25f 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java @@ -104,7 +104,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -148,7 +148,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } From 7e4abacbcee21d46a86837a2741753551bf92bb9 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Thu, 11 Feb 2021 14:16:51 +0100 Subject: [PATCH 12/35] Revert "Consider connection exceptions and disregard random nodes" This reverts commit 67a062aa231b24f9f6d0b5baa7f555e83b73e961. Lots of tests in JedisClusterCommandTests started failing, need to be fixed before trying again. --- .../clients/jedis/JedisClusterCommand.java | 150 +++++++++++------- .../jedis/tests/SSLJedisClusterTest.java | 4 +- ...disClusterWithCompleteCredentialsTest.java | 4 +- 3 files changed, 97 insertions(+), 61 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 3b084b5dfd..e9af44ee46 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -3,9 +3,9 @@ import java.time.Duration; import java.time.Instant; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; @@ -100,95 +100,131 @@ public T runWithAnyNode() { } } + private boolean shouldBackOff(int attemptsLeft) { + int attemptsDone = maxAttempts - attemptsLeft; + return attemptsDone >= maxAttempts / 3; + } + + private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { + if (attemptsLeft <= 0) { + return 0; + } + + long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); + if (millisLeft < 0) { + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + } + + return millisLeft / (attemptsLeft * attemptsLeft); + } + private T runWithRetries(final int slot) { Instant deadline = Instant.now().plus(maxTotalRetriesDuration); + Supplier connectionSupplier = () -> connectionHandler.getConnectionFromSlot(slot); + + // If we got one redirection, stick with that and don't try anything else + Supplier redirectionSupplier = null; - JedisRedirectionException redirect = null; - int consecutiveConnectionFailures = 0; - for (int attemptsLeft = this.maxAttempts; attemptsLeft > 0; attemptsLeft--) { + for (int currentAttempt = 0; currentAttempt < this.maxAttempts; currentAttempt++) { Jedis connection = null; try { - if (redirect != null) { - connection = connectionHandler.getConnectionFromNode(redirect.getTargetNode()); - if (redirect instanceof JedisAskDataException) { - // TODO: Pipeline asking with the original command to make it faster.... - connection.asking(); - } + if (redirectionSupplier != null) { + connection = redirectionSupplier.get(); } else { - connection = connectionHandler.getConnectionFromSlot(slot); + connection = connectionSupplier.get(); } - return execute(connection); - - } catch (JedisNoReachableClusterNodeException jnrcne) { - throw jnrcne; - } catch (JedisConnectionException jce) { - ++consecutiveConnectionFailures; - LOG.debug("Failed connecting to Redis: {}", connection, jce); - // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet - boolean reset = handleConnectionProblem(attemptsLeft - 1, consecutiveConnectionFailures, deadline); - if (reset) { - consecutiveConnectionFailures = 0; - redirect = null; + if (shouldBackOff(maxAttempts - currentAttempt)) { + // Don't just stick to this any more, start asking around + redirectionSupplier = null; } - } catch (JedisRedirectionException jre) { - LOG.debug("Redirected by server to {}", jre.getTargetNode()); - consecutiveConnectionFailures = 0; - redirect = jre; - // if MOVED redirection occurred, - if (jre instanceof JedisMovedDataException) { - // it rebuilds cluster's slot cache recommended by Redis cluster specification - this.connectionHandler.renewSlotCache(connection); + + final T result = execute(connection); + if (currentAttempt > 0) { + LOG.info("Success after {} attempts", currentAttempt + 1); } + return result; + } catch (JedisNoReachableClusterNodeException e) { + throw e; + } catch (JedisConnectionException e) { + LOG.warn("Failed connecting to Redis: {}", connection, e); + // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet + int attemptsLeft = maxAttempts - currentAttempt - 1; + connectionSupplier = handleConnectionProblem(connection, slot, attemptsLeft, deadline); + } catch (JedisRedirectionException e) { + redirectionSupplier = handleRedirection(connection, e); } finally { releaseConnection(connection); } + + LOG.info("{} retries left...", maxAttempts - currentAttempt - 1); } throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); } - private boolean handleConnectionProblem(int attemptsLeft, int consecutiveConnectionFailures, Instant doneDeadline) { - if (this.maxAttempts < 3) { - // keep the old implementations as is? - if (attemptsLeft <= 1) { - this.connectionHandler.renewSlotCache(); - } - return false; + protected void sleep(long sleepMillis) { + try { + LOG.info("Backing off, sleeping {}ms before trying again...", sleepMillis); + TimeUnit.MILLISECONDS.sleep(sleepMillis); + } catch (InterruptedException e) { + throw new RuntimeException(e); } + } - if (consecutiveConnectionFailures < 2) { - return false; + private Supplier handleConnectionProblem(Jedis failedConnection, final int slot, int attemptsLeft, + Instant doneDeadline) { + if (!shouldBackOff(attemptsLeft)) { + return () -> { + Jedis connection = connectionHandler.getConnectionFromSlot(slot); + LOG.info("Retrying with {}", connection); + return connection; + }; } - sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); + // Must release current connection before renewing the slot cache below. If we fail to do this, + // then JedisClusterTest.testReturnConnectionOnJedisClusterConnection will start failing + // intermittently. + releaseConnection(failedConnection); + //We need this because if node is not reachable anymore - we need to finally initiate slots //renewing, or we can stuck with cluster state without one node in opposite case. //TODO make tracking of successful/unsuccessful operations for node - do renewing only //if there were no successful responses from this node last few seconds this.connectionHandler.renewSlotCache(); - return true; + + return () -> { + sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); + // Get a random connection, it will redirect us if it's not the right one + LOG.info("Retrying with a random node..."); + Jedis connection = connectionHandler.getConnection(); + LOG.info("Retrying with random pick: {}", connection); + return connection; + }; } - private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { - if (attemptsLeft <= 0) { - return 0; - } + private Supplier handleRedirection(Jedis connection, final JedisRedirectionException jre) { + LOG.debug("Redirected by server to {}", jre.getTargetNode()); - long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); - if (millisLeft < 0) { - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + // if MOVED redirection occurred, + if (jre instanceof JedisMovedDataException) { + // it rebuilds cluster's slot cache recommended by Redis cluster specification + this.connectionHandler.renewSlotCache(connection); } - return millisLeft / (attemptsLeft * attemptsLeft); - } + // release current connection before iteration + releaseConnection(connection); - protected void sleep(long sleepMillis) { - try { - TimeUnit.MILLISECONDS.sleep(sleepMillis); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + return () -> { + Jedis redirectedConnection = connectionHandler.getConnectionFromNode(jre.getTargetNode()); + LOG.info("Retrying with redirection target {}", connection); + if (jre instanceof JedisAskDataException) { + // TODO: Pipeline asking with the original command to make it faster.... + redirectedConnection.asking(); + } + + return redirectedConnection; + }; } private void releaseConnection(Jedis connection) { diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java index ab2f41134a..ae6be79579 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java @@ -114,7 +114,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -159,7 +159,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java index 8a666de25f..1b14981243 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java @@ -104,7 +104,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -148,7 +148,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisNoReachableClusterNodeException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } From eabf10b55ebfeb4ff460754bb5377d36afb2ceae Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Thu, 11 Feb 2021 15:46:14 +0100 Subject: [PATCH 13/35] Add another backoff test case 1. We try to contact master => JedisConnectionException 2. We try to contact replica => It refers us to master, hasn't failed over yet 3. We try to contact master => JedisConnectionException 4. We try to contact replica => Success, because it has now failed over --- .../commands/JedisClusterCommandTest.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java index a908beab96..0c4352f5f8 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java @@ -1,6 +1,8 @@ package redis.clients.jedis.tests.commands; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -10,6 +12,7 @@ import static org.mockito.Mockito.when; import java.time.Duration; +import java.util.concurrent.atomic.AtomicLong; import java.util.function.LongConsumer; import org.junit.Test; import org.mockito.InOrder; @@ -261,6 +264,69 @@ protected void sleep(long sleepMillis) { inOrder.verifyNoMoreInteractions(); } + @Test + public void runMasterFailingReplicaRecovering() { + // We have two nodes, master and replica, and master has just gone down permanently. + // + // Test: + // 1. We try to contact master => JedisConnectionException + // 2. We try to contact replica => It refers us to master, hasn't failed over yet + // 3. We try to contact master => JedisConnectionException + // 4. We try to contact replica => Success, because it has now failed over + // + // Between 1 and 4 there should be at least one sleep(). + + final Jedis master = mock(Jedis.class); + when(master.toString()).thenReturn("master"); + + final Jedis replica = mock(Jedis.class); + when(replica.toString()).thenReturn("replica"); + + JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); + + // This is where we expect to find our data + when(connectionHandler.getConnectionFromSlot(anyInt())).thenReturn(master); + + // This is when trying to find a random node after giving up on master + when(connectionHandler.getConnection()).thenReturn(replica); + + // This is when we're handling a redirection + when(connectionHandler.getConnectionFromNode(any())).thenReturn(master); + + final HostAndPort movedTarget = new HostAndPort(null, 0); + final AtomicLong totalSleepMs = new AtomicLong(); + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, + Duration.ofSeconds(1)) { + int redirectionsCountFromReplica = 0; + + @Override + public String execute(Jedis connection) { + assertNotNull(connection); + + if (connection == master) { + throw new JedisConnectionException("Master is down"); + } + + assert connection == replica; + + if (redirectionsCountFromReplica++ == 0) { + throw new JedisMovedDataException("Moved", movedTarget, 0); + } + + return "Success!"; + } + + @Override + protected void sleep(long sleepMillis) { + assert sleepMillis > 0; + totalSleepMs.addAndGet(sleepMillis); + } + }; + + assertEquals("Success!", testMe.run("")); + assertTrue(totalSleepMs.get() > 0); + } + @Test(expected = JedisNoReachableClusterNodeException.class) public void runRethrowsJedisNoReachableClusterNodeException() { JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); From 32234044860a68bd02622361126008944fff452a Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Wed, 10 Feb 2021 22:37:57 +0600 Subject: [PATCH 14/35] consider connection exceptions and disregard random nodes --- .../clients/jedis/JedisClusterCommand.java | 147 +++++++----------- .../jedis/tests/SSLJedisClusterTest.java | 4 +- ...disClusterWithCompleteCredentialsTest.java | 4 +- 3 files changed, 58 insertions(+), 97 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index e9af44ee46..cc6652101c 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -3,9 +3,10 @@ import java.time.Duration; import java.time.Instant; import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; +import java.util.concurrent.atomic.AtomicInteger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; @@ -100,131 +101,91 @@ public T runWithAnyNode() { } } - private boolean shouldBackOff(int attemptsLeft) { - int attemptsDone = maxAttempts - attemptsLeft; - return attemptsDone >= maxAttempts / 3; - } - - private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { - if (attemptsLeft <= 0) { - return 0; - } - - long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); - if (millisLeft < 0) { - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); - } - - return millisLeft / (attemptsLeft * attemptsLeft); - } - private T runWithRetries(final int slot) { Instant deadline = Instant.now().plus(maxTotalRetriesDuration); - Supplier connectionSupplier = () -> connectionHandler.getConnectionFromSlot(slot); - - // If we got one redirection, stick with that and don't try anything else - Supplier redirectionSupplier = null; - for (int currentAttempt = 0; currentAttempt < this.maxAttempts; currentAttempt++) { + JedisRedirectionException redirect = null; + AtomicInteger consecutiveConnectionFailures = new AtomicInteger(); + for (int attemptsLeft = this.maxAttempts; attemptsLeft > 0; attemptsLeft--) { Jedis connection = null; try { - if (redirectionSupplier != null) { - connection = redirectionSupplier.get(); + if (redirect != null) { + connection = connectionHandler.getConnectionFromNode(redirect.getTargetNode()); + if (redirect instanceof JedisAskDataException) { + // TODO: Pipeline asking with the original command to make it faster.... + connection.asking(); + } } else { - connection = connectionSupplier.get(); + connection = connectionHandler.getConnectionFromSlot(slot); } - if (shouldBackOff(maxAttempts - currentAttempt)) { - // Don't just stick to this any more, start asking around - redirectionSupplier = null; - } + return execute(connection); - final T result = execute(connection); - if (currentAttempt > 0) { - LOG.info("Success after {} attempts", currentAttempt + 1); - } - return result; - } catch (JedisNoReachableClusterNodeException e) { - throw e; - } catch (JedisConnectionException e) { - LOG.warn("Failed connecting to Redis: {}", connection, e); + } catch (JedisNoReachableClusterNodeException jnrcne) { + throw jnrcne; + } catch (JedisConnectionException jce) { + consecutiveConnectionFailures.incrementAndGet(); + LOG.debug("Failed connecting to Redis: {}", connection, jce); // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet - int attemptsLeft = maxAttempts - currentAttempt - 1; - connectionSupplier = handleConnectionProblem(connection, slot, attemptsLeft, deadline); - } catch (JedisRedirectionException e) { - redirectionSupplier = handleRedirection(connection, e); + handleConnectionProblem(attemptsLeft - 1, consecutiveConnectionFailures, deadline); + } catch (JedisRedirectionException jre) { + LOG.debug("Redirected by server to {}", jre.getTargetNode()); + consecutiveConnectionFailures.set(0); + redirect = jre; + // if MOVED redirection occurred, + if (jre instanceof JedisMovedDataException) { + // it rebuilds cluster's slot cache recommended by Redis cluster specification + this.connectionHandler.renewSlotCache(connection); + } } finally { releaseConnection(connection); } - - LOG.info("{} retries left...", maxAttempts - currentAttempt - 1); } throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); } - protected void sleep(long sleepMillis) { - try { - LOG.info("Backing off, sleeping {}ms before trying again...", sleepMillis); - TimeUnit.MILLISECONDS.sleep(sleepMillis); - } catch (InterruptedException e) { - throw new RuntimeException(e); + private void handleConnectionProblem(int attemptsLeft, AtomicInteger consecutiveConnectionFailures, Instant doneDeadline) { + if (this.maxAttempts < 3) { + // keep the old implementations as is? + if (attemptsLeft <= 1) { + this.connectionHandler.renewSlotCache(); + } + return; } - } - private Supplier handleConnectionProblem(Jedis failedConnection, final int slot, int attemptsLeft, - Instant doneDeadline) { - if (!shouldBackOff(attemptsLeft)) { - return () -> { - Jedis connection = connectionHandler.getConnectionFromSlot(slot); - LOG.info("Retrying with {}", connection); - return connection; - }; + if (consecutiveConnectionFailures.get() < 2) { + return; } - // Must release current connection before renewing the slot cache below. If we fail to do this, - // then JedisClusterTest.testReturnConnectionOnJedisClusterConnection will start failing - // intermittently. - releaseConnection(failedConnection); - + sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); //We need this because if node is not reachable anymore - we need to finally initiate slots //renewing, or we can stuck with cluster state without one node in opposite case. //TODO make tracking of successful/unsuccessful operations for node - do renewing only //if there were no successful responses from this node last few seconds this.connectionHandler.renewSlotCache(); - - return () -> { - sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); - // Get a random connection, it will redirect us if it's not the right one - LOG.info("Retrying with a random node..."); - Jedis connection = connectionHandler.getConnection(); - LOG.info("Retrying with random pick: {}", connection); - return connection; - }; + consecutiveConnectionFailures.set(0); } - private Supplier handleRedirection(Jedis connection, final JedisRedirectionException jre) { - LOG.debug("Redirected by server to {}", jre.getTargetNode()); - - // if MOVED redirection occurred, - if (jre instanceof JedisMovedDataException) { - // it rebuilds cluster's slot cache recommended by Redis cluster specification - this.connectionHandler.renewSlotCache(connection); + private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { + if (attemptsLeft <= 0) { + return 0; } - // release current connection before iteration - releaseConnection(connection); + long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); + if (millisLeft < 0) { + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + } - return () -> { - Jedis redirectedConnection = connectionHandler.getConnectionFromNode(jre.getTargetNode()); - LOG.info("Retrying with redirection target {}", connection); - if (jre instanceof JedisAskDataException) { - // TODO: Pipeline asking with the original command to make it faster.... - redirectedConnection.asking(); - } + return millisLeft / (attemptsLeft * attemptsLeft); + } - return redirectedConnection; - }; + protected void sleep(long sleepMillis) { + try { + TimeUnit.MILLISECONDS.sleep(sleepMillis); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } } private void releaseConnection(Jedis connection) { diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java index ae6be79579..ab2f41134a 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterTest.java @@ -114,7 +114,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -159,7 +159,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java index 1b14981243..8a666de25f 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java @@ -104,7 +104,7 @@ public void connectToNodesFailsWithSSLParametersAndNoHostMapping() { null, sslParameters, null, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection to localhost works, but subsequent connections to nodes use 127.0.0.1 // and fail hostname verification } @@ -148,7 +148,7 @@ public void connectWithCustomHostNameVerifier() { null, null, hostnameVerifier, portMap)){ jc.get("foo"); Assert.fail("The code did not throw the expected JedisClusterMaxAttemptsException."); - } catch (JedisNoReachableClusterNodeException e) { + } catch (JedisClusterMaxAttemptsException e) { // initial connection made with 'localhost' but subsequent connections to nodes use 127.0.0.1 // which causes custom hostname verification to fail } From fd17343a0b04c7011ec6dc179810c11818c1cf3f Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 11 Feb 2021 16:07:11 +0600 Subject: [PATCH 15/35] reset redirection --- .../clients/jedis/JedisClusterCommand.java | 31 +++-- .../commands/JedisClusterCommandTest.java | 107 ++++++------------ src/test/resources/log4j2.xml | 2 +- 3 files changed, 56 insertions(+), 84 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index cc6652101c..7a38d72c0c 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -3,11 +3,11 @@ import java.time.Duration; import java.time.Instant; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import redis.clients.jedis.exceptions.JedisAskDataException; +import redis.clients.jedis.exceptions.JedisClusterException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -105,7 +105,7 @@ private T runWithRetries(final int slot) { Instant deadline = Instant.now().plus(maxTotalRetriesDuration); JedisRedirectionException redirect = null; - AtomicInteger consecutiveConnectionFailures = new AtomicInteger(); + int consecutiveConnectionFailures = 0; for (int attemptsLeft = this.maxAttempts; attemptsLeft > 0; attemptsLeft--) { Jedis connection = null; try { @@ -124,13 +124,17 @@ private T runWithRetries(final int slot) { } catch (JedisNoReachableClusterNodeException jnrcne) { throw jnrcne; } catch (JedisConnectionException jce) { - consecutiveConnectionFailures.incrementAndGet(); + ++consecutiveConnectionFailures; LOG.debug("Failed connecting to Redis: {}", connection, jce); // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet - handleConnectionProblem(attemptsLeft - 1, consecutiveConnectionFailures, deadline); + boolean reset = handleConnectionProblem(attemptsLeft - 1, consecutiveConnectionFailures, deadline); + if (reset) { + consecutiveConnectionFailures = 0; + redirect = null; + } } catch (JedisRedirectionException jre) { LOG.debug("Redirected by server to {}", jre.getTargetNode()); - consecutiveConnectionFailures.set(0); + consecutiveConnectionFailures = 0; redirect = jre; // if MOVED redirection occurred, if (jre instanceof JedisMovedDataException) { @@ -140,22 +144,25 @@ private T runWithRetries(final int slot) { } finally { releaseConnection(connection); } + if (Instant.now().isAfter(deadline)) { + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); // TODO: change to JedisClusterException + } } throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); } - private void handleConnectionProblem(int attemptsLeft, AtomicInteger consecutiveConnectionFailures, Instant doneDeadline) { + private boolean handleConnectionProblem(int attemptsLeft, int consecutiveConnectionFailures, Instant doneDeadline) { if (this.maxAttempts < 3) { // keep the old implementations as is? - if (attemptsLeft <= 1) { + if (attemptsLeft == 0) { this.connectionHandler.renewSlotCache(); } - return; + return false; } - if (consecutiveConnectionFailures.get() < 2) { - return; + if (consecutiveConnectionFailures < 2) { + return false; } sleep(getBackoffSleepMillis(attemptsLeft, doneDeadline)); @@ -164,7 +171,7 @@ private void handleConnectionProblem(int attemptsLeft, AtomicInteger consecutive //TODO make tracking of successful/unsuccessful operations for node - do renewing only //if there were no successful responses from this node last few seconds this.connectionHandler.renewSlotCache(); - consecutiveConnectionFailures.set(0); + return true; } private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { @@ -174,7 +181,7 @@ private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); if (millisLeft < 0) { - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); // TODO: change to JedisClusterException } return millisLeft / (attemptsLeft * attemptsLeft); diff --git a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java index 0c4352f5f8..70042a5297 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java @@ -7,8 +7,10 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; import static org.mockito.Mockito.when; import java.time.Duration; @@ -16,12 +18,15 @@ import java.util.function.LongConsumer; import org.junit.Test; import org.mockito.InOrder; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; import redis.clients.jedis.HostAndPort; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisClusterCommand; import redis.clients.jedis.JedisClusterConnectionHandler; import redis.clients.jedis.JedisSlotBasedConnectionHandler; import redis.clients.jedis.exceptions.JedisAskDataException; +import redis.clients.jedis.exceptions.JedisClusterException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisConnectionException; import redis.clients.jedis.exceptions.JedisMovedDataException; @@ -29,6 +34,8 @@ public class JedisClusterCommandTest { + private static final Duration ONE_SECOND = Duration.ofSeconds(1); + @Test(expected = JedisClusterMaxAttemptsException.class) public void runZeroAttempts() { JedisClusterCommand testMe = new JedisClusterCommand(null, 0, Duration.ZERO) { @@ -70,7 +77,7 @@ public void runFailOnFirstExecSuccessOnSecondExec() { JedisClusterConnectionHandler connectionHandler = mock(JedisClusterConnectionHandler.class); JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, - Duration.ZERO) { + ONE_SECOND) { boolean isFirstCall = true; @Override @@ -99,7 +106,7 @@ public void runAlwaysFailing() { final LongConsumer sleep = mock(LongConsumer.class); JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 3, - Duration.ofSeconds(1)) { + ONE_SECOND) { @Override public String execute(Jedis connection) { throw new JedisConnectionException("Connection failed"); @@ -118,14 +125,10 @@ protected void sleep(long sleepMillis) { // expected } InOrder inOrder = inOrder(connectionHandler, sleep); - inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); - inOrder.verify(connectionHandler).renewSlotCache(); - inOrder.verify(sleep).accept(anyLong()); - inOrder.verify(connectionHandler).getConnection(); - inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verify(connectionHandler, times(2)).getConnectionFromSlot(anyInt()); inOrder.verify(sleep).accept(anyLong()); - inOrder.verify(connectionHandler).getConnection(); inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); inOrder.verifyNoMoreInteractions(); } @@ -135,7 +138,7 @@ public void runMovedSuccess() { final HostAndPort movedTarget = new HostAndPort(null, 0); JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, - Duration.ZERO) { + ONE_SECOND) { boolean isFirstCall = true; @Override @@ -174,7 +177,7 @@ public void runAskSuccess() { when(connectionHandler.getConnectionFromNode(askTarget)).thenReturn(connection); JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, - Duration.ZERO) { + ONE_SECOND) { boolean isFirstCall = true; @Override @@ -220,12 +223,15 @@ public void runMovedThenAllNodesFailing() { final Jedis failer = mock(Jedis.class); when(connectionHandler.getConnectionFromNode(any(HostAndPort.class))).thenReturn(failer); - when(connectionHandler.getConnection()).thenReturn(failer); + doAnswer((Answer) (InvocationOnMock invocation) -> { + when(connectionHandler.getConnectionFromSlot(anyInt())).thenReturn(failer); + return null; + }).when(connectionHandler).renewSlotCache(); final LongConsumer sleep = mock(LongConsumer.class); final HostAndPort movedTarget = new HostAndPort(null, 0); - JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 3, - Duration.ofSeconds(1)) { + JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 5, + ONE_SECOND) { @Override public String execute(Jedis connection) { if (redirecter == connection) { @@ -256,10 +262,11 @@ protected void sleep(long sleepMillis) { InOrder inOrder = inOrder(connectionHandler, sleep); inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); inOrder.verify(connectionHandler).renewSlotCache(redirecter); - inOrder.verify(connectionHandler).getConnectionFromNode(movedTarget); + inOrder.verify(connectionHandler, times(2)).getConnectionFromNode(movedTarget); + inOrder.verify(sleep).accept(anyLong()); inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verify(connectionHandler, times(2)).getConnectionFromSlot(anyInt()); inOrder.verify(sleep).accept(anyLong()); - inOrder.verify(connectionHandler).getConnection(); inOrder.verify(connectionHandler).renewSlotCache(); inOrder.verifyNoMoreInteractions(); } @@ -270,11 +277,9 @@ public void runMasterFailingReplicaRecovering() { // // Test: // 1. We try to contact master => JedisConnectionException - // 2. We try to contact replica => It refers us to master, hasn't failed over yet - // 3. We try to contact master => JedisConnectionException + // 2. We try to contact master => JedisConnectionException + // 3. sleep and renew // 4. We try to contact replica => Success, because it has now failed over - // - // Between 1 and 4 there should be at least one sleep(). final Jedis master = mock(Jedis.class); when(master.toString()).thenReturn("master"); @@ -284,20 +289,16 @@ public void runMasterFailingReplicaRecovering() { JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); - // This is where we expect to find our data when(connectionHandler.getConnectionFromSlot(anyInt())).thenReturn(master); - // This is when trying to find a random node after giving up on master - when(connectionHandler.getConnection()).thenReturn(replica); - - // This is when we're handling a redirection - when(connectionHandler.getConnectionFromNode(any())).thenReturn(master); + doAnswer((Answer) (InvocationOnMock invocation) -> { + when(connectionHandler.getConnectionFromSlot(anyInt())).thenReturn(replica); + return null; + }).when(connectionHandler).renewSlotCache(); - final HostAndPort movedTarget = new HostAndPort(null, 0); final AtomicLong totalSleepMs = new AtomicLong(); JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 10, - Duration.ofSeconds(1)) { - int redirectionsCountFromReplica = 0; + ONE_SECOND) { @Override public String execute(Jedis connection) { @@ -309,10 +310,6 @@ public String execute(Jedis connection) { assert connection == replica; - if (redirectionsCountFromReplica++ == 0) { - throw new JedisMovedDataException("Moved", movedTarget, 0); - } - return "Success!"; } @@ -324,6 +321,11 @@ protected void sleep(long sleepMillis) { }; assertEquals("Success!", testMe.run("")); + InOrder inOrder = inOrder(connectionHandler); + inOrder.verify(connectionHandler, times(2)).getConnectionFromSlot(anyInt()); + inOrder.verify(connectionHandler).renewSlotCache(); + inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); + inOrder.verifyNoMoreInteractions(); assertTrue(totalSleepMs.get() > 0); } @@ -360,7 +362,7 @@ public void runStopsRetryingAfterTimeout() { public String execute(Jedis connection) { try { // exceed deadline - Thread.sleep(100L); + Thread.sleep(2L); } catch (InterruptedException e) { throw new RuntimeException(e); } @@ -376,48 +378,11 @@ protected void sleep(long sleepMillis) { try { testMe.run(""); fail("cluster command did not fail"); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisClusterException e) { // expected } InOrder inOrder = inOrder(connectionHandler, sleep); inOrder.verify(connectionHandler).getConnectionFromSlot(anyInt()); - inOrder.verify(connectionHandler).renewSlotCache(); - inOrder.verifyNoMoreInteractions(); - } - - @Test - public void runClosesConnectionBeforeRenewingSlotsCache() { - JedisSlotBasedConnectionHandler connectionHandler = mock(JedisSlotBasedConnectionHandler.class); - - Jedis connection = mock(Jedis.class); - when(connectionHandler.getConnectionFromSlot(anyInt())).thenReturn(connection); - - JedisClusterCommand testMe = new JedisClusterCommand(connectionHandler, 1, Duration.ZERO) { - @Override - public String execute(Jedis connection) { - throw new JedisConnectionException("Connection failure"); - } - }; - - try { - testMe.run(""); - fail("Didn't get the expected exception"); - } catch (JedisClusterMaxAttemptsException e) { - // Expected case, do nothing - } - - InOrder inOrder = inOrder(connectionHandler, connection); - // Must close connection before renewing slot cache, otherwise - // JedisClusterTest.testReturnConnectionOnJedisClusterConnection - // will start failing intermittently. - inOrder.verify(connection).close(); - inOrder.verify(connectionHandler).renewSlotCache(); - - // This one is because of a finally block, and isn't needed but doesn't hurt. - // If you rewrite the code so this close() call goes away, fell free to - // update this test as well to match! - inOrder.verify(connection).close(); - inOrder.verifyNoMoreInteractions(); } } diff --git a/src/test/resources/log4j2.xml b/src/test/resources/log4j2.xml index 99bb2f0109..a3131034ce 100644 --- a/src/test/resources/log4j2.xml +++ b/src/test/resources/log4j2.xml @@ -3,7 +3,7 @@ - + From bf56639a81b43c43e2442dd0fc2b34dd768bf002 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Fri, 12 Feb 2021 08:52:45 +0100 Subject: [PATCH 16/35] Fix test failure --- .../clients/jedis/tests/commands/JedisClusterCommandTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java index 70042a5297..e396d18dcb 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java @@ -378,7 +378,7 @@ protected void sleep(long sleepMillis) { try { testMe.run(""); fail("cluster command did not fail"); - } catch (JedisClusterException e) { + } catch (JedisClusterMaxAttemptsException e) { // expected } InOrder inOrder = inOrder(connectionHandler, sleep); From 16386039e6cbf9b73e6912590980a9ac21f709ff Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Fri, 12 Feb 2021 14:29:27 +0100 Subject: [PATCH 17/35] Apply suggestions from code review Co-authored-by: Jens Green Olander --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 2 +- .../jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 7a38d72c0c..ecbc7d1f29 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -126,7 +126,7 @@ private T runWithRetries(final int slot) { } catch (JedisConnectionException jce) { ++consecutiveConnectionFailures; LOG.debug("Failed connecting to Redis: {}", connection, jce); - // "- 1" because we just did one, but the currentAttempt counter hasn't increased yet + // "- 1" because we just did one, but the attemptsLeft counter hasn't been decremented yet boolean reset = handleConnectionProblem(attemptsLeft - 1, consecutiveConnectionFailures, deadline); if (reset) { consecutiveConnectionFailures = 0; diff --git a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java index 8a666de25f..0941bd90ee 100644 --- a/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java +++ b/src/test/java/redis/clients/jedis/tests/SSLJedisClusterWithCompleteCredentialsTest.java @@ -4,7 +4,6 @@ import redis.clients.jedis.*; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisConnectionException; -import redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException; import redis.clients.jedis.tests.SSLJedisTest.BasicHostnameVerifier; import redis.clients.jedis.tests.utils.RedisVersionUtil; From 68e8fdca933c09259ba47f6b7ac3e9c6dc578342 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Fri, 12 Feb 2021 21:37:52 +0600 Subject: [PATCH 18/35] update documentation --- .../redis/clients/jedis/JedisClusterCommand.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index ecbc7d1f29..a70fca189b 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -145,18 +145,29 @@ private T runWithRetries(final int slot) { releaseConnection(connection); } if (Instant.now().isAfter(deadline)) { - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); // TODO: change to JedisClusterException + // TODO: change to JedisClusterOperationException or a new sub-class of it + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); } } throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); } + /** + * Related values should be reset if TRUE is returned. + * + * @param attemptsLeft + * @param consecutiveConnectionFailures + * @param doneDeadline + * @return true - if some actions are taken + *
false - if no actions are taken + */ private boolean handleConnectionProblem(int attemptsLeft, int consecutiveConnectionFailures, Instant doneDeadline) { if (this.maxAttempts < 3) { // keep the old implementations as is? if (attemptsLeft == 0) { this.connectionHandler.renewSlotCache(); + return true; } return false; } @@ -181,7 +192,8 @@ private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); if (millisLeft < 0) { - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); // TODO: change to JedisClusterException + // TODO: change to JedisClusterOperationException or a new sub-class of it + throw new JedisClusterMaxAttemptsException("Deadline exceeded"); } return millisLeft / (attemptsLeft * attemptsLeft); From c665dc1b4e6f9770e20997e9efa761ccba790403 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Sun, 14 Feb 2021 18:19:57 +0100 Subject: [PATCH 19/35] Improve a comment --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index a70fca189b..b8da917032 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -164,7 +164,12 @@ private T runWithRetries(final int slot) { */ private boolean handleConnectionProblem(int attemptsLeft, int consecutiveConnectionFailures, Instant doneDeadline) { if (this.maxAttempts < 3) { - // keep the old implementations as is? + // Since we only renew the slots cache after two consecutive connection + // failures (see consecutiveConnectionFailures above), we need to special + // case the situation where we max out after two or fewer attempts. + // + // Otherwise, on two or fewer max attempts, the slots cache would never be + // renewed. if (attemptsLeft == 0) { this.connectionHandler.renewSlotCache(); return true; From d9f2596b613d786fb168824fd1f613b82c974c8c Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Wed, 17 Feb 2021 14:41:45 +0100 Subject: [PATCH 20/35] Update src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java --- .../java/redis/clients/jedis/DefaultJedisSocketFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java b/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java index c74b8d6e0b..e3d6bf6ced 100644 --- a/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java +++ b/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java @@ -124,6 +124,6 @@ public void setSoTimeout(int soTimeout) { @Override public String toString() { - return "DefaultJedisSocketFactory{" + host + ":" + +port + "}"; + return "DefaultJedisSocketFactory{" + host + ":" + port + "}"; } } From a23d6029e3b0dc93b456a71b3ca8e1741d68896f Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Thu, 25 Feb 2021 11:17:32 +0100 Subject: [PATCH 21/35] Add change from another branch Source (all of these point to the same place): * walles/retries-split * 4f80d7398c6210d189f9cf70749baf31c8dc55e9 * https://github.com/redis/jedis/pull/2355 --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index b8da917032..0944b84e72 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -5,9 +5,7 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import redis.clients.jedis.exceptions.JedisAskDataException; -import redis.clients.jedis.exceptions.JedisClusterException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -106,6 +104,7 @@ private T runWithRetries(final int slot) { JedisRedirectionException redirect = null; int consecutiveConnectionFailures = 0; + Exception lastException = null; for (int attemptsLeft = this.maxAttempts; attemptsLeft > 0; attemptsLeft--) { Jedis connection = null; try { @@ -124,6 +123,7 @@ private T runWithRetries(final int slot) { } catch (JedisNoReachableClusterNodeException jnrcne) { throw jnrcne; } catch (JedisConnectionException jce) { + lastException = jce; ++consecutiveConnectionFailures; LOG.debug("Failed connecting to Redis: {}", connection, jce); // "- 1" because we just did one, but the attemptsLeft counter hasn't been decremented yet @@ -133,6 +133,7 @@ private T runWithRetries(final int slot) { redirect = null; } } catch (JedisRedirectionException jre) { + lastException = jre; LOG.debug("Redirected by server to {}", jre.getTargetNode()); consecutiveConnectionFailures = 0; redirect = jre; @@ -150,7 +151,7 @@ private T runWithRetries(final int slot) { } } - throw new JedisClusterMaxAttemptsException("No more cluster attempts left."); + throw new JedisClusterMaxAttemptsException("No more cluster attempts left.", lastException); } /** From 791180c0e497e742f11b2928607ef4ea56541009 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Fri, 26 Feb 2021 19:19:45 +0600 Subject: [PATCH 22/35] Move JedisClusterCommandTest out of commands package --- .../jedis/tests/{commands => }/JedisClusterCommandTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename src/test/java/redis/clients/jedis/tests/{commands => }/JedisClusterCommandTest.java (99%) diff --git a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java b/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java similarity index 99% rename from src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java rename to src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java index e396d18dcb..1223916c3b 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/JedisClusterCommandTest.java +++ b/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java @@ -1,4 +1,4 @@ -package redis.clients.jedis.tests.commands; +package redis.clients.jedis.tests; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -26,7 +26,6 @@ import redis.clients.jedis.JedisClusterConnectionHandler; import redis.clients.jedis.JedisSlotBasedConnectionHandler; import redis.clients.jedis.exceptions.JedisAskDataException; -import redis.clients.jedis.exceptions.JedisClusterException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisConnectionException; import redis.clients.jedis.exceptions.JedisMovedDataException; From 4bf345bcbe102f965064c28c37764213ebd87b8a Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Fri, 26 Feb 2021 19:21:03 +0600 Subject: [PATCH 23/35] Use JedisClusterOperationException --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 0944b84e72..eebedf1ca6 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -147,7 +147,7 @@ private T runWithRetries(final int slot) { } if (Instant.now().isAfter(deadline)) { // TODO: change to JedisClusterOperationException or a new sub-class of it - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + throw new JedisClusterOperationException("Retry deadline exceeded"); } } @@ -168,7 +168,6 @@ private boolean handleConnectionProblem(int attemptsLeft, int consecutiveConnect // Since we only renew the slots cache after two consecutive connection // failures (see consecutiveConnectionFailures above), we need to special // case the situation where we max out after two or fewer attempts. - // // Otherwise, on two or fewer max attempts, the slots cache would never be // renewed. if (attemptsLeft == 0) { @@ -209,7 +208,7 @@ protected void sleep(long sleepMillis) { try { TimeUnit.MILLISECONDS.sleep(sleepMillis); } catch (InterruptedException e) { - throw new RuntimeException(e); + throw new JedisClusterOperationException(e); } } From 62a619e11796a4edfef8f2390861bade3328c15f Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Fri, 26 Feb 2021 19:22:26 +0600 Subject: [PATCH 24/35] Reduce sleep time, especially when few attempts left --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 2 +- .../redis/clients/jedis/tests/JedisClusterCommandTest.java | 3 ++- .../java/redis/clients/jedis/tests/JedisClusterTest.java | 6 +----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index eebedf1ca6..1ee64d84fe 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -201,7 +201,7 @@ private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { throw new JedisClusterMaxAttemptsException("Deadline exceeded"); } - return millisLeft / (attemptsLeft * attemptsLeft); + return millisLeft / (attemptsLeft * (attemptsLeft + 1)); } protected void sleep(long sleepMillis) { diff --git a/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java b/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java index 1223916c3b..cefe451ded 100644 --- a/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java +++ b/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java @@ -27,6 +27,7 @@ import redis.clients.jedis.JedisSlotBasedConnectionHandler; import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; +import redis.clients.jedis.exceptions.JedisClusterOperationException; import redis.clients.jedis.exceptions.JedisConnectionException; import redis.clients.jedis.exceptions.JedisMovedDataException; import redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException; @@ -377,7 +378,7 @@ protected void sleep(long sleepMillis) { try { testMe.run(""); fail("cluster command did not fail"); - } catch (JedisClusterMaxAttemptsException e) { + } catch (JedisClusterOperationException e) { // expected } InOrder inOrder = inOrder(connectionHandler, sleep); diff --git a/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java b/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java index 4e3aa69f14..de58c76c42 100644 --- a/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java +++ b/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java @@ -583,11 +583,7 @@ public void testReturnConnectionOnJedisConnectionException() throws InterruptedE jedisClusterNode.add(new HostAndPort("127.0.0.1", 7379)); JedisPoolConfig config = new JedisPoolConfig(); config.setMaxTotal(1); - - // Otherwise the test can time out before we are done - int shorterThanTheTestTimeoutMs = DEFAULT_TIMEOUT / 2; - - JedisCluster jc = new JedisCluster(jedisClusterNode, shorterThanTheTestTimeoutMs, shorterThanTheTestTimeoutMs, + JedisCluster jc = new JedisCluster(jedisClusterNode, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT, DEFAULT_REDIRECTIONS, "cluster", config); Jedis j = jc.getClusterNodes().get("127.0.0.1:7380").getResource(); From f1c307d04c90bf6b61f2a31dca278ac894020edc Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Fri, 26 Feb 2021 19:34:07 +0600 Subject: [PATCH 25/35] Update src/main/java/redis/clients/jedis/JedisClusterCommand.java --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 1ee64d84fe..13e66f6131 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -146,7 +146,6 @@ private T runWithRetries(final int slot) { releaseConnection(connection); } if (Instant.now().isAfter(deadline)) { - // TODO: change to JedisClusterOperationException or a new sub-class of it throw new JedisClusterOperationException("Retry deadline exceeded"); } } From 9b6242f99b4ff83ab0ae3e3dd9c7b8e47ef661df Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 11 Mar 2021 00:11:43 +0600 Subject: [PATCH 26/35] merge fix --- .../java/redis/clients/jedis/BinaryJedisCluster.java | 12 +++++++----- src/main/java/redis/clients/jedis/Connection.java | 2 +- .../clients/jedis/DefaultJedisSocketFactory.java | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index c2ce66af43..642fe59713 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -157,7 +157,7 @@ public BinaryJedisCluster(Set jedisClusterNode, JedisClientConfig c this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, clientConfig); this.maxAttempts = maxAttempts; - this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout); + this.maxTotalRetriesDuration = Duration.ofMillis(clientConfig.getSoTimeoutMillis()); } /** @@ -165,11 +165,13 @@ public BinaryJedisCluster(Set jedisClusterNode, JedisClientConfig c * the operation as failed. */ 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) { + 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); + connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName, ssl, + sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap); this.maxAttempts = maxAttempts; this.maxTotalRetriesDuration = maxTotalRetriesDuration; } diff --git a/src/main/java/redis/clients/jedis/Connection.java b/src/main/java/redis/clients/jedis/Connection.java index c8750d72d5..8f66254b48 100644 --- a/src/main/java/redis/clients/jedis/Connection.java +++ b/src/main/java/redis/clients/jedis/Connection.java @@ -83,7 +83,7 @@ public Connection(final JedisSocketFactory jedisSocketFactory) { @Override public String toString() { - return "Connection{" + jedisSocketFactory + "}"; + return "Connection{" + socketFactory + "}"; } public Socket getSocket() { diff --git a/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java b/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java index aeea29c475..aef2ae6880 100644 --- a/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java +++ b/src/main/java/redis/clients/jedis/DefaultJedisSocketFactory.java @@ -212,6 +212,6 @@ public void setHostAndPortMapper(HostAndPortMapper hostAndPortMapper) { @Override public String toString() { - return "DefaultJedisSocketFactory{" + host + ":" + port + "}"; + return "DefaultJedisSocketFactory{" + hostAndPort.toString() + "}"; } } From d14174da55efca20f346561e4e0665ca49e9004d Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:29:27 +0600 Subject: [PATCH 27/35] merge fix --- src/main/java/redis/clients/jedis/BinaryJedisCluster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index cd57976e8a..883cc447b8 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -153,7 +153,7 @@ public BinaryJedisCluster(Set jedisClusterNode, JedisClientConfig c this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, clientConfig); this.maxAttempts = maxAttempts; - this.maxTotalRetriesDuration = Duration.ofMillis(clientConfig.getSoTimeoutMillis()); + this.maxTotalRetriesDuration = Duration.ofMillis(clientConfig.getSocketTimeoutMillis()); } /** From 0ef36d3685c586c8c67bf46738337c998f400fef Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:14:08 +0600 Subject: [PATCH 28/35] Use maxAttempts --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 13e66f6131..e1e8f5a9c1 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -18,15 +18,12 @@ public abstract class JedisClusterCommand { private static final Logger LOG = LoggerFactory.getLogger(JedisClusterCommand.class); - private static final Duration DEFAULT_MAX_TOTAL_RETRIES_DURATION = Duration.ofMillis( - BinaryJedisCluster.DEFAULT_TIMEOUT * BinaryJedisCluster.DEFAULT_MAX_ATTEMPTS); - private final JedisClusterConnectionHandler connectionHandler; private final int maxAttempts; private final Duration maxTotalRetriesDuration; public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts) { - this(connectionHandler, maxAttempts, DEFAULT_MAX_TOTAL_RETRIES_DURATION); + this(connectionHandler, maxAttempts, Duration.ofMillis((long) BinaryJedisCluster.DEFAULT_TIMEOUT * maxAttempts)); } /** From 25303b72a4a0a1cf5e39b056e1874a15c65cb026 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:52:57 +0600 Subject: [PATCH 29/35] format import --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index e1e8f5a9c1..0e9b34545a 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -5,6 +5,7 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import redis.clients.jedis.exceptions.JedisAskDataException; import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisClusterOperationException; From 9e3fbcccb706f0ca8bfd1a4852022bcec536a5a6 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 29 Mar 2021 19:39:28 +0600 Subject: [PATCH 30/35] Re-add missing codes due to merge --- .../clients/jedis/JedisClusterCommand.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 0e9b34545a..6744000c34 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -28,6 +28,8 @@ public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int } /** + * @param connectionHandler + * @param maxAttempts * @param maxTotalRetriesDuration No more attempts after we have been trying for this long. */ public JedisClusterCommand(JedisClusterConnectionHandler connectionHandler, int maxAttempts, @@ -131,7 +133,10 @@ private T runWithRetries(final int slot) { redirect = null; } } catch (JedisRedirectionException jre) { - lastException = jre; + // avoid updating lastException if it is a connection exception + if (lastException == null || lastException instanceof JedisRedirectionException) { + lastException = jre; + } LOG.debug("Redirected by server to {}", jre.getTargetNode()); consecutiveConnectionFailures = 0; redirect = jre; @@ -144,11 +149,14 @@ private T runWithRetries(final int slot) { releaseConnection(connection); } if (Instant.now().isAfter(deadline)) { - throw new JedisClusterOperationException("Retry deadline exceeded"); + throw new JedisClusterOperationException("Cluster retry deadline exceeded."); } } - throw new JedisClusterMaxAttemptsException("No more cluster attempts left.", lastException); + JedisClusterMaxAttemptsException maxAttemptsException + = new JedisClusterMaxAttemptsException("No more cluster attempts left."); + maxAttemptsException.addSuppressed(lastException); + throw maxAttemptsException; } /** @@ -194,8 +202,7 @@ private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); if (millisLeft < 0) { - // TODO: change to JedisClusterOperationException or a new sub-class of it - throw new JedisClusterMaxAttemptsException("Deadline exceeded"); + throw new JedisClusterOperationException("Cluster retry deadline exceeded."); } return millisLeft / (attemptsLeft * (attemptsLeft + 1)); From 882dd49266856169fcf10d20166b8d32ff8262a7 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 29 Mar 2021 19:54:19 +0600 Subject: [PATCH 31/35] avoid NPE while zero max attempts --- src/main/java/redis/clients/jedis/JedisClusterCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 6744000c34..95523dadae 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -155,7 +155,9 @@ private T runWithRetries(final int slot) { JedisClusterMaxAttemptsException maxAttemptsException = new JedisClusterMaxAttemptsException("No more cluster attempts left."); - maxAttemptsException.addSuppressed(lastException); + if (lastException != null) { + maxAttemptsException.addSuppressed(lastException); + } throw maxAttemptsException; } From 7430b9b316d0d8c45b37da965c029e6553bad4e8 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 29 Mar 2021 20:18:42 +0600 Subject: [PATCH 32/35] Remove zero attempts test --- .../clients/jedis/JedisClusterCommand.java | 4 +--- .../jedis/tests/JedisClusterCommandTest.java | 17 ----------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisClusterCommand.java b/src/main/java/redis/clients/jedis/JedisClusterCommand.java index 95523dadae..6744000c34 100644 --- a/src/main/java/redis/clients/jedis/JedisClusterCommand.java +++ b/src/main/java/redis/clients/jedis/JedisClusterCommand.java @@ -155,9 +155,7 @@ private T runWithRetries(final int slot) { JedisClusterMaxAttemptsException maxAttemptsException = new JedisClusterMaxAttemptsException("No more cluster attempts left."); - if (lastException != null) { - maxAttemptsException.addSuppressed(lastException); - } + maxAttemptsException.addSuppressed(lastException); throw maxAttemptsException; } diff --git a/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java b/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java index cefe451ded..1541ca9f86 100644 --- a/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java +++ b/src/test/java/redis/clients/jedis/tests/JedisClusterCommandTest.java @@ -36,23 +36,6 @@ public class JedisClusterCommandTest { private static final Duration ONE_SECOND = Duration.ofSeconds(1); - @Test(expected = JedisClusterMaxAttemptsException.class) - public void runZeroAttempts() { - JedisClusterCommand testMe = new JedisClusterCommand(null, 0, Duration.ZERO) { - @Override - public String execute(Jedis connection) { - return null; - } - - @Override - protected void sleep(long ignored) { - throw new RuntimeException("This test should never sleep"); - } - }; - - testMe.run(""); - } - @Test public void runSuccessfulExecute() { JedisClusterConnectionHandler connectionHandler = mock(JedisClusterConnectionHandler.class); From 9eb8d5831c0f32cffb049875db86be28fe0ee73e Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 29 Mar 2021 22:32:14 +0600 Subject: [PATCH 33/35] More cluster constructors and customizability --- .../clients/jedis/BinaryJedisCluster.java | 34 +++++++++++-------- .../redis/clients/jedis/JedisCluster.java | 24 +++++++++++++ 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index 20b97d9f51..6b32dc4aea 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -41,7 +41,7 @@ public class BinaryJedisCluster implements BinaryJedisClusterCommands, * * Defaults to {@link #DEFAULT_TIMEOUT} if unset, or {@code soTimeout} if available. */ - protected final Duration maxTotalRetriesDuration; + protected Duration maxTotalRetriesDuration; protected JedisClusterConnectionHandler connectionHandler; @@ -143,25 +143,17 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo String clientName, GenericObjectPoolConfig poolConfig, boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) { - this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, - connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName, ssl, - sslSocketFactory, sslParameters, hostnameVerifier, hostAndPortMap); - this.maxAttempts = maxAttempts; - this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout); - } - - public BinaryJedisCluster(Set jedisClusterNode, JedisClientConfig clientConfig, - int maxAttempts, GenericObjectPoolConfig poolConfig) { - this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig, - clientConfig); - this.maxAttempts = maxAttempts; - this.maxTotalRetriesDuration = Duration.ofMillis(clientConfig.getSocketTimeoutMillis()); + 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, @@ -174,6 +166,20 @@ public BinaryJedisCluster(Set jedisClusterNode, int connectionTimeo 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 public void close() { if (connectionHandler != null) { diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index d8687c2562..cf07bddbe3 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -9,6 +9,7 @@ import redis.clients.jedis.util.JedisClusterHashTagUtil; import redis.clients.jedis.util.KeyMergeUtil; +import java.time.Duration; import java.util.Collections; import java.util.List; import java.util.Map; @@ -243,11 +244,34 @@ public JedisCluster(Set jedisClusterNode, int connectionTimeout, in hostAndPortMap); } + /** + * @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 JedisCluster(Set jedisClusterNode, int connectionTimeout, int soTimeout, + int infiniteSoTimeout, int maxAttempts, String user, String password, String clientName, + final GenericObjectPoolConfig poolConfig, boolean ssl, + SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, + HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap, + Duration maxTotalRetriesDuration) { + super(jedisClusterNode, connectionTimeout, soTimeout, infiniteSoTimeout, maxAttempts, user, + password, clientName, poolConfig, ssl, sslSocketFactory, sslParameters, hostnameVerifier, + hostAndPortMap, maxTotalRetriesDuration); + } + public JedisCluster(Set nodes, final JedisClientConfig clientConfig, int maxAttempts, final GenericObjectPoolConfig poolConfig) { super(nodes, clientConfig, maxAttempts, poolConfig); } + public JedisCluster(Set nodes, final JedisClientConfig clientConfig, + int maxAttempts, Duration maxTotalRetriesDuration, + final GenericObjectPoolConfig poolConfig) { + super(nodes, clientConfig, maxAttempts, maxTotalRetriesDuration, poolConfig); + } + @Override public Boolean copy(String srcKey, String dstKey, boolean replace) { return new JedisClusterCommand(connectionHandler, maxAttempts) { From 27bce50d0697446c21c733ed86a2b842e1285c27 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 29 Mar 2021 22:35:55 +0600 Subject: [PATCH 34/35] Use maxTotalRetriesDuration everywhere --- .../clients/jedis/BinaryJedisCluster.java | 512 +++++++++--------- .../redis/clients/jedis/JedisCluster.java | 503 +++++++++-------- 2 files changed, 506 insertions(+), 509 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index 6b32dc4aea..dfc9021b94 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -197,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); @@ -207,7 +207,7 @@ public Boolean execute(Jedis connection) { @Override public String set(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value); @@ -217,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value, params); @@ -227,7 +227,7 @@ public String execute(Jedis connection) { @Override public byte[] get(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.get(key); @@ -237,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); @@ -247,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); @@ -257,7 +257,7 @@ public byte[] execute(Jedis connection) { @Override public Long exists(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.exists(keys); @@ -267,7 +267,7 @@ public Long execute(Jedis connection) { @Override public Boolean exists(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.exists(key); @@ -277,7 +277,7 @@ public Boolean execute(Jedis connection) { @Override public Long persist(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.persist(key); @@ -287,7 +287,7 @@ public Long execute(Jedis connection) { @Override public String type(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.type(key); @@ -297,7 +297,7 @@ public String execute(Jedis connection) { @Override public byte[] dump(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.dump(key); @@ -307,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.restore(key, ttl, serializedValue); @@ -318,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); @@ -328,7 +328,7 @@ public String execute(Jedis connection) { @Override public Long expire(final byte[] key, final int seconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expire(key, seconds); @@ -338,7 +338,7 @@ public Long execute(Jedis connection) { @Override public Long pexpire(final byte[] key, final long milliseconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpire(key, milliseconds); @@ -348,7 +348,7 @@ public Long execute(Jedis connection) { @Override public Long expireAt(final byte[] key, final long unixTime) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expireAt(key, unixTime); @@ -358,7 +358,7 @@ public Long execute(Jedis connection) { @Override public Long pexpireAt(final byte[] key, final long millisecondsTimestamp) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpireAt(key, millisecondsTimestamp); @@ -368,7 +368,7 @@ public Long execute(Jedis connection) { @Override public Long ttl(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.ttl(key); @@ -378,7 +378,7 @@ public Long execute(Jedis connection) { @Override public Long pttl(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pttl(key); @@ -388,7 +388,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(key); @@ -398,7 +398,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(keys); @@ -408,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -418,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -428,7 +428,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean getbit(final byte[] key, final long offset) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.getbit(key, offset); @@ -438,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setrange(key, offset, value); @@ -448,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.getrange(key, startOffset, endOffset); @@ -458,7 +458,7 @@ public byte[] execute(Jedis connection) { @Override public byte[] getSet(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.getSet(key, value); @@ -468,7 +468,7 @@ public byte[] execute(Jedis connection) { @Override public Long setnx(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setnx(key, value); @@ -478,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.psetex(key, milliseconds, value); @@ -488,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.setex(key, seconds, value); @@ -498,7 +498,7 @@ public String execute(Jedis connection) { @Override public Long decrBy(final byte[] key, final long decrement) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decrBy(key, decrement); @@ -508,7 +508,7 @@ public Long execute(Jedis connection) { @Override public Long decr(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decr(key); @@ -518,7 +518,7 @@ public Long execute(Jedis connection) { @Override public Long incrBy(final byte[] key, final long increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incrBy(key, increment); @@ -528,7 +528,7 @@ public Long execute(Jedis connection) { @Override public Double incrByFloat(final byte[] key, final double increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.incrByFloat(key, increment); @@ -538,7 +538,7 @@ public Double execute(Jedis connection) { @Override public Long incr(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incr(key); @@ -548,7 +548,7 @@ public Long execute(Jedis connection) { @Override public Long append(final byte[] key, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.append(key, value); @@ -558,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.substr(key, start, end); @@ -568,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, field, value); @@ -578,7 +578,7 @@ public Long execute(Jedis connection) { @Override public Long hset(final byte[] key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, hash); @@ -588,7 +588,7 @@ public Long execute(Jedis connection) { @Override public byte[] hget(final byte[] key, final byte[] field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.hget(key, field); @@ -598,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hsetnx(key, field, value); @@ -608,7 +608,7 @@ public Long execute(Jedis connection) { @Override public String hmset(final byte[] key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.hmset(key, hash); @@ -618,7 +618,7 @@ public String execute(Jedis connection) { @Override public List hmget(final byte[] key, final byte[]... fields) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hmget(key, fields); @@ -628,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hincrBy(key, field, value); @@ -638,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, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.hincrByFloat(key, field, value); @@ -648,7 +648,7 @@ public Double execute(Jedis connection) { @Override public Boolean hexists(final byte[] key, final byte[] field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.hexists(key, field); @@ -658,7 +658,7 @@ public Boolean execute(Jedis connection) { @Override public Long hdel(final byte[] key, final byte[]... field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hdel(key, field); @@ -668,7 +668,7 @@ public Long execute(Jedis connection) { @Override public Long hlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hlen(key); @@ -678,7 +678,7 @@ public Long execute(Jedis connection) { @Override public Set hkeys(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.hkeys(key); @@ -688,7 +688,7 @@ public Set execute(Jedis connection) { @Override public List hvals(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hvals(key); @@ -698,7 +698,7 @@ public List execute(Jedis connection) { @Override public Map hgetAll(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Map execute(Jedis connection) { return connection.hgetAll(key); @@ -708,7 +708,7 @@ public Map execute(Jedis connection) { @Override public byte[] hrandfield(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.hrandfield(key); @@ -718,7 +718,7 @@ public byte[] execute(Jedis connection) { @Override public List hrandfield(final byte[] key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hrandfield(key, count); @@ -728,7 +728,7 @@ public List execute(Jedis connection) { @Override public Map hrandfieldWithValues(final byte[] key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Map execute(Jedis connection) { return connection.hrandfieldWithValues(key, count); @@ -738,7 +738,7 @@ public Map execute(Jedis connection) { @Override public Long rpush(final byte[] key, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpush(key, args); @@ -748,7 +748,7 @@ public Long execute(Jedis connection) { @Override public Long lpush(final byte[] key, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpush(key, args); @@ -758,7 +758,7 @@ public Long execute(Jedis connection) { @Override public Long llen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.llen(key); @@ -768,7 +768,7 @@ public Long execute(Jedis connection) { @Override public List lrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lrange(key, start, stop); @@ -778,7 +778,7 @@ public List execute(Jedis connection) { @Override public String ltrim(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.ltrim(key, start, stop); @@ -788,7 +788,7 @@ public String execute(Jedis connection) { @Override public byte[] lindex(final byte[] key, final long index) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.lindex(key, index); @@ -798,7 +798,7 @@ public byte[] execute(Jedis connection) { @Override public String lset(final byte[] key, final long index, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lset(key, index, value); @@ -808,7 +808,7 @@ public String execute(Jedis connection) { @Override public Long lrem(final byte[] key, final long count, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lrem(key, count, value); @@ -818,7 +818,7 @@ public Long execute(Jedis connection) { @Override public byte[] lpop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.lpop(key); @@ -828,7 +828,7 @@ public byte[] execute(Jedis connection) { @Override public List lpop(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpop(key, count); @@ -838,7 +838,7 @@ public List execute(Jedis connection) { @Override public Long lpos(final byte[] key, final byte[] element) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element); @@ -848,7 +848,7 @@ public Long execute(Jedis connection) { @Override public Long lpos(final byte[] key, final byte[] element, final LPosParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element, params); @@ -859,7 +859,7 @@ public Long execute(Jedis connection) { @Override public List lpos(final byte[] key, final byte[] element, final LPosParams params, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpos(key, element, params, count); @@ -869,7 +869,7 @@ public List execute(Jedis connection) { @Override public byte[] rpop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.rpop(key); @@ -879,7 +879,7 @@ public byte[] execute(Jedis connection) { @Override public List rpop(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.rpop(key, count); @@ -889,7 +889,7 @@ public List execute(Jedis connection) { @Override public Long sadd(final byte[] key, final byte[]... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sadd(key, member); @@ -899,7 +899,7 @@ public Long execute(Jedis connection) { @Override public Set smembers(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.smembers(key); @@ -909,7 +909,7 @@ public Set execute(Jedis connection) { @Override public Long srem(final byte[] key, final byte[]... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.srem(key, member); @@ -919,7 +919,7 @@ public Long execute(Jedis connection) { @Override public byte[] spop(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.spop(key); @@ -929,7 +929,7 @@ public byte[] execute(Jedis connection) { @Override public Set spop(final byte[] key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.spop(key, count); @@ -939,7 +939,7 @@ public Set execute(Jedis connection) { @Override public Long scard(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.scard(key); @@ -949,7 +949,7 @@ public Long execute(Jedis connection) { @Override public Boolean sismember(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.sismember(key, member); @@ -959,7 +959,7 @@ public Boolean execute(Jedis connection) { @Override public List smismember(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.smismember(key, members); @@ -969,7 +969,7 @@ public List execute(Jedis connection) { @Override public byte[] srandmember(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.srandmember(key); @@ -979,7 +979,7 @@ public byte[] execute(Jedis connection) { @Override public Long strlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.strlen(key); @@ -989,7 +989,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final double score, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member); @@ -1000,7 +1000,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final double score, final byte[] member, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member, params); @@ -1010,7 +1010,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final Map scoreMembers) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers); @@ -1020,7 +1020,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final byte[] key, final Map scoreMembers, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers, params); @@ -1030,7 +1030,7 @@ public Long execute(Jedis connection) { @Override public Double zaddIncr(byte[] key, double score, byte[] member, ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zaddIncr(key, score, member, params); @@ -1040,7 +1040,7 @@ public Double execute(Jedis connection) { @Override public Set zdiff(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zdiff(keys); @@ -1050,7 +1050,7 @@ public Set execute(Jedis connection) { @Override public Set zdiffWithScores(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zdiffWithScores(keys); @@ -1061,7 +1061,7 @@ public Set execute(Jedis connection) { @Override public Long zdiffStore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zdiffStore(dstkey, keys); @@ -1071,7 +1071,7 @@ public Long execute(Jedis connection) { @Override public Set zrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrange(key, start, stop); @@ -1081,7 +1081,7 @@ public Set execute(Jedis connection) { @Override public Long zrem(final byte[] key, final byte[]... members) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrem(key, members); @@ -1091,7 +1091,7 @@ public Long execute(Jedis connection) { @Override public Double zincrby(final byte[] key, final double increment, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member); @@ -1102,7 +1102,7 @@ public Double execute(Jedis connection) { @Override public Double zincrby(final byte[] key, final double increment, final byte[] member, final ZIncrByParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member, params); @@ -1112,7 +1112,7 @@ public Double execute(Jedis connection) { @Override public Long zrank(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrank(key, member); @@ -1122,7 +1122,7 @@ public Long execute(Jedis connection) { @Override public Long zrevrank(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrevrank(key, member); @@ -1132,7 +1132,7 @@ public Long execute(Jedis connection) { @Override public Set zrevrange(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrange(key, start, stop); @@ -1142,7 +1142,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeWithScores(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeWithScores(key, start, stop); @@ -1152,7 +1152,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeWithScores(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeWithScores(key, start, stop); @@ -1162,7 +1162,7 @@ public Set execute(Jedis connection) { @Override public byte[] zrandmember(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.zrandmember(key); @@ -1172,7 +1172,7 @@ public byte[] execute(Jedis connection) { @Override public Set zrandmember(final byte[] key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrandmember(key, count); @@ -1182,7 +1182,7 @@ public Set execute(Jedis connection) { @Override public Set zrandmemberWithScores(final byte[] key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrandmemberWithScores(key, count); @@ -1192,7 +1192,7 @@ public Set execute(Jedis connection) { @Override public Long zcard(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcard(key); @@ -1202,7 +1202,7 @@ public Long execute(Jedis connection) { @Override public Double zscore(final byte[] key, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zscore(key, member); @@ -1212,7 +1212,7 @@ public Double execute(Jedis connection) { @Override public List zmscore(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.zmscore(key, members); @@ -1222,7 +1222,7 @@ public List execute(Jedis connection) { @Override public Tuple zpopmax(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmax(key); @@ -1232,7 +1232,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmax(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmax(key, count); @@ -1242,7 +1242,7 @@ public Set execute(Jedis connection) { @Override public Tuple zpopmin(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmin(key); @@ -1252,7 +1252,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmin(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmin(key, count); @@ -1262,7 +1262,7 @@ public Set execute(Jedis connection) { @Override public List sort(final byte[] key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key); @@ -1272,7 +1272,7 @@ public List execute(Jedis connection) { @Override public List sort(final byte[] key, final SortingParams sortingParameters) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key, sortingParameters); @@ -1282,7 +1282,7 @@ public List execute(Jedis connection) { @Override public Long zcount(final byte[] key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1292,7 +1292,7 @@ public Long execute(Jedis connection) { @Override public Long zcount(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1302,7 +1302,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1312,7 +1312,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1322,7 +1322,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1333,7 +1333,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1343,7 +1343,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1354,7 +1354,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1365,7 +1365,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1375,7 +1375,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1385,7 +1385,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1396,7 +1396,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1407,7 +1407,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1417,7 +1417,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1427,7 +1427,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1438,7 +1438,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1449,7 +1449,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1460,7 +1460,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1470,7 +1470,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByRank(final byte[] key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByRank(key, start, stop); @@ -1480,7 +1480,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final byte[] key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1490,7 +1490,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1501,7 +1501,7 @@ public Long execute(Jedis connection) { @Override public Long linsert(final byte[] key, final ListPosition where, final byte[] pivot, final byte[] value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.linsert(key, where, pivot, value); @@ -1511,7 +1511,7 @@ public Long execute(Jedis connection) { @Override public Long lpushx(final byte[] key, final byte[]... arg) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpushx(key, arg); @@ -1521,7 +1521,7 @@ public Long execute(Jedis connection) { @Override public Long rpushx(final byte[] key, final byte[]... arg) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpushx(key, arg); @@ -1531,7 +1531,7 @@ public Long execute(Jedis connection) { @Override public Long del(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(key); @@ -1541,7 +1541,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(key); @@ -1551,7 +1551,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(keys); @@ -1562,7 +1562,7 @@ public Long execute(Jedis connection) { @Override public byte[] echo(final byte[] arg) { // note that it'll be run from arbitary node - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.echo(arg); @@ -1572,7 +1572,7 @@ public byte[] execute(Jedis connection) { @Override public Long bitcount(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key); @@ -1582,7 +1582,7 @@ public Long execute(Jedis connection) { @Override public Long bitcount(final byte[] key, final long start, final long end) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key, start, end); @@ -1592,7 +1592,7 @@ public Long execute(Jedis connection) { @Override public Long pfadd(final byte[] key, final byte[]... elements) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfadd(key, elements); @@ -1602,7 +1602,7 @@ public Long execute(Jedis connection) { @Override public long pfcount(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(key); @@ -1612,7 +1612,7 @@ public Long execute(Jedis connection) { @Override public List srandmember(final byte[] key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.srandmember(key, count); @@ -1622,7 +1622,7 @@ public List execute(Jedis connection) { @Override public Long zlexcount(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zlexcount(key, min, max); @@ -1632,7 +1632,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByLex(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max); @@ -1643,7 +1643,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByLex(final byte[] key, final byte[] min, final byte[] max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max, offset, count); @@ -1653,7 +1653,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final byte[] key, final byte[] max, final byte[] min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min); @@ -1664,7 +1664,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final byte[] key, final byte[] max, final byte[] min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min, offset, count); @@ -1674,7 +1674,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByLex(final byte[] key, final byte[] min, final byte[] max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByLex(key, min, max); @@ -1684,7 +1684,7 @@ public Long execute(Jedis connection) { @Override public Object eval(final byte[] script, final byte[] keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1694,7 +1694,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final int keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -1704,7 +1704,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keys, args); @@ -1714,7 +1714,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final byte[] script, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script); @@ -1724,7 +1724,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1); @@ -1734,7 +1734,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keys, args); @@ -1744,7 +1744,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final byte[] sha1, final int keyCount, final byte[]... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keyCount, params); @@ -1754,7 +1754,7 @@ public Object execute(Jedis connection) { @Override public List scriptExists(final byte[] sampleKey, final byte[]... sha1) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.scriptExists(sha1); @@ -1764,7 +1764,7 @@ public List execute(Jedis connection) { @Override public byte[] scriptLoad(final byte[] script, final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.scriptLoad(script); @@ -1774,7 +1774,7 @@ public byte[] execute(Jedis connection) { @Override public String scriptFlush(final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptFlush(); @@ -1784,7 +1784,7 @@ public String execute(Jedis connection) { @Override public String scriptFlush(final byte[] sampleKey, final FlushMode flushMode) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptFlush(flushMode); @@ -1794,7 +1794,7 @@ public String execute(Jedis connection) { @Override public String scriptKill(final byte[] sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptKill(); @@ -1804,7 +1804,7 @@ public String execute(Jedis connection) { @Override public Long del(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(keys); @@ -1815,7 +1815,7 @@ public Long execute(Jedis connection) { @Override public byte[] lmove(final byte[] srcKey, final byte[] dstKey, final ListDirection from, final ListDirection to) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.lmove(srcKey, dstKey, from, to); @@ -1826,7 +1826,7 @@ public byte[] execute(Jedis connection) { @Override public byte[] blmove(final byte[] srcKey, final byte[] dstKey, final ListDirection from, final ListDirection to, final int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.blmove(srcKey, dstKey, from, to, timeout); @@ -1836,7 +1836,7 @@ public byte[] execute(Jedis connection) { @Override public List blpop(final int timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1846,7 +1846,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, keys); @@ -1856,7 +1856,7 @@ public List execute(Jedis connection) { @Override public KeyedTuple bzpopmax(int timeout, byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public KeyedTuple execute(Jedis connection) { return connection.bzpopmax(timeout, keys); @@ -1866,7 +1866,7 @@ public KeyedTuple execute(Jedis connection) { @Override public KeyedTuple bzpopmin(int timeout, byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public KeyedTuple execute(Jedis connection) { return connection.bzpopmin(timeout, keys); @@ -1876,7 +1876,7 @@ public KeyedTuple execute(Jedis connection) { @Override public List mget(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.mget(keys); @@ -1892,7 +1892,7 @@ public String mset(final byte[]... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.mset(keysvalues); @@ -1908,7 +1908,7 @@ public Long msetnx(final byte[]... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.msetnx(keysvalues); @@ -1918,7 +1918,7 @@ public Long execute(Jedis connection) { @Override public String rename(final byte[] oldkey, final byte[] newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rename(oldkey, newkey); @@ -1928,7 +1928,7 @@ public String execute(Jedis connection) { @Override public Long renamenx(final byte[] oldkey, final byte[] newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.renamenx(oldkey, newkey); @@ -1938,7 +1938,7 @@ public Long execute(Jedis connection) { @Override public byte[] rpoplpush(final byte[] srckey, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.rpoplpush(srckey, dstkey); @@ -1948,7 +1948,7 @@ public byte[] execute(Jedis connection) { @Override public Set sdiff(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sdiff(keys); @@ -1960,7 +1960,7 @@ public Set execute(Jedis connection) { public Long sdiffstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sdiffstore(dstkey, keys); @@ -1970,7 +1970,7 @@ public Long execute(Jedis connection) { @Override public Set sinter(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sinter(keys); @@ -1982,7 +1982,7 @@ public Set execute(Jedis connection) { public Long sinterstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sinterstore(dstkey, keys); @@ -1992,7 +1992,7 @@ public Long execute(Jedis connection) { @Override public Long smove(final byte[] srckey, final byte[] dstkey, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.smove(srckey, dstkey, member); @@ -2002,7 +2002,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final byte[] key, final SortingParams sortingParameters, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, sortingParameters, dstkey); @@ -2012,7 +2012,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final byte[] key, final byte[] dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, dstkey); @@ -2022,7 +2022,7 @@ public Long execute(Jedis connection) { @Override public Set sunion(final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sunion(keys); @@ -2034,7 +2034,7 @@ public Set execute(Jedis connection) { public Long sunionstore(final byte[] dstkey, final byte[]... keys) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sunionstore(dstkey, keys); @@ -2044,7 +2044,7 @@ public Long execute(Jedis connection) { @Override public Set zinter(final ZParams params, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zinter(params, keys); @@ -2054,7 +2054,7 @@ public Set execute(Jedis connection) { @Override public Set zinterWithScores(final ZParams params, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zinterWithScores(params, keys); @@ -2066,7 +2066,7 @@ public Set execute(Jedis connection) { public Long zinterstore(final byte[] dstkey, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, sets); @@ -2078,7 +2078,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final byte[] dstkey, final ZParams params, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, params, sets); @@ -2088,7 +2088,7 @@ public Long execute(Jedis connection) { @Override public Set zunion(final ZParams params, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zunion(params, keys); @@ -2098,7 +2098,7 @@ public Set execute(Jedis connection) { @Override public Set zunionWithScores(final ZParams params, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zunionWithScores(params, keys); @@ -2110,7 +2110,7 @@ public Set execute(Jedis connection) { public Long zunionstore(final byte[] dstkey, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, sets); @@ -2122,7 +2122,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final byte[] dstkey, final ZParams params, final byte[]... sets) { byte[][] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, params, sets); @@ -2132,7 +2132,7 @@ public Long execute(Jedis connection) { @Override public byte[] brpoplpush(final byte[] source, final byte[] destination, final int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.brpoplpush(source, destination, timeout); @@ -2142,7 +2142,7 @@ public byte[] execute(Jedis connection) { @Override public Long publish(final byte[] channel, final byte[] message) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.publish(channel, message); @@ -2152,7 +2152,7 @@ public Long execute(Jedis connection) { @Override public void subscribe(final BinaryJedisPubSub jedisPubSub, final byte[]... channels) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.subscribe(jedisPubSub, channels); @@ -2163,7 +2163,7 @@ public Integer execute(Jedis connection) { @Override public void psubscribe(final BinaryJedisPubSub jedisPubSub, final byte[]... patterns) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.psubscribe(jedisPubSub, patterns); @@ -2176,7 +2176,7 @@ public Integer execute(Jedis connection) { public Long bitop(final BitOP op, final byte[] destKey, final byte[]... srcKeys) { byte[][] wholeKeys = KeyMergeUtil.merge(destKey, srcKeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitop(op, destKey, srcKeys); @@ -2188,7 +2188,7 @@ public Long execute(Jedis connection) { public String pfmerge(final byte[] destkey, final byte[]... sourcekeys) { byte[][] wholeKeys = KeyMergeUtil.merge(destkey, sourcekeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.pfmerge(destkey, sourcekeys); @@ -2198,7 +2198,7 @@ public String execute(Jedis connection) { @Override public Long pfcount(final byte[]... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(keys); @@ -2209,7 +2209,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final byte[] key, final double longitude, final double latitude, final byte[] member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, longitude, latitude, member); @@ -2219,7 +2219,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final byte[] key, final Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, memberCoordinateMap); @@ -2229,7 +2229,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(byte[] key, GeoAddParams params, Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, params, memberCoordinateMap); @@ -2239,7 +2239,7 @@ public Long execute(Jedis connection) { @Override public Double geodist(final byte[] key, final byte[] member1, final byte[] member2) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2); @@ -2250,7 +2250,7 @@ public Double execute(Jedis connection) { @Override public Double geodist(final byte[] key, final byte[] member1, final byte[] member2, final GeoUnit unit) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2, unit); @@ -2260,7 +2260,7 @@ public Double execute(Jedis connection) { @Override public List geohash(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geohash(key, members); @@ -2270,7 +2270,7 @@ public List execute(Jedis connection) { @Override public List geopos(final byte[] key, final byte[]... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geopos(key, members); @@ -2281,7 +2281,7 @@ public List execute(Jedis connection) { @Override public List georadius(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit); @@ -2292,7 +2292,7 @@ public List execute(Jedis connection) { @Override public List georadiusReadonly(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit); @@ -2303,7 +2303,7 @@ public List execute(Jedis connection) { @Override public List georadius(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit, param); @@ -2316,7 +2316,7 @@ public Long georadiusStore(final byte[] key, final double longitude, final doubl final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { byte[][] keys = storeParam.getByteKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusStore(key, longitude, latitude, radius, unit, param, storeParam); @@ -2327,7 +2327,7 @@ public Long execute(Jedis connection) { @Override public List georadiusReadonly(final byte[] key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit, param); @@ -2338,7 +2338,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final byte[] key, final byte[] member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit); @@ -2349,7 +2349,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final byte[] key, final byte[] member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit); @@ -2360,7 +2360,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit, param); @@ -2372,7 +2372,7 @@ public List execute(Jedis connection) { public Long georadiusByMemberStore(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { byte[][] keys = storeParam.getByteKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusByMemberStore(key, member, radius, unit, param, storeParam); @@ -2383,7 +2383,7 @@ public Long execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final byte[] key, final byte[] member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit, param); @@ -2403,7 +2403,7 @@ public Set keys(final byte[] pattern) { + " only supports KEYS commands with patterns containing hash-tags " + "( curly-brackets enclosed strings )"); } - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.keys(pattern); @@ -2429,7 +2429,7 @@ public ScanResult scan(final byte[] cursor, final ScanParams params) { } return new JedisClusterCommand>(connectionHandler, maxAttempts, - this.maxTotalRetriesDuration) { + maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.scan(cursor, params); @@ -2440,8 +2440,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult> hscan(final byte[] key, final byte[] cursor) { return new JedisClusterCommand>>(connectionHandler, - maxAttempts, - this.maxTotalRetriesDuration) { + maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor); @@ -2453,8 +2452,7 @@ public ScanResult> execute(Jedis connection) { public ScanResult> hscan(final byte[] key, final byte[] cursor, final ScanParams params) { return new JedisClusterCommand>>(connectionHandler, - maxAttempts, - this.maxTotalRetriesDuration) { + maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor, params); @@ -2464,7 +2462,7 @@ public ScanResult> execute(Jedis connection) { @Override public ScanResult sscan(final byte[] key, final byte[] cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor); @@ -2474,7 +2472,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult sscan(final byte[] key, final byte[] cursor, final ScanParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor, params); @@ -2484,7 +2482,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final byte[] key, final byte[] cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor); @@ -2494,7 +2492,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final byte[] key, final byte[] cursor, final ScanParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor, params); @@ -2504,7 +2502,7 @@ public ScanResult execute(Jedis connection) { @Override public List bitfield(final byte[] key, final byte[]... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfield(key, arguments); @@ -2514,7 +2512,7 @@ public List execute(Jedis connection) { @Override public List bitfieldReadonly(final byte[] key, final byte[]... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfieldReadonly(key, arguments); @@ -2524,7 +2522,7 @@ public List execute(Jedis connection) { @Override public Long hstrlen(final byte[] key, final byte[] field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hstrlen(key, field); @@ -2534,7 +2532,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key); @@ -2544,7 +2542,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final byte[] key, final int samples) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key, samples); @@ -2555,7 +2553,7 @@ public Long execute(Jedis connection) { @Override public byte[] xadd(final byte[] key, final byte[] id, final Map hash, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.xadd(key, id, hash, maxLen, approximateLength); @@ -2565,7 +2563,7 @@ public byte[] execute(Jedis connection) { @Override public byte[] xadd(final byte[] key, final Map hash, final XAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.xadd(key, hash, params); @@ -2575,7 +2573,7 @@ public byte[] execute(Jedis connection) { @Override public Long xlen(final byte[] key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xlen(key); @@ -2585,7 +2583,7 @@ public Long execute(Jedis connection) { @Override public List xrange(final byte[] key, final byte[] start, final byte[] end) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end); @@ -2596,7 +2594,7 @@ public List execute(Jedis connection) { @Override public List xrange(final byte[] key, final byte[] start, final byte[] end, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end, count); @@ -2606,7 +2604,7 @@ public List execute(Jedis connection) { @Override public List xrange(final byte[] key, final byte[] start, final byte[] end, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end, count); @@ -2616,7 +2614,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final byte[] key, final byte[] end, final byte[] start) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start); @@ -2627,7 +2625,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final byte[] key, final byte[] end, final byte[] start, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start, count); @@ -2639,7 +2637,7 @@ public List execute(Jedis connection) { public List xread(final int count, final long block, final Map streams) { byte[][] keys = streams.keySet().toArray(new byte[streams.size()][]); - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xread(count, block, streams); @@ -2649,7 +2647,7 @@ public List execute(Jedis connection) { @Override public List xread(final XReadParams xReadParams, final Entry... streams) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xread(xReadParams, streams); @@ -2659,7 +2657,7 @@ public List execute(Jedis connection) { @Override public Long xack(final byte[] key, final byte[] group, final byte[]... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xack(key, group, ids); @@ -2670,7 +2668,7 @@ public Long execute(Jedis connection) { @Override public String xgroupCreate(final byte[] key, final byte[] consumer, final byte[] id, final boolean makeStream) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupCreate(key, consumer, id, makeStream); @@ -2680,7 +2678,7 @@ public String execute(Jedis connection) { @Override public String xgroupSetID(final byte[] key, final byte[] consumer, final byte[] id) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupSetID(key, consumer, id); @@ -2690,7 +2688,7 @@ public String execute(Jedis connection) { @Override public Long xgroupDestroy(final byte[] key, final byte[] consumer) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDestroy(key, consumer); @@ -2700,7 +2698,7 @@ public Long execute(Jedis connection) { @Override public Long xgroupDelConsumer(final byte[] key, final byte[] consumer, final byte[] consumerName) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDelConsumer(key, consumer, consumerName); @@ -2714,7 +2712,7 @@ public List xreadGroup(final byte[] groupname, final byte[] consumer, fi byte[][] keys = streams.keySet().toArray(new byte[streams.size()][]); - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xreadGroup(groupname, consumer, count, block, noAck, streams); @@ -2725,7 +2723,7 @@ public List execute(Jedis connection) { @Override public List xreadGroup(final byte[] groupname, final byte[] consumer, final XReadGroupParams xReadGroupParams, final Entry... streams) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xreadGroup(groupname, consumer, xReadGroupParams, streams); @@ -2735,7 +2733,7 @@ public List execute(Jedis connection) { @Override public Long xdel(final byte[] key, final byte[]... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xdel(key, ids); @@ -2745,7 +2743,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final byte[] key, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, maxLen, approximateLength); @@ -2755,7 +2753,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final byte[] key, final XTrimParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, params); @@ -2766,7 +2764,7 @@ public Long execute(Jedis connection) { @Override public List xpending(final byte[] key, final byte[] groupname, final byte[] start, final byte[] end, final int count, final byte[] consumername) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, start, end, count, consumername); @@ -2776,7 +2774,7 @@ public List execute(Jedis connection) { @Override public Object xpending(final byte[] key, final byte[] groupname) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.xpending(key, groupname); @@ -2786,7 +2784,7 @@ public Object execute(Jedis connection) { @Override public List xpending(final byte[] key, final byte[] groupname, final XPendingParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, params); @@ -2798,7 +2796,7 @@ public List execute(Jedis connection) { public List xclaim(final byte[] key, final byte[] groupname, final byte[] consumername, final long minIdleTime, final long newIdleTime, final int retries, final boolean force, final byte[][] ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaim(key, groupname, consumername, minIdleTime, newIdleTime, retries, @@ -2810,7 +2808,7 @@ public List execute(Jedis connection) { @Override public List xclaim(byte[] key, byte[] group, byte[] consumername, long minIdleTime, XClaimParams params, byte[]... ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaim(key, group, consumername, minIdleTime, params, ids); @@ -2821,7 +2819,7 @@ public List execute(Jedis connection) { @Override public List xclaimJustId(byte[] key, byte[] group, byte[] consumername, long minIdleTime, XClaimParams params, byte[]... ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaimJustId(key, group, consumername, minIdleTime, params, ids); @@ -2831,7 +2829,7 @@ public List execute(Jedis connection) { @Override public Long waitReplicas(final byte[] key, final int replicas, final long timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.waitReplicas(replicas, timeout); @@ -2840,7 +2838,7 @@ public Long execute(Jedis connection) { } public Object sendCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.sendCommand(cmd, args); @@ -2850,7 +2848,7 @@ public Object execute(Jedis connection) { public Object sendBlockingCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.sendBlockingCommand(cmd, args); diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index cf07bddbe3..f8a0de1612 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -274,7 +274,7 @@ public JedisCluster(Set nodes, final JedisClientConfig clientConfig @Override public Boolean copy(String srcKey, String 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); @@ -284,7 +284,7 @@ public Boolean execute(Jedis connection) { @Override public String set(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value); @@ -294,7 +294,7 @@ public String execute(Jedis connection) { @Override public String set(final String key, final String value, final SetParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.set(key, value, params); @@ -304,7 +304,7 @@ public String execute(Jedis connection) { @Override public String get(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.get(key); @@ -314,7 +314,7 @@ public String execute(Jedis connection) { @Override public String getDel(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.getDel(key); @@ -324,7 +324,7 @@ public String execute(Jedis connection) { @Override public String getEx(String key, GetExParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.getEx(key, params); @@ -334,7 +334,7 @@ public String execute(Jedis connection) { @Override public Boolean exists(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.exists(key); @@ -344,7 +344,7 @@ public Boolean execute(Jedis connection) { @Override public Long exists(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.exists(keys); @@ -354,7 +354,7 @@ public Long execute(Jedis connection) { @Override public Long persist(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.persist(key); @@ -364,7 +364,7 @@ public Long execute(Jedis connection) { @Override public String type(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.type(key); @@ -374,7 +374,7 @@ public String execute(Jedis connection) { @Override public byte[] dump(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public byte[] execute(Jedis connection) { return connection.dump(key); @@ -384,7 +384,7 @@ public byte[] execute(Jedis connection) { @Override public String restore(final String key, final long ttl, final byte[] serializedValue) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.restore(key, ttl, serializedValue); @@ -395,7 +395,7 @@ public String execute(Jedis connection) { @Override public String restore(final String 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); @@ -405,7 +405,7 @@ public String execute(Jedis connection) { @Override public Long expire(final String key, final long seconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expire(key, seconds); @@ -415,7 +415,7 @@ public Long execute(Jedis connection) { @Override public Long pexpire(final String key, final long milliseconds) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpire(key, milliseconds); @@ -425,7 +425,7 @@ public Long execute(Jedis connection) { @Override public Long expireAt(final String key, final long unixTime) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.expireAt(key, unixTime); @@ -435,7 +435,7 @@ public Long execute(Jedis connection) { @Override public Long pexpireAt(final String key, final long millisecondsTimestamp) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pexpireAt(key, millisecondsTimestamp); @@ -445,7 +445,7 @@ public Long execute(Jedis connection) { @Override public Long ttl(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.ttl(key); @@ -455,7 +455,7 @@ public Long execute(Jedis connection) { @Override public Long pttl(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pttl(key); @@ -465,7 +465,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(key); @@ -475,7 +475,7 @@ public Long execute(Jedis connection) { @Override public Long touch(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.touch(keys); @@ -485,7 +485,7 @@ public Long execute(Jedis connection) { @Override public Boolean setbit(final String key, final long offset, final boolean value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -495,7 +495,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean setbit(final String key, final long offset, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.setbit(key, offset, value); @@ -505,7 +505,7 @@ public Boolean execute(Jedis connection) { @Override public Boolean getbit(final String key, final long offset) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.getbit(key, offset); @@ -515,7 +515,7 @@ public Boolean execute(Jedis connection) { @Override public Long setrange(final String key, final long offset, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setrange(key, offset, value); @@ -525,7 +525,7 @@ public Long execute(Jedis connection) { @Override public String getrange(final String key, final long startOffset, final long endOffset) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.getrange(key, startOffset, endOffset); @@ -535,7 +535,7 @@ public String execute(Jedis connection) { @Override public String getSet(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.getSet(key, value); @@ -545,7 +545,7 @@ public String execute(Jedis connection) { @Override public Long setnx(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.setnx(key, value); @@ -555,7 +555,7 @@ public Long execute(Jedis connection) { @Override public String setex(final String key, final long seconds, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.setex(key, seconds, value); @@ -565,7 +565,7 @@ public String execute(Jedis connection) { @Override public String psetex(final String key, final long milliseconds, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.psetex(key, milliseconds, value); @@ -575,7 +575,7 @@ public String execute(Jedis connection) { @Override public Long decrBy(final String key, final long decrement) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decrBy(key, decrement); @@ -585,7 +585,7 @@ public Long execute(Jedis connection) { @Override public Long decr(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.decr(key); @@ -595,7 +595,7 @@ public Long execute(Jedis connection) { @Override public Long incrBy(final String key, final long increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incrBy(key, increment); @@ -605,7 +605,7 @@ public Long execute(Jedis connection) { @Override public Double incrByFloat(final String key, final double increment) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.incrByFloat(key, increment); @@ -615,7 +615,7 @@ public Double execute(Jedis connection) { @Override public Long incr(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.incr(key); @@ -625,7 +625,7 @@ public Long execute(Jedis connection) { @Override public Long append(final String key, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.append(key, value); @@ -635,7 +635,7 @@ public Long execute(Jedis connection) { @Override public String substr(final String key, final int start, final int end) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.substr(key, start, end); @@ -645,7 +645,7 @@ public String execute(Jedis connection) { @Override public Long hset(final String key, final String field, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, field, value); @@ -655,7 +655,7 @@ public Long execute(Jedis connection) { @Override public Long hset(final String key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hset(key, hash); @@ -665,7 +665,7 @@ public Long execute(Jedis connection) { @Override public String hget(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.hget(key, field); @@ -675,7 +675,7 @@ public String execute(Jedis connection) { @Override public Long hsetnx(final String key, final String field, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hsetnx(key, field, value); @@ -685,7 +685,7 @@ public Long execute(Jedis connection) { @Override public String hmset(final String key, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.hmset(key, hash); @@ -695,7 +695,7 @@ public String execute(Jedis connection) { @Override public List hmget(final String key, final String... fields) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hmget(key, fields); @@ -705,7 +705,7 @@ public List execute(Jedis connection) { @Override public Long hincrBy(final String key, final String field, final long value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hincrBy(key, field, value); @@ -715,7 +715,7 @@ public Long execute(Jedis connection) { @Override public Double hincrByFloat(final String key, final String field, final double value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.hincrByFloat(key, field, value); @@ -725,7 +725,7 @@ public Double execute(Jedis connection) { @Override public Boolean hexists(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.hexists(key, field); @@ -735,7 +735,7 @@ public Boolean execute(Jedis connection) { @Override public Long hdel(final String key, final String... field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hdel(key, field); @@ -745,7 +745,7 @@ public Long execute(Jedis connection) { @Override public Long hlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hlen(key); @@ -755,7 +755,7 @@ public Long execute(Jedis connection) { @Override public Set hkeys(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.hkeys(key); @@ -765,7 +765,7 @@ public Set execute(Jedis connection) { @Override public List hvals(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hvals(key); @@ -775,7 +775,7 @@ public List execute(Jedis connection) { @Override public Map hgetAll(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Map execute(Jedis connection) { return connection.hgetAll(key); @@ -785,7 +785,7 @@ public Map execute(Jedis connection) { @Override public String hrandfield(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.hrandfield(key); @@ -795,7 +795,7 @@ public String execute(Jedis connection) { @Override public List hrandfield(final String key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.hrandfield(key, count); @@ -805,7 +805,7 @@ public List execute(Jedis connection) { @Override public Map hrandfieldWithValues(final String key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Map execute(Jedis connection) { return connection.hrandfieldWithValues(key, count); @@ -815,7 +815,7 @@ public Map execute(Jedis connection) { @Override public Long rpush(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpush(key, string); @@ -825,7 +825,7 @@ public Long execute(Jedis connection) { @Override public Long lpush(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpush(key, string); @@ -835,7 +835,7 @@ public Long execute(Jedis connection) { @Override public Long llen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.llen(key); @@ -845,7 +845,7 @@ public Long execute(Jedis connection) { @Override public List lrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lrange(key, start, stop); @@ -855,7 +855,7 @@ public List execute(Jedis connection) { @Override public String ltrim(final String key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.ltrim(key, start, stop); @@ -865,7 +865,7 @@ public String execute(Jedis connection) { @Override public String lindex(final String key, final long index) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lindex(key, index); @@ -875,7 +875,7 @@ public String execute(Jedis connection) { @Override public String lset(final String key, final long index, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lset(key, index, value); @@ -885,7 +885,7 @@ public String execute(Jedis connection) { @Override public Long lrem(final String key, final long count, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lrem(key, count, value); @@ -895,7 +895,7 @@ public Long execute(Jedis connection) { @Override public String lpop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lpop(key); @@ -905,7 +905,7 @@ public String execute(Jedis connection) { @Override public List lpop(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpop(key, count); @@ -915,7 +915,7 @@ public List execute(Jedis connection) { @Override public Long lpos(final String key, final String element) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element); @@ -925,7 +925,7 @@ public Long execute(Jedis connection) { @Override public Long lpos(final String key, final String element, final LPosParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpos(key, element, params); @@ -936,7 +936,7 @@ public Long execute(Jedis connection) { @Override public List lpos(final String key, final String element, final LPosParams params, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.lpos(key, element, params, count); @@ -946,7 +946,7 @@ public List execute(Jedis connection) { @Override public String rpop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rpop(key); @@ -956,7 +956,7 @@ public String execute(Jedis connection) { @Override public List rpop(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.rpop(key, count); @@ -966,7 +966,7 @@ public List execute(Jedis connection) { @Override public Long sadd(final String key, final String... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sadd(key, member); @@ -976,7 +976,7 @@ public Long execute(Jedis connection) { @Override public Set smembers(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.smembers(key); @@ -986,7 +986,7 @@ public Set execute(Jedis connection) { @Override public Long srem(final String key, final String... member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.srem(key, member); @@ -996,7 +996,7 @@ public Long execute(Jedis connection) { @Override public String spop(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.spop(key); @@ -1006,7 +1006,7 @@ public String execute(Jedis connection) { @Override public Set spop(final String key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.spop(key, count); @@ -1016,7 +1016,7 @@ public Set execute(Jedis connection) { @Override public Long scard(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.scard(key); @@ -1026,7 +1026,7 @@ public Long execute(Jedis connection) { @Override public Boolean sismember(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.sismember(key, member); @@ -1036,7 +1036,7 @@ public Boolean execute(Jedis connection) { @Override public List smismember(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.smismember(key, members); @@ -1046,7 +1046,7 @@ public List execute(Jedis connection) { @Override public String srandmember(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.srandmember(key); @@ -1056,7 +1056,7 @@ public String execute(Jedis connection) { @Override public List srandmember(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.srandmember(key, count); @@ -1066,7 +1066,7 @@ public List execute(Jedis connection) { @Override public Long strlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.strlen(key); @@ -1076,7 +1076,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final double score, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member); @@ -1087,7 +1087,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final double score, final String member, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, score, member, params); @@ -1097,7 +1097,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final Map scoreMembers) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers); @@ -1107,7 +1107,7 @@ public Long execute(Jedis connection) { @Override public Long zadd(final String key, final Map scoreMembers, final ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zadd(key, scoreMembers, params); @@ -1117,7 +1117,7 @@ public Long execute(Jedis connection) { @Override public Double zaddIncr(String key, double score, String member, ZAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zaddIncr(key, score, member, params); @@ -1127,7 +1127,7 @@ public Double execute(Jedis connection) { @Override public Set zdiff(String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zdiff(keys); @@ -1137,7 +1137,7 @@ public Set execute(Jedis connection) { @Override public Set zdiffWithScores(String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zdiffWithScores(keys); @@ -1148,7 +1148,7 @@ public Set execute(Jedis connection) { @Override public Long zdiffStore(final String dstkey, final String... keys) { String[] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zdiffStore(dstkey, keys); @@ -1158,7 +1158,7 @@ public Long execute(Jedis connection) { @Override public Set zrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrange(key, start, stop); @@ -1168,7 +1168,7 @@ public Set execute(Jedis connection) { @Override public Long zrem(final String key, final String... members) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrem(key, members); @@ -1178,7 +1178,7 @@ public Long execute(Jedis connection) { @Override public Double zincrby(final String key, final double increment, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member); @@ -1189,7 +1189,7 @@ public Double execute(Jedis connection) { @Override public Double zincrby(final String key, final double increment, final String member, final ZIncrByParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zincrby(key, increment, member, params); @@ -1199,7 +1199,7 @@ public Double execute(Jedis connection) { @Override public Long zrank(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrank(key, member); @@ -1209,7 +1209,7 @@ public Long execute(Jedis connection) { @Override public Long zrevrank(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zrevrank(key, member); @@ -1219,7 +1219,7 @@ public Long execute(Jedis connection) { @Override public Set zrevrange(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrange(key, start, stop); @@ -1229,7 +1229,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeWithScores(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeWithScores(key, start, stop); @@ -1239,7 +1239,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeWithScores(final String key, final long start, final long stop) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeWithScores(key, start, stop); @@ -1249,7 +1249,7 @@ public Set execute(Jedis connection) { @Override public String zrandmember(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.zrandmember(key); @@ -1259,7 +1259,7 @@ public String execute(Jedis connection) { @Override public Set zrandmember(final String key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrandmember(key, count); @@ -1269,7 +1269,7 @@ public Set execute(Jedis connection) { @Override public Set zrandmemberWithScores(final String key, final long count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrandmemberWithScores(key, count); @@ -1279,7 +1279,7 @@ public Set execute(Jedis connection) { @Override public Long zcard(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcard(key); @@ -1289,7 +1289,7 @@ public Long execute(Jedis connection) { @Override public Double zscore(final String key, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.zscore(key, member); @@ -1299,7 +1299,7 @@ public Double execute(Jedis connection) { @Override public List zmscore(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.zmscore(key, members); @@ -1309,7 +1309,7 @@ public List execute(Jedis connection) { @Override public Tuple zpopmax(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmax(key); @@ -1319,7 +1319,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmax(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmax(key, count); @@ -1329,7 +1329,7 @@ public Set execute(Jedis connection) { @Override public Tuple zpopmin(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Tuple execute(Jedis connection) { return connection.zpopmin(key); @@ -1339,7 +1339,7 @@ public Tuple execute(Jedis connection) { @Override public Set zpopmin(final String key, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zpopmin(key, count); @@ -1349,7 +1349,7 @@ public Set execute(Jedis connection) { @Override public List sort(final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key); @@ -1359,7 +1359,7 @@ public List execute(Jedis connection) { @Override public List sort(final String key, final SortingParams sortingParameters) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.sort(key, sortingParameters); @@ -1369,7 +1369,7 @@ public List execute(Jedis connection) { @Override public Long zcount(final String key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1379,7 +1379,7 @@ public Long execute(Jedis connection) { @Override public Long zcount(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zcount(key, min, max); @@ -1389,7 +1389,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1399,7 +1399,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max); @@ -1409,7 +1409,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1420,7 +1420,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1430,7 +1430,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min); @@ -1441,7 +1441,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScore(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScore(key, min, max, offset, count); @@ -1452,7 +1452,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1462,7 +1462,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final double min, final double max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1472,7 +1472,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final double max, final double min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1483,7 +1483,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final double min, final double max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1494,7 +1494,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScore(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScore(key, max, min, offset, count); @@ -1504,7 +1504,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max); @@ -1514,7 +1514,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min); @@ -1525,7 +1525,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByScoreWithScores(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByScoreWithScores(key, min, max, offset, count); @@ -1536,7 +1536,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final double max, final double min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1547,7 +1547,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByScoreWithScores(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByScoreWithScores(key, max, min, offset, count); @@ -1557,7 +1557,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByRank(final String key, final long start, final long stop) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByRank(key, start, stop); @@ -1567,7 +1567,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final String key, final double min, final double max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1577,7 +1577,7 @@ public Long execute(Jedis connection) { @Override public Long zremrangeByScore(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByScore(key, min, max); @@ -1587,7 +1587,7 @@ public Long execute(Jedis connection) { @Override public Long zlexcount(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zlexcount(key, min, max); @@ -1597,7 +1597,7 @@ public Long execute(Jedis connection) { @Override public Set zrangeByLex(final String key, final String min, final String max) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max); @@ -1608,7 +1608,7 @@ public Set execute(Jedis connection) { @Override public Set zrangeByLex(final String key, final String min, final String max, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, min, max, offset, count); @@ -1618,7 +1618,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final String key, final String max, final String min) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min); @@ -1629,7 +1629,7 @@ public Set execute(Jedis connection) { @Override public Set zrevrangeByLex(final String key, final String max, final String min, final int offset, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zrevrangeByLex(key, max, min, offset, count); @@ -1639,7 +1639,7 @@ public Set execute(Jedis connection) { @Override public Long zremrangeByLex(final String key, final String min, final String max) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zremrangeByLex(key, min, max); @@ -1650,7 +1650,7 @@ public Long execute(Jedis connection) { @Override public Long linsert(final String key, final ListPosition where, final String pivot, final String value) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.linsert(key, where, pivot, value); @@ -1660,7 +1660,7 @@ public Long execute(Jedis connection) { @Override public Long lpushx(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.lpushx(key, string); @@ -1670,7 +1670,7 @@ public Long execute(Jedis connection) { @Override public Long rpushx(final String key, final String... string) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.rpushx(key, string); @@ -1680,7 +1680,7 @@ public Long execute(Jedis connection) { @Override public Long del(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(key); @@ -1690,7 +1690,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(key); @@ -1700,7 +1700,7 @@ public Long execute(Jedis connection) { @Override public Long unlink(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.unlink(keys); @@ -1711,7 +1711,7 @@ public Long execute(Jedis connection) { @Override public String echo(final String string) { // note that it'll be run from arbitrary node - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.echo(string); @@ -1721,7 +1721,7 @@ public String execute(Jedis connection) { @Override public Long bitcount(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key); @@ -1731,7 +1731,7 @@ public Long execute(Jedis connection) { @Override public Long bitcount(final String key, final long start, final long end) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitcount(key, start, end); @@ -1751,7 +1751,7 @@ public Set keys(final String pattern) { + " only supports KEYS commands with patterns containing hash-tags" + " ( curly-brackets enclosed strings )"); } - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.keys(pattern); @@ -1777,7 +1777,7 @@ public ScanResult scan(final String cursor, final ScanParams params) { } return new JedisClusterCommand< ScanResult>(connectionHandler, maxAttempts, - this.maxTotalRetriesDuration) { + maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.scan(cursor, params); @@ -1788,8 +1788,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult> hscan(final String key, final String cursor) { return new JedisClusterCommand>>(connectionHandler, - maxAttempts, - this.maxTotalRetriesDuration) { + maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult> execute(Jedis connection) { return connection.hscan(key, cursor); @@ -1799,7 +1798,7 @@ public ScanResult> execute(Jedis connection) { @Override public ScanResult sscan(final String key, final String cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.sscan(key, cursor); @@ -1809,7 +1808,7 @@ public ScanResult execute(Jedis connection) { @Override public ScanResult zscan(final String key, final String cursor) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public ScanResult execute(Jedis connection) { return connection.zscan(key, cursor); @@ -1819,7 +1818,7 @@ public ScanResult execute(Jedis connection) { @Override public Long pfadd(final String key, final String... elements) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfadd(key, elements); @@ -1829,7 +1828,7 @@ public Long execute(Jedis connection) { @Override public long pfcount(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(key); @@ -1839,7 +1838,7 @@ public Long execute(Jedis connection) { @Override public List blpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, key); @@ -1849,7 +1848,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, key); @@ -1859,7 +1858,7 @@ public List execute(Jedis connection) { @Override public Long del(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.del(keys); @@ -1869,7 +1868,7 @@ public Long execute(Jedis connection) { @Override public String lmove(String srcKey, String dstKey, ListDirection from, ListDirection to) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.lmove(srcKey, dstKey, from, to); @@ -1880,7 +1879,7 @@ public String execute(Jedis connection) { @Override public String blmove(String srcKey, String dstKey, ListDirection from, ListDirection to, int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.blmove(srcKey, dstKey, from, to, timeout); @@ -1890,7 +1889,7 @@ public String execute(Jedis connection) { @Override public List blpop(final int timeout, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1901,7 +1900,7 @@ public List execute(Jedis connection) { @Override public List brpop(final int timeout, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, keys); @@ -1911,7 +1910,7 @@ public List execute(Jedis connection) { @Override public KeyedTuple bzpopmax(int timeout, String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public KeyedTuple execute(Jedis connection) { return connection.bzpopmax(timeout, keys); @@ -1921,7 +1920,7 @@ public KeyedTuple execute(Jedis connection) { @Override public KeyedTuple bzpopmin(int timeout, String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public KeyedTuple execute(Jedis connection) { return connection.bzpopmin(timeout, keys); @@ -1931,7 +1930,7 @@ public KeyedTuple execute(Jedis connection) { @Override public List mget(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.mget(keys); @@ -1947,7 +1946,7 @@ public String mset(final String... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.mset(keysvalues); @@ -1963,7 +1962,7 @@ public Long msetnx(final String... keysvalues) { keys[keyIdx] = keysvalues[keyIdx * 2]; } - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.msetnx(keysvalues); @@ -1973,7 +1972,7 @@ public Long execute(Jedis connection) { @Override public String rename(final String oldkey, final String newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rename(oldkey, newkey); @@ -1983,7 +1982,7 @@ public String execute(Jedis connection) { @Override public Long renamenx(final String oldkey, final String newkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.renamenx(oldkey, newkey); @@ -1993,7 +1992,7 @@ public Long execute(Jedis connection) { @Override public String rpoplpush(final String srckey, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.rpoplpush(srckey, dstkey); @@ -2003,7 +2002,7 @@ public String execute(Jedis connection) { @Override public Set sdiff(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sdiff(keys); @@ -2015,7 +2014,7 @@ public Set execute(Jedis connection) { public Long sdiffstore(final String dstkey, final String... keys) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sdiffstore(dstkey, keys); @@ -2025,7 +2024,7 @@ public Long execute(Jedis connection) { @Override public Set sinter(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sinter(keys); @@ -2037,7 +2036,7 @@ public Set execute(Jedis connection) { public Long sinterstore(final String dstkey, final String... keys) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sinterstore(dstkey, keys); @@ -2047,7 +2046,7 @@ public Long execute(Jedis connection) { @Override public Long smove(final String srckey, final String dstkey, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.smove(srckey, dstkey, member); @@ -2057,7 +2056,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final String key, final SortingParams sortingParameters, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, sortingParameters, dstkey); @@ -2067,7 +2066,7 @@ public Long execute(Jedis connection) { @Override public Long sort(final String key, final String dstkey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sort(key, dstkey); @@ -2077,7 +2076,7 @@ public Long execute(Jedis connection) { @Override public Set sunion(final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.sunion(keys); @@ -2089,7 +2088,7 @@ public Set execute(Jedis connection) { public Long sunionstore(final String dstkey, final String... keys) { String[] wholeKeys = KeyMergeUtil.merge(dstkey, keys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.sunionstore(dstkey, keys); @@ -2099,7 +2098,7 @@ public Long execute(Jedis connection) { @Override public Set zinter(final ZParams params, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zinter(params, keys); @@ -2109,7 +2108,7 @@ public Set execute(Jedis connection) { @Override public Set zinterWithScores(final ZParams params, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zinterWithScores(params, keys); @@ -2121,7 +2120,7 @@ public Set execute(Jedis connection) { public Long zinterstore(final String dstkey, final String... sets) { String[] wholeKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, sets); @@ -2133,7 +2132,7 @@ public Long execute(Jedis connection) { public Long zinterstore(final String dstkey, final ZParams params, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zinterstore(dstkey, params, sets); @@ -2143,7 +2142,7 @@ public Long execute(Jedis connection) { @Override public Set zunion(final ZParams params, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zunion(params, keys); @@ -2153,7 +2152,7 @@ public Set execute(Jedis connection) { @Override public Set zunionWithScores(final ZParams params, final String... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Set execute(Jedis connection) { return connection.zunionWithScores(params, keys); @@ -2165,7 +2164,7 @@ public Set execute(Jedis connection) { public Long zunionstore(final String dstkey, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, sets); @@ -2177,7 +2176,7 @@ public Long execute(Jedis connection) { public Long zunionstore(final String dstkey, final ZParams params, final String... sets) { String[] mergedKeys = KeyMergeUtil.merge(dstkey, sets); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.zunionstore(dstkey, params, sets); @@ -2187,7 +2186,7 @@ public Long execute(Jedis connection) { @Override public String brpoplpush(final String source, final String destination, final int timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.brpoplpush(source, destination, timeout); @@ -2197,7 +2196,7 @@ public String execute(Jedis connection) { @Override public Long publish(final String channel, final String message) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.publish(channel, message); @@ -2207,7 +2206,7 @@ public Long execute(Jedis connection) { @Override public void subscribe(final JedisPubSub jedisPubSub, final String... channels) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.subscribe(jedisPubSub, channels); @@ -2218,7 +2217,7 @@ public Integer execute(Jedis connection) { @Override public void psubscribe(final JedisPubSub jedisPubSub, final String... patterns) { - new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Integer execute(Jedis connection) { connection.psubscribe(jedisPubSub, patterns); @@ -2231,7 +2230,7 @@ public Integer execute(Jedis connection) { public Long bitop(final BitOP op, final String destKey, final String... srcKeys) { String[] mergedKeys = KeyMergeUtil.merge(destKey, srcKeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.bitop(op, destKey, srcKeys); @@ -2243,7 +2242,7 @@ public Long execute(Jedis connection) { public String pfmerge(final String destkey, final String... sourcekeys) { String[] mergedKeys = KeyMergeUtil.merge(destkey, sourcekeys); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.pfmerge(destkey, sourcekeys); @@ -2253,7 +2252,7 @@ public String execute(Jedis connection) { @Override public long pfcount(final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.pfcount(keys); @@ -2263,7 +2262,7 @@ public Long execute(Jedis connection) { @Override public Object eval(final String script, final int keyCount, final String... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keyCount, params); @@ -2273,7 +2272,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final String script, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script); @@ -2283,7 +2282,7 @@ public Object execute(Jedis connection) { @Override public Object eval(final String script, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.eval(script, keys, args); @@ -2293,7 +2292,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final int keyCount, final String... params) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keyCount, params); @@ -2303,7 +2302,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final List keys, final List args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1, keys, args); @@ -2313,7 +2312,7 @@ public Object execute(Jedis connection) { @Override public Object evalsha(final String sha1, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.evalsha(sha1); @@ -2323,7 +2322,7 @@ public Object execute(Jedis connection) { @Override public Boolean scriptExists(final String sha1, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Boolean execute(Jedis connection) { return connection.scriptExists(sha1); @@ -2333,7 +2332,7 @@ public Boolean execute(Jedis connection) { @Override public List scriptExists(final String sampleKey, final String... sha1) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.scriptExists(sha1); @@ -2343,7 +2342,7 @@ public List execute(Jedis connection) { @Override public String scriptLoad(final String script, final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptLoad(script); @@ -2353,7 +2352,7 @@ public String execute(Jedis connection) { @Override public String scriptFlush(final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptFlush(); @@ -2363,7 +2362,7 @@ public String execute(Jedis connection) { @Override public String scriptKill(final String sampleKey) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.scriptKill(); @@ -2374,7 +2373,7 @@ public String execute(Jedis connection) { @Override public Long geoadd(final String key, final double longitude, final double latitude, final String member) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, longitude, latitude, member); @@ -2384,7 +2383,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(final String key, final Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, memberCoordinateMap); @@ -2394,7 +2393,7 @@ public Long execute(Jedis connection) { @Override public Long geoadd(String key, GeoAddParams params, Map memberCoordinateMap) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.geoadd(key, params, memberCoordinateMap); @@ -2404,7 +2403,7 @@ public Long execute(Jedis connection) { @Override public Double geodist(final String key, final String member1, final String member2) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2); @@ -2415,7 +2414,7 @@ public Double execute(Jedis connection) { @Override public Double geodist(final String key, final String member1, final String member2, final GeoUnit unit) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Double execute(Jedis connection) { return connection.geodist(key, member1, member2, unit); @@ -2425,7 +2424,7 @@ public Double execute(Jedis connection) { @Override public List geohash(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geohash(key, members); @@ -2435,7 +2434,7 @@ public List execute(Jedis connection) { @Override public List geopos(final String key, final String... members) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.geopos(key, members); @@ -2446,7 +2445,7 @@ public List execute(Jedis connection) { @Override public List georadius(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit); @@ -2457,7 +2456,7 @@ public List execute(Jedis connection) { @Override public List georadiusReadonly(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit); @@ -2468,7 +2467,7 @@ public List execute(Jedis connection) { @Override public List georadius(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadius(key, longitude, latitude, radius, unit, param); @@ -2481,7 +2480,7 @@ public Long georadiusStore(final String key, final double longitude, final doubl final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { String[] keys = storeParam.getStringKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusStore(key, longitude, latitude, radius, unit, param, storeParam); @@ -2492,7 +2491,7 @@ public Long execute(Jedis connection) { @Override public List georadiusReadonly(final String key, final double longitude, final double latitude, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusReadonly(key, longitude, latitude, radius, unit, param); @@ -2503,7 +2502,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final String key, final String member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit); @@ -2514,7 +2513,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final String key, final String member, final double radius, final GeoUnit unit) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit); @@ -2525,7 +2524,7 @@ public List execute(Jedis connection) { @Override public List georadiusByMember(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMember(key, member, radius, unit, param); @@ -2537,7 +2536,7 @@ public List execute(Jedis connection) { public Long georadiusByMemberStore(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param, final GeoRadiusStoreParam storeParam) { String[] keys = storeParam.getStringKeys(key); - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.georadiusByMemberStore(key, member, radius, unit, param, storeParam); @@ -2548,7 +2547,7 @@ public Long execute(Jedis connection) { @Override public List georadiusByMemberReadonly(final String key, final String member, final double radius, final GeoUnit unit, final GeoRadiusParam param) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.georadiusByMemberReadonly(key, member, radius, unit, param); @@ -2558,7 +2557,7 @@ public List execute(Jedis connection) { @Override public List bitfield(final String key, final String... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfield(key, arguments); @@ -2568,7 +2567,7 @@ public List execute(Jedis connection) { @Override public List bitfieldReadonly(final String key, final String... arguments) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.bitfieldReadonly(key, arguments); @@ -2578,7 +2577,7 @@ public List execute(Jedis connection) { @Override public Long hstrlen(final String key, final String field) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.hstrlen(key, field); @@ -2588,7 +2587,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key); @@ -2598,7 +2597,7 @@ public Long execute(Jedis connection) { @Override public Long memoryUsage(final String key, final int samples) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.memoryUsage(key, samples); @@ -2608,7 +2607,7 @@ public Long execute(Jedis connection) { @Override public StreamEntryID xadd(final String key, final StreamEntryID id, final Map hash) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public StreamEntryID execute(Jedis connection) { return connection.xadd(key, id, hash); @@ -2619,7 +2618,7 @@ public StreamEntryID execute(Jedis connection) { @Override public StreamEntryID xadd(final String key, final StreamEntryID id, final Map hash, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public StreamEntryID execute(Jedis connection) { return connection.xadd(key, id, hash, maxLen, approximateLength); @@ -2629,7 +2628,7 @@ public StreamEntryID execute(Jedis connection) { @Override public StreamEntryID xadd(final String key, final Map hash, final XAddParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public StreamEntryID execute(Jedis connection) { return connection.xadd(key, hash, params); @@ -2639,7 +2638,7 @@ public StreamEntryID execute(Jedis connection) { @Override public Long xlen(final String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xlen(key); @@ -2650,7 +2649,7 @@ public Long execute(Jedis connection) { @Override public List xrange(final String key, final StreamEntryID start, final StreamEntryID end) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end); @@ -2661,7 +2660,7 @@ public List execute(Jedis connection) { @Override public List xrange(final String key, final StreamEntryID start, final StreamEntryID end, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrange(key, start, end, count); @@ -2672,7 +2671,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final String key, final StreamEntryID end, final StreamEntryID start) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start); @@ -2683,7 +2682,7 @@ public List execute(Jedis connection) { @Override public List xrevrange(final String key, final StreamEntryID end, final StreamEntryID start, final int count) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xrevrange(key, end, start, count); @@ -2710,7 +2709,7 @@ public List>> execute(Jedis connection) { @Override public List>> xread(final XReadParams xReadParams, final Map streams) { - return new JedisClusterCommand>>>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>>>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List>> execute(Jedis connection) { return connection.xread(xReadParams, streams); @@ -2720,7 +2719,7 @@ public List>> execute(Jedis connection) { @Override public Long xack(final String key, final String group, final StreamEntryID... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xack(key, group, ids); @@ -2731,7 +2730,7 @@ public Long execute(Jedis connection) { @Override public String xgroupCreate(final String key, final String groupname, final StreamEntryID id, final boolean makeStream) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupCreate(key, groupname, id, makeStream); @@ -2741,7 +2740,7 @@ public String execute(Jedis connection) { @Override public String xgroupSetID(final String key, final String groupname, final StreamEntryID id) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public String execute(Jedis connection) { return connection.xgroupSetID(key, groupname, id); @@ -2751,7 +2750,7 @@ public String execute(Jedis connection) { @Override public Long xgroupDestroy(final String key, final String groupname) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDestroy(key, groupname); @@ -2761,7 +2760,7 @@ public Long execute(Jedis connection) { @Override public Long xgroupDelConsumer(final String key, final String groupname, final String consumername) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xgroupDelConsumer(key, groupname, consumername); @@ -2792,7 +2791,7 @@ public List>> execute(Jedis connection) { public List>> xreadGroup(final String groupname, final String consumer, final XReadGroupParams xReadGroupParams, final Map streams) { - return new JedisClusterCommand>>>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>>>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List>> execute(Jedis connection) { return connection.xreadGroup(groupname, consumer, xReadGroupParams, streams); @@ -2802,7 +2801,7 @@ public List>> execute(Jedis connection) { @Override public StreamPendingSummary xpending(final String key, final String groupname) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public StreamPendingSummary execute(Jedis connection) { return connection.xpending(key, groupname); @@ -2813,7 +2812,7 @@ public StreamPendingSummary execute(Jedis connection) { @Override public List xpending(final String key, final String groupname, final StreamEntryID start, final StreamEntryID end, final int count, final String consumername) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, start, end, count, consumername); @@ -2823,7 +2822,7 @@ public List execute(Jedis connection) { @Override public List xpending(final String key, final String groupname, final XPendingParams params) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xpending(key, groupname, params); @@ -2833,7 +2832,7 @@ public List execute(Jedis connection) { @Override public Long xdel(final String key, final StreamEntryID... ids) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xdel(key, ids); @@ -2843,7 +2842,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final String key, final long maxLen, final boolean approximateLength) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, maxLen, approximateLength); @@ -2853,7 +2852,7 @@ public Long execute(Jedis connection) { @Override public Long xtrim(final String key, final XTrimParams params) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.xtrim(key, params); @@ -2865,7 +2864,7 @@ public Long execute(Jedis connection) { public List xclaim(final String key, final String group, final String consumername, final long minIdleTime, final long newIdleTime, final int retries, final boolean force, final StreamEntryID... ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaim(key, group, consumername, minIdleTime, newIdleTime, retries, @@ -2877,7 +2876,7 @@ public List execute(Jedis connection) { @Override public List xclaim(String key, String group, String consumername, long minIdleTime, XClaimParams params, StreamEntryID... ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaim(key, group, consumername, minIdleTime, params, ids); @@ -2888,7 +2887,7 @@ public List execute(Jedis connection) { @Override public List xclaimJustId(String key, String group, String consumername, long minIdleTime, XClaimParams params, StreamEntryID... ids) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.xclaimJustId(key, group, consumername, minIdleTime, params, ids); @@ -2897,7 +2896,7 @@ public List execute(Jedis connection) { } public Long waitReplicas(final String key, final int replicas, final long timeout) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Long execute(Jedis connection) { return connection.waitReplicas(replicas, timeout); @@ -2906,7 +2905,7 @@ public Long execute(Jedis connection) { } public Object sendCommand(final String sampleKey, final ProtocolCommand cmd, final String... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.sendCommand(cmd, args); @@ -2916,7 +2915,7 @@ public Object execute(Jedis connection) { public Object sendBlockingCommand(final String sampleKey, final ProtocolCommand cmd, final String... args) { - return new JedisClusterCommand(connectionHandler, maxAttempts, this.maxTotalRetriesDuration) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public Object execute(Jedis connection) { return connection.sendBlockingCommand(cmd, args); From 4501b0d40a45886a81eea7624aa34080dc0c2ab2 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Wed, 31 Mar 2021 07:54:43 +0600 Subject: [PATCH 35/35] more missing maxTotalRetriesDuration after merge --- .../java/redis/clients/jedis/BinaryJedisCluster.java | 4 ++-- src/main/java/redis/clients/jedis/JedisCluster.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java index b02426318e..821248d268 100644 --- a/src/main/java/redis/clients/jedis/BinaryJedisCluster.java +++ b/src/main/java/redis/clients/jedis/BinaryJedisCluster.java @@ -1846,7 +1846,7 @@ public List execute(Jedis connection) { @Override public List blpop(final double timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1866,7 +1866,7 @@ public List execute(Jedis connection) { @Override public List brpop(final double timeout, final byte[]... keys) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, keys); diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 71e67e421f..56eddd4880 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -1881,7 +1881,7 @@ public List execute(Jedis connection) { @Override public KeyedListElement blpop(final double timeout, final String... keys) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public KeyedListElement execute(Jedis connection) { return connection.blpop(timeout, keys); @@ -1932,7 +1932,7 @@ public KeyedZSetElement execute(Jedis connection) { @Override public List blpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.blpop(timeout, key); @@ -1942,7 +1942,7 @@ public List execute(Jedis connection) { @Override public KeyedListElement blpop(double timeout, String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public KeyedListElement execute(Jedis connection) { return connection.blpop(timeout, key); @@ -1952,7 +1952,7 @@ public KeyedListElement execute(Jedis connection) { @Override public List brpop(final int timeout, final String key) { - return new JedisClusterCommand>(connectionHandler, maxAttempts) { + return new JedisClusterCommand>(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public List execute(Jedis connection) { return connection.brpop(timeout, key); @@ -1962,7 +1962,7 @@ public List execute(Jedis connection) { @Override public KeyedListElement brpop(double timeout, String key) { - return new JedisClusterCommand(connectionHandler, maxAttempts) { + return new JedisClusterCommand(connectionHandler, maxAttempts, maxTotalRetriesDuration) { @Override public KeyedListElement execute(Jedis connection) { return connection.brpop(timeout, key);