Class BlockingListCommandsImpl<K,V>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
-
- io.quarkus.redis.runtime.datasource.BlockingListCommandsImpl<K,V>
-
- All Implemented Interfaces:
ListCommands<K,V>,RedisCommands
public class BlockingListCommandsImpl<K,V> extends AbstractRedisCommandGroup implements ListCommands<K,V>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
ds, timeout
-
-
Constructor Summary
Constructors Constructor Description BlockingListCommandsImpl(RedisDataSource ds, ReactiveListCommands<K,V> reactive, Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vblmove(K source, K destination, Position positionInSource, Position positionInDest, Duration timeout)Execute the command BLMOVE.List<KeyValue<K,V>>blmpop(Duration timeout, Position position, int count, K... keys)Execute the command BLMPOP.KeyValue<K,V>blmpop(Duration timeout, Position position, K... keys)Execute the command BLMPOP.KeyValue<K,V>blpop(Duration timeout, K... keys)Execute the command BLPOP.KeyValue<K,V>brpop(Duration timeout, K... keys)Execute the command BRPOP.Vbrpoplpush(Duration timeout, K source, K destination)Execute the command BRPOPLPUSH.Vlindex(K key, long index)Execute the command LINDEX.longlinsertAfterPivot(K key, V pivot, V element)Execute the command LINSERT.longlinsertBeforePivot(K key, V pivot, V element)Execute the command LINSERT.longllen(K key)Execute the command LLEN.Vlmove(K source, K destination, Position positionInSource, Position positionInDestination)Execute the command LMOVE.List<KeyValue<K,V>>lmpop(Position position, int count, K... keys)Execute the command LMPOP.KeyValue<K,V>lmpop(Position position, K... keys)Execute the command LMPOP.Vlpop(K key)Execute the command LPOP.List<V>lpop(K key, int count)Execute the command LPOP.OptionalLonglpos(K key, V element)Execute the command LPOS.List<Long>lpos(K key, V element, int count)Execute the command LPOS.List<Long>lpos(K key, V element, int count, LPosArgs args)Execute the command LPOS.OptionalLonglpos(K key, V element, LPosArgs args)Execute the command LPOS.longlpush(K key, V... elements)Execute the command LPUSH.longlpushx(K key, V... elements)Execute the command LPUSHX.List<V>lrange(K key, long start, long stop)Execute the command LRANGE.longlrem(K key, long count, V element)Execute the command LREM.voidlset(K key, long index, V element)Execute the command LSET.voidltrim(K key, long start, long stop)Execute the command LTRIM.Vrpop(K key)Execute the command RPOP.List<V>rpop(K key, int count)Execute the command RPOP.Vrpoplpush(K source, K destination)Execute the command RPOPLPUSH.longrpush(K key, V... values)Execute the command RPUSH.longrpushx(K key, V... values)Execute the command RPUSHX.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.-
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
-
BlockingListCommandsImpl
public BlockingListCommandsImpl(RedisDataSource ds, ReactiveListCommands<K,V> reactive, Duration timeout)
-
-
Method Detail
-
blmove
public V blmove(K source, K destination, Position positionInSource, Position positionInDest, Duration timeout)
Description copied from interface:ListCommandsExecute the command BLMOVE. Summary: Pop an element from a list, push it to another list and return it; or block until one is available Group: list Requires Redis 6.2.0- Specified by:
blmovein interfaceListCommands<K,V>- Parameters:
source- the keydestination- the keypositionInSource- the position of the element in the source,LEFTmeans the first element,RIGHTmeans the last element.positionInDest- the position of the element in the destination,LEFTmeans the first element,RIGHTmeans the last element.timeout- the operation timeout (in seconds)- Returns:
- the element being popped from source and pushed to destination. If timeout is reached, a Null reply is returned.
-
blmpop
public KeyValue<K,V> blmpop(Duration timeout, Position position, K... keys)
Description copied from interface:ListCommandsExecute the command BLMPOP. Summary: Pop elements from a list, or block until one is available Group: list Requires Redis 7.0.0- Specified by:
blmpopin interfaceListCommands<K,V>- Parameters:
timeout- the operation timeout (in seconds)position- whether if the element must be popped from the beginning of the list (LEFT) or from the end (RIGHT)keys- the keys from which the element must be popped- Returns:
nullwhen no element could be popped, and timeout is reached, otherwise the key/value structure
-
blmpop
public List<KeyValue<K,V>> blmpop(Duration timeout, Position position, int count, K... keys)
Description copied from interface:ListCommandsExecute the command BLMPOP. Summary: Pop elements from a list, or block until one is available Group: list Requires Redis 7.0.0- Specified by:
blmpopin interfaceListCommands<K,V>- Parameters:
timeout- the operation timeout (in seconds)position- whether if the element must be popped from the beginning of the list (LEFT) or from the end (RIGHT)count- the number of element to popkeys- the keys from which the element must be popped- Returns:
nullwhen no element could be popped, and timeout is reached, otherwise the list of key/value structures
-
blpop
public KeyValue<K,V> blpop(Duration timeout, K... keys)
Description copied from interface:ListCommandsExecute the command BLPOP. Summary: Remove and get the first element in a list, or block until one is available Group: list Requires Redis 2.0.0- Specified by:
blpopin interfaceListCommands<K,V>- Parameters:
timeout- the operation timeout (in seconds)keys- the keys from which the element must be popped- Returns:
- A
nullmulti-bulk when no element could be popped and the timeout expired, otherwise the key/value structure.
-
brpop
public KeyValue<K,V> brpop(Duration timeout, K... keys)
Description copied from interface:ListCommandsExecute the command BRPOP. Summary: Remove and get the last element in a list, or block until one is available Group: list Requires Redis 2.0.0- Specified by:
brpopin interfaceListCommands<K,V>- Parameters:
timeout- the operation timeout (in seconds)keys- the keys from which the element must be popped- Returns:
- A
nullmulti-bulk when no element could be popped and the timeout expired, otherwise the key/value structure.
-
brpoplpush
public V brpoplpush(Duration timeout, K source, K destination)
Description copied from interface:ListCommandsExecute the command BRPOPLPUSH. Summary: Pop an element from a list, push it to another list and return it; or block until one is available Group: list Requires Redis 2.2.0- Specified by:
brpoplpushin interfaceListCommands<K,V>- Parameters:
timeout- the timeout, in secondssource- the source keydestination- the detination key- Returns:
- the element being popped from source and pushed to destination. If timeout is reached, a Null reply is returned.
-
lindex
public V lindex(K key, long index)
Description copied from interface:ListCommandsExecute the command LINDEX. Summary: Get an element from a list by its index Group: list Requires Redis 1.0.0- Specified by:
lindexin interfaceListCommands<K,V>- Parameters:
key- the keyindex- the index- Returns:
- the requested element, or
nullwhen index is out of range.
-
linsertBeforePivot
public long linsertBeforePivot(K key, V pivot, V element)
Description copied from interface:ListCommandsExecute the command LINSERT. Summary: Insert an element before another element in a list Group: list Requires Redis 2.2.0- Specified by:
linsertBeforePivotin interfaceListCommands<K,V>- Parameters:
key- the keypivot- the pivot, i.e. the position referenceelement- the element to insert- Returns:
- the length of the list after the insert operation, or -1 when the value
pivotwas not found.
-
linsertAfterPivot
public long linsertAfterPivot(K key, V pivot, V element)
Description copied from interface:ListCommandsExecute the command LINSERT. Summary: Insert an element after another element in a list Group: list Requires Redis 2.2.0- Specified by:
linsertAfterPivotin interfaceListCommands<K,V>- Parameters:
key- the keypivot- the pivot, i.e. the position referenceelement- the element to insert- Returns:
- the length of the list after the insert operation, or -1 when the value
pivotwas not found.
-
llen
public long llen(K key)
Description copied from interface:ListCommandsExecute the command LLEN. Summary: Get the length of a list Group: list Requires Redis 1.0.0- Specified by:
llenin interfaceListCommands<K,V>- Parameters:
key- the key- Returns:
- the length of the list at key, if the list is empty, 0 is returned.
-
lmove
public V lmove(K source, K destination, Position positionInSource, Position positionInDestination)
Description copied from interface:ListCommandsExecute the command LMOVE. Summary: Pop an element from a list, push it to another list and return it Group: list Requires Redis 6.2.0- Specified by:
lmovein interfaceListCommands<K,V>- Parameters:
source- the keydestination- the keypositionInSource- the position of the element to pop in the source (LEFT: first element, RIGHT: last element)positionInDestination- the position of the element to insert in the destination (LEFT: first element, RIGHT: last element)- Returns:
- the element being popped and pushed.
-
lmpop
public KeyValue<K,V> lmpop(Position position, K... keys)
Description copied from interface:ListCommandsExecute the command LMPOP. Summary: Pop one element from the first non-empty list Group: list Requires Redis 7.0.0- Specified by:
lmpopin interfaceListCommands<K,V>- Parameters:
position- the position of the item to pop (LEFT: beginning ot the list, RIGHT: end of the list)keys- the keys from which the item will be popped, must not be empty- Returns:
- A
nullwhen no element could be popped. AKeyValuewith the key and popped value.
-
lmpop
public List<KeyValue<K,V>> lmpop(Position position, int count, K... keys)
Description copied from interface:ListCommandsExecute the command LMPOP. Summary: Popcountelements from the first non-empty list Group: list Requires Redis 7.0.0- Specified by:
lmpopin interfaceListCommands<K,V>- Parameters:
position- the position of the item to pop (LEFT: beginning ot the list, RIGHT: end of the list)count- the number of items to popkeys- the keys from which the item will be popped, must not be empty- Returns:
emptywhen no element could be popped. A list ofKeyValuewith at most count items.
-
lpop
public V lpop(K key)
Description copied from interface:ListCommandsExecute the command LPOP. Summary: Remove and get the first elements in a list Group: list Requires Redis 1.0.0- Specified by:
lpopin interfaceListCommands<K,V>- Parameters:
key- the key- Returns:
- the value of the first element, or
nullwhen key does not exist.
-
lpop
public List<V> lpop(K key, int count)
Description copied from interface:ListCommandsExecute the command LPOP. Summary: Remove and get the first elements in a list Group: list Requires Redis 1.0.0- Specified by:
lpopin interfaceListCommands<K,V>- Parameters:
key- the keycount- the number of element to pop- Returns:
- the popped elements (at most
count), oremptywhen key does not exist.
-
lpos
public OptionalLong lpos(K key, V element)
Description copied from interface:ListCommandsExecute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6- Specified by:
lposin interfaceListCommands<K,V>- Parameters:
key- the keyelement- the element to find- Returns:
- The command returns the integer representing the matching element, or
emptyif there is no match.
-
lpos
public OptionalLong lpos(K key, V element, LPosArgs args)
Description copied from interface:ListCommandsExecute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6- Specified by:
lposin interfaceListCommands<K,V>- Parameters:
key- the keyelement- the element to findargs- the extra command parameter- Returns:
- The command returns the integer representing the matching element, or
emptyif there is no match.
-
lpos
public List<Long> lpos(K key, V element, int count)
Description copied from interface:ListCommandsExecute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6- Specified by:
lposin interfaceListCommands<K,V>- Parameters:
key- the keyelement- the element to findcount- the number of occurrence to find- Returns:
- the list of positions (empty if there are no matches).
-
lpos
public List<Long> lpos(K key, V element, int count, LPosArgs args)
Description copied from interface:ListCommandsExecute the command LPOS. Summary: Return the index of matching elements on a list Group: list Requires Redis 6.0.6- Specified by:
lposin interfaceListCommands<K,V>- Parameters:
key- the keyelement- the element to findcount- the number of occurrence to find- Returns:
- the list of positions (empty if there are no matches).
-
lpush
public long lpush(K key, V... elements)
Description copied from interface:ListCommandsExecute the command LPUSH. Summary: Prepend one or multiple elements to a list Group: list Requires Redis 1.0.0- Specified by:
lpushin interfaceListCommands<K,V>- Parameters:
key- the keyelements- the elements to add- Returns:
- the length of the list after the push operations.
-
lpushx
public long lpushx(K key, V... elements)
Description copied from interface:ListCommandsExecute the command LPUSHX. Summary: Prepend an element to a list, only if the list exists Group: list Requires Redis 2.2.0- Specified by:
lpushxin interfaceListCommands<K,V>- Parameters:
key- the keyelements- the elements to add- Returns:
- the length of the list after the push operation.
-
lrange
public List<V> lrange(K key, long start, long stop)
Description copied from interface:ListCommandsExecute the command LRANGE. Summary: Get a range of elements from a list Group: list Requires Redis 1.0.0- Specified by:
lrangein interfaceListCommands<K,V>- Parameters:
key- the keystart- the starting positionstop- the last position- Returns:
- list of elements in the specified range.
-
lrem
public long lrem(K key, long count, V element)
Description copied from interface:ListCommandsExecute the command LREM. Summary: Remove elements from a list Group: list Requires Redis 1.0.0- Specified by:
lremin interfaceListCommands<K,V>- Parameters:
key- the keycount- the number of occurence to remove, following the given rules: if count > 0: Remove elements equal to element moving from head to tail. if count < 0: Remove elements equal to element moving from tail to head. if count = 0: Remove all elements equal to element.element- the element to remove- Returns:
- the number of removed elements.
-
lset
public void lset(K key, long index, V element)
Description copied from interface:ListCommandsExecute the command LSET. Summary: Set the value of an element in a list by its index Group: list Requires Redis 1.0.0- Specified by:
lsetin interfaceListCommands<K,V>- Parameters:
key- the keyindex- the indexelement- the element to insert
-
ltrim
public void ltrim(K key, long start, long stop)
Description copied from interface:ListCommandsExecute the command LTRIM. Summary: Trim a list to the specified range Group: list Requires Redis 1.0.0- Specified by:
ltrimin interfaceListCommands<K,V>- Parameters:
key- the keystart- the starting indexstop- the last index
-
rpop
public V rpop(K key)
Description copied from interface:ListCommandsExecute the command RPOP. Summary: Remove and get the last elements in a list Group: list Requires Redis 1.0.0- Specified by:
rpopin interfaceListCommands<K,V>- Parameters:
key- the key- Returns:
- the value of the last element, or
nullwhen key does not exist.
-
rpop
public List<V> rpop(K key, int count)
Description copied from interface:ListCommandsExecute the command RPOP. Summary: Remove and get the last elements in a list Group: list Requires Redis 1.0.0- Specified by:
rpopin interfaceListCommands<K,V>- Parameters:
key- the keycount- the number of element to pop- Returns:
- the list of popped elements, or
nullwhen key does not exist.
-
rpoplpush
public V rpoplpush(K source, K destination)
Description copied from interface:ListCommandsExecute the command RPOPLPUSH. Summary: Remove the last element in a list, prepend it to another list and return it Group: list Requires Redis 1.2.0- Specified by:
rpoplpushin interfaceListCommands<K,V>- Parameters:
source- the keydestination- the key- Returns:
- the element being popped and pushed, or
nullif the source does not exist
-
rpush
public long rpush(K key, V... values)
Description copied from interface:ListCommandsExecute the command RPUSH. Summary: Append one or multiple elements to a list Group: list Requires Redis 1.0.0- Specified by:
rpushin interfaceListCommands<K,V>- Parameters:
key- the keyvalues- the values to add to the list- Returns:
- the length of the list after the push operation.
-
rpushx
public long rpushx(K key, V... values)
Description copied from interface:ListCommandsExecute the command RPUSHX. Summary: Append an element to a list, only if the list exists Group: list Requires Redis 2.2.0- Specified by:
rpushxin interfaceListCommands<K,V>- Parameters:
key- the keyvalues- the values to add to the list- Returns:
- the length of the list after the push operation.
-
sort
public List<V> sort(K key)
Description copied from interface:ListCommandsExecute the command SORT. Summary: Sort the elements in a list, set or sorted set Group: generic Requires Redis 1.0.0- Specified by:
sortin interfaceListCommands<K,V>- Returns:
- the list of sorted elements.
-
sort
public List<V> sort(K key, SortArgs sortArguments)
Description copied from interface:ListCommandsExecute the command SORT. Summary: Sort the elements in a list, set or sorted set Group: generic Requires Redis 1.0.0- Specified by:
sortin interfaceListCommands<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:ListCommandsExecute 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 interfaceListCommands<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:ListCommandsExecute 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 interfaceListCommands<K,V>- Returns:
- the number of sorted elements in the destination list.
-
-