From 8bf374a024a4da0d84564124dba7a8e09f9a3162 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:05:51 +0600 Subject: [PATCH 1/5] Use redis:8.0-M01 image --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1800f00d7e..e46996438e 100644 --- a/Makefile +++ b/Makefile @@ -446,7 +446,7 @@ start: stunnel cleanup compile-module echo "$$REDIS_UDS" | redis-server - echo "$$REDIS_UNAVAILABLE_CONF" | redis-server - redis-cli -a cluster --cluster create 127.0.0.1:7479 127.0.0.1:7480 127.0.0.1:7481 --cluster-yes - docker run -p 6479:6379 --name jedis-stack -d redis/redis-stack-server:edge + docker run -p 6479:6379 --name jedis-stack -d redis:8.0-M01 cleanup: - rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null From ce7a91f7d75e615551afa852091ac1e77b5551e6 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:23:57 +0600 Subject: [PATCH 2/5] Deprecate TFUNCTION commands --- .../redis/clients/jedis/CommandObjects.java | 3 +++ .../redis/clients/jedis/UnifiedJedis.java | 3 +++ .../jedis/gears/RedisGearsCommands.java | 10 +++++----- .../jedis/gears/RedisGearsProtocol.java | 2 +- ...jectsTriggersAndFunctionsCommandsTest.java | 2 ++ ...JedisTriggersAndFunctionsCommandsTest.java | 3 ++- .../jedis/modules/gears/GearsTest.java | 20 ++++++++++--------- 7 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/main/java/redis/clients/jedis/CommandObjects.java b/src/main/java/redis/clients/jedis/CommandObjects.java index 89eb3e16ca..51baa7f8ef 100644 --- a/src/main/java/redis/clients/jedis/CommandObjects.java +++ b/src/main/java/redis/clients/jedis/CommandObjects.java @@ -4414,16 +4414,19 @@ public final CommandObject> graphConfigGet(String configName // RedisGraph commands // RedisGears commands + @Deprecated public final CommandObject tFunctionLoad(String libraryCode, TFunctionLoadParams params) { return new CommandObject<>(commandArguments(GearsCommand.TFUNCTION).add(GearsKeyword.LOAD) .addParams(params).add(libraryCode), BuilderFactory.STRING); } + @Deprecated public final CommandObject tFunctionDelete(String libraryName) { return new CommandObject<>(commandArguments(GearsCommand.TFUNCTION).add(GearsKeyword.DELETE) .add(libraryName), BuilderFactory.STRING); } + @Deprecated public final CommandObject> tFunctionList(TFunctionListParams params) { return new CommandObject<>(commandArguments(GearsCommand.TFUNCTION).add(GearsKeyword.LIST) .addParams(params), GearsLibraryInfo.GEARS_LIBRARY_INFO_LIST); diff --git a/src/main/java/redis/clients/jedis/UnifiedJedis.java b/src/main/java/redis/clients/jedis/UnifiedJedis.java index e3bc4aba50..ebefdb860b 100644 --- a/src/main/java/redis/clients/jedis/UnifiedJedis.java +++ b/src/main/java/redis/clients/jedis/UnifiedJedis.java @@ -4984,16 +4984,19 @@ public Map graphConfigGet(String configName) { // RedisGraph commands // RedisGears commands + @Deprecated @Override public String tFunctionLoad(String libraryCode, TFunctionLoadParams params) { return executeCommand(commandObjects.tFunctionLoad(libraryCode, params)); } + @Deprecated @Override public String tFunctionDelete(String libraryName) { return executeCommand(commandObjects.tFunctionDelete(libraryName)); } + @Deprecated @Override public List tFunctionList(TFunctionListParams params) { return executeCommand(commandObjects.tFunctionList(params)); diff --git a/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java b/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java index f5adb42c9e..94f81f0dd5 100644 --- a/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java +++ b/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java @@ -6,19 +6,19 @@ public interface RedisGearsCommands { - default String tFunctionLoad(String libraryCode) { + @Deprecated default String tFunctionLoad(String libraryCode) { return tFunctionLoad(libraryCode, TFunctionLoadParams.loadParams()); } - String tFunctionLoad(String libraryCode, TFunctionLoadParams params); + @Deprecated String tFunctionLoad(String libraryCode, TFunctionLoadParams params); - default List tFunctionList() { + @Deprecated default List tFunctionList() { return tFunctionList(TFunctionListParams.listParams()); } - List tFunctionList(TFunctionListParams params); + @Deprecated List tFunctionList(TFunctionListParams params); - String tFunctionDelete(String libraryName); + @Deprecated String tFunctionDelete(String libraryName); Object tFunctionCall(String library, String function, List keys, List args); diff --git a/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java b/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java index fc43f29e66..1dc3a1c27d 100644 --- a/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java +++ b/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java @@ -8,7 +8,7 @@ public class RedisGearsProtocol { public enum GearsCommand implements ProtocolCommand { - TFUNCTION, + @Deprecated TFUNCTION, TFCALL, TFCALLASYNC; diff --git a/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTriggersAndFunctionsCommandsTest.java b/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTriggersAndFunctionsCommandsTest.java index 6403f57404..ce198f4627 100644 --- a/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTriggersAndFunctionsCommandsTest.java +++ b/src/test/java/redis/clients/jedis/commands/commandobjects/CommandObjectsTriggersAndFunctionsCommandsTest.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.List; import org.junit.After; +import org.junit.Ignore; import org.junit.Test; import redis.clients.jedis.RedisProtocol; @@ -19,6 +20,7 @@ /** * Tests related to Triggers and functions commands. */ +@Ignore public class CommandObjectsTriggersAndFunctionsCommandsTest extends CommandObjectsModulesTestBase { public CommandObjectsTriggersAndFunctionsCommandsTest(RedisProtocol protocol) { diff --git a/src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisTriggersAndFunctionsCommandsTest.java b/src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisTriggersAndFunctionsCommandsTest.java index 5dec794c65..62fd7bf7cd 100644 --- a/src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisTriggersAndFunctionsCommandsTest.java +++ b/src/test/java/redis/clients/jedis/mocked/unified/UnifiedJedisTriggersAndFunctionsCommandsTest.java @@ -9,12 +9,13 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; - +import org.junit.Ignore; import org.junit.Test; import redis.clients.jedis.gears.TFunctionListParams; import redis.clients.jedis.gears.TFunctionLoadParams; import redis.clients.jedis.gears.resps.GearsLibraryInfo; +@Ignore public class UnifiedJedisTriggersAndFunctionsCommandsTest extends UnifiedJedisMockedTestBase { @Test diff --git a/src/test/java/redis/clients/jedis/modules/gears/GearsTest.java b/src/test/java/redis/clients/jedis/modules/gears/GearsTest.java index 117094b9b8..e32e526279 100644 --- a/src/test/java/redis/clients/jedis/modules/gears/GearsTest.java +++ b/src/test/java/redis/clients/jedis/modules/gears/GearsTest.java @@ -1,9 +1,19 @@ package redis.clients.jedis.modules.gears; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.hamcrest.Matchers; import org.junit.After; import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -15,15 +25,6 @@ import redis.clients.jedis.modules.RedisModuleCommandsTestBase; import redis.clients.jedis.gears.resps.GearsLibraryInfo; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -31,6 +32,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +@Ignore @RunWith(Parameterized.class) public class GearsTest extends RedisModuleCommandsTestBase { From 666d90bb9a00c32ddabf64c3c95029c6a088abb0 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 26 Sep 2024 16:30:13 +0600 Subject: [PATCH 3/5] Deprecate TFCALL and TFCALLASYNC commands --- src/main/java/redis/clients/jedis/CommandObjects.java | 2 ++ src/main/java/redis/clients/jedis/UnifiedJedis.java | 2 ++ .../java/redis/clients/jedis/gears/RedisGearsCommands.java | 4 ++-- .../java/redis/clients/jedis/gears/RedisGearsProtocol.java | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/redis/clients/jedis/CommandObjects.java b/src/main/java/redis/clients/jedis/CommandObjects.java index 51baa7f8ef..5a66f803a8 100644 --- a/src/main/java/redis/clients/jedis/CommandObjects.java +++ b/src/main/java/redis/clients/jedis/CommandObjects.java @@ -4432,11 +4432,13 @@ public final CommandObject> tFunctionList(TFunctionListPa .addParams(params), GearsLibraryInfo.GEARS_LIBRARY_INFO_LIST); } + @Deprecated public final CommandObject tFunctionCall(String library, String function, List keys, List args) { return new CommandObject<>(commandArguments(GearsCommand.TFCALL).add(library + "." + function) .add(keys.size()).keys(keys).addObjects(args), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT); } + @Deprecated public final CommandObject tFunctionCallAsync(String library, String function, List keys, List args) { return new CommandObject<>(commandArguments(GearsCommand.TFCALLASYNC).add(library + "." + function) .add(keys.size()).keys(keys).addObjects(args), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT); diff --git a/src/main/java/redis/clients/jedis/UnifiedJedis.java b/src/main/java/redis/clients/jedis/UnifiedJedis.java index ebefdb860b..50d18351d7 100644 --- a/src/main/java/redis/clients/jedis/UnifiedJedis.java +++ b/src/main/java/redis/clients/jedis/UnifiedJedis.java @@ -5002,11 +5002,13 @@ public List tFunctionList(TFunctionListParams params) { return executeCommand(commandObjects.tFunctionList(params)); } + @Deprecated @Override public Object tFunctionCall(String library, String function, List keys, List args) { return executeCommand(commandObjects.tFunctionCall(library, function, keys, args)); } + @Deprecated @Override public Object tFunctionCallAsync(String library, String function, List keys, List args) { return executeCommand(commandObjects.tFunctionCallAsync(library, function, keys, args)); diff --git a/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java b/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java index 94f81f0dd5..87f9f63f5d 100644 --- a/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java +++ b/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java @@ -20,7 +20,7 @@ public interface RedisGearsCommands { @Deprecated String tFunctionDelete(String libraryName); - Object tFunctionCall(String library, String function, List keys, List args); + @Deprecated Object tFunctionCall(String library, String function, List keys, List args); - Object tFunctionCallAsync(String library, String function, List keys, List args); + @Deprecated Object tFunctionCallAsync(String library, String function, List keys, List args); } diff --git a/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java b/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java index 1dc3a1c27d..436e9f1568 100644 --- a/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java +++ b/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java @@ -9,8 +9,8 @@ public class RedisGearsProtocol { public enum GearsCommand implements ProtocolCommand { @Deprecated TFUNCTION, - TFCALL, - TFCALLASYNC; + @Deprecated TFCALL, + @Deprecated TFCALLASYNC; private final byte[] raw; From 1c8c335935db3c1551b0a6f3f0bbf21d934b92c7 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 26 Sep 2024 16:42:47 +0600 Subject: [PATCH 4/5] Deprecate EVERYTHING about Gears module --- .../java/redis/clients/jedis/gears/RedisGearsCommands.java | 1 + .../java/redis/clients/jedis/gears/RedisGearsProtocol.java | 3 +++ .../java/redis/clients/jedis/gears/TFunctionListParams.java | 1 + .../java/redis/clients/jedis/gears/TFunctionLoadParams.java | 1 + .../java/redis/clients/jedis/gears/resps/FunctionInfo.java | 2 ++ .../redis/clients/jedis/gears/resps/FunctionStreamInfo.java | 2 ++ .../java/redis/clients/jedis/gears/resps/GearsLibraryInfo.java | 3 +++ .../redis/clients/jedis/gears/resps/StreamTriggerInfo.java | 2 ++ src/main/java/redis/clients/jedis/gears/resps/TriggerInfo.java | 2 ++ 9 files changed, 17 insertions(+) diff --git a/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java b/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java index 87f9f63f5d..e196835ab0 100644 --- a/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java +++ b/src/main/java/redis/clients/jedis/gears/RedisGearsCommands.java @@ -4,6 +4,7 @@ import java.util.List; +@Deprecated public interface RedisGearsCommands { @Deprecated default String tFunctionLoad(String libraryCode) { diff --git a/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java b/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java index 436e9f1568..dfb73b04a9 100644 --- a/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java +++ b/src/main/java/redis/clients/jedis/gears/RedisGearsProtocol.java @@ -4,8 +4,10 @@ import redis.clients.jedis.commands.ProtocolCommand; import redis.clients.jedis.util.SafeEncoder; +@Deprecated public class RedisGearsProtocol { + @Deprecated public enum GearsCommand implements ProtocolCommand { @Deprecated TFUNCTION, @@ -24,6 +26,7 @@ public byte[] getRaw() { } } + @Deprecated public enum GearsKeyword implements Rawable { CONFIG, diff --git a/src/main/java/redis/clients/jedis/gears/TFunctionListParams.java b/src/main/java/redis/clients/jedis/gears/TFunctionListParams.java index d3f867e92b..e32bb43639 100644 --- a/src/main/java/redis/clients/jedis/gears/TFunctionListParams.java +++ b/src/main/java/redis/clients/jedis/gears/TFunctionListParams.java @@ -6,6 +6,7 @@ import java.util.Collections; +@Deprecated public class TFunctionListParams implements IParams { private boolean withCode = false; private int verbose; diff --git a/src/main/java/redis/clients/jedis/gears/TFunctionLoadParams.java b/src/main/java/redis/clients/jedis/gears/TFunctionLoadParams.java index d155727ec5..b8b0363b6e 100644 --- a/src/main/java/redis/clients/jedis/gears/TFunctionLoadParams.java +++ b/src/main/java/redis/clients/jedis/gears/TFunctionLoadParams.java @@ -4,6 +4,7 @@ import redis.clients.jedis.gears.RedisGearsProtocol.GearsKeyword; import redis.clients.jedis.params.IParams; +@Deprecated public class TFunctionLoadParams implements IParams { private boolean replace = false; private String config; diff --git a/src/main/java/redis/clients/jedis/gears/resps/FunctionInfo.java b/src/main/java/redis/clients/jedis/gears/resps/FunctionInfo.java index ccb8785812..24d47b0e4e 100644 --- a/src/main/java/redis/clients/jedis/gears/resps/FunctionInfo.java +++ b/src/main/java/redis/clients/jedis/gears/resps/FunctionInfo.java @@ -10,6 +10,7 @@ import static redis.clients.jedis.BuilderFactory.*; +@Deprecated public class FunctionInfo { private final String name; private final String description; @@ -40,6 +41,7 @@ public FunctionInfo(String name, String description, boolean isAsync, List> FUNCTION_INFO_LIST = new Builder>() { @Override public List build(Object data) { diff --git a/src/main/java/redis/clients/jedis/gears/resps/FunctionStreamInfo.java b/src/main/java/redis/clients/jedis/gears/resps/FunctionStreamInfo.java index f4b607d6a3..577a0992fc 100644 --- a/src/main/java/redis/clients/jedis/gears/resps/FunctionStreamInfo.java +++ b/src/main/java/redis/clients/jedis/gears/resps/FunctionStreamInfo.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.stream.Collectors; +@Deprecated public class FunctionStreamInfo { private final String name; private final String idToReadFrom; @@ -67,6 +68,7 @@ public FunctionStreamInfo(String name, String idToReadFrom, String lastError, this.pendingIds = pendingIds; } + @Deprecated public static final Builder> STREAM_INFO_LIST = new Builder>() { @Override public List build(Object data) { diff --git a/src/main/java/redis/clients/jedis/gears/resps/GearsLibraryInfo.java b/src/main/java/redis/clients/jedis/gears/resps/GearsLibraryInfo.java index 5ed6515ff6..d16a607cd2 100644 --- a/src/main/java/redis/clients/jedis/gears/resps/GearsLibraryInfo.java +++ b/src/main/java/redis/clients/jedis/gears/resps/GearsLibraryInfo.java @@ -12,6 +12,7 @@ import static redis.clients.jedis.gears.resps.StreamTriggerInfo.STREAM_TRIGGER_INFO_LIST; import static redis.clients.jedis.gears.resps.TriggerInfo.KEYSPACE_TRIGGER_INFO_LIST; +@Deprecated public class GearsLibraryInfo { private final String apiVersion; private final List clusterFunctions; @@ -90,6 +91,7 @@ public String getUser() { return user; } + @Deprecated public static final Builder GEARS_LIBRARY_INFO = new Builder() { @Override public GearsLibraryInfo build(Object data) { @@ -171,6 +173,7 @@ public GearsLibraryInfo build(Object data) { } }; + @Deprecated public static final Builder> GEARS_LIBRARY_INFO_LIST = new Builder>() { @Override public List build(Object data) { diff --git a/src/main/java/redis/clients/jedis/gears/resps/StreamTriggerInfo.java b/src/main/java/redis/clients/jedis/gears/resps/StreamTriggerInfo.java index be526e0e71..202d4bba4f 100644 --- a/src/main/java/redis/clients/jedis/gears/resps/StreamTriggerInfo.java +++ b/src/main/java/redis/clients/jedis/gears/resps/StreamTriggerInfo.java @@ -11,6 +11,7 @@ import static redis.clients.jedis.BuilderFactory.*; import static redis.clients.jedis.gears.resps.FunctionStreamInfo.STREAM_INFO_LIST; +@Deprecated public class StreamTriggerInfo { private final String name; private final String description; @@ -60,6 +61,7 @@ public StreamTriggerInfo(String name, String description, String prefix, this(name, description, prefix, window, trim, Collections.emptyList()); } + @Deprecated public static final Builder> STREAM_TRIGGER_INFO_LIST = new Builder>() { @Override public List build(Object data) { diff --git a/src/main/java/redis/clients/jedis/gears/resps/TriggerInfo.java b/src/main/java/redis/clients/jedis/gears/resps/TriggerInfo.java index 8a5b470484..775af5cecd 100644 --- a/src/main/java/redis/clients/jedis/gears/resps/TriggerInfo.java +++ b/src/main/java/redis/clients/jedis/gears/resps/TriggerInfo.java @@ -11,6 +11,7 @@ import static redis.clients.jedis.BuilderFactory.LONG; import static redis.clients.jedis.BuilderFactory.STRING; +@Deprecated public class TriggerInfo { private final String name; private final String description; @@ -80,6 +81,7 @@ public TriggerInfo(String name, String description, String lastError, long numFi this.totalExecutionTime = totalExecutionTime; } + @Deprecated public static final Builder> KEYSPACE_TRIGGER_INFO_LIST = new Builder>() { @Override public List build(Object data) { From e0267a8c13911f8b03597b4d560adc2eea0179fb Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:04:47 +0600 Subject: [PATCH 5/5] Revert "Use redis:8.0-M01 image" This reverts commit 8bf374a024a4da0d84564124dba7a8e09f9a3162. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e46996438e..1800f00d7e 100644 --- a/Makefile +++ b/Makefile @@ -446,7 +446,7 @@ start: stunnel cleanup compile-module echo "$$REDIS_UDS" | redis-server - echo "$$REDIS_UNAVAILABLE_CONF" | redis-server - redis-cli -a cluster --cluster create 127.0.0.1:7479 127.0.0.1:7480 127.0.0.1:7481 --cluster-yes - docker run -p 6479:6379 --name jedis-stack -d redis:8.0-M01 + docker run -p 6479:6379 --name jedis-stack -d redis/redis-stack-server:edge cleanup: - rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null