From 8794aaffba65afc64d9e30ec86fc0f4610c377c5 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 13:21:51 +0200 Subject: [PATCH 01/26] Upgrade com.github.javaparser to 3.27.0 --- pom.xml | 2 +- .../io/lettuce/apigenerator/CompilationUnitFactory.java | 7 +++---- .../java/io/lettuce/apigenerator/CreateReactiveApi.java | 2 +- .../lettuce/apigenerator/KotlinCompilationUnitFactory.java | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index ddfe631b16..e221df4bf8 100644 --- a/pom.xml +++ b/pom.xml @@ -438,7 +438,7 @@ com.github.javaparser javaparser-core - 3.6.3 + 3.27.0 test diff --git a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java index 55e54d0496..7d8a7908f1 100644 --- a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java +++ b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.EnumSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -40,7 +39,7 @@ import org.apache.commons.lang3.StringUtils; -import com.github.javaparser.JavaParser; +import com.github.javaparser.StaticJavaParser; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.ImportDeclaration; import com.github.javaparser.ast.Modifier; @@ -130,10 +129,10 @@ public void createInterface() throws Exception { result.setPackageDeclaration(new PackageDeclaration(new Name(targetPackage))); - template = JavaParser.parse(templateFile); + template = StaticJavaParser.parse(templateFile); ClassOrInterfaceDeclaration templateTypeDeclaration = (ClassOrInterfaceDeclaration) template.getTypes().get(0); - resultType = new ClassOrInterfaceDeclaration(EnumSet.of(Modifier.PUBLIC), true, targetName); + resultType = new ClassOrInterfaceDeclaration(new NodeList<>(new Modifier(Modifier.Keyword.PUBLIC)), true, targetName); if (templateTypeDeclaration.getExtendedTypes() != null) { resultType.setExtendedTypes(templateTypeDeclaration.getExtendedTypes()); } diff --git a/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java b/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java index 21097102be..5cdce2a2d5 100644 --- a/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java +++ b/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java @@ -41,7 +41,7 @@ import com.github.javaparser.ast.expr.MarkerAnnotationExpr; import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.type.Type; -import com.github.javaparser.printer.PrettyPrinterConfiguration; +import com.github.javaparser.printer.configuration.PrettyPrinterConfiguration; import io.lettuce.core.internal.LettuceSets; diff --git a/src/test/java/io/lettuce/apigenerator/KotlinCompilationUnitFactory.java b/src/test/java/io/lettuce/apigenerator/KotlinCompilationUnitFactory.java index 9b160643ee..76691fc3ef 100644 --- a/src/test/java/io/lettuce/apigenerator/KotlinCompilationUnitFactory.java +++ b/src/test/java/io/lettuce/apigenerator/KotlinCompilationUnitFactory.java @@ -37,7 +37,7 @@ import org.apache.commons.lang3.StringUtils; -import com.github.javaparser.JavaParser; +import com.github.javaparser.StaticJavaParser; import com.github.javaparser.JavaToken; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.NodeList; @@ -132,7 +132,7 @@ public KotlinCompilationUnitFactory(File templateFile, File sources, String targ } public void create() throws Exception { - CompilationUnit template = JavaParser.parse(templateFile); + CompilationUnit template = StaticJavaParser.parse(templateFile); JavaToken license = template.getTokenRange().get().getBegin(); result.append(license.asString().replaceAll("Copyright ([\\d]{4})-([\\d]{4})", "Copyright 2020-$2")); From 6c3b6a213f15ebfd6f268b64f7f9b8a0e805d21f Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 13:41:04 +0200 Subject: [PATCH 02/26] Use EclipseImportOrderingStrategy instead of custom sorting --- .../apigenerator/CompilationUnitFactory.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java index 7d8a7908f1..9c1b483148 100644 --- a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java +++ b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java @@ -37,6 +37,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import com.github.javaparser.printer.configuration.imports.EclipseImportOrderingStrategy; import org.apache.commons.lang3.StringUtils; import com.github.javaparser.StaticJavaParser; @@ -55,6 +56,9 @@ import com.github.javaparser.ast.type.Type; import com.github.javaparser.ast.type.TypeParameter; import com.github.javaparser.ast.visitor.VoidVisitorAdapter; +import com.github.javaparser.printer.DefaultPrettyPrinter; +import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration; +import com.github.javaparser.printer.configuration.DefaultConfigurationOption; /** * @author Mark Paluch @@ -179,9 +183,17 @@ public void keepMethodSignaturesFor(Set methodSignaturesToKeep) { } private void writeResult() throws IOException { + // Configure PrettyPrinter with IntelliJ import ordering strategy + DefaultPrinterConfiguration config = new DefaultPrinterConfiguration(); + DefaultConfigurationOption option = new DefaultConfigurationOption( + DefaultPrinterConfiguration.ConfigOption.SORT_IMPORTS_STRATEGY, new EclipseImportOrderingStrategy()); + config.addOption(option); + + DefaultPrettyPrinter printer = new DefaultPrettyPrinter(config); + String formattedCode = printer.print(result); FileOutputStream fos = new FileOutputStream(target); - fos.write(result.toString().getBytes()); + fos.write(formattedCode.getBytes()); fos.close(); } @@ -218,13 +230,7 @@ public void removeUnusedImports() { String importIdentifier = i.getName().getIdentifier(); return fullType.contains(importIdentifier); - }).isPresent()).sorted((o1, o2) -> { - if (o1.getNameAsString().startsWith("java")) - return -1; - if (o2.getNameAsString().startsWith("java")) - return 1; - return o1.getNameAsString().compareTo(o2.getNameAsString()); - }).collect(Collectors.toList()); + }).isPresent()).collect(Collectors.toList()); result.setImports(NodeList.nodeList(optimizedImports)); } From 962201dd9d824a158ac16ad16fae641439a9e47f Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 13:57:30 +0200 Subject: [PATCH 03/26] Update templates to use explicit imports --- .../io/lettuce/core/api/RedisAclCommands.java | 9 +++++---- .../io/lettuce/core/api/RedisGeoCommands.java | 10 +++++++++- .../io/lettuce/core/api/RedisKeyCommands.java | 10 +++++++++- .../lettuce/core/api/RedisSortedSetCommands.java | 13 ++++++++++++- .../io/lettuce/core/api/RedisStreamCommands.java | 14 +++++++++++++- .../io/lettuce/core/api/RedisStringCommands.java | 9 ++++++++- 6 files changed, 56 insertions(+), 9 deletions(-) diff --git a/src/main/templates/io/lettuce/core/api/RedisAclCommands.java b/src/main/templates/io/lettuce/core/api/RedisAclCommands.java index c4dd88c499..199d318ce2 100644 --- a/src/main/templates/io/lettuce/core/api/RedisAclCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisAclCommands.java @@ -19,14 +19,15 @@ */ package io.lettuce.core; -import io.lettuce.core.*; -import io.lettuce.core.protocol.CommandType; -import io.lettuce.core.protocol.RedisCommand; - import java.util.List; import java.util.Map; import java.util.Set; +import io.lettuce.core.AclCategory; +import io.lettuce.core.AclSetuserArgs; +import io.lettuce.core.protocol.CommandType; +import io.lettuce.core.protocol.RedisCommand; + /** * ${intent} for the ACL-API. * diff --git a/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java b/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java index 3bab7c2b01..45ac8c363f 100644 --- a/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java @@ -1,9 +1,17 @@ package io.lettuce.core; -import io.lettuce.core.*; import java.util.List; import java.util.Set; +import io.lettuce.core.GeoAddArgs; +import io.lettuce.core.GeoArgs; +import io.lettuce.core.GeoCoordinates; +import io.lettuce.core.GeoRadiusStoreArgs; +import io.lettuce.core.GeoSearch; +import io.lettuce.core.GeoValue; +import io.lettuce.core.GeoWithin; +import io.lettuce.core.Value; + /** * ${intent} for the Geo-API. * diff --git a/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java b/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java index 0357998dbb..3af647d948 100644 --- a/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java @@ -24,7 +24,15 @@ import java.util.Date; import java.util.List; -import io.lettuce.core.*; +import io.lettuce.core.CopyArgs; +import io.lettuce.core.ExpireArgs; +import io.lettuce.core.KeyScanCursor; +import io.lettuce.core.MigrateArgs; +import io.lettuce.core.RestoreArgs; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.SortArgs; +import io.lettuce.core.StreamScanCursor; import io.lettuce.core.output.KeyStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; diff --git a/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java b/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java index 1c7f4fca79..8b54dc6432 100644 --- a/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java @@ -21,7 +21,18 @@ import java.util.List; -import io.lettuce.core.*; +import io.lettuce.core.KeyValue; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZAggregateArgs; +import io.lettuce.core.ZPopArgs; +import io.lettuce.core.ZStoreArgs; import io.lettuce.core.output.ScoredValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; diff --git a/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java b/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java index 954216a544..e9748c1cbc 100644 --- a/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java @@ -22,11 +22,23 @@ import java.util.List; import java.util.Map; -import io.lettuce.core.*; +import io.lettuce.core.Consumer; +import io.lettuce.core.KeyValue; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.Value; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XAutoClaimArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XGroupCreateArgs; +import io.lettuce.core.XPendingArgs; +import io.lettuce.core.XReadArgs; import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.XTrimArgs; import io.lettuce.core.models.stream.ClaimedMessages; import io.lettuce.core.models.stream.PendingMessage; import io.lettuce.core.models.stream.PendingMessages; +import io.lettuce.core.models.stream.StreamMessage; /** * ${intent} for Streams. diff --git a/src/main/templates/io/lettuce/core/api/RedisStringCommands.java b/src/main/templates/io/lettuce/core/api/RedisStringCommands.java index d4530aa886..7e2cf09a9f 100644 --- a/src/main/templates/io/lettuce/core/api/RedisStringCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisStringCommands.java @@ -22,7 +22,14 @@ import java.util.List; import java.util.Map; -import io.lettuce.core.*; +import io.lettuce.core.BitFieldArgs; +import io.lettuce.core.GetExArgs; +import io.lettuce.core.KeyValue; +import io.lettuce.core.LcsArgs; +import io.lettuce.core.SetArgs; +import io.lettuce.core.StrAlgoArgs; +import io.lettuce.core.StringMatchResult; +import io.lettuce.core.Value; import io.lettuce.core.output.KeyValueStreamingChannel; /** From fe167a5fcd8b1028c05ffa567802783b92f28a32 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 13:58:18 +0200 Subject: [PATCH 04/26] Enable imports sorting --- .../java/io/lettuce/apigenerator/CompilationUnitFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java index 9c1b483148..e350a03c05 100644 --- a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java +++ b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java @@ -185,8 +185,10 @@ public void keepMethodSignaturesFor(Set methodSignaturesToKeep) { private void writeResult() throws IOException { // Configure PrettyPrinter with IntelliJ import ordering strategy DefaultPrinterConfiguration config = new DefaultPrinterConfiguration(); + EclipseImportOrderingStrategy strategy = new EclipseImportOrderingStrategy(); + strategy.setSortImportsAlphabetically(true); DefaultConfigurationOption option = new DefaultConfigurationOption( - DefaultPrinterConfiguration.ConfigOption.SORT_IMPORTS_STRATEGY, new EclipseImportOrderingStrategy()); + DefaultPrinterConfiguration.ConfigOption.SORT_IMPORTS_STRATEGY, strategy); config.addOption(option); DefaultPrettyPrinter printer = new DefaultPrettyPrinter(config); From ccc00c9088e7bac7d245a3553e15014bcef5bc26 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:02:46 +0200 Subject: [PATCH 05/26] Add missing license headers to templates --- .../io/lettuce/core/api/RedisGeoCommands.java | 19 +++++++++++++++++++ .../io/lettuce/core/api/RedisHLLCommands.java | 19 +++++++++++++++++++ .../core/api/RedisTransactionalCommands.java | 19 +++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java b/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java index 45ac8c363f..968a7c0028 100644 --- a/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017-Present, Redis Ltd. and Contributors + * All rights reserved. + * + * Licensed under the MIT License. + * + * This file contains contributions from third-party contributors + * licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.lettuce.core; import java.util.List; diff --git a/src/main/templates/io/lettuce/core/api/RedisHLLCommands.java b/src/main/templates/io/lettuce/core/api/RedisHLLCommands.java index e4ba553c8f..0916c9a0d2 100644 --- a/src/main/templates/io/lettuce/core/api/RedisHLLCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisHLLCommands.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017-Present, Redis Ltd. and Contributors + * All rights reserved. + * + * Licensed under the MIT License. + * + * This file contains contributions from third-party contributors + * licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.lettuce.core.api; /** diff --git a/src/main/templates/io/lettuce/core/api/RedisTransactionalCommands.java b/src/main/templates/io/lettuce/core/api/RedisTransactionalCommands.java index 78ee54015f..85a906579c 100644 --- a/src/main/templates/io/lettuce/core/api/RedisTransactionalCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisTransactionalCommands.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017-Present, Redis Ltd. and Contributors + * All rights reserved. + * + * Licensed under the MIT License. + * + * This file contains contributions from third-party contributors + * licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.lettuce.core.api; import java.util.List; From 412ef2a0b4f90f3ecbf1bb720182e9e7a40f67f5 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:02:58 +0200 Subject: [PATCH 06/26] Remove unused import from template --- src/main/templates/io/lettuce/core/api/RedisStringCommands.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/templates/io/lettuce/core/api/RedisStringCommands.java b/src/main/templates/io/lettuce/core/api/RedisStringCommands.java index 7e2cf09a9f..9a42d2f7be 100644 --- a/src/main/templates/io/lettuce/core/api/RedisStringCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisStringCommands.java @@ -29,7 +29,6 @@ import io.lettuce.core.SetArgs; import io.lettuce.core.StrAlgoArgs; import io.lettuce.core.StringMatchResult; -import io.lettuce.core.Value; import io.lettuce.core.output.KeyValueStreamingChannel; /** From 0619f3b3197386538d9d7c3c087fc1a322f738c8 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:11:07 +0200 Subject: [PATCH 07/26] Do not remove imported annotations --- .../apigenerator/CompilationUnitFactory.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java index e350a03c05..dd48bb8f97 100644 --- a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java +++ b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java @@ -50,6 +50,7 @@ import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.comments.Comment; import com.github.javaparser.ast.comments.JavadocComment; +import com.github.javaparser.ast.expr.AnnotationExpr; import com.github.javaparser.ast.expr.Name; import com.github.javaparser.ast.expr.SimpleName; import com.github.javaparser.ast.type.ClassOrInterfaceType; @@ -227,16 +228,29 @@ public void removeUnusedImports() { ClassOrInterfaceDeclaration declaringClass = (ClassOrInterfaceDeclaration) result.getChildNodes().get(1); List optimizedImports = result.getImports().stream() - .filter(i -> i.isAsterisk() || i.isStatic() || declaringClass.findFirst(Type.class, t -> { - String fullType = t.toString(); - String importIdentifier = i.getName().getIdentifier(); - - return fullType.contains(importIdentifier); - }).isPresent()).collect(Collectors.toList()); + .filter(i -> i.isAsterisk() || i.isStatic() || isImportUsed(declaringClass, i)).collect(Collectors.toList()); result.setImports(NodeList.nodeList(optimizedImports)); } + private boolean isImportUsed(ClassOrInterfaceDeclaration declaringClass, ImportDeclaration importDeclaration) { + String importIdentifier = importDeclaration.getName().getIdentifier(); + + // Check if import is used in types + boolean usedInTypes = declaringClass.findFirst(Type.class, t -> { + String fullType = t.toString(); + return fullType.contains(importIdentifier); + }).isPresent(); + + // Check if import is used in annotations + boolean usedInAnnotations = declaringClass.findFirst(AnnotationExpr.class, a -> { + String annotationName = a.getNameAsString(); + return annotationName.equals(importIdentifier); + }).isPresent(); + + return usedInTypes || usedInAnnotations; + } + /** * Simple visitor implementation for visiting MethodDeclaration nodes. */ From 7087750621238126fb26f9b8d00e2eca6ccd4b43 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:11:19 +0200 Subject: [PATCH 08/26] Fix import in template --- src/main/templates/io/lettuce/core/api/RedisStreamCommands.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java b/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java index e9748c1cbc..6c861b03fb 100644 --- a/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisStreamCommands.java @@ -38,7 +38,7 @@ import io.lettuce.core.models.stream.ClaimedMessages; import io.lettuce.core.models.stream.PendingMessage; import io.lettuce.core.models.stream.PendingMessages; -import io.lettuce.core.models.stream.StreamMessage; +import io.lettuce.core.StreamMessage; /** * ${intent} for Streams. From 2d21f018bdc30fc681d0c7fe1dac0d67e601c178 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:16:38 +0200 Subject: [PATCH 09/26] Use absolute identifier for KeyScanArgs --- .../io/lettuce/core/api/RedisKeyCommands.java | 78 ++++++++++--------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java b/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java index 3af647d948..8578c7f638 100644 --- a/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java @@ -105,7 +105,7 @@ public interface RedisKeyCommands { * @param key the key. * @param seconds the seconds type: long. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. */ Boolean expire(K key, long seconds); @@ -116,7 +116,7 @@ public interface RedisKeyCommands { * @param seconds the seconds type: long. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. * @since 6.2 */ Boolean expire(K key, long seconds, ExpireArgs expireArgs); @@ -127,7 +127,7 @@ public interface RedisKeyCommands { * @param key the key. * @param seconds the seconds. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. * @since 6.1 */ Boolean expire(K key, Duration seconds); @@ -139,7 +139,7 @@ public interface RedisKeyCommands { * @param seconds the seconds. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. * @since 6.2 */ Boolean expire(K key, Duration seconds, ExpireArgs expireArgs); @@ -150,7 +150,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean expireat(K key, long timestamp); @@ -161,7 +161,7 @@ public interface RedisKeyCommands { * @param timestamp the timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean expireat(K key, long timestamp, ExpireArgs expireArgs); @@ -172,7 +172,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean expireat(K key, Date timestamp); @@ -183,7 +183,7 @@ public interface RedisKeyCommands { * @param timestamp the timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean expireat(K key, Date timestamp, ExpireArgs expireArgs); @@ -194,7 +194,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.1 */ Boolean expireat(K key, Instant timestamp); @@ -206,7 +206,7 @@ public interface RedisKeyCommands { * @param timestamp the timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean expireat(K key, Instant timestamp, ExpireArgs expireArgs); @@ -216,7 +216,7 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply in seconds, or a negative value in order to signal an error. The command returns {@code -1} if - * the key exists but has no associated expiration time. The command returns {@code -2} if the key does not exist. + * the key exists but has no associated expiration time. The command returns {@code -2} if the key does not exist. * @since 6.2 */ Long expiretime(K key); @@ -311,8 +311,8 @@ public interface RedisKeyCommands { * @param key the key. * @return Boolean integer-reply specifically: * - * {@code true} if the timeout was removed. {@code false} if {@code key} does not exist or does not have an - * associated timeout. + * {@code true} if the timeout was removed. {@code false} if {@code key} does not exist or does not have an associated + * timeout. */ Boolean persist(K key); @@ -322,7 +322,7 @@ public interface RedisKeyCommands { * @param key the key. * @param milliseconds the milliseconds type: long. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. */ Boolean pexpire(K key, long milliseconds); @@ -333,7 +333,7 @@ public interface RedisKeyCommands { * @param milliseconds the milliseconds type: long. * @param expireArgs the expiry arguments. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. * @since 6.2 */ Boolean pexpire(K key, long milliseconds, ExpireArgs expireArgs); @@ -344,7 +344,7 @@ public interface RedisKeyCommands { * @param key the key. * @param milliseconds the milliseconds. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. * @since 6.1 */ Boolean pexpire(K key, Duration milliseconds); @@ -356,7 +356,7 @@ public interface RedisKeyCommands { * @param milliseconds the milliseconds. * @param expireArgs the expiry arguments. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. * @since 6.2 */ Boolean pexpire(K key, Duration milliseconds, ExpireArgs expireArgs); @@ -367,7 +367,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the milliseconds-timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean pexpireat(K key, long timestamp); @@ -378,7 +378,7 @@ public interface RedisKeyCommands { * @param timestamp the milliseconds-timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean pexpireat(K key, long timestamp, ExpireArgs expireArgs); @@ -389,7 +389,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the milliseconds-timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean pexpireat(K key, Date timestamp); @@ -400,7 +400,7 @@ public interface RedisKeyCommands { * @param timestamp the milliseconds-timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean pexpireat(K key, Date timestamp, ExpireArgs expireArgs); @@ -411,7 +411,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the milliseconds-timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean pexpireat(K key, Instant timestamp); @@ -422,7 +422,7 @@ public interface RedisKeyCommands { * @param timestamp the milliseconds-timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean pexpireat(K key, Instant timestamp, ExpireArgs expireArgs); @@ -432,8 +432,8 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply in milliseconds, or a negative value in order to signal an error. The command returns - * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key - * does not exist. + * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key does not + * exist. * @since 6.2 */ Long pexpiretime(K key); @@ -443,8 +443,8 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply in milliseconds, or a negative value in order to signal an error. The command returns - * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key - * does not exist. + * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key does not + * exist. */ Long pttl(K key); @@ -471,7 +471,7 @@ public interface RedisKeyCommands { * @param newKey the newkey type: key. * @return Boolean integer-reply specifically: * - * {@code true} if {@code key} was renamed to {@code newkey}. {@code false} if {@code newkey} already exists. + * {@code true} if {@code key} was renamed to {@code newkey}. {@code false} if {@code newkey} already exists. */ Boolean renamenx(K key, K newKey); @@ -595,8 +595,8 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply TTL in seconds, or a negative value in order to signal an error. The command returns - * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key - * does not exist. + * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key does not + * exist. */ Long ttl(K key); @@ -616,21 +616,23 @@ public interface RedisKeyCommands { KeyScanCursor scan(); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific + * arguments. * * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ KeyScanCursor scan(ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific + * arguments. * * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ KeyScanCursor scan(ScanCursor scanCursor, ScanArgs scanArgs); @@ -651,23 +653,23 @@ public interface RedisKeyCommands { StreamScanCursor scan(KeyStreamingChannel channel); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ StreamScanCursor scan(KeyStreamingChannel channel, ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ StreamScanCursor scan(KeyStreamingChannel channel, ScanCursor scanCursor, ScanArgs scanArgs); From 0152dd9b5ef2ae7aa5896327e934ebadd993e8f8 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:25:42 +0200 Subject: [PATCH 10/26] Add missing getJsonParser() to template --- .../templates/io/lettuce/core/api/BaseRedisCommands.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/templates/io/lettuce/core/api/BaseRedisCommands.java b/src/main/templates/io/lettuce/core/api/BaseRedisCommands.java index 744f9ea47c..9408ecbf8d 100644 --- a/src/main/templates/io/lettuce/core/api/BaseRedisCommands.java +++ b/src/main/templates/io/lettuce/core/api/BaseRedisCommands.java @@ -26,6 +26,7 @@ import io.lettuce.core.protocol.CommandArgs; import io.lettuce.core.protocol.ProtocolKeyword; import io.lettuce.core.output.CommandOutput; +import io.lettuce.core.json.JsonParser; /** * ${intent} for basic commands. @@ -230,4 +231,10 @@ public interface BaseRedisCommands { @Deprecated void flushCommands(); + /** + * @return the currently configured instance of the {@link JsonParser} + * @since 6.5 + */ + JsonParser getJsonParser(); + } From 489d94de88e8c72acaa3af1cffc5f28ba89bf4b0 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:25:56 +0200 Subject: [PATCH 11/26] Add missing import --- src/main/templates/io/lettuce/core/api/RedisStringCommands.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/templates/io/lettuce/core/api/RedisStringCommands.java b/src/main/templates/io/lettuce/core/api/RedisStringCommands.java index 9a42d2f7be..36c814ac04 100644 --- a/src/main/templates/io/lettuce/core/api/RedisStringCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisStringCommands.java @@ -26,6 +26,7 @@ import io.lettuce.core.GetExArgs; import io.lettuce.core.KeyValue; import io.lettuce.core.LcsArgs; +import io.lettuce.core.Value; import io.lettuce.core.SetArgs; import io.lettuce.core.StrAlgoArgs; import io.lettuce.core.StringMatchResult; From f9eaa5fc5c1a4dc19571e9793141edc1081f015d Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:31:13 +0200 Subject: [PATCH 12/26] Add getJsonParser to KEEP_METHOD_RESULT_TYPE --- src/test/java/io/lettuce/apigenerator/CreateAsyncApi.java | 2 +- src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/io/lettuce/apigenerator/CreateAsyncApi.java b/src/test/java/io/lettuce/apigenerator/CreateAsyncApi.java index a6bd40f8d2..dad83ace4a 100644 --- a/src/test/java/io/lettuce/apigenerator/CreateAsyncApi.java +++ b/src/test/java/io/lettuce/apigenerator/CreateAsyncApi.java @@ -47,7 +47,7 @@ class CreateAsyncApi { public static final Set KEEP_METHOD_RESULT_TYPE = LettuceSets.unmodifiableSet("shutdown", "debugOom", "debugSegfault", "digest", "close", "isOpen", "BaseRedisCommands.reset", "getStatefulConnection", - "setAutoFlushCommands", "flushCommands"); + "setAutoFlushCommands", "flushCommands", "getJsonParser"); /** * Mutate type comment. diff --git a/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java b/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java index 5cdce2a2d5..5707c7e444 100644 --- a/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java +++ b/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java @@ -55,7 +55,7 @@ public class CreateReactiveApi { public static Set KEEP_METHOD_RESULT_TYPE = LettuceSets.unmodifiableSet("digest", "close", "isOpen", - "BaseRedisCommands.reset", "getStatefulConnection", "setAutoFlushCommands", "flushCommands"); + "BaseRedisCommands.reset", "getStatefulConnection", "setAutoFlushCommands", "flushCommands", "getJsonParser"); public static Set FORCE_FLUX_RESULT = LettuceSets.unmodifiableSet("eval", "evalsha", "evalReadOnly", "evalshaReadOnly", "fcall", "fcallReadOnly", "dispatch"); From 39896123a4692b6cef38edd49a5d340e4b49f185 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:32:58 +0200 Subject: [PATCH 13/26] Add missing getJsonParser to the async interface --- .../io/lettuce/core/api/async/BaseRedisAsyncCommands.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/io/lettuce/core/api/async/BaseRedisAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/BaseRedisAsyncCommands.java index 444513ee0c..cf8a716467 100644 --- a/src/main/java/io/lettuce/core/api/async/BaseRedisAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/BaseRedisAsyncCommands.java @@ -23,6 +23,7 @@ import java.util.Map; import io.lettuce.core.RedisFuture; +import io.lettuce.core.json.JsonParser; import io.lettuce.core.output.CommandOutput; import io.lettuce.core.protocol.CommandArgs; import io.lettuce.core.protocol.ProtocolKeyword; @@ -33,6 +34,7 @@ * @param Key type. * @param Value type. * @author Mark Paluch + * @author Tihomir Mateev * @author Ali Takavci * @since 4.0 * @generated by io.lettuce.apigenerator.CreateAsyncApi @@ -228,4 +230,10 @@ public interface BaseRedisAsyncCommands { @Deprecated void flushCommands(); + /** + * @return the currently configured instance of the {@link JsonParser} + * @since 6.5 + */ + JsonParser getJsonParser(); + } From 651e0626c6aeac0969cafe8f50f74c1614f7d6ca Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 14:48:07 +0200 Subject: [PATCH 14/26] Fix discrepancies in formatting to reduce deviations with templates --- .../api/async/RedisHashAsyncCommands.java | 12 ++++----- .../api/async/RedisJsonAsyncCommands.java | 1 + .../core/api/async/RedisKeyAsyncCommands.java | 27 ++++++++++++------- .../api/async/RedisServerAsyncCommands.java | 2 +- .../api/async/RedisStreamAsyncCommands.java | 13 ++++++++- .../async/RedisVectorSetAsyncCommands.java | 3 ++- .../reactive/RedisAclReactiveCommands.java | 4 +-- .../reactive/RedisGeoReactiveCommands.java | 4 +-- .../reactive/RedisHLLReactiveCommands.java | 19 +++++++++++++ .../reactive/RedisJsonReactiveCommands.java | 1 + .../reactive/RedisKeyReactiveCommands.java | 21 +++++++-------- .../reactive/RedisListReactiveCommands.java | 4 +-- .../RedisScriptingReactiveCommands.java | 4 +-- .../reactive/RedisSetReactiveCommands.java | 4 +-- .../reactive/RedisStreamReactiveCommands.java | 18 ++++++++++--- .../reactive/RedisStringReactiveCommands.java | 10 +++---- .../RedisTransactionalReactiveCommands.java | 21 ++++++++++++++- .../RedisVectorSetReactiveCommands.java | 1 + 18 files changed, 120 insertions(+), 49 deletions(-) diff --git a/src/main/java/io/lettuce/core/api/async/RedisHashAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisHashAsyncCommands.java index f1fa1d9b8f..bef097f012 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisHashAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisHashAsyncCommands.java @@ -19,6 +19,12 @@ */ package io.lettuce.core.api.async; +import java.time.Duration; +import java.time.Instant; +import java.util.Date; +import java.util.List; +import java.util.Map; + import io.lettuce.core.ExpireArgs; import io.lettuce.core.HGetExArgs; import io.lettuce.core.HSetExArgs; @@ -33,12 +39,6 @@ import io.lettuce.core.output.KeyValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; -import java.time.Duration; -import java.time.Instant; -import java.util.Date; -import java.util.List; -import java.util.Map; - /** * Asynchronous executed commands for Hashes (Key-Value pairs). * diff --git a/src/main/java/io/lettuce/core/api/async/RedisJsonAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisJsonAsyncCommands.java index 74494e2718..0dfa428b02 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisJsonAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisJsonAsyncCommands.java @@ -7,6 +7,7 @@ package io.lettuce.core.api.async; import java.util.List; + import io.lettuce.core.RedisFuture; import io.lettuce.core.json.JsonPath; import io.lettuce.core.json.JsonType; diff --git a/src/main/java/io/lettuce/core/api/async/RedisKeyAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisKeyAsyncCommands.java index 078a4a57a7..5ef0bb4515 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisKeyAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisKeyAsyncCommands.java @@ -24,7 +24,16 @@ import java.util.Date; import java.util.List; -import io.lettuce.core.*; +import io.lettuce.core.CopyArgs; +import io.lettuce.core.ExpireArgs; +import io.lettuce.core.KeyScanCursor; +import io.lettuce.core.MigrateArgs; +import io.lettuce.core.RedisFuture; +import io.lettuce.core.RestoreArgs; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.SortArgs; +import io.lettuce.core.StreamScanCursor; import io.lettuce.core.output.KeyStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; @@ -609,21 +618,21 @@ public interface RedisKeyAsyncCommands { RedisFuture> scan(); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ RedisFuture> scan(ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ RedisFuture> scan(ScanCursor scanCursor, ScanArgs scanArgs); @@ -644,23 +653,23 @@ public interface RedisKeyAsyncCommands { RedisFuture scan(KeyStreamingChannel channel); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ RedisFuture scan(KeyStreamingChannel channel, ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ RedisFuture scan(KeyStreamingChannel channel, ScanCursor scanCursor, ScanArgs scanArgs); diff --git a/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java index a4245c2d54..e1abb2e9d2 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisServerAsyncCommands.java @@ -29,8 +29,8 @@ import io.lettuce.core.RedisFuture; import io.lettuce.core.ShutdownArgs; import io.lettuce.core.TrackingArgs; -import io.lettuce.core.UnblockType; import io.lettuce.core.TrackingInfo; +import io.lettuce.core.UnblockType; import io.lettuce.core.protocol.CommandType; /** diff --git a/src/main/java/io/lettuce/core/api/async/RedisStreamAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisStreamAsyncCommands.java index 317f02a195..e6494b266a 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisStreamAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisStreamAsyncCommands.java @@ -22,8 +22,19 @@ import java.util.List; import java.util.Map; -import io.lettuce.core.*; +import io.lettuce.core.Consumer; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.RedisFuture; +import io.lettuce.core.StreamMessage; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XAutoClaimArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XGroupCreateArgs; +import io.lettuce.core.XPendingArgs; +import io.lettuce.core.XReadArgs; import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.XTrimArgs; import io.lettuce.core.models.stream.ClaimedMessages; import io.lettuce.core.models.stream.PendingMessage; import io.lettuce.core.models.stream.PendingMessages; diff --git a/src/main/java/io/lettuce/core/api/async/RedisVectorSetAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisVectorSetAsyncCommands.java index c54324210b..64a1998879 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisVectorSetAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisVectorSetAsyncCommands.java @@ -6,8 +6,9 @@ */ package io.lettuce.core.api.async; -import java.util.Map; import java.util.List; +import java.util.Map; + import io.lettuce.core.RedisFuture; import io.lettuce.core.VAddArgs; import io.lettuce.core.VSimArgs; diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisAclReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisAclReactiveCommands.java index 27772cc01c..3534c329c8 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisAclReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisAclReactiveCommands.java @@ -23,12 +23,12 @@ import java.util.Map; import java.util.Set; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.AclCategory; import io.lettuce.core.AclSetuserArgs; import io.lettuce.core.protocol.CommandType; import io.lettuce.core.protocol.RedisCommand; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for the ACL-API. diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisGeoReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisGeoReactiveCommands.java index d241878131..8cdb75723a 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisGeoReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisGeoReactiveCommands.java @@ -19,8 +19,6 @@ */ package io.lettuce.core.api.reactive; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.GeoAddArgs; import io.lettuce.core.GeoArgs; import io.lettuce.core.GeoCoordinates; @@ -29,6 +27,8 @@ import io.lettuce.core.GeoValue; import io.lettuce.core.GeoWithin; import io.lettuce.core.Value; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for the Geo-API. diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisHLLReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisHLLReactiveCommands.java index 3df1188651..4f0ce7c0e5 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisHLLReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisHLLReactiveCommands.java @@ -1,3 +1,22 @@ +/* + * Copyright 2017-Present, Redis Ltd. and Contributors + * All rights reserved. + * + * Licensed under the MIT License. + * + * This file contains contributions from third-party contributors + * licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.lettuce.core.api.reactive; import reactor.core.publisher.Mono; diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisJsonReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisJsonReactiveCommands.java index de5e060125..66e6bf274d 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisJsonReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisJsonReactiveCommands.java @@ -7,6 +7,7 @@ package io.lettuce.core.api.reactive; import java.util.List; + import io.lettuce.core.json.JsonPath; import io.lettuce.core.json.JsonType; import io.lettuce.core.json.JsonValue; diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java index e08654af88..d833dfc8d4 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java @@ -23,11 +23,8 @@ import java.time.Instant; import java.util.Date; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.CopyArgs; import io.lettuce.core.ExpireArgs; -import io.lettuce.core.KeyScanArgs; import io.lettuce.core.KeyScanCursor; import io.lettuce.core.MigrateArgs; import io.lettuce.core.RestoreArgs; @@ -37,6 +34,8 @@ import io.lettuce.core.StreamScanCursor; import io.lettuce.core.output.KeyStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for Keys (Key manipulation/querying). @@ -634,21 +633,21 @@ public interface RedisKeyReactiveCommands { Mono> scan(); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ Mono> scan(ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ Mono> scan(ScanCursor scanCursor, ScanArgs scanArgs); @@ -672,12 +671,12 @@ public interface RedisKeyReactiveCommands { Mono scan(KeyStreamingChannel channel); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by * {@link #scan}. */ @@ -685,13 +684,13 @@ public interface RedisKeyReactiveCommands { Mono scan(KeyStreamingChannel channel, ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by * {@link #scan}. */ diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java index 65f9a5b0bb..0cdf47386e 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java @@ -21,13 +21,13 @@ import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.KeyValue; import io.lettuce.core.LMPopArgs; import io.lettuce.core.LMoveArgs; import io.lettuce.core.LPosArgs; import io.lettuce.core.output.ValueStreamingChannel; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for Lists. diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisScriptingReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisScriptingReactiveCommands.java index 30164f566c..046533b1f7 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisScriptingReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisScriptingReactiveCommands.java @@ -19,10 +19,10 @@ */ package io.lettuce.core.api.reactive; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.FlushMode; import io.lettuce.core.ScriptOutputType; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for Scripting. {@link java.lang.String Lua scripts} are encoded by using the configured diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java index d186af9af5..3988043db9 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java @@ -19,13 +19,13 @@ */ package io.lettuce.core.api.reactive; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.ScanArgs; import io.lettuce.core.ScanCursor; import io.lettuce.core.StreamScanCursor; import io.lettuce.core.ValueScanCursor; import io.lettuce.core.output.ValueStreamingChannel; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for Sets. diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisStreamReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisStreamReactiveCommands.java index e0e5534996..269b675c74 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisStreamReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisStreamReactiveCommands.java @@ -21,13 +21,23 @@ import java.util.Map; -import io.lettuce.core.models.stream.ClaimedMessages; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import io.lettuce.core.*; +import io.lettuce.core.Consumer; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.StreamMessage; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XAutoClaimArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XGroupCreateArgs; +import io.lettuce.core.XPendingArgs; +import io.lettuce.core.XReadArgs; import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.XTrimArgs; +import io.lettuce.core.models.stream.ClaimedMessages; import io.lettuce.core.models.stream.PendingMessage; import io.lettuce.core.models.stream.PendingMessages; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for Streams. diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java index 60e2d5294c..2ffe37cd2a 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java @@ -21,17 +21,17 @@ import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.BitFieldArgs; import io.lettuce.core.GetExArgs; import io.lettuce.core.KeyValue; +import io.lettuce.core.LcsArgs; import io.lettuce.core.SetArgs; import io.lettuce.core.StrAlgoArgs; -import io.lettuce.core.LcsArgs; import io.lettuce.core.StringMatchResult; import io.lettuce.core.Value; import io.lettuce.core.output.KeyValueStreamingChannel; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for Strings. @@ -353,7 +353,7 @@ public interface RedisStringReactiveCommands { /** * Set multiple keys to multiple values. * - * @param map the map. + * @param map the map containing key-value pairs. * @return String simple-string-reply always {@code OK} since {@code MSET} can't fail. */ Mono mset(Map map); @@ -361,7 +361,7 @@ public interface RedisStringReactiveCommands { /** * Set multiple keys to multiple values, only if none of the keys exist. * - * @param map the map. + * @param map the map containing key-value pairs. * @return Boolean integer-reply specifically: * * {@code 1} if the all the keys were set. {@code 0} if no key was set (at least one key already existed). diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisTransactionalReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisTransactionalReactiveCommands.java index 3c4da45792..9c4d929aba 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisTransactionalReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisTransactionalReactiveCommands.java @@ -1,7 +1,26 @@ +/* + * Copyright 2017-Present, Redis Ltd. and Contributors + * All rights reserved. + * + * Licensed under the MIT License. + * + * This file contains contributions from third-party contributors + * licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package io.lettuce.core.api.reactive; -import reactor.core.publisher.Mono; import io.lettuce.core.TransactionResult; +import reactor.core.publisher.Mono; /** * Reactive executed commands for Transactions. diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisVectorSetReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisVectorSetReactiveCommands.java index a42ada3427..bb01967d05 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisVectorSetReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisVectorSetReactiveCommands.java @@ -7,6 +7,7 @@ package io.lettuce.core.api.reactive; import java.util.Map; + import io.lettuce.core.VAddArgs; import io.lettuce.core.VSimArgs; import io.lettuce.core.annotations.Experimental; From 156fd2e4b90c73f46d6e21653ec08764a813a2c0 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 15:24:06 +0200 Subject: [PATCH 15/26] More formatting fixes to align with generator --- .../api/async/RedisSortedSetAsyncCommands.java | 16 ++++++++++++++-- .../api/reactive/BaseRedisReactiveCommands.java | 7 ++++--- .../reactive/RedisSortedSetReactiveCommands.java | 16 ++++++++++++++-- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/lettuce/core/api/async/RedisSortedSetAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisSortedSetAsyncCommands.java index b1d19e8580..f75eb0924f 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisSortedSetAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisSortedSetAsyncCommands.java @@ -20,8 +20,20 @@ package io.lettuce.core.api.async; import java.util.List; -import io.lettuce.core.*; + +import io.lettuce.core.KeyValue; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; import io.lettuce.core.RedisFuture; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZAggregateArgs; +import io.lettuce.core.ZPopArgs; +import io.lettuce.core.ZStoreArgs; import io.lettuce.core.output.ScoredValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; @@ -1448,7 +1460,7 @@ RedisFuture zrevrangebyscoreWithScores(ScoredValueStreamingChannel chan * stores the result in the {@code dstKey} destination key. * * @param dstKey the src key. - * + * * @param srcKey the dst key. * @param range the score range. * @param limit the limit to apply. diff --git a/src/main/java/io/lettuce/core/api/reactive/BaseRedisReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/BaseRedisReactiveCommands.java index 098500c1e5..77bc380f9f 100644 --- a/src/main/java/io/lettuce/core/api/reactive/BaseRedisReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/BaseRedisReactiveCommands.java @@ -22,11 +22,11 @@ import java.util.Map; import io.lettuce.core.json.JsonParser; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import io.lettuce.core.output.CommandOutput; import io.lettuce.core.protocol.CommandArgs; import io.lettuce.core.protocol.ProtocolKeyword; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; /** * Reactive executed commands for basic commands. @@ -34,6 +34,7 @@ * @param Key type. * @param Value type. * @author Mark Paluch + * @author Tihomir Mateev * @author Ali Takavci * @since 4.0 * @generated by io.lettuce.apigenerator.CreateReactiveApi @@ -81,7 +82,7 @@ public interface BaseRedisReactiveCommands { /** * Lists the currently *active shard channels*. - * + * * @param pattern the pattern type: patternkey (pattern). * @return K array-reply a list of active channels, optionally matching the specified pattern. */ diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java index 01fef6392e..5e8a82bfad 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java @@ -20,7 +20,19 @@ package io.lettuce.core.api.reactive; import java.util.List; -import io.lettuce.core.*; + +import io.lettuce.core.KeyValue; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZAggregateArgs; +import io.lettuce.core.ZPopArgs; +import io.lettuce.core.ZStoreArgs; import io.lettuce.core.output.ScoredValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; import reactor.core.publisher.Flux; @@ -1515,7 +1527,7 @@ Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K * stores the result in the {@code dstKey} destination key. * * @param dstKey the src key. - * + * * @param srcKey the dst key. * @param range the score range. * @param limit the limit to apply. From aa2910316524dc438a819f3217a9476aa768f4f4 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 15:32:34 +0200 Subject: [PATCH 16/26] Clarify deprecation warning for StreamingChannel Since we decided to add new Hash commands using deprecated StreamingChannel we should remove "since 6.0" to make it less confusing. --- .../reactive/RedisHashReactiveCommands.java | 68 ++++++---- .../reactive/RedisKeyReactiveCommands.java | 36 ++--- .../reactive/RedisListReactiveCommands.java | 4 +- .../reactive/RedisSetReactiveCommands.java | 36 ++--- .../RedisSortedSetReactiveCommands.java | 128 +++++++++--------- .../reactive/RedisStringReactiveCommands.java | 4 +- .../apigenerator/CreateReactiveApi.java | 2 +- 7 files changed, 144 insertions(+), 134 deletions(-) diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisHashReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisHashReactiveCommands.java index d7b610593e..60af595ffc 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisHashReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisHashReactiveCommands.java @@ -19,6 +19,11 @@ */ package io.lettuce.core.api.reactive; +import java.time.Duration; +import java.time.Instant; +import java.util.Date; +import java.util.Map; + import io.lettuce.core.ExpireArgs; import io.lettuce.core.HGetExArgs; import io.lettuce.core.HSetExArgs; @@ -34,11 +39,6 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.time.Duration; -import java.time.Instant; -import java.util.Date; -import java.util.Map; - /** * Reactive executed commands for Hashes (Key-Value pairs). * @@ -117,8 +117,8 @@ public interface RedisHashReactiveCommands { * @param channel the channel. * @param key the key. * @return Long count of the keys. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hgetall}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hgetall}. */ @Deprecated Mono hgetall(KeyValueStreamingChannel channel, K key); @@ -137,8 +137,8 @@ public interface RedisHashReactiveCommands { * @param channel the channel. * @param key the key. * @return Long count of the keys. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hkeys}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hkeys}. */ @Deprecated Mono hkeys(KeyStreamingChannel channel, K key); @@ -167,8 +167,8 @@ public interface RedisHashReactiveCommands { * @param key the key. * @param fields the fields. * @return Long count of the keys. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hmget}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hmget}. */ @Deprecated Mono hmget(KeyValueStreamingChannel channel, K key, K... fields); @@ -304,8 +304,8 @@ public interface RedisHashReactiveCommands { * @param channel streaming channel that receives a call for every key-value pair. * @param key the key. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscan}. */ @Deprecated Mono hscan(KeyValueStreamingChannel channel, K key); @@ -316,8 +316,9 @@ public interface RedisHashReactiveCommands { * @param channel streaming channel that receives a call for every key. * @param key the key. * @return StreamScanCursor scan cursor. - * @deprecated since 6.4 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscanNovalues}. + * @since 6.4 + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscanNovalues}. */ @Deprecated Mono hscanNovalues(KeyStreamingChannel channel, K key); @@ -329,8 +330,8 @@ public interface RedisHashReactiveCommands { * @param key the key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscan}. */ @Deprecated Mono hscan(KeyValueStreamingChannel channel, K key, ScanArgs scanArgs); @@ -342,8 +343,9 @@ public interface RedisHashReactiveCommands { * @param key the key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.4 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscanNovalues}. + * @since 6.4 + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscanNovalues}. */ @Deprecated Mono hscanNovalues(KeyStreamingChannel channel, K key, ScanArgs scanArgs); @@ -356,8 +358,8 @@ public interface RedisHashReactiveCommands { * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscan}. */ @Deprecated Mono hscan(KeyValueStreamingChannel channel, K key, ScanCursor scanCursor, ScanArgs scanArgs); @@ -370,8 +372,9 @@ public interface RedisHashReactiveCommands { * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.4 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscanNovalues}. + * @since 6.4 + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscanNovalues}. */ @Deprecated Mono hscanNovalues(KeyStreamingChannel channel, K key, ScanCursor scanCursor, ScanArgs scanArgs); @@ -383,8 +386,8 @@ public interface RedisHashReactiveCommands { * @param key the key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscan}. */ @Deprecated Mono hscan(KeyValueStreamingChannel channel, K key, ScanCursor scanCursor); @@ -396,8 +399,9 @@ public interface RedisHashReactiveCommands { * @param key the key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @return StreamScanCursor scan cursor. - * @deprecated since 6.4 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hscanNovalues}. + * @since 6.4 + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hscanNovalues}. */ @Deprecated Mono hscanNovalues(KeyStreamingChannel channel, K key, ScanCursor scanCursor); @@ -475,7 +479,10 @@ public interface RedisHashReactiveCommands { * @param hGetExArgs hgetex arguments. * @param fields fields to retrieve. * @return Long the number of fields that were removed from the hash. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hgetex}. */ + @Deprecated Mono hgetex(KeyValueStreamingChannel channel, K key, HGetExArgs hGetExArgs, K... fields); /** @@ -494,7 +501,10 @@ public interface RedisHashReactiveCommands { * @param key the key. * @param fields fields to retrieve and delete. * @return Long the number of fields that were removed from the hash. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hgetdel}. */ + @Deprecated Mono hgetdel(KeyValueStreamingChannel channel, K key, K... fields); /** @@ -534,8 +544,8 @@ public interface RedisHashReactiveCommands { * @param channel streaming channel that receives a call for every value. * @param key the key. * @return Long count of the keys. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #hvals}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #hvals}. */ @Deprecated Mono hvals(ValueStreamingChannel channel, K key); diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java index d833dfc8d4..f61df67a7e 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisKeyReactiveCommands.java @@ -237,8 +237,8 @@ public interface RedisKeyReactiveCommands { * @param channel the channel. * @param pattern the pattern. * @return Long array-reply list of keys matching {@code pattern}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #keys}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #keys}. */ @Deprecated Mono keys(KeyStreamingChannel channel, K pattern); @@ -515,8 +515,8 @@ public interface RedisKeyReactiveCommands { * @param channel streaming channel that receives a call for every value. * @param key the key. * @return Long number of values. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sort}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sort}. */ @Deprecated Mono sort(ValueStreamingChannel channel, K key); @@ -537,8 +537,8 @@ public interface RedisKeyReactiveCommands { * @param key the key. * @param sortArgs sort arguments. * @return Long number of values. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sort}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sort}. */ @Deprecated Mono sort(ValueStreamingChannel channel, K key, SortArgs sortArgs); @@ -559,8 +559,8 @@ public interface RedisKeyReactiveCommands { * @param key the key. * @return Long number of values. * @since 6.2 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sortReadOnly}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sortReadOnly}. */ @Deprecated Mono sortReadOnly(ValueStreamingChannel channel, K key); @@ -583,8 +583,8 @@ public interface RedisKeyReactiveCommands { * @param sortArgs sort arguments. * @return Long number of values. * @since 6.2 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sortReadOnly}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sortReadOnly}. */ @Deprecated Mono sortReadOnly(ValueStreamingChannel channel, K key, SortArgs sortArgs); @@ -664,8 +664,8 @@ public interface RedisKeyReactiveCommands { * * @param channel streaming channel that receives a call for every key. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #scan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #scan}. */ @Deprecated Mono scan(KeyStreamingChannel channel); @@ -677,8 +677,8 @@ public interface RedisKeyReactiveCommands { * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. * @see io.lettuce.core.KeyScanArgs - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #scan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #scan}. */ @Deprecated Mono scan(KeyStreamingChannel channel, ScanArgs scanArgs); @@ -691,8 +691,8 @@ public interface RedisKeyReactiveCommands { * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. * @see io.lettuce.core.KeyScanArgs - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #scan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #scan}. */ @Deprecated Mono scan(KeyStreamingChannel channel, ScanCursor scanCursor, ScanArgs scanArgs); @@ -703,8 +703,8 @@ public interface RedisKeyReactiveCommands { * @param channel streaming channel that receives a call for every key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #scan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #scan}. */ @Deprecated Mono scan(KeyStreamingChannel channel, ScanCursor scanCursor); diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java index 0cdf47386e..daf33189c9 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisListReactiveCommands.java @@ -335,8 +335,8 @@ public interface RedisListReactiveCommands { * @param start the start type: long. * @param stop the stop type: long. * @return Long count of elements in the specified range. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #lrange}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #lrange}. */ @Deprecated Mono lrange(ValueStreamingChannel channel, K key, long start, long stop); diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java index 3988043db9..eb458d1f9a 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisSetReactiveCommands.java @@ -71,8 +71,8 @@ public interface RedisSetReactiveCommands { * @param channel the channel. * @param keys the keys. * @return Long count of members of the resulting set. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sdiff}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sdiff}. */ @Deprecated Mono sdiff(ValueStreamingChannel channel, K... keys); @@ -100,8 +100,8 @@ public interface RedisSetReactiveCommands { * @param channel the channel. * @param keys the keys. * @return Long count of members of the resulting set. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sinter}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sinter}. */ @Deprecated Mono sinter(ValueStreamingChannel channel, K... keys); @@ -163,8 +163,8 @@ public interface RedisSetReactiveCommands { * @param channel the channel. * @param key the keys. * @return Long count of members of the resulting set. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #smembers}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #smembers}. */ @Deprecated Mono smembers(ValueStreamingChannel channel, K key); @@ -236,8 +236,8 @@ public interface RedisSetReactiveCommands { * @param key the key. * @param count the count. * @return Long count of members of the resulting set. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #srandmember}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #srandmember}. */ @Deprecated Mono srandmember(ValueStreamingChannel channel, K key, long count); @@ -265,8 +265,8 @@ public interface RedisSetReactiveCommands { * @param channel streaming channel that receives a call for every value. * @param keys the keys. * @return Long count of members of the resulting set. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sunion}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sunion}. */ @Deprecated Mono sunion(ValueStreamingChannel channel, K... keys); @@ -322,8 +322,8 @@ public interface RedisSetReactiveCommands { * @param channel streaming channel that receives a call for every value. * @param key the key. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sscan}. */ @Deprecated Mono sscan(ValueStreamingChannel channel, K key); @@ -335,8 +335,8 @@ public interface RedisSetReactiveCommands { * @param key the key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sscan}. */ @Deprecated Mono sscan(ValueStreamingChannel channel, K key, ScanArgs scanArgs); @@ -349,8 +349,8 @@ public interface RedisSetReactiveCommands { * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sscan}. */ @Deprecated Mono sscan(ValueStreamingChannel channel, K key, ScanCursor scanCursor, ScanArgs scanArgs); @@ -362,8 +362,8 @@ public interface RedisSetReactiveCommands { * @param key the key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #sscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #sscan}. */ @Deprecated Mono sscan(ValueStreamingChannel channel, K key, ScanCursor scanCursor); diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java index 5e8a82bfad..b3f91e9a29 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java @@ -547,8 +547,8 @@ public interface RedisSortedSetReactiveCommands { * @param start the start. * @param stop the stop. * @return Long count of elements in the specified range. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrange}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrange}. */ @Deprecated Mono zrange(ValueStreamingChannel channel, K key, long start, long stop); @@ -571,8 +571,8 @@ public interface RedisSortedSetReactiveCommands { * @param start the start. * @param stop the stop. * @return Long count of elements in the specified range. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangeWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangeWithScores}. */ @Deprecated Mono zrangeWithScores(ScoredValueStreamingChannel channel, K key, long start, long stop); @@ -706,8 +706,8 @@ public interface RedisSortedSetReactiveCommands { * @param max max score. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscore(ValueStreamingChannel, java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscore}. */ @Deprecated Mono zrangebyscore(ValueStreamingChannel channel, K key, double min, double max); @@ -721,8 +721,8 @@ public interface RedisSortedSetReactiveCommands { * @param max max score. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscore(ValueStreamingChannel, java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscore}. */ @Deprecated Mono zrangebyscore(ValueStreamingChannel channel, K key, String min, String max); @@ -735,8 +735,8 @@ public interface RedisSortedSetReactiveCommands { * @param range the range. * @return Long count of elements in the specified score range. * @since 4.3 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscore}. */ @Deprecated Mono zrangebyscore(ValueStreamingChannel channel, K key, Range range); @@ -752,8 +752,8 @@ public interface RedisSortedSetReactiveCommands { * @param count the count. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscore(ValueStreamingChannel, java.lang.Object, Range, Limit limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscore}. */ @Deprecated Mono zrangebyscore(ValueStreamingChannel channel, K key, double min, double max, long offset, long count); @@ -769,8 +769,8 @@ public interface RedisSortedSetReactiveCommands { * @param count the count. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscore(ValueStreamingChannel, java.lang.Object, Range, Limit limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscore}. */ @Deprecated Mono zrangebyscore(ValueStreamingChannel channel, K key, String min, String max, long offset, long count); @@ -784,8 +784,8 @@ public interface RedisSortedSetReactiveCommands { * @param limit the limit. * @return Long count of elements in the specified score range. * @since 4.3 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscore}. */ @Deprecated Mono zrangebyscore(ValueStreamingChannel channel, K key, Range range, Limit limit); @@ -872,8 +872,8 @@ public interface RedisSortedSetReactiveCommands { * @param max max score. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscoreWithScores}. */ @Deprecated Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, double min, double max); @@ -887,8 +887,8 @@ public interface RedisSortedSetReactiveCommands { * @param max max score. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscoreWithScores}. */ @Deprecated Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, String min, String max); @@ -901,8 +901,8 @@ public interface RedisSortedSetReactiveCommands { * @param range the range. * @return Long count of elements in the specified score range. * @since 4.3 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscoreWithScores}. */ @Deprecated Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, Range range); @@ -918,8 +918,8 @@ public interface RedisSortedSetReactiveCommands { * @param count the count. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range, Limit limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscoreWithScores}. */ @Deprecated Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, double min, double max, long offset, @@ -936,8 +936,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param count the count. * @return Long count of elements in the specified score range. * @deprecated Use {@link #zrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range, Limit limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscoreWithScores}. */ @Deprecated Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, String min, String max, long offset, @@ -952,8 +952,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param limit the limit. * @return Long count of elements in the specified score range. * @since 4.3 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrangebyscoreWithScores}. */ @Deprecated Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, Range range, @@ -1112,8 +1112,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param start the start. * @param stop the stop. * @return Long count of elements in the specified range. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrange}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrange}. */ @Deprecated Mono zrevrange(ValueStreamingChannel channel, K key, long start, long stop); @@ -1136,8 +1136,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param start the start. * @param stop the stop. * @return Long count of elements in the specified range. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangeWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangeWithScores}. */ @Deprecated Mono zrevrangeWithScores(ScoredValueStreamingChannel channel, K key, long start, long stop); @@ -1245,8 +1245,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param min min score. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscore(java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscore}. */ @Deprecated Mono zrevrangebyscore(ValueStreamingChannel channel, K key, double max, double min); @@ -1260,8 +1260,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param max max score. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscore(java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscore}. */ @Deprecated Mono zrevrangebyscore(ValueStreamingChannel channel, K key, String max, String min); @@ -1274,8 +1274,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param range the range. * @return Long count of elements in the specified range. * @since 4.3 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscore}. */ @Deprecated Mono zrevrangebyscore(ValueStreamingChannel channel, K key, Range range); @@ -1291,8 +1291,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param count the count. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscoreWithScores(java.lang.Object, Range, Limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscore}. */ @Deprecated Mono zrevrangebyscore(ValueStreamingChannel channel, K key, double max, double min, long offset, long count); @@ -1308,8 +1308,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param count the count. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscoreWithScores(java.lang.Object, Range, Limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscore}. */ @Deprecated Mono zrevrangebyscore(ValueStreamingChannel channel, K key, String max, String min, long offset, long count); @@ -1323,8 +1323,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param limit the limit. * @return Long count of elements in the specified range. * @since 4.3 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscore}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscore}. */ @Deprecated Mono zrevrangebyscore(ValueStreamingChannel channel, K key, Range range, Limit limit); @@ -1411,8 +1411,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param max max score. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscoreWithScores}. */ @Deprecated Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, double max, double min); @@ -1426,8 +1426,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param max max score. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscoreWithScores}. */ @Deprecated Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, String max, String min); @@ -1439,8 +1439,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param key the key. * @param range the range. * @return Long count of elements in the specified range. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscoreWithScores}. */ @Deprecated Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, Range range); @@ -1456,8 +1456,8 @@ Mono zrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key * @param count the count. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range, Limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscoreWithScores}. */ @Deprecated Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, double max, double min, long offset, @@ -1474,8 +1474,8 @@ Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K * @param count the count. * @return Long count of elements in the specified range. * @deprecated Use {@link #zrevrangebyscoreWithScores(ScoredValueStreamingChannel, java.lang.Object, Range, Limit)}. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscoreWithScores}. */ @Deprecated Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, String max, String min, long offset, @@ -1490,8 +1490,8 @@ Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K * @param limit the limit. * @return Long count of elements in the specified range. * @since 4.3 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zrevrangebyscoreWithScores}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zrevrangebyscoreWithScores}. */ @Deprecated Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, Range range, @@ -1598,8 +1598,8 @@ Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K * @param channel streaming channel that receives a call for every scored value. * @param key the key. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zscan}. */ @Deprecated Mono zscan(ScoredValueStreamingChannel channel, K key); @@ -1611,8 +1611,8 @@ Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K * @param key the key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zscan}. */ @Deprecated Mono zscan(ScoredValueStreamingChannel channel, K key, ScanArgs scanArgs); @@ -1625,8 +1625,8 @@ Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zscan}. */ @Deprecated Mono zscan(ScoredValueStreamingChannel channel, K key, ScanCursor scanCursor, ScanArgs scanArgs); @@ -1638,8 +1638,8 @@ Mono zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K * @param key the key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @return StreamScanCursor scan cursor. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #zscan}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #zscan}. */ @Deprecated Mono zscan(ScoredValueStreamingChannel channel, K key, ScanCursor scanCursor); diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java index 2ffe37cd2a..ec43fecdce 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisStringReactiveCommands.java @@ -344,8 +344,8 @@ public interface RedisStringReactiveCommands { * @param channel the channel. * @param keys the keys. * @return Long array-reply list of values at the specified keys. - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #mget}. + * @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the + * {@link org.reactivestreams.Publisher} returned by {@link #mget}. */ @Deprecated Mono mget(KeyValueStreamingChannel channel, K... keys); diff --git a/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java b/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java index 5707c7e444..3379eeec63 100644 --- a/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java +++ b/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java @@ -119,7 +119,7 @@ BiFunction methodCommentMutator() { commentText = commentText.replaceAll("List<(.*)>", "$1").replaceAll("Set<(.*)>", "$1"); if (isStreamingChannelMethod(method)) { - commentText += "* @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by {@link #" + commentText += "* @deprecated StreamingChannel methods are deprecated in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by {@link #" + method.getNameAsString() + "}."; } From 0e2d3d516503547877b80be3de5c1af891f9b3e0 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 15:33:29 +0200 Subject: [PATCH 17/26] Fix formatting --- .../io/lettuce/core/api/RedisKeyCommands.java | 66 +++++++++---------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java b/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java index 8578c7f638..a1c141d477 100644 --- a/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java @@ -105,7 +105,7 @@ public interface RedisKeyCommands { * @param key the key. * @param seconds the seconds type: long. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. */ Boolean expire(K key, long seconds); @@ -116,7 +116,7 @@ public interface RedisKeyCommands { * @param seconds the seconds type: long. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. * @since 6.2 */ Boolean expire(K key, long seconds, ExpireArgs expireArgs); @@ -127,7 +127,7 @@ public interface RedisKeyCommands { * @param key the key. * @param seconds the seconds. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. * @since 6.1 */ Boolean expire(K key, Duration seconds); @@ -139,7 +139,7 @@ public interface RedisKeyCommands { * @param seconds the seconds. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set. + * exist or the timeout could not be set. * @since 6.2 */ Boolean expire(K key, Duration seconds, ExpireArgs expireArgs); @@ -150,7 +150,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean expireat(K key, long timestamp); @@ -161,7 +161,7 @@ public interface RedisKeyCommands { * @param timestamp the timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean expireat(K key, long timestamp, ExpireArgs expireArgs); @@ -172,7 +172,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean expireat(K key, Date timestamp); @@ -183,7 +183,7 @@ public interface RedisKeyCommands { * @param timestamp the timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean expireat(K key, Date timestamp, ExpireArgs expireArgs); @@ -194,7 +194,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.1 */ Boolean expireat(K key, Instant timestamp); @@ -206,7 +206,7 @@ public interface RedisKeyCommands { * @param timestamp the timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean expireat(K key, Instant timestamp, ExpireArgs expireArgs); @@ -216,7 +216,7 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply in seconds, or a negative value in order to signal an error. The command returns {@code -1} if - * the key exists but has no associated expiration time. The command returns {@code -2} if the key does not exist. + * the key exists but has no associated expiration time. The command returns {@code -2} if the key does not exist. * @since 6.2 */ Long expiretime(K key); @@ -311,8 +311,8 @@ public interface RedisKeyCommands { * @param key the key. * @return Boolean integer-reply specifically: * - * {@code true} if the timeout was removed. {@code false} if {@code key} does not exist or does not have an associated - * timeout. + * {@code true} if the timeout was removed. {@code false} if {@code key} does not exist or does not have an + * associated timeout. */ Boolean persist(K key); @@ -322,7 +322,7 @@ public interface RedisKeyCommands { * @param key the key. * @param milliseconds the milliseconds type: long. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. */ Boolean pexpire(K key, long milliseconds); @@ -333,7 +333,7 @@ public interface RedisKeyCommands { * @param milliseconds the milliseconds type: long. * @param expireArgs the expiry arguments. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. * @since 6.2 */ Boolean pexpire(K key, long milliseconds, ExpireArgs expireArgs); @@ -344,7 +344,7 @@ public interface RedisKeyCommands { * @param key the key. * @param milliseconds the milliseconds. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. * @since 6.1 */ Boolean pexpire(K key, Duration milliseconds); @@ -356,7 +356,7 @@ public interface RedisKeyCommands { * @param milliseconds the milliseconds. * @param expireArgs the expiry arguments. * @return integer-reply, specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not exist or - * the timeout could not be set. + * the timeout could not be set. * @since 6.2 */ Boolean pexpire(K key, Duration milliseconds, ExpireArgs expireArgs); @@ -367,7 +367,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the milliseconds-timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean pexpireat(K key, long timestamp); @@ -378,7 +378,7 @@ public interface RedisKeyCommands { * @param timestamp the milliseconds-timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean pexpireat(K key, long timestamp, ExpireArgs expireArgs); @@ -389,7 +389,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the milliseconds-timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean pexpireat(K key, Date timestamp); @@ -400,7 +400,7 @@ public interface RedisKeyCommands { * @param timestamp the milliseconds-timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean pexpireat(K key, Date timestamp, ExpireArgs expireArgs); @@ -411,7 +411,7 @@ public interface RedisKeyCommands { * @param key the key. * @param timestamp the milliseconds-timestamp type: posix time. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). */ Boolean pexpireat(K key, Instant timestamp); @@ -422,7 +422,7 @@ public interface RedisKeyCommands { * @param timestamp the milliseconds-timestamp type: posix time. * @param expireArgs the expiry arguments. * @return Boolean integer-reply specifically: {@code true} if the timeout was set. {@code false} if {@code key} does not - * exist or the timeout could not be set (see: {@code EXPIRE}). + * exist or the timeout could not be set (see: {@code EXPIRE}). * @since 6.2 */ Boolean pexpireat(K key, Instant timestamp, ExpireArgs expireArgs); @@ -432,8 +432,8 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply in milliseconds, or a negative value in order to signal an error. The command returns - * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key does not - * exist. + * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key + * does not exist. * @since 6.2 */ Long pexpiretime(K key); @@ -443,8 +443,8 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply in milliseconds, or a negative value in order to signal an error. The command returns - * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key does not - * exist. + * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key + * does not exist. */ Long pttl(K key); @@ -471,7 +471,7 @@ public interface RedisKeyCommands { * @param newKey the newkey type: key. * @return Boolean integer-reply specifically: * - * {@code true} if {@code key} was renamed to {@code newkey}. {@code false} if {@code newkey} already exists. + * {@code true} if {@code key} was renamed to {@code newkey}. {@code false} if {@code newkey} already exists. */ Boolean renamenx(K key, K newKey); @@ -595,8 +595,8 @@ public interface RedisKeyCommands { * * @param key the key. * @return Long integer-reply TTL in seconds, or a negative value in order to signal an error. The command returns - * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key does not - * exist. + * {@code -1} if the key exists but has no associated expiration time. The command returns {@code -2} if the key + * does not exist. */ Long ttl(K key); @@ -616,8 +616,7 @@ public interface RedisKeyCommands { KeyScanCursor scan(); /** - * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific - * arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. @@ -626,8 +625,7 @@ public interface RedisKeyCommands { KeyScanCursor scan(ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific - * arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. From f21ec4c4dcdd05ecd13a659f1066faa04575639b Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 16:56:17 +0200 Subject: [PATCH 18/26] Fix bug in matching used types --- .../java/io/lettuce/apigenerator/CompilationUnitFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java index dd48bb8f97..db30c24c20 100644 --- a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java +++ b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java @@ -35,6 +35,7 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.function.Supplier; +import java.util.regex.Pattern; import java.util.stream.Collectors; import com.github.javaparser.printer.configuration.imports.EclipseImportOrderingStrategy; @@ -239,7 +240,9 @@ private boolean isImportUsed(ClassOrInterfaceDeclaration declaringClass, ImportD // Check if import is used in types boolean usedInTypes = declaringClass.findFirst(Type.class, t -> { String fullType = t.toString(); - return fullType.contains(importIdentifier); + // Match patterns like: Flux>, X, X where X is importIdentifier + String regex = "\\b" + Pattern.quote(importIdentifier) + "(?:<[^>]*>)?\\b"; + return Pattern.compile(regex).matcher(fullType).find(); }).isPresent(); // Check if import is used in annotations From 943dc05418959bd054ef0b0dcd56f6825feda526 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 16:56:28 +0200 Subject: [PATCH 19/26] Fix imports order --- .../lettuce/core/api/reactive/RedisServerReactiveCommands.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/lettuce/core/api/reactive/RedisServerReactiveCommands.java b/src/main/java/io/lettuce/core/api/reactive/RedisServerReactiveCommands.java index e8f9c070fd..7be24acb7d 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisServerReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisServerReactiveCommands.java @@ -27,8 +27,8 @@ import io.lettuce.core.KillArgs; import io.lettuce.core.ShutdownArgs; import io.lettuce.core.TrackingArgs; -import io.lettuce.core.UnblockType; import io.lettuce.core.TrackingInfo; +import io.lettuce.core.UnblockType; import io.lettuce.core.protocol.CommandType; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; From a2c7bbea0a0ad287b61dac45419cb130274a82c7 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 16:57:17 +0200 Subject: [PATCH 20/26] Align formatting with template --- .../io/lettuce/core/api/async/RedisStringAsyncCommands.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/lettuce/core/api/async/RedisStringAsyncCommands.java b/src/main/java/io/lettuce/core/api/async/RedisStringAsyncCommands.java index bcacfa731e..7696338c63 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisStringAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisStringAsyncCommands.java @@ -25,9 +25,9 @@ import io.lettuce.core.BitFieldArgs; import io.lettuce.core.GetExArgs; import io.lettuce.core.KeyValue; +import io.lettuce.core.LcsArgs; import io.lettuce.core.RedisFuture; import io.lettuce.core.SetArgs; -import io.lettuce.core.LcsArgs; import io.lettuce.core.StrAlgoArgs; import io.lettuce.core.StringMatchResult; import io.lettuce.core.output.KeyValueStreamingChannel; @@ -349,7 +349,7 @@ public interface RedisStringAsyncCommands { /** * Set multiple keys to multiple values. * - * @param map the map. + * @param map the map containing key-value pairs. * @return String simple-string-reply always {@code OK} since {@code MSET} can't fail. */ RedisFuture mset(Map map); @@ -357,7 +357,7 @@ public interface RedisStringAsyncCommands { /** * Set multiple keys to multiple values, only if none of the keys exist. * - * @param map the map. + * @param map the map containing key-value pairs. * @return Boolean integer-reply specifically: * * {@code 1} if the all the keys were set. {@code 0} if no key was set (at least one key already existed). From 78d0e2c2d3381b4903175b0264307234891fb12b Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 16:59:10 +0200 Subject: [PATCH 21/26] Align sync interfaces with template --- .../core/api/sync/BaseRedisCommands.java | 8 ++++++++ .../core/api/sync/RedisHashCommands.java | 12 ++++++------ .../core/api/sync/RedisJsonCommands.java | 1 + .../lettuce/core/api/sync/RedisKeyCommands.java | 17 ++++++++--------- .../core/api/sync/RedisScriptingCommands.java | 14 +++++++------- .../core/api/sync/RedisSortedSetCommands.java | 16 ++++++++++++++-- .../core/api/sync/RedisStreamCommands.java | 12 +++++++++++- .../core/api/sync/RedisStringCommands.java | 6 +++--- .../core/api/sync/RedisVectorSetCommands.java | 3 ++- 9 files changed, 60 insertions(+), 29 deletions(-) diff --git a/src/main/java/io/lettuce/core/api/sync/BaseRedisCommands.java b/src/main/java/io/lettuce/core/api/sync/BaseRedisCommands.java index 303469cbb9..dabfc47658 100644 --- a/src/main/java/io/lettuce/core/api/sync/BaseRedisCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/BaseRedisCommands.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; +import io.lettuce.core.json.JsonParser; import io.lettuce.core.output.CommandOutput; import io.lettuce.core.protocol.CommandArgs; import io.lettuce.core.protocol.ProtocolKeyword; @@ -32,6 +33,7 @@ * @param Key type. * @param Value type. * @author Mark Paluch + * @author Tihomir Mateev * @author Ali Takavci * @since 4.0 * @generated by io.lettuce.apigenerator.CreateSyncApi @@ -205,4 +207,10 @@ public interface BaseRedisCommands { @Deprecated void reset(); + /** + * @return the currently configured instance of the {@link JsonParser} + * @since 6.5 + */ + JsonParser getJsonParser(); + } diff --git a/src/main/java/io/lettuce/core/api/sync/RedisHashCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisHashCommands.java index a0a4927e0e..82954b2d45 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisHashCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisHashCommands.java @@ -19,6 +19,12 @@ */ package io.lettuce.core.api.sync; +import java.time.Duration; +import java.time.Instant; +import java.util.Date; +import java.util.List; +import java.util.Map; + import io.lettuce.core.ExpireArgs; import io.lettuce.core.HGetExArgs; import io.lettuce.core.HSetExArgs; @@ -32,12 +38,6 @@ import io.lettuce.core.output.KeyValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; -import java.time.Duration; -import java.time.Instant; -import java.util.Date; -import java.util.List; -import java.util.Map; - /** * Synchronous executed commands for Hashes (Key-Value pairs). * diff --git a/src/main/java/io/lettuce/core/api/sync/RedisJsonCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisJsonCommands.java index 006e382283..d467271bc6 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisJsonCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisJsonCommands.java @@ -7,6 +7,7 @@ package io.lettuce.core.api.sync; import java.util.List; + import io.lettuce.core.json.JsonPath; import io.lettuce.core.json.JsonType; import io.lettuce.core.json.JsonValue; diff --git a/src/main/java/io/lettuce/core/api/sync/RedisKeyCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisKeyCommands.java index c806730e75..36b94de106 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisKeyCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisKeyCommands.java @@ -26,7 +26,6 @@ import io.lettuce.core.CopyArgs; import io.lettuce.core.ExpireArgs; -import io.lettuce.core.KeyScanArgs; import io.lettuce.core.KeyScanCursor; import io.lettuce.core.MigrateArgs; import io.lettuce.core.RestoreArgs; @@ -618,21 +617,21 @@ public interface RedisKeyCommands { KeyScanCursor scan(); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ KeyScanCursor scan(ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ KeyScanCursor scan(ScanCursor scanCursor, ScanArgs scanArgs); @@ -653,23 +652,23 @@ public interface RedisKeyCommands { StreamScanCursor scan(KeyStreamingChannel channel); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ StreamScanCursor scan(KeyStreamingChannel channel, ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ StreamScanCursor scan(KeyStreamingChannel channel, ScanCursor scanCursor, ScanArgs scanArgs); diff --git a/src/main/java/io/lettuce/core/api/sync/RedisScriptingCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisScriptingCommands.java index 48da2c9c81..9f98e19f2e 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisScriptingCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisScriptingCommands.java @@ -63,7 +63,7 @@ public interface RedisScriptingCommands { * Execute a Lua script server side. * * @param script Lua 5.1 script. - * @param type output type. + * @param type the type. * @param keys the keys. * @param values the values. * @param expected return type. @@ -75,7 +75,7 @@ public interface RedisScriptingCommands { * Execute a Lua script server side. * * @param script Lua 5.1 script. - * @param type output type. + * @param type the type. * @param keys the keys. * @param values the values. * @param expected return type. @@ -88,7 +88,7 @@ public interface RedisScriptingCommands { * This is a read-only variant of the EVAL command that cannot execute commands that modify data. * * @param script Lua 5.1 script. - * @param type output type. + * @param type the type. * @param keys the keys. * @param values the values. * @param expected return type. @@ -101,7 +101,7 @@ public interface RedisScriptingCommands { * This is a read-only variant of the EVAL command that cannot execute commands that modify data. * * @param script Lua 5.1 script. - * @param type output type. + * @param type the type. * @param keys the keys. * @param values the values. * @param expected return type. @@ -114,7 +114,7 @@ public interface RedisScriptingCommands { * Evaluates a script cached on the server side by its SHA1 digest. * * @param digest SHA1 of the script. - * @param type output type. + * @param type the type. * @param keys the keys. * @param expected return type. * @return script result. @@ -125,7 +125,7 @@ public interface RedisScriptingCommands { * Execute a Lua script server side. * * @param digest SHA1 of the script. - * @param type output type. + * @param type the type. * @param keys the keys. * @param values the values. * @param expected return type. @@ -137,7 +137,7 @@ public interface RedisScriptingCommands { * This is a read-only variant of the EVALSHA command that cannot execute commands that modify data. * * @param digest SHA1 of the script. - * @param type output type. + * @param type the type. * @param keys the keys. * @param values the values. * @param expected return type. diff --git a/src/main/java/io/lettuce/core/api/sync/RedisSortedSetCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisSortedSetCommands.java index 43bc1c98be..fd7dba6b79 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisSortedSetCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisSortedSetCommands.java @@ -20,7 +20,19 @@ package io.lettuce.core.api.sync; import java.util.List; -import io.lettuce.core.*; + +import io.lettuce.core.KeyValue; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZAggregateArgs; +import io.lettuce.core.ZPopArgs; +import io.lettuce.core.ZStoreArgs; import io.lettuce.core.output.ScoredValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; @@ -1443,7 +1455,7 @@ Long zrevrangebyscoreWithScores(ScoredValueStreamingChannel channel, K key, S * stores the result in the {@code dstKey} destination key. * * @param dstKey the src key. - * + * * @param srcKey the dst key. * @param range the score range. * @param limit the limit to apply. diff --git a/src/main/java/io/lettuce/core/api/sync/RedisStreamCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisStreamCommands.java index 68ed5ab897..091c1fa5cd 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisStreamCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisStreamCommands.java @@ -22,8 +22,18 @@ import java.util.List; import java.util.Map; -import io.lettuce.core.*; +import io.lettuce.core.Consumer; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.StreamMessage; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XAutoClaimArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XGroupCreateArgs; +import io.lettuce.core.XPendingArgs; +import io.lettuce.core.XReadArgs; import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.XTrimArgs; import io.lettuce.core.models.stream.ClaimedMessages; import io.lettuce.core.models.stream.PendingMessage; import io.lettuce.core.models.stream.PendingMessages; diff --git a/src/main/java/io/lettuce/core/api/sync/RedisStringCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisStringCommands.java index bae38567b8..f602a6d52b 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisStringCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisStringCommands.java @@ -25,9 +25,9 @@ import io.lettuce.core.BitFieldArgs; import io.lettuce.core.GetExArgs; import io.lettuce.core.KeyValue; +import io.lettuce.core.LcsArgs; import io.lettuce.core.SetArgs; import io.lettuce.core.StrAlgoArgs; -import io.lettuce.core.LcsArgs; import io.lettuce.core.StringMatchResult; import io.lettuce.core.output.KeyValueStreamingChannel; @@ -348,7 +348,7 @@ public interface RedisStringCommands { /** * Set multiple keys to multiple values. * - * @param map the map. + * @param map the map containing key-value pairs. * @return String simple-string-reply always {@code OK} since {@code MSET} can't fail. */ String mset(Map map); @@ -356,7 +356,7 @@ public interface RedisStringCommands { /** * Set multiple keys to multiple values, only if none of the keys exist. * - * @param map the map. + * @param map the map containing key-value pairs. * @return Boolean integer-reply specifically: * * {@code 1} if the all the keys were set. {@code 0} if no key was set (at least one key already existed). diff --git a/src/main/java/io/lettuce/core/api/sync/RedisVectorSetCommands.java b/src/main/java/io/lettuce/core/api/sync/RedisVectorSetCommands.java index 6bb2725d2c..8f14e91fe2 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisVectorSetCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisVectorSetCommands.java @@ -6,8 +6,9 @@ */ package io.lettuce.core.api.sync; -import java.util.Map; import java.util.List; +import java.util.Map; + import io.lettuce.core.VAddArgs; import io.lettuce.core.VSimArgs; import io.lettuce.core.annotations.Experimental; From 7503219db0b844f3cfe8bb73784a53f7c61f8866 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 17:03:34 +0200 Subject: [PATCH 22/26] Align node selection async interfaces with template --- .../async/NodeSelectionHashAsyncCommands.java | 12 ++++++------ .../async/NodeSelectionJsonAsyncCommands.java | 1 + .../async/NodeSelectionKeyAsyncCommands.java | 17 ++++++++--------- .../async/NodeSelectionServerAsyncCommands.java | 7 ++++--- .../NodeSelectionSortedSetAsyncCommands.java | 16 ++++++++++++++-- .../async/NodeSelectionStreamAsyncCommands.java | 12 +++++++++++- .../async/NodeSelectionStringAsyncCommands.java | 6 +++--- .../NodeSelectionVectorSetAsyncCommands.java | 3 ++- 8 files changed, 49 insertions(+), 25 deletions(-) diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionHashAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionHashAsyncCommands.java index c9e13ba1de..def1b0a484 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionHashAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionHashAsyncCommands.java @@ -19,6 +19,12 @@ */ package io.lettuce.core.cluster.api.async; +import java.time.Duration; +import java.time.Instant; +import java.util.Date; +import java.util.List; +import java.util.Map; + import io.lettuce.core.ExpireArgs; import io.lettuce.core.HGetExArgs; import io.lettuce.core.HSetExArgs; @@ -32,12 +38,6 @@ import io.lettuce.core.output.KeyValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; -import java.time.Duration; -import java.time.Instant; -import java.util.Date; -import java.util.List; -import java.util.Map; - /** * Asynchronous executed commands on a node selection for Hashes (Key-Value pairs). * diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionJsonAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionJsonAsyncCommands.java index bc4d9229dd..a289b1bc30 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionJsonAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionJsonAsyncCommands.java @@ -7,6 +7,7 @@ package io.lettuce.core.cluster.api.async; import java.util.List; + import io.lettuce.core.json.JsonPath; import io.lettuce.core.json.JsonType; import io.lettuce.core.json.JsonValue; diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionKeyAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionKeyAsyncCommands.java index 29cf0464b1..442b687d09 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionKeyAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionKeyAsyncCommands.java @@ -26,7 +26,6 @@ import io.lettuce.core.CopyArgs; import io.lettuce.core.ExpireArgs; -import io.lettuce.core.KeyScanArgs; import io.lettuce.core.KeyScanCursor; import io.lettuce.core.MigrateArgs; import io.lettuce.core.RestoreArgs; @@ -618,21 +617,21 @@ public interface NodeSelectionKeyAsyncCommands { AsyncExecutions> scan(); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ AsyncExecutions> scan(ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ AsyncExecutions> scan(ScanCursor scanCursor, ScanArgs scanArgs); @@ -653,23 +652,23 @@ public interface NodeSelectionKeyAsyncCommands { AsyncExecutions scan(KeyStreamingChannel channel); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ AsyncExecutions scan(KeyStreamingChannel channel, ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ AsyncExecutions scan(KeyStreamingChannel channel, ScanCursor scanCursor, ScanArgs scanArgs); diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionServerAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionServerAsyncCommands.java index f3b7b877c0..a3fcee4aeb 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionServerAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionServerAsyncCommands.java @@ -19,15 +19,16 @@ */ package io.lettuce.core.cluster.api.async; -import java.util.Map; -import java.util.List; import java.util.Date; +import java.util.List; +import java.util.Map; + import io.lettuce.core.ClientListArgs; import io.lettuce.core.FlushMode; import io.lettuce.core.KillArgs; import io.lettuce.core.TrackingArgs; -import io.lettuce.core.UnblockType; import io.lettuce.core.TrackingInfo; +import io.lettuce.core.UnblockType; import io.lettuce.core.protocol.CommandType; /** diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionSortedSetAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionSortedSetAsyncCommands.java index b6b5663369..dca442d90a 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionSortedSetAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionSortedSetAsyncCommands.java @@ -20,7 +20,19 @@ package io.lettuce.core.cluster.api.async; import java.util.List; -import io.lettuce.core.*; + +import io.lettuce.core.KeyValue; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZAggregateArgs; +import io.lettuce.core.ZPopArgs; +import io.lettuce.core.ZStoreArgs; import io.lettuce.core.output.ScoredValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; @@ -1450,7 +1462,7 @@ AsyncExecutions zrevrangebyscoreWithScores(ScoredValueStreamingChannel * stores the result in the {@code dstKey} destination key. * * @param dstKey the src key. - * + * * @param srcKey the dst key. * @param range the score range. * @param limit the limit to apply. diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStreamAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStreamAsyncCommands.java index e6469db3a6..139fc162e3 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStreamAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStreamAsyncCommands.java @@ -22,8 +22,18 @@ import java.util.List; import java.util.Map; -import io.lettuce.core.*; +import io.lettuce.core.Consumer; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.StreamMessage; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XAutoClaimArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XGroupCreateArgs; +import io.lettuce.core.XPendingArgs; +import io.lettuce.core.XReadArgs; import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.XTrimArgs; import io.lettuce.core.models.stream.ClaimedMessages; import io.lettuce.core.models.stream.PendingMessage; import io.lettuce.core.models.stream.PendingMessages; diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStringAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStringAsyncCommands.java index 44672f3810..d27c2db953 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStringAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionStringAsyncCommands.java @@ -25,10 +25,10 @@ import io.lettuce.core.BitFieldArgs; import io.lettuce.core.GetExArgs; import io.lettuce.core.KeyValue; +import io.lettuce.core.LcsArgs; import io.lettuce.core.SetArgs; import io.lettuce.core.StrAlgoArgs; import io.lettuce.core.StringMatchResult; -import io.lettuce.core.LcsArgs; import io.lettuce.core.output.KeyValueStreamingChannel; /** @@ -348,7 +348,7 @@ public interface NodeSelectionStringAsyncCommands { /** * Set multiple keys to multiple values. * - * @param map the map. + * @param map the map containing key-value pairs. * @return String simple-string-reply always {@code OK} since {@code MSET} can't fail. */ AsyncExecutions mset(Map map); @@ -356,7 +356,7 @@ public interface NodeSelectionStringAsyncCommands { /** * Set multiple keys to multiple values, only if none of the keys exist. * - * @param map the map. + * @param map the map containing key-value pairs. * @return Boolean integer-reply specifically: * * {@code 1} if the all the keys were set. {@code 0} if no key was set (at least one key already existed). diff --git a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionVectorSetAsyncCommands.java b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionVectorSetAsyncCommands.java index e23d42dc63..48e69e7e22 100644 --- a/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionVectorSetAsyncCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/async/NodeSelectionVectorSetAsyncCommands.java @@ -6,8 +6,9 @@ */ package io.lettuce.core.cluster.api.async; -import java.util.Map; import java.util.List; +import java.util.Map; + import io.lettuce.core.VAddArgs; import io.lettuce.core.VSimArgs; import io.lettuce.core.annotations.Experimental; From 5e805a96e37bec539e8e898016e98499552e9613 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 17:14:04 +0200 Subject: [PATCH 23/26] Align node selection sync interfaces with template --- .../api/sync/BaseNodeSelectionCommands.java | 1 + .../api/sync/NodeSelectionHashCommands.java | 12 ++++++------ .../api/sync/NodeSelectionJsonCommands.java | 1 + .../api/sync/NodeSelectionKeyCommands.java | 17 ++++++++--------- .../api/sync/NodeSelectionServerCommands.java | 2 +- .../sync/NodeSelectionSortedSetCommands.java | 16 ++++++++++++++-- .../api/sync/NodeSelectionStreamCommands.java | 12 +++++++++++- .../api/sync/NodeSelectionStringCommands.java | 6 +++--- .../sync/NodeSelectionVectorSetCommands.java | 3 ++- 9 files changed, 47 insertions(+), 23 deletions(-) diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/BaseNodeSelectionCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/BaseNodeSelectionCommands.java index 9b7978f499..237101455a 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/BaseNodeSelectionCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/BaseNodeSelectionCommands.java @@ -28,6 +28,7 @@ * @param Key type. * @param Value type. * @author Mark Paluch + * @author Tihomir Mateev * @author Ali Takavci * @since 4.0 * @generated by io.lettuce.apigenerator.CreateSyncNodeSelectionClusterApi diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionHashCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionHashCommands.java index 13dcd1d920..d428c90143 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionHashCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionHashCommands.java @@ -19,6 +19,12 @@ */ package io.lettuce.core.cluster.api.sync; +import java.time.Duration; +import java.time.Instant; +import java.util.Date; +import java.util.List; +import java.util.Map; + import io.lettuce.core.ExpireArgs; import io.lettuce.core.HGetExArgs; import io.lettuce.core.HSetExArgs; @@ -32,12 +38,6 @@ import io.lettuce.core.output.KeyValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; -import java.time.Duration; -import java.time.Instant; -import java.util.Date; -import java.util.List; -import java.util.Map; - /** * Synchronous executed commands on a node selection for Hashes (Key-Value pairs). * diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionJsonCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionJsonCommands.java index 0ca886a8b8..24cef80f5f 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionJsonCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionJsonCommands.java @@ -7,6 +7,7 @@ package io.lettuce.core.cluster.api.sync; import java.util.List; + import io.lettuce.core.json.JsonPath; import io.lettuce.core.json.JsonType; import io.lettuce.core.json.JsonValue; diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionKeyCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionKeyCommands.java index 22cb374a78..617512fa41 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionKeyCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionKeyCommands.java @@ -26,7 +26,6 @@ import io.lettuce.core.CopyArgs; import io.lettuce.core.ExpireArgs; -import io.lettuce.core.KeyScanArgs; import io.lettuce.core.KeyScanCursor; import io.lettuce.core.MigrateArgs; import io.lettuce.core.RestoreArgs; @@ -618,21 +617,21 @@ public interface NodeSelectionKeyCommands { Executions> scan(); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ Executions> scan(ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return KeyScanCursor<K> scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ Executions> scan(ScanCursor scanCursor, ScanArgs scanArgs); @@ -653,23 +652,23 @@ public interface NodeSelectionKeyCommands { Executions scan(KeyStreamingChannel channel); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ Executions scan(KeyStreamingChannel channel, ScanArgs scanArgs); /** - * Incrementally iterate the keys space. Use {@link KeyScanArgs} to specify {@code SCAN}-specific arguments. + * Incrementally iterate the keys space. Use {@link io.lettuce.core.KeyScanArgs} to specify {@code SCAN}-specific arguments. * * @param channel streaming channel that receives a call for every key. * @param scanCursor cursor to resume from a previous scan, must not be {@code null}. * @param scanArgs scan arguments. * @return StreamScanCursor scan cursor. - * @see KeyScanArgs + * @see io.lettuce.core.KeyScanArgs */ Executions scan(KeyStreamingChannel channel, ScanCursor scanCursor, ScanArgs scanArgs); diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionServerCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionServerCommands.java index bd6b2e13d3..eefd8de8fb 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionServerCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionServerCommands.java @@ -27,8 +27,8 @@ import io.lettuce.core.FlushMode; import io.lettuce.core.KillArgs; import io.lettuce.core.TrackingArgs; -import io.lettuce.core.UnblockType; import io.lettuce.core.TrackingInfo; +import io.lettuce.core.UnblockType; import io.lettuce.core.protocol.CommandType; /** diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionSortedSetCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionSortedSetCommands.java index f2abb7e63b..14ff7b8ae1 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionSortedSetCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionSortedSetCommands.java @@ -20,7 +20,19 @@ package io.lettuce.core.cluster.api.sync; import java.util.List; -import io.lettuce.core.*; + +import io.lettuce.core.KeyValue; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.ScanArgs; +import io.lettuce.core.ScanCursor; +import io.lettuce.core.ScoredValue; +import io.lettuce.core.ScoredValueScanCursor; +import io.lettuce.core.StreamScanCursor; +import io.lettuce.core.ZAddArgs; +import io.lettuce.core.ZAggregateArgs; +import io.lettuce.core.ZPopArgs; +import io.lettuce.core.ZStoreArgs; import io.lettuce.core.output.ScoredValueStreamingChannel; import io.lettuce.core.output.ValueStreamingChannel; @@ -1445,7 +1457,7 @@ Executions zrevrangebyscoreWithScores(ScoredValueStreamingChannel chann * stores the result in the {@code dstKey} destination key. * * @param dstKey the src key. - * + * * @param srcKey the dst key. * @param range the score range. * @param limit the limit to apply. diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStreamCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStreamCommands.java index 342aa2cce3..8533d7f583 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStreamCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStreamCommands.java @@ -22,8 +22,18 @@ import java.util.List; import java.util.Map; -import io.lettuce.core.*; +import io.lettuce.core.Consumer; +import io.lettuce.core.Limit; +import io.lettuce.core.Range; +import io.lettuce.core.StreamMessage; +import io.lettuce.core.XAddArgs; +import io.lettuce.core.XAutoClaimArgs; +import io.lettuce.core.XClaimArgs; +import io.lettuce.core.XGroupCreateArgs; +import io.lettuce.core.XPendingArgs; +import io.lettuce.core.XReadArgs; import io.lettuce.core.XReadArgs.StreamOffset; +import io.lettuce.core.XTrimArgs; import io.lettuce.core.models.stream.ClaimedMessages; import io.lettuce.core.models.stream.PendingMessage; import io.lettuce.core.models.stream.PendingMessages; diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStringCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStringCommands.java index d52a332d55..b4ca7eed98 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStringCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionStringCommands.java @@ -25,10 +25,10 @@ import io.lettuce.core.BitFieldArgs; import io.lettuce.core.GetExArgs; import io.lettuce.core.KeyValue; +import io.lettuce.core.LcsArgs; import io.lettuce.core.SetArgs; import io.lettuce.core.StrAlgoArgs; import io.lettuce.core.StringMatchResult; -import io.lettuce.core.LcsArgs; import io.lettuce.core.output.KeyValueStreamingChannel; /** @@ -348,7 +348,7 @@ public interface NodeSelectionStringCommands { /** * Set multiple keys to multiple values. * - * @param map the map. + * @param map the map containing key-value pairs. * @return String simple-string-reply always {@code OK} since {@code MSET} can't fail. */ Executions mset(Map map); @@ -356,7 +356,7 @@ public interface NodeSelectionStringCommands { /** * Set multiple keys to multiple values, only if none of the keys exist. * - * @param map the map. + * @param map the map containing key-value pairs. * @return Boolean integer-reply specifically: * * {@code 1} if the all the keys were set. {@code 0} if no key was set (at least one key already existed). diff --git a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionVectorSetCommands.java b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionVectorSetCommands.java index 66430b024f..0f267df9ee 100644 --- a/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionVectorSetCommands.java +++ b/src/main/java/io/lettuce/core/cluster/api/sync/NodeSelectionVectorSetCommands.java @@ -6,8 +6,9 @@ */ package io.lettuce.core.cluster.api.sync; -import java.util.Map; import java.util.List; +import java.util.Map; + import io.lettuce.core.VAddArgs; import io.lettuce.core.VSimArgs; import io.lettuce.core.annotations.Experimental; From cf7ea115f0ef5ffaeea5f735c3116b46515208cb Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 17:14:25 +0200 Subject: [PATCH 24/26] Fix node selection generators --- .../apigenerator/CreateAsyncNodeSelectionClusterApi.java | 2 +- .../lettuce/apigenerator/CreateSyncNodeSelectionClusterApi.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/io/lettuce/apigenerator/CreateAsyncNodeSelectionClusterApi.java b/src/test/java/io/lettuce/apigenerator/CreateAsyncNodeSelectionClusterApi.java index 577c1b8f59..7cc6071ecb 100644 --- a/src/test/java/io/lettuce/apigenerator/CreateAsyncNodeSelectionClusterApi.java +++ b/src/test/java/io/lettuce/apigenerator/CreateAsyncNodeSelectionClusterApi.java @@ -53,7 +53,7 @@ class CreateAsyncNodeSelectionClusterApi { private static final Set FILTER_METHODS = LettuceSets.unmodifiableSet("shutdown", "debugOom", "debugSegfault", "digest", "close", "isOpen", "BaseRedisCommands.reset", "readOnly", "readWrite", "setAutoFlushCommands", - "flushCommands"); + "flushCommands", "getJsonParser"); /** * Mutate type comment. diff --git a/src/test/java/io/lettuce/apigenerator/CreateSyncNodeSelectionClusterApi.java b/src/test/java/io/lettuce/apigenerator/CreateSyncNodeSelectionClusterApi.java index 6f051d2fc3..85896d8770 100644 --- a/src/test/java/io/lettuce/apigenerator/CreateSyncNodeSelectionClusterApi.java +++ b/src/test/java/io/lettuce/apigenerator/CreateSyncNodeSelectionClusterApi.java @@ -56,7 +56,7 @@ public class CreateSyncNodeSelectionClusterApi { private static final Set FILTER_METHODS = LettuceSets.unmodifiableSet("shutdown", "debugOom", "debugSegfault", "digest", "close", "isOpen", "BaseRedisCommands.reset", "readOnly", "readWrite", "dispatch", "setAutoFlushCommands", - "flushCommands"); + "flushCommands", "getJsonParser"); /** * Mutate type comment. From b09dba39627ac15d2598b371bc8aa961f0c23e1f Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 17:58:54 +0200 Subject: [PATCH 25/26] Add CI workflow for validation --- .github/workflows/api-generator.yml | 141 ++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 .github/workflows/api-generator.yml diff --git a/.github/workflows/api-generator.yml b/.github/workflows/api-generator.yml new file mode 100644 index 0000000000..0a269188d8 --- /dev/null +++ b/.github/workflows/api-generator.yml @@ -0,0 +1,141 @@ +name: API Generator Tests + +on: + push: + paths-ignore: + - 'docs/**' + - '**/*.md' + - '**/*.rst' + branches: + - main + - '[0-9].*' + pull_request: + branches: + - main + - '[0-9].*' + workflow_dispatch: + +env: + # Files to ignore when checking for changes after generation and formatting + # Add one file per line, using shell glob patterns + IGNORED_FILES: | + src/main/java/io/lettuce/core/cluster/api/async/BaseNodeSelectionAsyncCommands.java + +jobs: + api-generator: + name: API Generator Tests and Formatting + runs-on: ubuntu-latest + + steps: + - name: Checkout project + uses: actions/checkout@v4 + + - name: Set Java up in the runner + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + cache: 'maven' + + - name: Setup Maven + uses: s4u/setup-maven-action@v1.8.0 + with: + java-version: 8 + + - name: Maven offline + run: | + mvn -q dependency:go-offline + continue-on-error: true + + - name: Compile project + run: | + mvn compile test-compile + env: + JVM_OPTS: -Xmx3200m + TERM: dumb + + - name: Run API generator tests (excluding Kotlin) + run: | + mvn surefire:test -Dgroups="api_generator" -Dtest="io.lettuce.apigenerator.*,!io.lettuce.apigenerator.CreateKotlinCoroutinesApi" + env: + JVM_OPTS: -Xmx3200m + TERM: dumb + + - name: Run formatter + run: | + mvn formatter:format + env: + JVM_OPTS: -Xmx3200m + TERM: dumb + + - name: Check for changes after generation and formatting + run: | + # Get all changed files + CHANGED_FILES=$(git status --porcelain) + + if [ -n "$CHANGED_FILES" ]; then + echo "Files changed after generation and formatting:" + echo "$CHANGED_FILES" + echo "" + + # Filter out ignored files + FILTERED_FILES="" + while IFS= read -r file; do + if [ -n "$file" ]; then + # Extract filename from git status output (remove status prefix) + filename=$(echo "$file" | sed 's/^...//') + + # Check if file should be ignored + should_ignore=false + while IFS= read -r ignore_pattern; do + if [ -n "$ignore_pattern" ] && [[ "$filename" == $ignore_pattern ]]; then + echo "🔇 Ignoring changes in: $filename" + should_ignore=true + break + fi + done <<< "$IGNORED_FILES" + + # Add to filtered list if not ignored + if [ "$should_ignore" = false ]; then + FILTERED_FILES="$FILTERED_FILES$file"$'\n' + fi + fi + done <<< "$CHANGED_FILES" + + # Check if there are any non-ignored changes + if [ -n "$(echo "$FILTERED_FILES" | tr -d '\n')" ]; then + echo "" + echo "❌ Code changes detected after running API generators and formatter!" + echo "The following files have been modified (excluding ignored files):" + echo "$FILTERED_FILES" + echo "" + echo "Git diff (excluding ignored files):" + while IFS= read -r file; do + if [ -n "$file" ]; then + filename=$(echo "$file" | sed 's/^...//') + should_ignore=false + while IFS= read -r ignore_pattern; do + if [ -n "$ignore_pattern" ] && [[ "$filename" == $ignore_pattern ]]; then + should_ignore=true + break + fi + done <<< "$IGNORED_FILES" + + if [ "$should_ignore" = false ]; then + echo "--- Changes in: $filename ---" + git diff "$filename" + echo "" + fi + fi + done <<< "$CHANGED_FILES" + echo "" + echo "This indicates that the generated code is not up to date with the templates" + echo "or that the code formatting is inconsistent." + echo "Please run the API generators and formatter locally and commit the changes." + exit 1 + else + echo "✅ All changes are in ignored files. Generated code and formatting are up to date!" + fi + else + echo "✅ No changes detected. Generated code and formatting are up to date!" + fi From 24342dfdece45548b202aaa34a4c82536a1d4cc9 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Fri, 11 Jul 2025 18:10:39 +0200 Subject: [PATCH 26/26] Fix workflow --- .github/workflows/api-generator.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/api-generator.yml b/.github/workflows/api-generator.yml index 0a269188d8..1e204d4487 100644 --- a/.github/workflows/api-generator.yml +++ b/.github/workflows/api-generator.yml @@ -46,17 +46,10 @@ jobs: run: | mvn -q dependency:go-offline continue-on-error: true - - - name: Compile project - run: | - mvn compile test-compile - env: - JVM_OPTS: -Xmx3200m - TERM: dumb - name: Run API generator tests (excluding Kotlin) run: | - mvn surefire:test -Dgroups="api_generator" -Dtest="io.lettuce.apigenerator.*,!io.lettuce.apigenerator.CreateKotlinCoroutinesApi" + mvn test -Dgroups="api_generator" -Dtest='!CreateKotlinCoroutinesApi' env: JVM_OPTS: -Xmx3200m TERM: dumb