diff --git a/src/main/java/io/lettuce/core/AbstractRedisAsyncCommands.java b/src/main/java/io/lettuce/core/AbstractRedisAsyncCommands.java index 680678a25b..7e44fa8c20 100644 --- a/src/main/java/io/lettuce/core/AbstractRedisAsyncCommands.java +++ b/src/main/java/io/lettuce/core/AbstractRedisAsyncCommands.java @@ -2141,7 +2141,7 @@ public RedisFuture zintercard(K... keys) { } @Override - public RedisFuture zintercard(int limit, K... keys) { + public RedisFuture zintercard(long limit, K... keys) { return dispatch(commandBuilder.zintercard(limit, keys)); } diff --git a/src/main/java/io/lettuce/core/AbstractRedisReactiveCommands.java b/src/main/java/io/lettuce/core/AbstractRedisReactiveCommands.java index 9215293d75..b86826b833 100644 --- a/src/main/java/io/lettuce/core/AbstractRedisReactiveCommands.java +++ b/src/main/java/io/lettuce/core/AbstractRedisReactiveCommands.java @@ -2214,7 +2214,7 @@ public Mono zintercard(K... keys) { } @Override - public Mono zintercard(int limit, K... keys) { + public Mono zintercard(long limit, K... keys) { return createMono(() -> commandBuilder.zintercard(limit, keys)); } diff --git a/src/main/java/io/lettuce/core/RedisCommandBuilder.java b/src/main/java/io/lettuce/core/RedisCommandBuilder.java index 75efba2cde..d298171dbb 100644 --- a/src/main/java/io/lettuce/core/RedisCommandBuilder.java +++ b/src/main/java/io/lettuce/core/RedisCommandBuilder.java @@ -3098,7 +3098,7 @@ Command zintercard(K... keys) { return createCommand(ZINTERCARD, new IntegerOutput<>(codec), args); } - Command zintercard(int limit, K... keys) { + Command zintercard(long limit, K... keys) { notEmpty(keys); CommandArgs args = new CommandArgs<>(codec).add(keys.length).addKeys(keys).add(LIMIT).add(limit); 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 bf78036701..a8653c9361 100644 --- a/src/main/java/io/lettuce/core/api/async/RedisSortedSetAsyncCommands.java +++ b/src/main/java/io/lettuce/core/api/async/RedisSortedSetAsyncCommands.java @@ -279,22 +279,26 @@ public interface RedisSortedSetAsyncCommands { RedisFuture> zinter(ZAggregateArgs aggregateArgs, K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ RedisFuture zintercard(K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param limit If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and * yield limit as the cardinality * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ - RedisFuture zintercard(int limit, K... keys); + RedisFuture zintercard(long limit, K... keys); /** * Intersect multiple sorted sets and returns the resulting sorted. 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 8672b20e30..ea1a2c4635 100644 --- a/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java +++ b/src/main/java/io/lettuce/core/api/reactive/RedisSortedSetReactiveCommands.java @@ -281,22 +281,26 @@ public interface RedisSortedSetReactiveCommands { Flux zinter(ZAggregateArgs aggregateArgs, K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ Mono zintercard(K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param limit If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and * yield limit as the cardinality * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ - Mono zintercard(int limit, K... keys); + Mono zintercard(long limit, K... keys); /** * Intersect multiple sorted sets and returns the resulting sorted. 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 2b4cb5f9d0..60e59303af 100644 --- a/src/main/java/io/lettuce/core/api/sync/RedisSortedSetCommands.java +++ b/src/main/java/io/lettuce/core/api/sync/RedisSortedSetCommands.java @@ -279,22 +279,26 @@ public interface RedisSortedSetCommands { List zinter(ZAggregateArgs aggregateArgs, K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ Long zintercard(K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param limit If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and * yield limit as the cardinality * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ - Long zintercard(int limit, K... keys); + Long zintercard(long limit, K... keys); /** * Intersect multiple sorted sets and returns the resulting sorted. 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 3d08f421e4..d552c3eab6 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 @@ -279,22 +279,26 @@ public interface NodeSelectionSortedSetAsyncCommands { AsyncExecutions> zinter(ZAggregateArgs aggregateArgs, K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ AsyncExecutions zintercard(K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param limit If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and * yield limit as the cardinality * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ - AsyncExecutions zintercard(int limit, K... keys); + AsyncExecutions zintercard(long limit, K... keys); /** * Intersect multiple sorted sets and returns the resulting sorted. 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 38ed34ccef..8bc783d716 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 @@ -279,22 +279,26 @@ public interface NodeSelectionSortedSetCommands { Executions> zinter(ZAggregateArgs aggregateArgs, K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ Executions zintercard(K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param limit If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and * yield limit as the cardinality * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ - Executions zintercard(int limit, K... keys); + Executions zintercard(long limit, K... keys); /** * Intersect multiple sorted sets and returns the resulting sorted. diff --git a/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommands.kt b/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommands.kt index 2340fe1173..2db1c59b37 100644 --- a/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommands.kt +++ b/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommands.kt @@ -254,22 +254,26 @@ interface RedisSortedSetCoroutinesCommands { fun zinter(aggregateArgs: ZAggregateArgs, vararg keys: K): Flow /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(Any[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ suspend fun zintercard(vararg keys: K): Long? /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(Any[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param limit If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and * yield limit as the cardinality * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ - suspend fun zintercard(limit: Int, vararg keys: K): Long? + suspend fun zintercard(limit: Long, vararg keys: K): Long? /** * Intersect multiple sorted sets and returns the resulting sorted. diff --git a/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommandsImpl.kt b/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommandsImpl.kt index fb01aa0760..40a185c90c 100644 --- a/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommandsImpl.kt +++ b/src/main/kotlin/io/lettuce/core/api/coroutines/RedisSortedSetCoroutinesCommandsImpl.kt @@ -103,7 +103,8 @@ internal class RedisSortedSetCoroutinesCommandsImpl(internal v override suspend fun zintercard(vararg keys: K): Long? = ops.zintercard(*keys).awaitFirstOrNull() - override suspend fun zintercard(limit: Int, vararg keys: K): Long? = ops.zintercard(limit, *keys).awaitFirstOrNull() + override suspend fun zintercard(limit: Long, vararg keys: K): Long? = + ops.zintercard(limit, *keys).awaitFirstOrNull() override fun zinterWithScores(vararg keys: K): Flow> = ops.zinterWithScores(*keys).asFlow() diff --git a/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java b/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java index 339d3a863e..5eefd5b599 100644 --- a/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java +++ b/src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java @@ -278,22 +278,26 @@ public interface RedisSortedSetCommands { List zinter(ZAggregateArgs aggregateArgs, K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ Long zintercard(K... keys); /** - * This command is similar to ZINTER, but instead of returning the result set, it returns just the cardinality of the result. + * This command is similar to {@link #zinter(java.lang.Object[])}, but instead of returning the result set, it returns just + * the cardinality of the result. * * @param limit If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and * yield limit as the cardinality * @param keys the keys. * @return Long Integer reply the number of elements in the resulting intersection. + * @since 6.2 */ - Long zintercard(int limit, K... keys); + Long zintercard(long limit, K... keys); /** * Intersect multiple sorted sets and returns the resulting sorted.