Interface ReactiveSetOperations<K,V>
public interface ReactiveSetOperations<K,V>
Reactive Redis operations for Set Commands.
Streams of methods returning Mono<K>
or Flux<M>
are terminated with
InvalidDataAccessApiUsageException
when
RedisElementReader.read(ByteBuffer)
returns null
for a
particular element as Reactive Streams prohibit the usage of null
values.
- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl, Roman Bezpalko
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Long>
Add givenvalues
to set atkey
.reactor.core.publisher.Mono<Boolean>
Removes the given key.reactor.core.publisher.Flux<V>
difference
(Collection<K> keys) Diff all sets for givenkeys
.reactor.core.publisher.Flux<V>
difference
(K key, Collection<K> otherKeys) Diff all sets for givenkey
andotherKeys
.reactor.core.publisher.Flux<V>
difference
(K key, K otherKey) Diff all sets for givenkey
andotherKey
.reactor.core.publisher.Mono<Long>
differenceAndStore
(Collection<K> keys, K destKey) Diff all sets for givenkeys
and store result indestKey
.reactor.core.publisher.Mono<Long>
differenceAndStore
(K key, Collection<K> otherKeys, K destKey) Diff all sets for givenkey
andotherKeys
and store result indestKey
.reactor.core.publisher.Mono<Long>
differenceAndStore
(K key, K otherKey, K destKey) Diff all sets for givenkey
andotherKey
and store result indestKey
.reactor.core.publisher.Flux<V>
distinctRandomMembers
(K key, long count) Getcount
distinct random elements from set atkey
.reactor.core.publisher.Flux<V>
intersect
(Collection<K> keys) Returns the members intersecting all given sets atkeys
.reactor.core.publisher.Flux<V>
intersect
(K key, Collection<K> otherKeys) Returns the members intersecting all given sets atkey
andotherKeys
.reactor.core.publisher.Flux<V>
Returns the members intersecting all given sets atkey
andotherKey
.reactor.core.publisher.Mono<Long>
intersectAndStore
(Collection<K> keys, K destKey) Intersect all given sets atkeys
and store result indestKey
.reactor.core.publisher.Mono<Long>
intersectAndStore
(K key, Collection<K> otherKeys, K destKey) Intersect all given sets atkey
andotherKeys
and store result indestKey
.reactor.core.publisher.Mono<Long>
intersectAndStore
(K key, K otherKey, K destKey) Intersect all given sets atkey
andotherKey
and store result indestKey
.reactor.core.publisher.Mono<Boolean>
Check if set atkey
containsvalue
.Check if set atkey
contains one or morevalues
.reactor.core.publisher.Flux<V>
Get all elements of set atkey
.reactor.core.publisher.Mono<Boolean>
Movevalue
fromkey
todestKey
reactor.core.publisher.Mono<V>
Remove and return a random member from set atkey
.reactor.core.publisher.Flux<V>
Remove and returncount
random members from set atkey
.reactor.core.publisher.Mono<V>
randomMember
(K key) Get random element from set atkey
.reactor.core.publisher.Flux<V>
randomMembers
(K key, long count) Getcount
random elements from set atkey
.reactor.core.publisher.Mono<Long>
Remove givenvalues
from set atkey
and return the number of removed elements.default reactor.core.publisher.Flux<V>
Use aFlux
to iterate over entries in the set atkey
.reactor.core.publisher.Flux<V>
scan
(K key, ScanOptions options) reactor.core.publisher.Mono<Long>
Get size of set atkey
.reactor.core.publisher.Flux<V>
union
(Collection<K> keys) Union all sets at givenkeys
.reactor.core.publisher.Flux<V>
union
(K key, Collection<K> otherKeys) Union all sets at givenkeys
andotherKeys
.reactor.core.publisher.Flux<V>
Union all sets at givenkeys
andotherKey
.reactor.core.publisher.Mono<Long>
unionAndStore
(Collection<K> keys, K destKey) Union all sets at givenkeys
and store result indestKey
.reactor.core.publisher.Mono<Long>
unionAndStore
(K key, Collection<K> otherKeys, K destKey) Union all sets at givenkey
andotherKeys
and store result indestKey
.reactor.core.publisher.Mono<Long>
unionAndStore
(K key, K otherKey, K destKey) Union all sets at givenkey
andotherKey
and store result indestKey
.
-
Method Details
-
add
Add givenvalues
to set atkey
.- Parameters:
key
- must not be null.values
-- Returns:
- See Also:
-
remove
Remove givenvalues
from set atkey
and return the number of removed elements.- Parameters:
key
- must not be null.values
-- Returns:
- See Also:
-
pop
Remove and return a random member from set atkey
.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
pop
Remove and returncount
random members from set atkey
.- Parameters:
key
- must not be null.count
- number of random members to pop from the set.- Returns:
Flux
emitting random members.- See Also:
-
move
Movevalue
fromkey
todestKey
- Parameters:
sourceKey
- must not be null.value
-destKey
- must not be null.- Returns:
- See Also:
-
size
Get size of set atkey
.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
isMember
Check if set atkey
containsvalue
.- Parameters:
key
- must not be null.o
-- Returns:
- See Also:
-
isMember
Check if set atkey
contains one or morevalues
.- Parameters:
key
- must not be null.objects
-- Returns:
- Since:
- 2.6
- See Also:
-
intersect
Returns the members intersecting all given sets atkey
andotherKey
.- Parameters:
key
- must not be null.otherKey
- must not be null.- Returns:
- See Also:
-
intersect
Returns the members intersecting all given sets atkey
andotherKeys
.- Parameters:
key
- must not be null.otherKeys
- must not be null.- Returns:
- See Also:
-
intersect
Returns the members intersecting all given sets atkeys
.- Parameters:
keys
- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
intersectAndStore
Intersect all given sets atkey
andotherKey
and store result indestKey
.- Parameters:
key
- must not be null.otherKey
- must not be null.destKey
- must not be null.- Returns:
- See Also:
-
intersectAndStore
Intersect all given sets atkey
andotherKeys
and store result indestKey
.- Parameters:
key
- must not be null.otherKeys
- must not be null.destKey
- must not be null.- Returns:
- See Also:
-
intersectAndStore
Intersect all given sets atkeys
and store result indestKey
.- Parameters:
keys
- must not be null.destKey
- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
union
Union all sets at givenkeys
andotherKey
.- Parameters:
key
- must not be null.otherKey
- must not be null.- Returns:
- See Also:
-
union
Union all sets at givenkeys
andotherKeys
.- Parameters:
key
- must not be null.otherKeys
- must not be null.- Returns:
- See Also:
-
union
Union all sets at givenkeys
.- Parameters:
keys
- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
unionAndStore
Union all sets at givenkey
andotherKey
and store result indestKey
.- Parameters:
key
- must not be null.otherKey
- must not be null.destKey
- must not be null.- Returns:
- See Also:
-
unionAndStore
Union all sets at givenkey
andotherKeys
and store result indestKey
.- Parameters:
key
- must not be null.otherKeys
- must not be null.destKey
- must not be null.- Returns:
- See Also:
-
unionAndStore
Union all sets at givenkeys
and store result indestKey
.- Parameters:
keys
- must not be null.destKey
- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
difference
Diff all sets for givenkey
andotherKey
.- Parameters:
key
- must not be null.otherKey
- must not be null.- Returns:
- See Also:
-
difference
Diff all sets for givenkey
andotherKeys
.- Parameters:
key
- must not be null.otherKeys
- must not be null.- Returns:
- See Also:
-
difference
Diff all sets for givenkeys
.- Parameters:
keys
- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
differenceAndStore
Diff all sets for givenkey
andotherKey
and store result indestKey
.- Parameters:
key
- must not be null.otherKey
- must not be null.destKey
- must not be null.- Returns:
- See Also:
-
differenceAndStore
Diff all sets for givenkey
andotherKeys
and store result indestKey
.- Parameters:
key
- must not be null.otherKeys
- must not be null.destKey
- must not be null.- Returns:
- See Also:
-
differenceAndStore
Diff all sets for givenkeys
and store result indestKey
.- Parameters:
keys
- must not be null.destKey
- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
members
Get all elements of set atkey
.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
scan
Use aFlux
to iterate over entries in the set atkey
. The resultingFlux
acts as a cursor and issuesSSCAN
commands itself as long as the subscriber signals demand.- Parameters:
key
- must not be null.- Returns:
- the
Flux
emitting the values one by one or anempty Flux
if none exist. - Throws:
IllegalArgumentException
- when givenkey
is null.- Since:
- 2.1
- See Also:
-
scan
Use aFlux
to iterate over entries in the set atkey
givenScanOptions
. The resultingFlux
acts as a cursor and issuesSSCAN
commands itself as long as the subscriber signals demand.- Parameters:
key
- must not be null.options
- must not be null. UseScanOptions.NONE
instead.- Returns:
- the
Flux
emitting the values one by one or anempty Flux
if the key does not exist. - Throws:
IllegalArgumentException
- when one of the required arguments is null.- Since:
- 2.1
- See Also:
-
randomMember
Get random element from set atkey
.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
distinctRandomMembers
Getcount
distinct random elements from set atkey
.- Parameters:
key
- must not be null.count
- number of members to return.- Returns:
- See Also:
-
randomMembers
Getcount
random elements from set atkey
.- Parameters:
key
- must not be null.count
- number of members to return.- Returns:
- See Also:
-
delete
Removes the given key.- Parameters:
key
- must not be null.
-