From 57b77eff119cea15a6e9473ca238cfa4af1aa368 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Mon, 1 May 2023 12:34:34 +0600 Subject: [PATCH] Deprecate Sharding/Sharded feature (#3386) --- src/main/java/redis/clients/jedis/JedisSharding.java | 4 ++++ .../java/redis/clients/jedis/ShardedCommandArguments.java | 4 ++++ .../java/redis/clients/jedis/ShardedCommandObjects.java | 4 ++++ src/main/java/redis/clients/jedis/ShardedPipeline.java | 4 ++++ src/main/java/redis/clients/jedis/UnifiedJedis.java | 8 ++++++++ .../jedis/providers/ShardedConnectionProvider.java | 4 ++++ src/main/java/redis/clients/jedis/util/Hashing.java | 4 ++++ src/main/java/redis/clients/jedis/util/MurmurHash.java | 2 ++ 8 files changed, 34 insertions(+) diff --git a/src/main/java/redis/clients/jedis/JedisSharding.java b/src/main/java/redis/clients/jedis/JedisSharding.java index 636c2b02ee..271946cf32 100644 --- a/src/main/java/redis/clients/jedis/JedisSharding.java +++ b/src/main/java/redis/clients/jedis/JedisSharding.java @@ -6,6 +6,10 @@ import redis.clients.jedis.providers.ShardedConnectionProvider; import redis.clients.jedis.util.Hashing; +/** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ +@Deprecated // TODO: RESP3 public class JedisSharding extends UnifiedJedis { diff --git a/src/main/java/redis/clients/jedis/ShardedCommandArguments.java b/src/main/java/redis/clients/jedis/ShardedCommandArguments.java index 30552eb7e8..7eec0561a2 100644 --- a/src/main/java/redis/clients/jedis/ShardedCommandArguments.java +++ b/src/main/java/redis/clients/jedis/ShardedCommandArguments.java @@ -6,6 +6,10 @@ import redis.clients.jedis.exceptions.JedisException; import redis.clients.jedis.util.Hashing; +/** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ +@Deprecated public class ShardedCommandArguments extends CommandArguments { private final Hashing algo; diff --git a/src/main/java/redis/clients/jedis/ShardedCommandObjects.java b/src/main/java/redis/clients/jedis/ShardedCommandObjects.java index da46d2048d..76a21fb00c 100644 --- a/src/main/java/redis/clients/jedis/ShardedCommandObjects.java +++ b/src/main/java/redis/clients/jedis/ShardedCommandObjects.java @@ -13,6 +13,10 @@ import redis.clients.jedis.util.Hashing; import redis.clients.jedis.util.JedisClusterHashTag; +/** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ +@Deprecated public class ShardedCommandObjects extends CommandObjects { private final Hashing algo; diff --git a/src/main/java/redis/clients/jedis/ShardedPipeline.java b/src/main/java/redis/clients/jedis/ShardedPipeline.java index d939b84a5e..b8d32de6c8 100644 --- a/src/main/java/redis/clients/jedis/ShardedPipeline.java +++ b/src/main/java/redis/clients/jedis/ShardedPipeline.java @@ -7,6 +7,10 @@ import redis.clients.jedis.util.Hashing; import redis.clients.jedis.util.IOUtils; +/** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ +@Deprecated // TODO: RESP3 public class ShardedPipeline extends MultiNodePipelineBase { diff --git a/src/main/java/redis/clients/jedis/UnifiedJedis.java b/src/main/java/redis/clients/jedis/UnifiedJedis.java index 95cd5fb0cb..efbf9d6dde 100644 --- a/src/main/java/redis/clients/jedis/UnifiedJedis.java +++ b/src/main/java/redis/clients/jedis/UnifiedJedis.java @@ -144,6 +144,10 @@ public UnifiedJedis(ClusterConnectionProvider provider, int maxAttempts, Duratio this.graphCommandObjects.setBaseCommandArgumentsCreator((comm) -> this.commandObjects.commandArguments(comm)); } + /** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ + @Deprecated public UnifiedJedis(ShardedConnectionProvider provider) { this.provider = provider; this.executor = new DefaultCommandExecutor(provider); @@ -152,6 +156,10 @@ public UnifiedJedis(ShardedConnectionProvider provider) { this.graphCommandObjects.setBaseCommandArgumentsCreator((comm) -> this.commandObjects.commandArguments(comm)); } + /** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ + @Deprecated public UnifiedJedis(ShardedConnectionProvider provider, Pattern tagPattern) { this.provider = provider; this.executor = new DefaultCommandExecutor(provider); diff --git a/src/main/java/redis/clients/jedis/providers/ShardedConnectionProvider.java b/src/main/java/redis/clients/jedis/providers/ShardedConnectionProvider.java index 63d6c7946f..da5a377f34 100644 --- a/src/main/java/redis/clients/jedis/providers/ShardedConnectionProvider.java +++ b/src/main/java/redis/clients/jedis/providers/ShardedConnectionProvider.java @@ -19,6 +19,10 @@ import redis.clients.jedis.exceptions.JedisException; import redis.clients.jedis.util.Hashing; +/** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ +@Deprecated public class ShardedConnectionProvider implements ConnectionProvider { private final TreeMap nodes = new TreeMap<>(); diff --git a/src/main/java/redis/clients/jedis/util/Hashing.java b/src/main/java/redis/clients/jedis/util/Hashing.java index df815883c3..b10ff04975 100644 --- a/src/main/java/redis/clients/jedis/util/Hashing.java +++ b/src/main/java/redis/clients/jedis/util/Hashing.java @@ -3,6 +3,10 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +/** + * @deprecated Sharding/Sharded feature will be removed in next major release. + */ +@Deprecated public interface Hashing { Hashing MURMUR_HASH = new MurmurHash(); ThreadLocal md5Holder = new ThreadLocal<>(); diff --git a/src/main/java/redis/clients/jedis/util/MurmurHash.java b/src/main/java/redis/clients/jedis/util/MurmurHash.java index 91bf463b59..a882745bca 100644 --- a/src/main/java/redis/clients/jedis/util/MurmurHash.java +++ b/src/main/java/redis/clients/jedis/util/MurmurHash.java @@ -21,7 +21,9 @@ * The C version of MurmurHash 2.0 found at that site was ported to Java by Andrzej Bialecki (ab at * getopt org). *

+ * @deprecated Sharding/Sharded feature will be removed in next major release. */ +@Deprecated public class MurmurHash implements Hashing { /** * Hashes bytes in an array.