Class BlockingSetCommandsImpl<K,V>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
-
- io.quarkus.redis.runtime.datasource.BlockingSetCommandsImpl<K,V>
-
- All Implemented Interfaces:
RedisCommands,SetCommands<K,V>
public class BlockingSetCommandsImpl<K,V> extends AbstractRedisCommandGroup implements SetCommands<K,V>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
ds, timeout
-
-
Constructor Summary
Constructors Constructor Description BlockingSetCommandsImpl(RedisDataSource ds, ReactiveSetCommands<K,V> reactive, Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intsadd(K key, V... values)Execute the command SADD.longscard(K key)Execute the command SCARD.Set<V>sdiff(K... keys)Execute the command SDIFF.longsdiffstore(K destination, K... keys)Execute the command SDIFFSTORE.Set<V>sinter(K... keys)Execute the command SINTER.longsintercard(int limit, K... keys)Execute the command SINTERCARD.longsintercard(K... keys)Execute the command SINTERCARD.longsinterstore(K destination, K... keys)Execute the command SINTERSTORE.booleansismember(K key, V member)Execute the command SISMEMBER.Set<V>smembers(K key)Execute the command SMEMBERS.List<Boolean>smismember(K key, V... members)Execute the command SMISMEMBER.booleansmove(K source, K destination, V member)Execute the command SMOVE.List<V>sort(K key)Execute the command SORT.List<V>sort(K key, SortArgs sortArguments)Execute the command SORT.longsortAndStore(K key, K destination)Execute the command SORT with theSTOREoption.longsortAndStore(K key, K destination, SortArgs sortArguments)Execute the command SORT with theSTOREoption.Vspop(K key)Execute the command SPOP.Set<V>spop(K key, int count)Execute the command SPOP.Vsrandmember(K key)Execute the command SRANDMEMBER.List<V>srandmember(K key, int count)Execute the command SRANDMEMBER.intsrem(K key, V... members)Execute the command SREM.SScanCursor<V>sscan(K key)Execute the command SSCAN.SScanCursor<V>sscan(K key, ScanArgs scanArgs)Execute the command SSCAN.Set<V>sunion(K... keys)Execute the command SUNION.longsunionstore(K destination, K... keys)Execute the command SUNIONSTORE.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
getDataSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommands
getDataSource
-
-
-
-
Constructor Detail
-
BlockingSetCommandsImpl
public BlockingSetCommandsImpl(RedisDataSource ds, ReactiveSetCommands<K,V> reactive, Duration timeout)
-
-
Method Detail
-
sadd
public int sadd(K key, V... values)
Description copied from interface:SetCommandsExecute the command SADD. Summary: Add one or more members to a set Group: set Requires Redis 1.0.0- Specified by:
saddin interfaceSetCommands<K,V>- Parameters:
key- the keyvalues- the values- Returns:
- the number of elements that were added to the set, not including all the elements already present in the set.
-
scard
public long scard(K key)
Description copied from interface:SetCommandsExecute the command SCARD. Summary: Get the number of members in a set Group: set Requires Redis 1.0.0- Specified by:
scardin interfaceSetCommands<K,V>- Parameters:
key- the key- Returns:
- the cardinality (number of elements) of the set, or
0key does not exist.
-
sdiff
public Set<V> sdiff(K... keys)
Description copied from interface:SetCommandsExecute the command SDIFF. Summary: Subtract multiple sets Group: set Requires Redis 1.0.0- Specified by:
sdiffin interfaceSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- list with members of the resulting set.
-
sdiffstore
public long sdiffstore(K destination, K... keys)
Description copied from interface:SetCommandsExecute the command SDIFFSTORE. Summary: Subtract multiple sets and store the resulting set in a key Group: set Requires Redis 1.0.0- Specified by:
sdiffstorein interfaceSetCommands<K,V>- Parameters:
destination- the keykeys- the keys- Returns:
- the number of elements in the resulting set.
-
sinter
public Set<V> sinter(K... keys)
Description copied from interface:SetCommandsExecute the command SINTER. Summary: Intersect multiple sets Group: set Requires Redis 1.0.0- Specified by:
sinterin interfaceSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- list with members of the resulting set.
-
sintercard
public long sintercard(K... keys)
Description copied from interface:SetCommandsExecute the command SINTERCARD. Summary: Intersect multiple sets and return the cardinality of the result Group: set Requires Redis 7.0.0- Specified by:
sintercardin interfaceSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- the number of elements in the resulting intersection.
-
sintercard
public long sintercard(int limit, K... keys)Description copied from interface:SetCommandsExecute the command SINTERCARD. Summary: Intersect multiple sets and return the cardinality of the result Group: set Requires Redis 7.0.0- Specified by:
sintercardin interfaceSetCommands<K,V>- Parameters:
limit- When provided with the optional LIMIT argument (which defaults to 0 and means unlimited), if the intersection cardinality reaches limit partway through the computation, the algorithm will exit and yield limit as the cardinality.keys- the keys- Returns:
- the number of elements in the resulting intersection.
-
sinterstore
public long sinterstore(K destination, K... keys)
Description copied from interface:SetCommandsExecute the command SINTERSTORE. Summary: Intersect multiple sets and store the resulting set in a key Group: set Requires Redis 1.0.0- Specified by:
sinterstorein interfaceSetCommands<K,V>- Parameters:
destination- the keykeys- the keys- Returns:
- the number of elements in the resulting set.
-
sismember
public boolean sismember(K key, V member)
Description copied from interface:SetCommandsExecute the command SISMEMBER. Summary: Determine if a given value is a member of a set Group: set Requires Redis 1.0.0- Specified by:
sismemberin interfaceSetCommands<K,V>- Parameters:
key- the keymember- the member to check- Returns:
truethe element is a member of the set.falsethe element is not a member of the set, or if key does not exist.
-
smembers
public Set<V> smembers(K key)
Description copied from interface:SetCommandsExecute the command SMEMBERS. Summary: Get all the members in a set Group: set Requires Redis 1.0.0- Specified by:
smembersin interfaceSetCommands<K,V>- Parameters:
key- the key- Returns:
- all elements of the set.
-
smismember
public List<Boolean> smismember(K key, V... members)
Description copied from interface:SetCommandsExecute the command SMISMEMBER. Summary: Returns the membership associated with the given elements for a set Group: set Requires Redis 6.2.0- Specified by:
smismemberin interfaceSetCommands<K,V>- Parameters:
key- the keymembers- the members to check- Returns:
- list representing the membership of the given elements, in the same order as they are requested.
-
smove
public boolean smove(K source, K destination, V member)
Description copied from interface:SetCommandsExecute the command SMOVE. Summary: Move a member from one set to another Group: set Requires Redis 1.0.0- Specified by:
smovein interfaceSetCommands<K,V>- Parameters:
source- the keydestination- the keymember- the member to move- Returns:
truethe element is moved.falsethe element is not a member of source and no operation was performed.
-
spop
public V spop(K key)
Description copied from interface:SetCommandsExecute the command SPOP. Summary: Remove and return one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
spopin interfaceSetCommands<K,V>- Parameters:
key- the key- Returns:
- the removed member, or
nullwhen key does not exist.
-
spop
public Set<V> spop(K key, int count)
Description copied from interface:SetCommandsExecute the command SPOP. Summary: Remove and return one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
spopin interfaceSetCommands<K,V>- Parameters:
key- the key- Returns:
- the removed members, or an empty array when key does not exist.
-
srandmember
public V srandmember(K key)
Description copied from interface:SetCommandsExecute the command SRANDMEMBER. Summary: Get one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
srandmemberin interfaceSetCommands<K,V>- Parameters:
key- the key- Returns:
- the randomly selected element, or
nullwhen key does not exist.
-
srandmember
public List<V> srandmember(K key, int count)
Description copied from interface:SetCommandsExecute the command SRANDMEMBER. Summary: Get one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
srandmemberin interfaceSetCommands<K,V>- Parameters:
key- the keycount- the number of elements to pick- Returns:
- an array of elements, or an empty array when key does not exist.
-
srem
public int srem(K key, V... members)
Description copied from interface:SetCommandsExecute the command SREM. Summary: Remove one or more members from a set Group: set Requires Redis 1.0.0- Specified by:
sremin interfaceSetCommands<K,V>- Parameters:
key- the key- Returns:
- the number of members that were removed from the set, not including non-existing members.
-
sunion
public Set<V> sunion(K... keys)
Description copied from interface:SetCommandsExecute the command SUNION. Summary: Add multiple sets Group: set Requires Redis 1.0.0- Specified by:
sunionin interfaceSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- list with members of the resulting set.
-
sunionstore
public long sunionstore(K destination, K... keys)
Description copied from interface:SetCommandsExecute the command SUNIONSTORE. Summary: Add multiple sets and store the resulting set in a key Group: set Requires Redis 1.0.0- Specified by:
sunionstorein interfaceSetCommands<K,V>- Parameters:
destination- the destination keykeys- the keys- Returns:
- the number of elements in the resulting set.
-
sscan
public SScanCursor<V> sscan(K key)
Description copied from interface:SetCommandsExecute the command SSCAN. Summary: Incrementally iterate Set elements Group: set Requires Redis 2.8.0- Specified by:
sscanin interfaceSetCommands<K,V>- Parameters:
key- the key- Returns:
- the cursor
-
sscan
public SScanCursor<V> sscan(K key, ScanArgs scanArgs)
Description copied from interface:SetCommandsExecute the command SSCAN. Summary: Incrementally iterate Set elements Group: set Requires Redis 2.8.0- Specified by:
sscanin interfaceSetCommands<K,V>- Parameters:
key- the keyscanArgs- the extra parameters- Returns:
- the cursor
-
sort
public List<V> sort(K key)
Description copied from interface:SetCommandsExecute the command SORT. Summary: Sort the elements in a list, set or sorted set Group: generic Requires Redis 1.0.0- Specified by:
sortin interfaceSetCommands<K,V>- Returns:
- the list of sorted elements.
-
sort
public List<V> sort(K key, SortArgs sortArguments)
Description copied from interface:SetCommandsExecute the command SORT. Summary: Sort the elements in a list, set or sorted set Group: generic Requires Redis 1.0.0- Specified by:
sortin interfaceSetCommands<K,V>- Parameters:
key- the keysortArguments- theSORTcommand extra-arguments- Returns:
- the list of sorted elements.
-
sortAndStore
public long sortAndStore(K key, K destination, SortArgs sortArguments)
Description copied from interface:SetCommandsExecute the command SORT with theSTOREoption. Summary: Sort the elements in a list, set or sorted set Group: generic Requires Redis 1.0.0- Specified by:
sortAndStorein interfaceSetCommands<K,V>sortArguments- the SORT command extra-arguments- Returns:
- the number of sorted elements in the destination list.
-
sortAndStore
public long sortAndStore(K key, K destination)
Description copied from interface:SetCommandsExecute the command SORT with theSTOREoption. Summary: Sort the elements in a list, set or sorted set Group: generic Requires Redis 1.0.0- Specified by:
sortAndStorein interfaceSetCommands<K,V>- Returns:
- the number of sorted elements in the destination list.
-
-