diff --git a/src/main/java/redis/clients/jedis/ClusterCommandObjects.java b/src/main/java/redis/clients/jedis/ClusterCommandObjects.java index 7e2e026c79..c218f76877 100644 --- a/src/main/java/redis/clients/jedis/ClusterCommandObjects.java +++ b/src/main/java/redis/clients/jedis/ClusterCommandObjects.java @@ -4,19 +4,11 @@ import static redis.clients.jedis.Protocol.Command.SCAN; import static redis.clients.jedis.Protocol.Keyword.TYPE; -import java.util.List; -import java.util.Map; import java.util.Set; import redis.clients.jedis.commands.ProtocolCommand; import redis.clients.jedis.params.ScanParams; import redis.clients.jedis.resps.ScanResult; -import redis.clients.jedis.search.IndexOptions; -import redis.clients.jedis.search.Query; -import redis.clients.jedis.search.Schema; -import redis.clients.jedis.search.SearchResult; -import redis.clients.jedis.search.aggr.AggregationBuilder; -import redis.clients.jedis.search.aggr.AggregationResult; import redis.clients.jedis.util.JedisClusterHashTag; public class ClusterCommandObjects extends CommandObjects { @@ -105,127 +97,4 @@ public final CommandObject> scan(byte[] cursor, ScanParams pa public final CommandObject waitReplicas(int replicas, long timeout) { throw new UnsupportedOperationException(CLUSTER_UNSUPPORTED_MESSAGE); } - - // RediSearch commands - // TODO: Send RediSearch command to random 'master' node or random hashslot. -// boolean searchLite = false; - - private CommandObject processSearchCommand(String indexName, CommandObject command) { -// if (searchLite) command.getArguments().processKey(indexName); - command.getArguments().processKey(indexName); - return command; - } - - @Override - public final CommandObject ftCreate(String indexName, IndexOptions indexOptions, Schema schema) { - return processSearchCommand(indexName, super.ftCreate(indexName, indexOptions, schema)); - } - - @Override - public final CommandObject ftAlter(String indexName, Schema schema) { - return processSearchCommand(indexName, super.ftAlter(indexName, schema)); - } - - @Override - public final CommandObject ftSearch(String indexName, Query query) { - return processSearchCommand(indexName, super.ftSearch(indexName, query)); - } - - @Override - public final CommandObject ftSearch(byte[] indexName, Query query) { - CommandObject command = super.ftSearch(indexName, query); -// if (searchLite) command.getArguments().processKey(indexName); - command.getArguments().processKey(indexName); - return command; - } - - @Override - public CommandObject ftExplain(String indexName, Query query) { - return processSearchCommand(indexName, super.ftExplain(indexName, query)); - } - - @Override - public CommandObject> ftExplainCLI(String indexName, Query query) { - return processSearchCommand(indexName, super.ftExplainCLI(indexName, query)); - } - - @Override - public CommandObject ftAggregate(String indexName, AggregationBuilder aggr) { - return processSearchCommand(indexName, super.ftAggregate(indexName, aggr)); - } - - @Override - public CommandObject ftCursorRead(String indexName, long cursorId, int count) { - return processSearchCommand(indexName, super.ftCursorRead(indexName, cursorId, count)); - } - - @Override - public CommandObject ftCursorDel(String indexName, long cursorId) { - return processSearchCommand(indexName, super.ftCursorDel(indexName, cursorId)); - } - - @Override - public CommandObject ftDropIndex(String indexName) { - return processSearchCommand(indexName, super.ftDropIndex(indexName)); - } - - @Override - public CommandObject ftDropIndexDD(String indexName) { - return processSearchCommand(indexName, super.ftDropIndexDD(indexName)); - } - - @Override - public CommandObject ftSynUpdate(String indexName, String synonymGroupId, String... terms) { - return processSearchCommand(indexName, super.ftSynUpdate(indexName, synonymGroupId, terms)); - } - - @Override - public CommandObject>> ftSynDump(String indexName) { - return processSearchCommand(indexName, super.ftSynDump(indexName)); - } - - @Override - public CommandObject> ftInfo(String indexName) { - return processSearchCommand(indexName, super.ftInfo(indexName)); - } - - @Override - public CommandObject> ftTagVals(String indexName, String fieldName) { - return processSearchCommand(indexName, super.ftTagVals(indexName, fieldName)); - } - - @Override - public CommandObject ftAliasAdd(String aliasName, String indexName) { -// CommandObject command = super.ftAliasAdd(aliasName, indexName); -// if (searchLite) command.getArguments().processKey(aliasName).processKey(indexName); -// return command; - return processSearchCommand(indexName, super.ftAliasAdd(aliasName, indexName)); - } - - @Override - public CommandObject ftAliasUpdate(String aliasName, String indexName) { -// CommandObject command = super.ftAliasUpdate(aliasName, indexName); -// if (searchLite) command.getArguments().processKey(aliasName).processKey(indexName); -// return command; - return processSearchCommand(indexName, super.ftAliasUpdate(aliasName, indexName)); - } - - @Override - public CommandObject ftAliasDel(String aliasName) { -// CommandObject command = super.ftAliasDel(aliasName); -// if (searchLite) command.getArguments().processKey(aliasName); -// return command; - return processSearchCommand(aliasName, super.ftAliasDel(aliasName)); - } - - @Override - public CommandObject> ftConfigGet(String indexName, String option) { - return processSearchCommand(indexName, super.ftConfigGet(indexName, option)); - } - - @Override - public CommandObject ftConfigSet(String indexName, String option, String value) { - return processSearchCommand(indexName, super.ftConfigSet(indexName, option, value)); - } - // RediSearch commands } diff --git a/src/main/java/redis/clients/jedis/CommandObjects.java b/src/main/java/redis/clients/jedis/CommandObjects.java index 0f52726184..7091316af8 100644 --- a/src/main/java/redis/clients/jedis/CommandObjects.java +++ b/src/main/java/redis/clients/jedis/CommandObjects.java @@ -35,6 +35,12 @@ public class CommandObjects { private volatile JsonObjectMapper jsonObjectMapper; + private JedisBroadcastAndRoundRobinConfig broadcastAndRoundRobinConfig = null; + + void setBroadcastAndRoundRobinConfig(JedisBroadcastAndRoundRobinConfig config) { + this.broadcastAndRoundRobinConfig = config; + } + protected CommandArguments commandArguments(ProtocolCommand command) { return new CommandArguments(command); } @@ -3120,14 +3126,36 @@ public final CommandObject publish(byte[] channel, byte[] message) { // Miscellaneous commands // RediSearch commands - public CommandObject ftCreate(String indexName, IndexOptions indexOptions, Schema schema) { + private boolean isRoundRobinSearchCommand() { + if (broadcastAndRoundRobinConfig == null) { + return true; + } else if (broadcastAndRoundRobinConfig.getRediSearchModeInCluster() == JedisBroadcastAndRoundRobinConfig.RediSearchMode.LIGHT) { + return false; + } + return true; + } + + private CommandArguments checkAndRoundRobinSearchCommand(CommandArguments commandArguments, String indexName) { + return isRoundRobinSearchCommand() ? commandArguments.add(indexName) : commandArguments.key(indexName); + } + + private CommandArguments checkAndRoundRobinSearchCommand(CommandArguments commandArguments, byte[] indexName) { + return isRoundRobinSearchCommand() ? commandArguments.add(indexName) : commandArguments.key(indexName); + } + + private CommandObject directSearchCommand(CommandObject object, String indexName) { + object.getArguments().processKey(indexName); + return object; + } + + public final CommandObject ftCreate(String indexName, IndexOptions indexOptions, Schema schema) { CommandArguments args = commandArguments(SearchCommand.CREATE).add(indexName) .addParams(indexOptions).add(SearchKeyword.SCHEMA); schema.fields.forEach(field -> args.addParams(field)); return new CommandObject<>(args, BuilderFactory.STRING); } - public CommandObject ftCreate(String indexName, FTCreateParams createParams, + public final CommandObject ftCreate(String indexName, FTCreateParams createParams, Iterable schemaFields) { CommandArguments args = commandArguments(SearchCommand.CREATE).add(indexName) .addParams(createParams).add(SearchKeyword.SCHEMA); @@ -3135,111 +3163,119 @@ public CommandObject ftCreate(String indexName, FTCreateParams createPar return new CommandObject<>(args, BuilderFactory.STRING); } - public CommandObject ftAlter(String indexName, Schema schema) { + public final CommandObject ftAlter(String indexName, Schema schema) { CommandArguments args = commandArguments(SearchCommand.ALTER).add(indexName) .add(SearchKeyword.SCHEMA).add(SearchKeyword.ADD); schema.fields.forEach(field -> args.addParams(field)); return new CommandObject<>(args, BuilderFactory.STRING); } - public CommandObject ftAlter(String indexName, Iterable schemaFields) { + public final CommandObject ftAlter(String indexName, Iterable schemaFields) { CommandArguments args = commandArguments(SearchCommand.ALTER).add(indexName) .add(SearchKeyword.SCHEMA).add(SearchKeyword.ADD); schemaFields.forEach(field -> args.addParams(field)); return new CommandObject<>(args, BuilderFactory.STRING); } - public CommandObject ftSearch(String indexName, String query) { - return new CommandObject<>(commandArguments(SearchCommand.SEARCH).add(indexName).add(query), + public final CommandObject ftSearch(String indexName, String query) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SEARCH), indexName).add(query), new SearchResultBuilder(true, false, false, true)); } - public CommandObject ftSearch(String indexName, String query, FTSearchParams params) { - return new CommandObject<>(commandArguments(SearchCommand.SEARCH).add(indexName).add(query).addParams(params), - new SearchResultBuilder(!params.getNoContent(), params.getWithScores(), false, true)); + public final CommandObject ftSearch(String indexName, String query, FTSearchParams params) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SEARCH), indexName) + .add(query).addParams(params), new SearchResultBuilder(!params.getNoContent(), params.getWithScores(), false, true)); } - public CommandObject ftSearch(String indexName, Query query) { - return new CommandObject<>(commandArguments(SearchCommand.SEARCH).add(indexName).addParams(query), + public final CommandObject ftSearch(String indexName, Query query) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SEARCH), indexName).addParams(query), new SearchResultBuilder(!query.getNoContent(), query.getWithScores(), query.getWithPayloads(), true)); } - public CommandObject ftSearch(byte[] indexName, Query query) { - return new CommandObject<>(commandArguments(SearchCommand.SEARCH).add(indexName).addParams(query), + public final CommandObject ftSearch(byte[] indexName, Query query) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SEARCH), indexName).addParams(query), new SearchResultBuilder(!query.getNoContent(), query.getWithScores(), query.getWithPayloads(), false)); } - public CommandObject ftExplain(String indexName, Query query) { - return new CommandObject<>(commandArguments(SearchCommand.EXPLAIN).add(indexName).addParams(query), BuilderFactory.STRING); + public final CommandObject ftExplain(String indexName, Query query) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.EXPLAIN), indexName) + .addParams(query), BuilderFactory.STRING); } - public CommandObject> ftExplainCLI(String indexName, Query query) { - return new CommandObject<>(commandArguments(SearchCommand.EXPLAINCLI).add(indexName).addParams(query), BuilderFactory.STRING_LIST); + public final CommandObject> ftExplainCLI(String indexName, Query query) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.EXPLAINCLI), indexName) + .addParams(query), BuilderFactory.STRING_LIST); } - public CommandObject ftAggregate(String indexName, AggregationBuilder aggr) { - return new CommandObject<>(commandArguments(SearchCommand.AGGREGATE).add(indexName).addObjects(aggr.getArgs()), - !aggr.isWithCursor() ? SearchBuilderFactory.SEARCH_AGGREGATION_RESULT : SearchBuilderFactory.SEARCH_AGGREGATION_RESULT_WITH_CURSOR); + public final CommandObject ftAggregate(String indexName, AggregationBuilder aggr) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.AGGREGATE), indexName) + .addObjects(aggr.getArgs()), !aggr.isWithCursor() ? SearchBuilderFactory.SEARCH_AGGREGATION_RESULT + : SearchBuilderFactory.SEARCH_AGGREGATION_RESULT_WITH_CURSOR); } - public CommandObject ftCursorRead(String indexName, long cursorId, int count) { + public final CommandObject ftCursorRead(String indexName, long cursorId, int count) { return new CommandObject<>(commandArguments(SearchCommand.CURSOR).add(SearchKeyword.READ) - .add(indexName).add(cursorId).add(SearchKeyword.COUNT).add(count), SearchBuilderFactory.SEARCH_AGGREGATION_RESULT_WITH_CURSOR); + .add(indexName).add(cursorId).add(SearchKeyword.COUNT).add(count), + SearchBuilderFactory.SEARCH_AGGREGATION_RESULT_WITH_CURSOR); } - public CommandObject ftCursorDel(String indexName, long cursorId) { + public final CommandObject ftCursorDel(String indexName, long cursorId) { return new CommandObject<>(commandArguments(SearchCommand.CURSOR).add(SearchKeyword.DEL) .add(indexName).add(cursorId), BuilderFactory.STRING); } - public CommandObject>> ftProfileAggregate( + public final CommandObject>> ftProfileAggregate( String indexName, FTProfileParams profileParams, AggregationBuilder aggr) { - return new CommandObject<>(commandArguments(SearchCommand.PROFILE).add(indexName) + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.PROFILE), indexName) .add(SearchKeyword.AGGREGATE).addParams(profileParams).add(SearchKeyword.QUERY) .addObjects(aggr.getArgs()), new SearchProfileResponseBuilder<>(!aggr.isWithCursor() ? SearchBuilderFactory.SEARCH_AGGREGATION_RESULT : SearchBuilderFactory.SEARCH_AGGREGATION_RESULT_WITH_CURSOR)); } - public CommandObject>> ftProfileSearch( + public final CommandObject>> ftProfileSearch( String indexName, FTProfileParams profileParams, Query query) { - return new CommandObject<>(commandArguments(SearchCommand.PROFILE).add(indexName) + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.PROFILE), indexName) .add(SearchKeyword.SEARCH).addParams(profileParams).add(SearchKeyword.QUERY) .addParams(query), new SearchProfileResponseBuilder<>(new SearchResultBuilder( !query.getNoContent(), query.getWithScores(), query.getWithPayloads(), true))); } - public CommandObject>> ftProfileSearch( + public final CommandObject>> ftProfileSearch( String indexName, FTProfileParams profileParams, String query, FTSearchParams searchParams) { - return new CommandObject<>(commandArguments(SearchCommand.PROFILE).add(indexName) + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.PROFILE), indexName) .add(SearchKeyword.SEARCH).addParams(profileParams).add(SearchKeyword.QUERY).add(query) .addParams(searchParams), new SearchProfileResponseBuilder<>(new SearchResultBuilder( !searchParams.getNoContent(), searchParams.getWithScores(), false, true))); } - public CommandObject ftDropIndex(String indexName) { + public final CommandObject ftDropIndex(String indexName) { return new CommandObject<>(commandArguments(SearchCommand.DROPINDEX).add(indexName), BuilderFactory.STRING); } - public CommandObject ftDropIndexDD(String indexName) { - return new CommandObject<>(commandArguments(SearchCommand.DROPINDEX).add(indexName).add(SearchKeyword.DD), BuilderFactory.STRING); + public final CommandObject ftDropIndexDD(String indexName) { + return new CommandObject<>(commandArguments(SearchCommand.DROPINDEX).add(indexName).add(SearchKeyword.DD), + BuilderFactory.STRING); } - public CommandObject ftSynUpdate(String indexName, String synonymGroupId, String... terms) { - return new CommandObject<>(commandArguments(SearchCommand.SYNUPDATE).add(indexName) + public final CommandObject ftSynUpdate(String indexName, String synonymGroupId, String... terms) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SYNUPDATE), indexName) .add(synonymGroupId).addObjects((Object[]) terms), BuilderFactory.STRING); } - public CommandObject>> ftSynDump(String indexName) { - return new CommandObject<>(commandArguments(SearchCommand.SYNDUMP).add(indexName), SearchBuilderFactory.SEARCH_SYNONYM_GROUPS); + public final CommandObject>> ftSynDump(String indexName) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SYNDUMP), indexName), + SearchBuilderFactory.SEARCH_SYNONYM_GROUPS); } public final CommandObject ftDictAdd(String dictionary, String... terms) { - return new CommandObject<>(commandArguments(SearchCommand.DICTADD).add(dictionary).addObjects((Object[]) terms), BuilderFactory.LONG); + return new CommandObject<>(commandArguments(SearchCommand.DICTADD).add(dictionary).addObjects((Object[]) terms), + BuilderFactory.LONG); } public final CommandObject ftDictDel(String dictionary, String... terms) { - return new CommandObject<>(commandArguments(SearchCommand.DICTDEL).add(dictionary).addObjects((Object[]) terms), BuilderFactory.LONG); + return new CommandObject<>(commandArguments(SearchCommand.DICTDEL).add(dictionary).addObjects((Object[]) terms), + BuilderFactory.LONG); } public final CommandObject> ftDictDump(String dictionary) { @@ -3247,45 +3283,47 @@ public final CommandObject> ftDictDump(String dictionary) { } public final CommandObject ftDictAddBySampleKey(String indexName, String dictionary, String... terms) { - return addProcessKey(ftDictAdd(dictionary, terms), indexName); + return directSearchCommand(ftDictAdd(dictionary, terms), indexName); } public final CommandObject ftDictDelBySampleKey(String indexName, String dictionary, String... terms) { - return addProcessKey(ftDictDel(dictionary, terms), indexName); + return directSearchCommand(ftDictDel(dictionary, terms), indexName); } public final CommandObject> ftDictDumpBySampleKey(String indexName, String dictionary) { - return addProcessKey(ftDictDump(dictionary), indexName); + return directSearchCommand(ftDictDump(dictionary), indexName); } public final CommandObject>> ftSpellCheck(String index, String query) { - return new CommandObject<>(commandArguments(SearchCommand.SPELLCHECK).key(index).add(query), + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SPELLCHECK), index).add(query), SearchBuilderFactory.SEARCH_SPELLCHECK_RESPONSE); } public final CommandObject>> ftSpellCheck(String index, String query, FTSpellCheckParams spellCheckParams) { - return new CommandObject<>(commandArguments(SearchCommand.SPELLCHECK).key(index).add(query) + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.SPELLCHECK), index).add(query) .addParams(spellCheckParams), SearchBuilderFactory.SEARCH_SPELLCHECK_RESPONSE); } - public CommandObject> ftInfo(String indexName) { - return new CommandObject<>(commandArguments(SearchCommand.INFO).add(indexName), BuilderFactory.ENCODED_OBJECT_MAP); + public final CommandObject> ftInfo(String indexName) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.INFO), indexName), + BuilderFactory.ENCODED_OBJECT_MAP); } - public CommandObject> ftTagVals(String indexName, String fieldName) { - return new CommandObject<>(commandArguments(SearchCommand.TAGVALS).add(indexName).add(fieldName), BuilderFactory.STRING_SET); + public final CommandObject> ftTagVals(String indexName, String fieldName) { + return new CommandObject<>(checkAndRoundRobinSearchCommand(commandArguments(SearchCommand.TAGVALS), indexName) + .add(fieldName), BuilderFactory.STRING_SET); } - public CommandObject ftAliasAdd(String aliasName, String indexName) { + public final CommandObject ftAliasAdd(String aliasName, String indexName) { return new CommandObject<>(commandArguments(SearchCommand.ALIASADD).add(aliasName).add(indexName), BuilderFactory.STRING); } - public CommandObject ftAliasUpdate(String aliasName, String indexName) { + public final CommandObject ftAliasUpdate(String aliasName, String indexName) { return new CommandObject<>(commandArguments(SearchCommand.ALIASUPDATE).add(aliasName).add(indexName), BuilderFactory.STRING); } - public CommandObject ftAliasDel(String aliasName) { + public final CommandObject ftAliasDel(String aliasName) { return new CommandObject<>(commandArguments(SearchCommand.ALIASDEL).add(aliasName), BuilderFactory.STRING); } @@ -3293,16 +3331,16 @@ public final CommandObject> ftConfigGet(String option) { return new CommandObject<>(commandArguments(SearchCommand.CONFIG).add(SearchKeyword.GET).add(option), BuilderFactory.STRING_MAP_FROM_PAIRS); } - public CommandObject> ftConfigGet(String indexName, String option) { - return ftConfigGet(option); + public final CommandObject> ftConfigGet(String indexName, String option) { + return directSearchCommand(ftConfigGet(option), indexName); } public final CommandObject ftConfigSet(String option, String value) { return new CommandObject<>(commandArguments(SearchCommand.CONFIG).add(SearchKeyword.SET).add(option).add(value), BuilderFactory.STRING); } - public CommandObject ftConfigSet(String indexName, String option, String value) { - return ftConfigSet(option, value); + public final CommandObject ftConfigSet(String indexName, String option, String value) { + return directSearchCommand(ftConfigSet(option, value), indexName); } public final CommandObject ftSugAdd(String key, String string, double score) { @@ -4229,9 +4267,4 @@ private CommandArguments addGeoCoordinateFlatMapArgs(CommandArguments args, Map< } return args; } - - private CommandObject addProcessKey(CommandObject object, String sampleKey) { - object.getArguments().processKey(sampleKey); - return object; - } } diff --git a/src/main/java/redis/clients/jedis/MultiNodePipelineBase.java b/src/main/java/redis/clients/jedis/MultiNodePipelineBase.java index 6cd2c26ce8..d30370887b 100644 --- a/src/main/java/redis/clients/jedis/MultiNodePipelineBase.java +++ b/src/main/java/redis/clients/jedis/MultiNodePipelineBase.java @@ -3422,21 +3422,25 @@ public Response ftAggregate(String indexName, AggregationBuil } @Override + @Deprecated public Response ftCursorRead(String indexName, long cursorId, int count) { return appendCommand(commandObjects.ftCursorRead(indexName, cursorId, count)); } @Override + @Deprecated public Response ftCursorDel(String indexName, long cursorId) { return appendCommand(commandObjects.ftCursorDel(indexName, cursorId)); } @Override + @Deprecated public Response ftDropIndex(String indexName) { return appendCommand(commandObjects.ftDropIndex(indexName)); } @Override + @Deprecated public Response ftDropIndexDD(String indexName) { return appendCommand(commandObjects.ftDropIndexDD(indexName)); } @@ -3502,16 +3506,19 @@ public Response> ftTagVals(String indexName, String fieldName) { } @Override + @Deprecated public Response ftAliasAdd(String aliasName, String indexName) { return appendCommand(commandObjects.ftAliasAdd(aliasName, indexName)); } @Override + @Deprecated public Response ftAliasUpdate(String aliasName, String indexName) { return appendCommand(commandObjects.ftAliasUpdate(aliasName, indexName)); } @Override + @Deprecated public Response ftAliasDel(String aliasName) { return appendCommand(commandObjects.ftAliasDel(aliasName)); } diff --git a/src/main/java/redis/clients/jedis/Pipeline.java b/src/main/java/redis/clients/jedis/Pipeline.java index 9ebdf38909..00cc6b14fd 100644 --- a/src/main/java/redis/clients/jedis/Pipeline.java +++ b/src/main/java/redis/clients/jedis/Pipeline.java @@ -3373,21 +3373,25 @@ public Response ftAggregate(String indexName, AggregationBuil } @Override + @Deprecated public Response ftCursorRead(String indexName, long cursorId, int count) { return appendCommand(commandObjects.ftCursorRead(indexName, cursorId, count)); } @Override + @Deprecated public Response ftCursorDel(String indexName, long cursorId) { return appendCommand(commandObjects.ftCursorDel(indexName, cursorId)); } @Override + @Deprecated public Response ftDropIndex(String indexName) { return appendCommand(commandObjects.ftDropIndex(indexName)); } @Override + @Deprecated public Response ftDropIndexDD(String indexName) { return appendCommand(commandObjects.ftDropIndexDD(indexName)); } @@ -3453,16 +3457,19 @@ public Response> ftTagVals(String indexName, String fieldName) { } @Override + @Deprecated public Response ftAliasAdd(String aliasName, String indexName) { return appendCommand(commandObjects.ftAliasAdd(aliasName, indexName)); } @Override + @Deprecated public Response ftAliasUpdate(String aliasName, String indexName) { return appendCommand(commandObjects.ftAliasUpdate(aliasName, indexName)); } @Override + @Deprecated public Response ftAliasDel(String aliasName) { return appendCommand(commandObjects.ftAliasDel(aliasName)); } diff --git a/src/main/java/redis/clients/jedis/TransactionBase.java b/src/main/java/redis/clients/jedis/TransactionBase.java index e255df31d4..227180486c 100644 --- a/src/main/java/redis/clients/jedis/TransactionBase.java +++ b/src/main/java/redis/clients/jedis/TransactionBase.java @@ -3472,21 +3472,25 @@ public Response ftAggregate(String indexName, AggregationBuil } @Override + @Deprecated public Response ftCursorRead(String indexName, long cursorId, int count) { return appendCommand(commandObjects.ftCursorRead(indexName, cursorId, count)); } @Override + @Deprecated public Response ftCursorDel(String indexName, long cursorId) { return appendCommand(commandObjects.ftCursorDel(indexName, cursorId)); } @Override + @Deprecated public Response ftDropIndex(String indexName) { return appendCommand(commandObjects.ftDropIndex(indexName)); } @Override + @Deprecated public Response ftDropIndexDD(String indexName) { return appendCommand(commandObjects.ftDropIndexDD(indexName)); } @@ -3552,16 +3556,19 @@ public Response> ftTagVals(String indexName, String fieldName) { } @Override + @Deprecated public Response ftAliasAdd(String aliasName, String indexName) { return appendCommand(commandObjects.ftAliasAdd(aliasName, indexName)); } @Override + @Deprecated public Response ftAliasUpdate(String aliasName, String indexName) { return appendCommand(commandObjects.ftAliasUpdate(aliasName, indexName)); } @Override + @Deprecated public Response ftAliasDel(String aliasName) { return appendCommand(commandObjects.ftAliasDel(aliasName)); } diff --git a/src/main/java/redis/clients/jedis/UnifiedJedis.java b/src/main/java/redis/clients/jedis/UnifiedJedis.java index 7a46e0ae2c..60f8f7ba58 100644 --- a/src/main/java/redis/clients/jedis/UnifiedJedis.java +++ b/src/main/java/redis/clients/jedis/UnifiedJedis.java @@ -201,6 +201,7 @@ private T checkAndBroadcastCommand(CommandObject commandObject) { public void setBroadcastAndRoundRobinConfig(JedisBroadcastAndRoundRobinConfig config) { this.broadcastAndRoundRobinConfig = config; + this.commandObjects.setBroadcastAndRoundRobinConfig(this.broadcastAndRoundRobinConfig); } public String ping() { diff --git a/src/main/java/redis/clients/jedis/search/RediSearchPipelineCommands.java b/src/main/java/redis/clients/jedis/search/RediSearchPipelineCommands.java index 5598a10dc1..e78155f697 100644 --- a/src/main/java/redis/clients/jedis/search/RediSearchPipelineCommands.java +++ b/src/main/java/redis/clients/jedis/search/RediSearchPipelineCommands.java @@ -59,12 +59,16 @@ default Response ftSearch(String indexName) { Response ftAggregate(String indexName, AggregationBuilder aggr); + @Deprecated Response ftCursorRead(String indexName, long cursorId, int count); + @Deprecated Response ftCursorDel(String indexName, long cursorId); + @Deprecated Response ftDropIndex(String indexName); + @Deprecated Response ftDropIndexDD(String indexName); Response ftSynUpdate(String indexName, String synonymGroupId, String... terms); @@ -92,10 +96,13 @@ Response>> ftSpellCheck(String index, String que Response> ftTagVals(String indexName, String fieldName); + @Deprecated Response ftAliasAdd(String aliasName, String indexName); + @Deprecated Response ftAliasUpdate(String aliasName, String indexName); + @Deprecated Response ftAliasDel(String aliasName); Response> ftConfigGet(String option);