From 1f0d1e7b2c60a89c380de8d5f629a5ac7514fb06 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 27 Feb 2023 20:21:45 +0100 Subject: [PATCH 1/9] Basic Jedis-Cluster constructors commented. More advanced/longer constructors are yet to be commented. --- .../redis/clients/jedis/JedisCluster.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 6b80653bf9..d70a58629e 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -13,16 +13,37 @@ public class JedisCluster extends UnifiedJedis { * Default timeout in milliseconds. */ public static final int DEFAULT_TIMEOUT = 2000; + /** + * Default amount of attemps for connecting. + */ public static final int DEFAULT_MAX_ATTEMPTS = 5; + /** + * Creates a Jedis-Cluster Instance where only a single Host is being used as a "Cluster".
+ * Here, the default Timeout of {@value #DEFAULT_TIMEOUT} ms is being used with {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts. + * @param node Host to connect to. + */ public JedisCluster(HostAndPort node) { this(Collections.singleton(node)); } + /** + * Creates a Jedis-Cluster Instance where only a single Host is being used as a "Cluster".
+ * Here, the default of {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts is being used. + * @param node Host to connect to. + * @param timeout Timeout in milliseconds. + */ public JedisCluster(HostAndPort node, int timeout) { this(Collections.singleton(node), timeout); } + /** + * Creates a Jedis-Cluster Instance where only a single Host is being used as a "Cluster".
+ * You can specify the timeout and the maximum attempts. + * @param node Host to connect to. + * @param timeout Timeout in milliseconds. + * @param maxAttempts Maximum Attempts to use. + */ public JedisCluster(HostAndPort node, int timeout, int maxAttempts) { this(Collections.singleton(node), timeout, maxAttempts); } @@ -83,14 +104,32 @@ public JedisCluster(HostAndPort node, final JedisClientConfig clientConfig, int this(Collections.singleton(node), clientConfig, maxAttempts, poolConfig); } + /** + * Creates a Jedis-Cluster with multiple Nodes/Instances. + * Here, the default Timeout of {@value #DEFAULT_TIMEOUT} ms is being used with {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts. + * @param nodes Hosts to connect to. + */ public JedisCluster(Set nodes) { this(nodes, DEFAULT_TIMEOUT); } + /** + * Creates a Jedis-Cluster with multiple Nodes/Instances. + * Here, the default of {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts is being used. + * @param nodes Hosts to connect to. + * @param timeout Timeout in milliseconds. + */ public JedisCluster(Set nodes, int timeout) { this(nodes, DefaultJedisClientConfig.builder().timeoutMillis(timeout).build()); } + /** + * Creates a Jedis-Cluster with multiple Nodes/Instances.
+ * You can specify the timeout and the maximum attempts. + * @param nodes Hosts to connect to. + * @param timeout Timeout in milliseconds. + * @param maxAttempts Maximum Attempts to use. + */ public JedisCluster(Set nodes, int timeout, int maxAttempts) { this(nodes, DefaultJedisClientConfig.builder().timeoutMillis(timeout).build(), maxAttempts); } @@ -187,6 +226,18 @@ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfi super(clusterNodes, clientConfig, maxAttempts); } + /** + * Creates a Jedis-Cluster with multiple Nodes/Instances.
+ * You can specify the timeout and the maximum attempts.

+ * + * Additionally, you are free to provide a {@link JedisClientConfig} instance.
+ * You can use the {@link DefaultJedisClientConfig#builder()} Builder-Pattern to customize your configuration, includings socketTimeouts, Username & Passwords aswell as SSL and hostnames. + * + * @param clusterNodes Hosts to connect to. + * @param clientConfig Timeout in milliseconds. + * @param maxAttempts Maximum Attempts to use. + * @param maxTotalRetriesDuration Maximum time used for reconnecting. + */ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfig, int maxAttempts, Duration maxTotalRetriesDuration) { super(clusterNodes, clientConfig, maxAttempts, maxTotalRetriesDuration); @@ -197,10 +248,22 @@ public JedisCluster(ClusterConnectionProvider provider, int maxAttempts, super(provider, maxAttempts, maxTotalRetriesDuration); } + /** + * Returns all nodes that were configured to connect to in a KEY-VALUE pair (Map). + * Key is the HOST:PORT and the value is the connection. + * @return Map of all connections. + */ public Map getClusterNodes() { return ((ClusterConnectionProvider) provider).getNodes(); } + /** + * Returns the connection for one of the 16,384 slots.

+ * If there is no connection for the given slot, either cause the node died or didn't connect, it may not return the correct node. + * It will try to resolve connection-based issues using reconnection. + * @param slot Slot to retrieve the Connection for + * @return Connection of the provided slot, given that the Redis-Cluster is enabled. + */ public Connection getConnectionFromSlot(int slot) { return ((ClusterConnectionProvider) provider).getConnectionFromSlot(slot); } From 03940f1c41477328f594a516d66ee74a1a3a6628 Mon Sep 17 00:00:00 2001 From: Thorben <46635221+Gandalf1783@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:43:15 +0100 Subject: [PATCH 2/9] Update src/main/java/redis/clients/jedis/JedisCluster.java Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> --- src/main/java/redis/clients/jedis/JedisCluster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index d70a58629e..39f261b734 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -262,7 +262,7 @@ public Map getClusterNodes() { * If there is no connection for the given slot, either cause the node died or didn't connect, it may not return the correct node. * It will try to resolve connection-based issues using reconnection. * @param slot Slot to retrieve the Connection for - * @return Connection of the provided slot, given that the Redis-Cluster is enabled. + * @return connection of the provided slot. {@code close()} of this connection must be called after use. */ public Connection getConnectionFromSlot(int slot) { return ((ClusterConnectionProvider) provider).getConnectionFromSlot(slot); From 85e5b79de0b9cb7e01e32de783f3418e7fa6a0b7 Mon Sep 17 00:00:00 2001 From: Thorben <46635221+Gandalf1783@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:43:24 +0100 Subject: [PATCH 3/9] Update src/main/java/redis/clients/jedis/JedisCluster.java Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> --- src/main/java/redis/clients/jedis/JedisCluster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 39f261b734..76e5b661de 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -251,7 +251,7 @@ public JedisCluster(ClusterConnectionProvider provider, int maxAttempts, /** * Returns all nodes that were configured to connect to in a KEY-VALUE pair (Map). * Key is the HOST:PORT and the value is the connection. - * @return Map of all connections. + * @return the map of all connections. */ public Map getClusterNodes() { return ((ClusterConnectionProvider) provider).getNodes(); From 49c956da811214d766913d446eee4e7f70e2bea2 Mon Sep 17 00:00:00 2001 From: Thorben <46635221+Gandalf1783@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:43:30 +0100 Subject: [PATCH 4/9] Update src/main/java/redis/clients/jedis/JedisCluster.java Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> --- src/main/java/redis/clients/jedis/JedisCluster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 76e5b661de..5de0788044 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -261,7 +261,7 @@ public Map getClusterNodes() { * Returns the connection for one of the 16,384 slots.

* If there is no connection for the given slot, either cause the node died or didn't connect, it may not return the correct node. * It will try to resolve connection-based issues using reconnection. - * @param slot Slot to retrieve the Connection for + * @param slot the slot to retrieve the connection for. * @return connection of the provided slot. {@code close()} of this connection must be called after use. */ public Connection getConnectionFromSlot(int slot) { From 22d150cf45ba1e8c90cbd327f9df2aa24601bd40 Mon Sep 17 00:00:00 2001 From: Gandalf1783 <46635221+Gandalf1783@users.noreply.github.com> Date: Sun, 22 Sep 2024 11:39:18 +0200 Subject: [PATCH 5/9] Resolving further issues with PR --- .../redis/clients/jedis/JedisCluster.java | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 5de0788044..c3052142a8 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -13,36 +13,37 @@ public class JedisCluster extends UnifiedJedis { * Default timeout in milliseconds. */ public static final int DEFAULT_TIMEOUT = 2000; + /** - * Default amount of attemps for connecting. + * Default amount of attempts for executing a command */ public static final int DEFAULT_MAX_ATTEMPTS = 5; /** - * Creates a Jedis-Cluster Instance where only a single Host is being used as a "Cluster".
- * Here, the default Timeout of {@value #DEFAULT_TIMEOUT} ms is being used with {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts. - * @param node Host to connect to. + * Creates a JedisCluster Instance. The provided Instance is used to make the first contact with the cluster.
+ * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. + * @param node Node to first connect to. */ public JedisCluster(HostAndPort node) { this(Collections.singleton(node)); } /** - * Creates a Jedis-Cluster Instance where only a single Host is being used as a "Cluster".
- * Here, the default of {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts is being used. + * Creates a JedisCluster Instance. The provided Instance is used to make the first contact with the cluster.
+ * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param node Host to connect to. - * @param timeout Timeout in milliseconds. + * @param timeout connection and socket timeout in milliseconds. */ public JedisCluster(HostAndPort node, int timeout) { this(Collections.singleton(node), timeout); } - /** - * Creates a Jedis-Cluster Instance where only a single Host is being used as a "Cluster".
+/** + * Creates a JedisCluster Instance where only a single Host is being used as a "Cluster".
* You can specify the timeout and the maximum attempts. * @param node Host to connect to. - * @param timeout Timeout in milliseconds. - * @param maxAttempts Maximum Attempts to use. + * @param timeout connection and socket timeout in milliseconds. + * @param maxAttempts maximum attempts for executing a command. */ public JedisCluster(HostAndPort node, int timeout, int maxAttempts) { this(Collections.singleton(node), timeout, maxAttempts); @@ -105,8 +106,8 @@ public JedisCluster(HostAndPort node, final JedisClientConfig clientConfig, int } /** - * Creates a Jedis-Cluster with multiple Nodes/Instances. - * Here, the default Timeout of {@value #DEFAULT_TIMEOUT} ms is being used with {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts. + * Creates a JedisCluster with multiple entry points. + * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param nodes Hosts to connect to. */ public JedisCluster(Set nodes) { @@ -114,21 +115,21 @@ public JedisCluster(Set nodes) { } /** - * Creates a Jedis-Cluster with multiple Nodes/Instances. - * Here, the default of {@value #DEFAULT_MAX_ATTEMPTS} maximum attempts is being used. + * Creates a JedisCluster with multiple entry points. + * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param nodes Hosts to connect to. - * @param timeout Timeout in milliseconds. + * @param timeout connection and socket timeout in milliseconds. */ public JedisCluster(Set nodes, int timeout) { this(nodes, DefaultJedisClientConfig.builder().timeoutMillis(timeout).build()); } /** - * Creates a Jedis-Cluster with multiple Nodes/Instances.
+ * Creates a JedisCluster with multiple entry points.
* You can specify the timeout and the maximum attempts. * @param nodes Hosts to connect to. - * @param timeout Timeout in milliseconds. - * @param maxAttempts Maximum Attempts to use. + * @param timeout connection and socket timeout in milliseconds. + * @param maxAttempts maximum attempts for executing a command. */ public JedisCluster(Set nodes, int timeout, int maxAttempts) { this(nodes, DefaultJedisClientConfig.builder().timeoutMillis(timeout).build(), maxAttempts); @@ -227,15 +228,15 @@ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfi } /** - * Creates a Jedis-Cluster with multiple Nodes/Instances.
+ * Creates a JedisCluster with multiple entry points.
* You can specify the timeout and the maximum attempts.

* * Additionally, you are free to provide a {@link JedisClientConfig} instance.
- * You can use the {@link DefaultJedisClientConfig#builder()} Builder-Pattern to customize your configuration, includings socketTimeouts, Username & Passwords aswell as SSL and hostnames. + * You can use the {@link DefaultJedisClientConfig#builder()} Builder-Pattern to customize your configuration, including socketTimeouts, Username & Passwords as well as SSL related parameters. * * @param clusterNodes Hosts to connect to. * @param clientConfig Timeout in milliseconds. - * @param maxAttempts Maximum Attempts to use. + * @param maxAttempts maximum attempts for executing a command. * @param maxTotalRetriesDuration Maximum time used for reconnecting. */ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfig, int maxAttempts, @@ -245,12 +246,12 @@ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfi public JedisCluster(ClusterConnectionProvider provider, int maxAttempts, Duration maxTotalRetriesDuration) { - super(provider, maxAttempts, maxTotalRetriesDuration); + super(provider, maxAttempts, maxTotalRetriesDuration ); } /** - * Returns all nodes that were configured to connect to in a KEY-VALUE pair (Map). - * Key is the HOST:PORT and the value is the connection. + * Returns all nodes that were configured to connect to in key-value pairs ({@link Map}). + * Key is the HOST:PORT and the value is the connection pool. * @return the map of all connections. */ public Map getClusterNodes() { @@ -259,8 +260,6 @@ public Map getClusterNodes() { /** * Returns the connection for one of the 16,384 slots.

- * If there is no connection for the given slot, either cause the node died or didn't connect, it may not return the correct node. - * It will try to resolve connection-based issues using reconnection. * @param slot the slot to retrieve the connection for. * @return connection of the provided slot. {@code close()} of this connection must be called after use. */ From db599ba33b6074ef7e74687726d235820d19f2dc Mon Sep 17 00:00:00 2001 From: Gandalf1783 <46635221+Gandalf1783@users.noreply.github.com> Date: Sun, 22 Sep 2024 11:42:00 +0200 Subject: [PATCH 6/9] Changed overlooked JavaDoc --- src/main/java/redis/clients/jedis/JedisCluster.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index c3052142a8..a3af8de1d8 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -39,7 +39,7 @@ public JedisCluster(HostAndPort node, int timeout) { } /** - * Creates a JedisCluster Instance where only a single Host is being used as a "Cluster".
+ * Creates a JedisCluster Instance. The provided Instance is used to make the first contact with the cluster.
* You can specify the timeout and the maximum attempts. * @param node Host to connect to. * @param timeout connection and socket timeout in milliseconds. @@ -246,7 +246,7 @@ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfi public JedisCluster(ClusterConnectionProvider provider, int maxAttempts, Duration maxTotalRetriesDuration) { - super(provider, maxAttempts, maxTotalRetriesDuration ); + super(provider, maxAttempts, maxTotalRetriesDuration ); } /** From a9f2af8ff02e4d41f3e484d3a18640aa50100933 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sun, 22 Sep 2024 17:23:11 +0600 Subject: [PATCH 7/9] Format JedisCluster.java --- src/main/java/redis/clients/jedis/JedisCluster.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 585342256d..35ba876d8a 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -44,7 +44,7 @@ public JedisCluster(HostAndPort node, int timeout) { this(Collections.singleton(node), timeout); } -/** + /** * Creates a JedisCluster Instance. The provided Instance is used to make the first contact with the cluster.
* You can specify the timeout and the maximum attempts. * @param node Host to connect to. @@ -112,7 +112,7 @@ public JedisCluster(HostAndPort node, final JedisClientConfig clientConfig, int } /** - * Creates a JedisCluster with multiple entry points. + * Creates a JedisCluster with multiple entry points. * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param nodes Hosts to connect to. */ @@ -251,7 +251,8 @@ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfi * You can specify the timeout and the maximum attempts.

* * Additionally, you are free to provide a {@link JedisClientConfig} instance.
- * You can use the {@link DefaultJedisClientConfig#builder()} Builder-Pattern to customize your configuration, including socketTimeouts, Username & Passwords as well as SSL related parameters. + * You can use the {@link DefaultJedisClientConfig#builder()} Builder-Pattern to customize your configuration, including socketTimeouts, + * Username & Passwords as well as SSL related parameters. * * @param clusterNodes Hosts to connect to. * @param clientConfig Timeout in milliseconds. From 3d1e45599350547bf6f19f4848c22cac92462251 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sun, 22 Sep 2024 17:34:39 +0600 Subject: [PATCH 8/9] Update JedisCluster.java --- .../redis/clients/jedis/JedisCluster.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index 35ba876d8a..ff020df1c5 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -26,7 +26,7 @@ public class JedisCluster extends UnifiedJedis { public static final int DEFAULT_MAX_ATTEMPTS = 5; /** - * Creates a JedisCluster Instance. The provided Instance is used to make the first contact with the cluster.
+ * Creates a JedisCluster instance. The provided node is used to make the first contact with the cluster.
* Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param node Node to first connect to. */ @@ -35,9 +35,9 @@ public JedisCluster(HostAndPort node) { } /** - * Creates a JedisCluster Instance. The provided Instance is used to make the first contact with the cluster.
+ * Creates a JedisCluster instance. The provided node is used to make the first contact with the cluster.
* Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. - * @param node Host to connect to. + * @param node Node to first connect to. * @param timeout connection and socket timeout in milliseconds. */ public JedisCluster(HostAndPort node, int timeout) { @@ -45,9 +45,9 @@ public JedisCluster(HostAndPort node, int timeout) { } /** - * Creates a JedisCluster Instance. The provided Instance is used to make the first contact with the cluster.
+ * Creates a JedisCluster instance. The provided node is used to make the first contact with the cluster.
* You can specify the timeout and the maximum attempts. - * @param node Host to connect to. + * @param node Node to first connect to. * @param timeout connection and socket timeout in milliseconds. * @param maxAttempts maximum attempts for executing a command. */ @@ -114,7 +114,7 @@ public JedisCluster(HostAndPort node, final JedisClientConfig clientConfig, int /** * Creates a JedisCluster with multiple entry points. * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. - * @param nodes Hosts to connect to. + * @param nodes Nodes to connect to. */ public JedisCluster(Set nodes) { this(nodes, DEFAULT_TIMEOUT); @@ -123,7 +123,7 @@ public JedisCluster(Set nodes) { /** * Creates a JedisCluster with multiple entry points. * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. - * @param nodes Hosts to connect to. + * @param nodes Nodes to connect to. * @param timeout connection and socket timeout in milliseconds. */ public JedisCluster(Set nodes, int timeout) { @@ -133,7 +133,7 @@ public JedisCluster(Set nodes, int timeout) { /** * Creates a JedisCluster with multiple entry points.
* You can specify the timeout and the maximum attempts. - * @param nodes Hosts to connect to. + * @param nodes Nodes to connect to. * @param timeout connection and socket timeout in milliseconds. * @param maxAttempts maximum attempts for executing a command. */ @@ -248,14 +248,14 @@ public JedisCluster(Set clusterNodes, JedisClientConfig clientConfi /** * Creates a JedisCluster with multiple entry points.
- * You can specify the timeout and the maximum attempts.

+ * You can specify the timeout and the maximum attempts.
* - * Additionally, you are free to provide a {@link JedisClientConfig} instance.
- * You can use the {@link DefaultJedisClientConfig#builder()} Builder-Pattern to customize your configuration, including socketTimeouts, - * Username & Passwords as well as SSL related parameters. + * Additionally, you are free to provide a {@link JedisClientConfig} instance.
+ * You can use the {@link DefaultJedisClientConfig#builder()} builder pattern to customize your configuration, including socket timeouts, + * username and passwords as well as SSL related parameters. * - * @param clusterNodes Hosts to connect to. - * @param clientConfig Timeout in milliseconds. + * @param clusterNodes Nodes to connect to. + * @param clientConfig Client configuration parameters. * @param maxAttempts maximum attempts for executing a command. * @param maxTotalRetriesDuration Maximum time used for reconnecting. */ @@ -277,7 +277,7 @@ private JedisCluster(ClusterConnectionProvider provider, int maxAttempts, Durati } /** - * Returns all nodes that were configured to connect to in key-value pairs ({@link Map}). + * Returns all nodes that were configured to connect to in key-value pairs ({@link Map}).
* Key is the HOST:PORT and the value is the connection pool. * @return the map of all connections. */ @@ -286,7 +286,7 @@ public Map getClusterNodes() { } /** - * Returns the connection for one of the 16,384 slots.

+ * Returns the connection for one of the 16,384 slots. * @param slot the slot to retrieve the connection for. * @return connection of the provided slot. {@code close()} of this connection must be called after use. */ From 5eeddc0c2ec200c29cff7bae76c181b6559f229d Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sun, 22 Sep 2024 23:37:09 +0600 Subject: [PATCH 9/9] Use value annotation --- src/main/java/redis/clients/jedis/JedisCluster.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisCluster.java b/src/main/java/redis/clients/jedis/JedisCluster.java index ff020df1c5..4d6b672272 100644 --- a/src/main/java/redis/clients/jedis/JedisCluster.java +++ b/src/main/java/redis/clients/jedis/JedisCluster.java @@ -27,7 +27,7 @@ public class JedisCluster extends UnifiedJedis { /** * Creates a JedisCluster instance. The provided node is used to make the first contact with the cluster.
- * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. + * Here, the default timeout of {@value JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@value JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param node Node to first connect to. */ public JedisCluster(HostAndPort node) { @@ -36,7 +36,7 @@ public JedisCluster(HostAndPort node) { /** * Creates a JedisCluster instance. The provided node is used to make the first contact with the cluster.
- * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. + * Here, the default timeout of {@value JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@value JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param node Node to first connect to. * @param timeout connection and socket timeout in milliseconds. */ @@ -113,7 +113,7 @@ public JedisCluster(HostAndPort node, final JedisClientConfig clientConfig, int /** * Creates a JedisCluster with multiple entry points. - * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. + * Here, the default timeout of {@value JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@value JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param nodes Nodes to connect to. */ public JedisCluster(Set nodes) { @@ -122,7 +122,7 @@ public JedisCluster(Set nodes) { /** * Creates a JedisCluster with multiple entry points. - * Here, the default timeout of {@link JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@link JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. + * Here, the default timeout of {@value JedisCluster#DEFAULT_TIMEOUT} ms is being used with {@value JedisCluster#DEFAULT_MAX_ATTEMPTS} maximum attempts. * @param nodes Nodes to connect to. * @param timeout connection and socket timeout in milliseconds. */