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
Nested ClassesModifier 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 TypeMethodDescriptionsAdd
(ByteBuffer key, ByteBuffer value) Add given value to set at key.sAdd
(ByteBuffer key, Collection<ByteBuffer> values) Add given values to set at key.sAdd
(Publisher<ReactiveSetCommands.SAddCommand> commands) Add givenReactiveSetCommands.SAddCommand.getValues()
to set atReactiveRedisConnection.KeyCommand.getKey()
.sCard
(ByteBuffer key) Get size of set at key.sCard
(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get size of set atReactiveRedisConnection.KeyCommand.getKey()
.default Flux<ByteBuffer>
sDiff
(Collection<ByteBuffer> keys) Returns the diff of the members of all given sets at keys.sDiff
(Publisher<ReactiveSetCommands.SDiffCommand> commands) Returns the diff of the members of all given sets atReactiveSetCommands.SInterCommand.getKeys()
.sDiffStore
(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Diff all given sets at keys and store result in destinationKey.Diff all given sets at keys and store result in destinationKey.default Flux<ByteBuffer>
sInter
(Collection<ByteBuffer> keys) Returns the members intersecting all given sets at keys.sInter
(Publisher<ReactiveSetCommands.SInterCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.sInterStore
(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Intersect all given sets at keys and store result in destinationKey.Intersect all given sets at keys and store result in destinationKey.sIsMember
(ByteBuffer key, ByteBuffer value) Check if set at key contains value.Check if set atReactiveRedisConnection.KeyCommand.getKey()
containsReactiveSetCommands.SIsMemberCommand.getValue()
.default Flux<ByteBuffer>
sMembers
(ByteBuffer key) Get all elements of set at key.sMembers
(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
.Check if set atReactiveRedisConnection.KeyCommand.getKey()
containsReactiveSetCommands.SMIsMemberCommand.getValues()
.sMove
(ByteBuffer sourceKey, ByteBuffer destinationKey, ByteBuffer value) Move value from sourceKey to destinationKeysMove
(Publisher<ReactiveSetCommands.SMoveCommand> commands) default Mono<ByteBuffer>
sPop
(ByteBuffer key) Remove and return a random member from set at key.default Flux<ByteBuffer>
sPop
(ByteBuffer key, long count) Remove and returncount
random members from set atkey
.sPop
(Publisher<ReactiveRedisConnection.KeyCommand> commands) Remove and return a random member from set atReactiveRedisConnection.KeyCommand.getKey()
sPop
(ReactiveSetCommands.SPopCommand command) Remove and return a random member from set at key.default Mono<ByteBuffer>
sRandMember
(ByteBuffer key) Get random element from set at key.default Flux<ByteBuffer>
sRandMember
(ByteBuffer key, Long count) Get count random elements from set at key.Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SRandMembersCommand,
Flux<ByteBuffer>>> GetReactiveSetCommands.SRandMembersCommand.getCount()
random elements from set atReactiveRedisConnection.KeyCommand.getKey()
.sRem
(ByteBuffer key, ByteBuffer value) Remove given value from set at key and return the number of removed elements.sRem
(ByteBuffer key, Collection<ByteBuffer> values) Remove given values from set at key and return the number of removed elements.sRem
(Publisher<ReactiveSetCommands.SRemCommand> commands) Remove givenReactiveSetCommands.SRemCommand.getValues()
from set atReactiveRedisConnection.KeyCommand.getKey()
.default Flux<ByteBuffer>
sScan
(ByteBuffer key) Use aFlux
to iterate over members in the set atkey
.default Flux<ByteBuffer>
sScan
(ByteBuffer key, ScanOptions options) sScan
(Publisher<ReactiveRedisConnection.KeyScanCommand> commands) Use aFlux
to iterate over members in the set atkey
.default Flux<ByteBuffer>
sUnion
(Collection<ByteBuffer> keys) Returns the members intersecting all given sets at keys.sUnion
(Publisher<ReactiveSetCommands.SUnionCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.sUnionStore
(ByteBuffer destinationKey, Collection<ByteBuffer> keys) Union all given sets at keys and store result in destinationKey.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
Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SAddCommand,Long>> sAdd(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
Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SRemCommand,Long>> sRem(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
Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.KeyCommand>> sPop(Publisher<ReactiveRedisConnection.KeyCommand> commands) Remove and return a random member from set atReactiveRedisConnection.KeyCommand.getKey()
- Parameters:
commands
-- Returns:
- See Also:
-
sMove
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
Flux<ReactiveRedisConnection.BooleanResponse<ReactiveSetCommands.SMoveCommand>> sMove(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
Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,Long>> sCard(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
Flux<ReactiveRedisConnection.BooleanResponse<ReactiveSetCommands.SIsMemberCommand>> sIsMember(Publisher<ReactiveSetCommands.SIsMemberCommand> commands) Check if set atReactiveRedisConnection.KeyCommand.getKey()
containsReactiveSetCommands.SIsMemberCommand.getValue()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sMIsMember
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
Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveSetCommands.SMIsMemberCommand,Boolean>> sMIsMember(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
Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SInterCommand,Flux<ByteBuffer>>> sInter(Publisher<ReactiveSetCommands.SInterCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sInterStore
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
Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SInterStoreCommand,Long>> sInterStore(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
Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SUnionCommand,Flux<ByteBuffer>>> sUnion(Publisher<ReactiveSetCommands.SUnionCommand> commands) Returns the members intersecting all given sets atReactiveSetCommands.SInterCommand.getKeys()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
sUnionStore
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
Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SUnionStoreCommand,Long>> sUnionStore(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
Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SDiffCommand,Flux<ByteBuffer>>> sDiff(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
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
Flux<ReactiveRedisConnection.NumericResponse<ReactiveSetCommands.SDiffStoreCommand,Long>> sDiffStore(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
Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<ByteBuffer>>> sMembers(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
Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<ByteBuffer>>> sScan(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
Flux<ReactiveRedisConnection.CommandResponse<ReactiveSetCommands.SRandMembersCommand,Flux<ByteBuffer>>> sRandMember(Publisher<ReactiveSetCommands.SRandMembersCommand> commands) GetReactiveSetCommands.SRandMembersCommand.getCount()
random elements from set atReactiveRedisConnection.KeyCommand.getKey()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-