Fixed - add readDiff() method to RScoredSortedSet object #3356

pull/3384/head
Nikita Koksharov 4 years ago
parent 732e573cb0
commit 36d5910020

@ -1276,6 +1276,20 @@ public class RedissonScoredSortedSet<V> extends RedissonExpirable implements RSc
return commandExecutor.readAsync(getName(), codec, RedisCommands.SORT_SET, params.toArray());
}
@Override
public Collection<V> readDiff(String... names) {
return get(readDiffAsync(names));
}
@Override
public RFuture<Collection<V>> readDiffAsync(String... names) {
List<Object> args = new ArrayList<Object>(names.length + 1);
args.add(names.length + 1);
args.add(getName());
args.addAll(Arrays.asList(names));
return commandExecutor.readAsync(getName(), codec, RedisCommands.ZDIFF, args.toArray());
}
@Override
public RFuture<V> takeFirstAsync() {
return pollFirstAsync(0, TimeUnit.SECONDS);

@ -899,4 +899,15 @@ public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable<
*/
Collection<V> readUnion(Aggregate aggregate, Map<String, Double> nameWithWeight);
/**
* Diff ScoredSortedSets specified by name
* with current ScoredSortedSet without state change.
* <p>
* Requires <b>Redis 6.2.0 and higher.</b>
*
* @param names - name of sets
* @return result of diff
*/
Collection<V> readDiff(String... names);
}

@ -766,4 +766,15 @@ public interface RScoredSortedSetAsync<V> extends RExpirableAsync, RSortableAsyn
*/
RFuture<Collection<V>> readUnionAsync(Aggregate aggregate, Map<String, Double> nameWithWeight);
/**
* Diff ScoredSortedSets specified by name
* with current ScoredSortedSet without state change.
* <p>
* Requires <b>Redis 6.2.0 and higher.</b>
*
* @param names - name of sets
* @return result of diff
*/
RFuture<Collection<V>> readDiffAsync(String... names);
}

@ -789,6 +789,17 @@ public interface RScoredSortedSetReactive<V> extends RExpirableReactive, RSortab
*/
Mono<Collection<V>> readUnion(Aggregate aggregate, Map<String, Double> nameWithWeight);
/**
* Diff ScoredSortedSets specified by name
* with current ScoredSortedSet without state change.
* <p>
* Requires <b>Redis 6.2.0 and higher.</b>
*
* @param names - name of sets
* @return result of diff
*/
Mono<Collection<V>> readDiff(String... names);
/**
* Removes and returns the head element waiting if necessary for an element to become available.
*

@ -791,6 +791,17 @@ public interface RScoredSortedSetRx<V> extends RExpirableRx, RSortableRx<Set<V>>
*/
Single<Collection<V>> readUnion(Aggregate aggregate, Map<String, Double> nameWithWeight);
/**
* Diff ScoredSortedSets specified by name
* with current ScoredSortedSet without state change.
* <p>
* Requires <b>Redis 6.2.0 and higher.</b>
*
* @param names - name of sets
* @return result of diff
*/
Single<Collection<V>> readDiff(String... names);
/**
* Removes and returns the head element waiting if necessary for an element to become available.
*

@ -94,6 +94,7 @@ public interface RedisCommands {
RedisStrictCommand<Void> ASKING = new RedisStrictCommand<Void>("ASKING", new VoidReplayConvertor());
RedisStrictCommand<Void> READONLY = new RedisStrictCommand<Void>("READONLY", new VoidReplayConvertor());
RedisStrictCommand<List<Object>> ZDIFF = new RedisStrictCommand<>("ZDIFF", new ObjectListReplayDecoder<>());
RedisCommand<List<Object>> ZUNION = new RedisCommand<>("ZUNION", new ObjectListReplayDecoder<>());
RedisCommand<List<Object>> ZINTER = new RedisCommand<>("ZINTER", new ObjectListReplayDecoder<>());
RedisStrictCommand<Integer> ZUNIONSTORE_INT = new RedisStrictCommand<Integer>("ZUNIONSTORE", new IntegerReplayConvertor());

Loading…
Cancel
Save