diff --git a/.github/workflows/api-generator.yml b/.github/workflows/api-generator.yml new file mode 100644 index 0000000000..1e204d4487 --- /dev/null +++ b/.github/workflows/api-generator.yml @@ -0,0 +1,134 @@ +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: Run API generator tests (excluding Kotlin) + run: | + mvn test -Dgroups="api_generator" -Dtest='!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 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/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(); + } 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/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/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/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). 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/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/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/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/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..f61df67a7e 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). @@ -238,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); @@ -516,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); @@ -538,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); @@ -560,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); @@ -584,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); @@ -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); @@ -665,35 +664,35 @@ 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); /** - * 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 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #scan}. + * @see io.lettuce.core.KeyScanArgs + * @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); /** - * 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 - * @deprecated since 6.0 in favor of consuming large results through the {@link org.reactivestreams.Publisher} returned by - * {@link #scan}. + * @see io.lettuce.core.KeyScanArgs + * @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); @@ -704,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 65f9a5b0bb..daf33189c9 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. @@ -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/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/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; 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..eb458d1f9a 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. @@ -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 01fef6392e..b3f91e9a29 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; @@ -535,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); @@ -559,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); @@ -694,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); @@ -709,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); @@ -723,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); @@ -740,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); @@ -757,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); @@ -772,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); @@ -860,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); @@ -875,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); @@ -889,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); @@ -906,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, @@ -924,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, @@ -940,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, @@ -1100,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); @@ -1124,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); @@ -1233,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); @@ -1248,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); @@ -1262,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); @@ -1279,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); @@ -1296,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); @@ -1311,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); @@ -1399,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); @@ -1414,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); @@ -1427,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); @@ -1444,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, @@ -1462,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, @@ -1478,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, @@ -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. @@ -1586,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); @@ -1599,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); @@ -1613,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); @@ -1626,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/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..ec43fecdce 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. @@ -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); @@ -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; 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; 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; 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; 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(); + } 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..968a7c0028 100644 --- a/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisGeoCommands.java @@ -1,9 +1,36 @@ +/* + * 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 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/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/RedisKeyCommands.java b/src/main/templates/io/lettuce/core/api/RedisKeyCommands.java index 0357998dbb..a1c141d477 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; @@ -608,21 +616,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); @@ -643,23 +651,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/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..6c861b03fb 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.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..36c814ac04 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.Value; +import io.lettuce.core.SetArgs; +import io.lettuce.core.StrAlgoArgs; +import io.lettuce.core.StringMatchResult; import io.lettuce.core.output.KeyValueStreamingChannel; /** 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; diff --git a/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java b/src/test/java/io/lettuce/apigenerator/CompilationUnitFactory.java index 55e54d0496..db30c24c20 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; @@ -36,11 +35,13 @@ 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; 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; @@ -50,12 +51,16 @@ 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; 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 @@ -130,10 +135,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()); } @@ -180,9 +185,19 @@ 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, strategy); + 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(); } @@ -214,22 +229,31 @@ 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()).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()); + .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(); + // 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 + 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. */ 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/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/CreateReactiveApi.java b/src/test/java/io/lettuce/apigenerator/CreateReactiveApi.java index 21097102be..3379eeec63 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; @@ -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"); @@ -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() + "}."; } 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. 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"));