Interface ReactiveSetCommands
- All Known Subinterfaces:
ReactiveClusterSetCommands
public interface ReactiveSetCommands
Redis Set commands executed using reactive infrastructure.
- Since:
- 2.0
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
SADD
command parameters.static class
SDIFF
command parameters.static class
SDIFFSTORE
command parameters.static class
SINTER
command parameters.static class
SINTERSTORE
command parameters.static class
SISMEMBER
command parameters.static class
SMISMEMBER
command parameters.static class
SMOVE
command parameters.static class
SPOP
command parameters.static class
SRANDMEMBER
command parameters.static class
SREM
command parameters.static class
SUNION
command parameters.static class
SUNIONSTORE
command parameters. -
Method Summary
Modifier and TypeMethodDescriptiondefault reactor.core.publisher.Mono<Long>
sAdd
(ByteBuffer key, ByteBuffer value) Add given value to set at key.default reactor.core.publisher.Mono<Long>
sAdd
(ByteBuffer key, Collection<ByteBuffer> values) Add given values to set at key.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SAddCommand,
Long>> sAdd
(org.reactivestreams.Publisher<ReactiveSetCommands.SAddCommand> commands) Add givenReactiveSetCommands.SAddCommand.getValues()
to set atReactiveRedisConnection.KeyCommand.getKey()
.default reactor.core.publisher.Mono<Long>
sCard
(ByteBuffer key) Get size of set at key.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,
Long>> sCard
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get size of set atReactiveRedisConnection.KeyCommand.getKey()
.default reactor.core.publisher.Flux<ByteBuffer>
sDiff
(Collection<ByteBuffer> keys) Returns the diff of the members of all given sets at keys.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SDiffCommand,
reactor.core.publisher.Flux<ByteBuffer>>> sDiff
(org.reactivestreams.Publisher<ReactiveSetCommands.SDiffCommand> commands) Returns the diff of the members of all given sets atReactiveSetCommands.SInterCommand.getKeys()
.default reactor.core.publisher.Mono<Long>
sDiffStore
(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Diff all given sets at keys and store result in destinationKey.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SDiffStoreCommand,
Long>> sDiffStore
(org.reactivestreams.Publisher<ReactiveSetCommands.SDiffStoreCommand> commands) Diff all given sets at keys and store result in destinationKey.default reactor.core.publisher.Flux<ByteBuffer>
sInter
(Collection<ByteBuffer> keys) Returns the members intersecting all given sets at keys.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SInterCommand,
reactor.core.publisher.Flux<ByteBuffer>>> sInter
(org.reactivestreams.Publisher<ReactiveSetCommands.SInterCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.default reactor.core.publisher.Mono<Long>
sInterStore
(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Intersect all given sets at keys and store result in destinationKey.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SInterStoreCommand,
Long>> sInterStore
(org.reactivestreams.Publisher<ReactiveSetCommands.SInterStoreCommand> commands) Intersect all given sets at keys and store result in destinationKey.default reactor.core.publisher.Mono<Boolean>
sIsMember
(ByteBuffer key, ByteBuffer value) Check if set at key contains value.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveSetCommands.SIsMemberCommand>>
sIsMember
(org.reactivestreams.Publisher<ReactiveSetCommands.SIsMemberCommand> commands) Check if set atReactiveRedisConnection.KeyCommand.getKey()
containsReactiveSetCommands.SIsMemberCommand.getValue()
.default reactor.core.publisher.Flux<ByteBuffer>
sMembers
(ByteBuffer key) Get all elements of set at key.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,
reactor.core.publisher.Flux<ByteBuffer>>> sMembers
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get all elements of set atReactiveRedisConnection.KeyCommand.getKey()
.sMIsMember
(ByteBuffer key, List<ByteBuffer> values) Check if set atkey
contains one or morevalues
.reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveSetCommands.SMIsMemberCommand,
Boolean>> sMIsMember
(org.reactivestreams.Publisher<ReactiveSetCommands.SMIsMemberCommand> commands) Check if set atReactiveRedisConnection.KeyCommand.getKey()
containsReactiveSetCommands.SMIsMemberCommand.getValues()
.default reactor.core.publisher.Mono<Boolean>
sMove
(ByteBuffer sourceKey, ByteBuffer destinationKey, ByteBuffer value) Move value from sourceKey to destinationKeyreactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveSetCommands.SMoveCommand>>
sMove
(org.reactivestreams.Publisher<ReactiveSetCommands.SMoveCommand> commands) default reactor.core.publisher.Mono<ByteBuffer>
sPop
(ByteBuffer key) Remove and return a random member from set at key.default reactor.core.publisher.Flux<ByteBuffer>
sPop
(ByteBuffer key, long count) Remove and returncount
random members from set atkey
.reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.KeyCommand>>
sPop
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Remove and return a random member from set atReactiveRedisConnection.KeyCommand.getKey()
reactor.core.publisher.Flux<ByteBuffer>
sPop
(ReactiveSetCommands.SPopCommand command) Remove and return a random member from set at key.default reactor.core.publisher.Mono<ByteBuffer>
sRandMember
(ByteBuffer key) Get random element from set at key.default reactor.core.publisher.Flux<ByteBuffer>
sRandMember
(ByteBuffer key, Long count) Get count random elements from set at key.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SRandMembersCommand,
reactor.core.publisher.Flux<ByteBuffer>>> sRandMember
(org.reactivestreams.Publisher<ReactiveSetCommands.SRandMembersCommand> commands) GetReactiveSetCommands.SRandMembersCommand.getCount()
random elements from set atReactiveRedisConnection.KeyCommand.getKey()
.default reactor.core.publisher.Mono<Long>
sRem
(ByteBuffer key, ByteBuffer value) Remove given value from set at key and return the number of removed elements.default reactor.core.publisher.Mono<Long>
sRem
(ByteBuffer key, Collection<ByteBuffer> values) Remove given values from set at key and return the number of removed elements.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SRemCommand,
Long>> sRem
(org.reactivestreams.Publisher<ReactiveSetCommands.SRemCommand> commands) Remove givenReactiveSetCommands.SRemCommand.getValues()
from set atReactiveRedisConnection.KeyCommand.getKey()
.default reactor.core.publisher.Flux<ByteBuffer>
sScan
(ByteBuffer key) Use aFlux
to iterate over members in the set atkey
.default reactor.core.publisher.Flux<ByteBuffer>
sScan
(ByteBuffer key, ScanOptions options) reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,
reactor.core.publisher.Flux<ByteBuffer>>> sScan
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyScanCommand> commands) Use aFlux
to iterate over members in the set atkey
.default reactor.core.publisher.Flux<ByteBuffer>
sUnion
(Collection<ByteBuffer> keys) Returns the members intersecting all given sets at keys.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SUnionCommand,
reactor.core.publisher.Flux<ByteBuffer>>> sUnion
(org.reactivestreams.Publisher<ReactiveSetCommands.SUnionCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.default reactor.core.publisher.Mono<Long>
sUnionStore
(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Union all given sets at keys and store result in destinationKey.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SUnionStoreCommand,
Long>> sUnionStore
(org.reactivestreams.Publisher<ReactiveSetCommands.SUnionStoreCommand> commands) Union all given sets at keys and store result in destinationKey.
-
Method Details
-
sAdd
Add given value to set at key.- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- See Also:
-
sAdd
Add given values to set at key.- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- See Also:
-
sAdd
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SAddCommand,Long>> sAdd(org.reactivestreams.Publisher<ReactiveSetCommands.SAddCommand> commands) Add givenReactiveSetCommands.SAddCommand.getValues()
to set atReactiveRedisConnection.KeyCommand.getKey()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sRem
Remove given value from set at key and return the number of removed elements.- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- See Also:
-
sRem
Remove given values from set at key and return the number of removed elements.- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- See Also:
-
sRem
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SRemCommand,Long>> sRem(org.reactivestreams.Publisher<ReactiveSetCommands.SRemCommand> commands) Remove givenReactiveSetCommands.SRemCommand.getValues()
from set atReactiveRedisConnection.KeyCommand.getKey()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sPop
Remove and return a random member from set at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sPop
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:
- See Also:
-
sPop
Remove and return a random member from set at key.- Parameters:
command
- must not be null.- Returns:
- See Also:
-
sPop
reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.KeyCommand>> sPop(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Remove and return a random member from set atReactiveRedisConnection.KeyCommand.getKey()
- Parameters:
commands
-- Returns:
- See Also:
-
sMove
default reactor.core.publisher.Mono<Boolean> sMove(ByteBuffer sourceKey, ByteBuffer destinationKey, ByteBuffer value) Move value from sourceKey to destinationKey- Parameters:
sourceKey
- must not be null.destinationKey
- must not be null.value
- must not be null.- Returns:
- See Also:
-
sMove
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveSetCommands.SMoveCommand>> sMove(org.reactivestreams.Publisher<ReactiveSetCommands.SMoveCommand> commands) MoveReactiveSetCommands.SMoveCommand.getValue()
fromReactiveRedisConnection.KeyCommand.getKey()
toReactiveSetCommands.SMoveCommand.getDestination()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sCard
Get size of set at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sCard
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,Long>> sCard(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get size of set atReactiveRedisConnection.KeyCommand.getKey()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sIsMember
Check if set at key contains value.- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- See Also:
-
sIsMember
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveSetCommands.SIsMemberCommand>> sIsMember(org.reactivestreams.Publisher<ReactiveSetCommands.SIsMemberCommand> commands) Check if set atReactiveRedisConnection.KeyCommand.getKey()
containsReactiveSetCommands.SIsMemberCommand.getValue()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sMIsMember
default reactor.core.publisher.Mono<List<Boolean>> sMIsMember(ByteBuffer key, List<ByteBuffer> values) Check if set atkey
contains one or morevalues
.- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
sMIsMember
reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveSetCommands.SMIsMemberCommand,Boolean>> sMIsMember(org.reactivestreams.Publisher<ReactiveSetCommands.SMIsMemberCommand> commands) Check if set atReactiveRedisConnection.KeyCommand.getKey()
containsReactiveSetCommands.SMIsMemberCommand.getValues()
.- Parameters:
commands
- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
sInter
Returns the members intersecting all given sets at keys.- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
sInter
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SInterCommand,reactor.core.publisher.Flux<ByteBuffer>>> sInter(org.reactivestreams.Publisher<ReactiveSetCommands.SInterCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sInterStore
default reactor.core.publisher.Mono<Long> sInterStore(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Intersect all given sets at keys and store result in destinationKey.- Parameters:
destinationKey
- must not be null.keys
- must not be null.- Returns:
- size of set stored a destinationKey.
- See Also:
-
sInterStore
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SInterStoreCommand,Long>> sInterStore(org.reactivestreams.Publisher<ReactiveSetCommands.SInterStoreCommand> commands) Intersect all given sets at keys and store result in destinationKey.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sUnion
Returns the members intersecting all given sets at keys.- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
sUnion
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SUnionCommand,reactor.core.publisher.Flux<ByteBuffer>>> sUnion(org.reactivestreams.Publisher<ReactiveSetCommands.SUnionCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sUnionStore
default reactor.core.publisher.Mono<Long> sUnionStore(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Union all given sets at keys and store result in destinationKey.- Parameters:
destinationKey
- must not be null.keys
- must not be null.- Returns:
- size of set stored a destinationKey.
- See Also:
-
sUnionStore
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SUnionStoreCommand,Long>> sUnionStore(org.reactivestreams.Publisher<ReactiveSetCommands.SUnionStoreCommand> commands) Union all given sets at keys and store result in destinationKey.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sDiff
Returns the diff of the members of all given sets at keys.- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
sDiff
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SDiffCommand,reactor.core.publisher.Flux<ByteBuffer>>> sDiff(org.reactivestreams.Publisher<ReactiveSetCommands.SDiffCommand> commands) Returns the diff of the members of all given sets atReactiveSetCommands.SInterCommand.getKeys()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sDiffStore
default reactor.core.publisher.Mono<Long> sDiffStore(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Diff all given sets at keys and store result in destinationKey.- Parameters:
destinationKey
- must not be null.keys
- must not be null.- Returns:
- size of set stored a destinationKey.
- See Also:
-
sDiffStore
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SDiffStoreCommand,Long>> sDiffStore(org.reactivestreams.Publisher<ReactiveSetCommands.SDiffStoreCommand> commands) Diff all given sets at keys and store result in destinationKey.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sMembers
Get all elements of set at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sMembers
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,reactor.core.publisher.Flux<ByteBuffer>>> sMembers(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get all elements of set atReactiveRedisConnection.KeyCommand.getKey()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sScan
Use aFlux
to iterate over members 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 rawmembers
one by one. - Throws:
IllegalArgumentException
- when options is null.- Since:
- 2.1
- See Also:
-
sScan
Use aFlux
to iterate over members 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 rawmembers
one by one. - Throws:
IllegalArgumentException
- when one of the required arguments is null.- Since:
- 2.1
- See Also:
-
sScan
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,reactor.core.publisher.Flux<ByteBuffer>>> sScan(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyScanCommand> commands) Use aFlux
to iterate over members in the set atkey
. The resultingFlux
acts as a cursor and issuesSSCAN
commands itself as long as the subscriber signals demand.- Parameters:
commands
- must not be null.- Returns:
- Since:
- 2.1
- See Also:
-
sRandMember
Get random element from set at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sRandMember
Get count random elements from set at key.- Parameters:
key
- must not be null.count
- must not be null.- Returns:
- See Also:
-
sRandMember
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SRandMembersCommand,reactor.core.publisher.Flux<ByteBuffer>>> sRandMember(org.reactivestreams.Publisher<ReactiveSetCommands.SRandMembersCommand> commands) GetReactiveSetCommands.SRandMembersCommand.getCount()
random elements from set atReactiveRedisConnection.KeyCommand.getKey()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-