Skip to content

Commit

Permalink
Polishing #1982
Browse files Browse the repository at this point in the history
Add since tags, switch count to long type.
  • Loading branch information
mp911de committed Feb 28, 2022
1 parent b5d6eef commit 24b8a7a
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,7 @@ public RedisFuture<Long> zintercard(K... keys) {
}

@Override
public RedisFuture<Long> zintercard(int limit, K... keys) {
public RedisFuture<Long> zintercard(long limit, K... keys) {
return dispatch(commandBuilder.zintercard(limit, keys));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,7 @@ public Mono<Long> zintercard(K... keys) {
}

@Override
public Mono<Long> zintercard(int limit, K... keys) {
public Mono<Long> zintercard(long limit, K... keys) {
return createMono(() -> commandBuilder.zintercard(limit, keys));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/lettuce/core/RedisCommandBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -3098,7 +3098,7 @@ Command<K, V, Long> zintercard(K... keys) {
return createCommand(ZINTERCARD, new IntegerOutput<>(codec), args);
}

Command<K, V, Long> zintercard(int limit, K... keys) {
Command<K, V, Long> zintercard(long limit, K... keys) {
notEmpty(keys);

CommandArgs<K, V> args = new CommandArgs<>(codec).add(keys.length).addKeys(keys).add(LIMIT).add(limit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,26 @@ public interface RedisSortedSetAsyncCommands<K, V> {
RedisFuture<List<V>> 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<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
*/
RedisFuture<Long> zintercard(int limit, K... keys);
RedisFuture<Long> zintercard(long limit, K... keys);

/**
* Intersect multiple sorted sets and returns the resulting sorted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,26 @@ public interface RedisSortedSetReactiveCommands<K, V> {
Flux<V> 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<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
*/
Mono<Long> zintercard(int limit, K... keys);
Mono<Long> zintercard(long limit, K... keys);

/**
* Intersect multiple sorted sets and returns the resulting sorted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,26 @@ public interface RedisSortedSetCommands<K, V> {
List<V> 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,26 @@ public interface NodeSelectionSortedSetAsyncCommands<K, V> {
AsyncExecutions<List<V>> 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<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
*/
AsyncExecutions<Long> zintercard(int limit, K... keys);
AsyncExecutions<Long> zintercard(long limit, K... keys);

/**
* Intersect multiple sorted sets and returns the resulting sorted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,26 @@ public interface NodeSelectionSortedSetCommands<K, V> {
Executions<List<V>> 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<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
*/
Executions<Long> zintercard(int limit, K... keys);
Executions<Long> zintercard(long limit, K... keys);

/**
* Intersect multiple sorted sets and returns the resulting sorted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,22 +254,26 @@ interface RedisSortedSetCoroutinesCommands<K : Any, V : Any> {
fun zinter(aggregateArgs: ZAggregateArgs, vararg keys: K): Flow<V>

/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ internal class RedisSortedSetCoroutinesCommandsImpl<K : Any, V : Any>(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<ScoredValue<V>> = ops.zinterWithScores(*keys).asFlow()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,26 @@ public interface RedisSortedSetCommands<K, V> {
List<V> 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.
Expand Down

0 comments on commit 24b8a7a

Please sign in to comment.