Class BlockingTopKCommandsImpl<K,V>
java.lang.Object
io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
io.quarkus.redis.runtime.datasource.BlockingTopKCommandsImpl<K,V>
- All Implemented Interfaces:
RedisCommands
,TopKCommands<K,
V>
public class BlockingTopKCommandsImpl<K,V>
extends AbstractRedisCommandGroup
implements TopKCommands<K,V>
-
Field Summary
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
ds, timeout
-
Constructor Summary
ConstructorDescriptionBlockingTopKCommandsImpl
(RedisDataSource ds, ReactiveTopKCommands<K, V> reactive, Duration timeout) -
Method Summary
Modifier and TypeMethodDescriptionExecute the command TOPK.ADD.Execute the command TOPK.ADD.topkIncrBy
(K key, Map<V, Integer> couples) Execute the command TOPK.INCRBY.topkIncrBy
(K key, V item, int increment) Execute the command TOPK.INCRBY.Execute the command TOPK.LIST.topkListWithCount
(K key) Execute the command TOPK.LIST.boolean
Execute the command TOPK.QUERY.Execute the command TOPK.QUERY.void
topkReserve
(K key, int topk) Execute the command TOPK.RESERVE.void
topkReserve
(K key, int topk, int width, int depth, double decay) Execute the command TOPK.RESERVE.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 Details
-
BlockingTopKCommandsImpl
public BlockingTopKCommandsImpl(RedisDataSource ds, ReactiveTopKCommands<K, V> reactive, Duration timeout)
-
-
Method Details
-
topkAdd
Description copied from interface:TopKCommands
Execute the command TOPK.ADD. Summary: Adds an item to the data structure. Multiple items can be added at once. If an item enters the Top-K list, the item which is expelled is returned. This allows dynamic heavy-hitter detection of items being entered or expelled from Top-K list. Group: top-k- Specified by:
topkAdd
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list where item is added, must not benull
item
- the item to add, must not benull
- Returns:
- an optional containing the item that get expelled if any, empty otherwise
-
topkAdd
Description copied from interface:TopKCommands
Execute the command TOPK.ADD. Summary: Adds an item to the data structure. Multiple items can be added at once. If an item enters the Top-K list, the item which is expelled is returned. This allows dynamic heavy-hitter detection of items being entered or expelled from Top-K list. Group: top-k- Specified by:
topkAdd
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list where item is added, must not benull
items
- the items to add, must not benull
, must not be empty, must not containnull
- Returns:
- a list containing for each corresponding added item the expelled item if any,
null
otherwise.
-
topkIncrBy
Description copied from interface:TopKCommands
Execute the command TOPK.INCRBY. Summary: Increase the score of an item in the data structure by increment. Multiple items' score can be increased at once. If an item enters the Top-K list, the item which is expelled is returned. Group: top-k- Specified by:
topkIncrBy
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list where item is added, must not benull
item
- the item to add, must not benull
increment
- increment to current item score. Increment must be greater or equal to 1. Increment is limited to 100,000 to avoid server freeze.- Returns:
- an optional containing the item that get expelled if any, empty otherwise
-
topkIncrBy
Description copied from interface:TopKCommands
Execute the command TOPK.INCRBY. Summary: Increase the score of an item in the data structure by increment. Multiple items' score can be increased at once. If an item enters the Top-K list, the item which is expelled is returned. Group: top-k- Specified by:
topkIncrBy
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list where item is added, must not benull
couples
- The map containing the item / increment, must not benull
, must not be empty- Returns:
- a map containing for each added item the expelled item if any,
null
otherwise
-
topkList
Description copied from interface:TopKCommands
Execute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k- Specified by:
topkList
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list, must not benull
- Returns:
- the list of items
-
topkListWithCount
Description copied from interface:TopKCommands
Execute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k- Specified by:
topkListWithCount
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list, must not benull
- Returns:
- the Map of items with the associated count
-
topkQuery
Description copied from interface:TopKCommands
Execute the command TOPK.QUERY. Summary: Checks whether an item is one of Top-K items. Multiple items can be checked at once. Group: top-k- Specified by:
topkQuery
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list, must not benull
item
- the item to check, must not benull
- Returns:
true
if the item is in the list,false
otherwise
-
topkQuery
Description copied from interface:TopKCommands
Execute the command TOPK.QUERY. Summary: Checks whether an item is one of Top-K items. Multiple items can be checked at once. Group: top-k- Specified by:
topkQuery
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list, must not benull
items
- the items to check, must not benull
, must not containnull
, must not be empty- Returns:
- a list containing
true
if the corresponding item is in the list,false
otherwise
-
topkReserve
Description copied from interface:TopKCommands
Execute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k- Specified by:
topkReserve
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list, must not benull
topk
- the number of top occurring items to keep.
-
topkReserve
Description copied from interface:TopKCommands
Execute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k- Specified by:
topkReserve
in interfaceTopKCommands<K,
V> - Parameters:
key
- the name of list, must not benull
topk
- the number of top occurring items to keep.width
- the number of counters kept in each array. (Default 8)depth
- the number of arrays. (Default 7)decay
- the probability of reducing a counter in an occupied bucket. It is raised to power of it's counter (decay ^ bucket[i].counter). Therefore, as the counter gets higher, the chance of a reduction is being reduced. (Default 0.9)
-