Package io.quarkus.redis.datasource.topk
Interface ReactiveTransactionalTopKCommands<K,V>
-
- Type Parameters:
K
- the type of the keyV
- the type of the value stored in the sketch
- All Superinterfaces:
ReactiveTransactionalRedisCommands
- All Known Implementing Classes:
ReactiveTransactionalTopKCommandsImpl
public interface ReactiveTransactionalTopKCommands<K,V> extends ReactiveTransactionalRedisCommands
Allows executing commands from thetop-k
group. These commands require the Redis Bloom module (this modules also include Top-K list support) to be installed in the Redis server.See the top-k command list for further information about these commands.
This API is intended to be used in a Redis transaction (
MULTI
), thus, all command methods returnUni<Void>
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>
topkAdd(K key, V item)
Execute the command TOPK.ADD.io.smallrye.mutiny.Uni<Void>
topkAdd(K key, V... items)
Execute the command TOPK.ADD.io.smallrye.mutiny.Uni<Void>
topkIncrBy(K key, Map<V,Integer> couples)
Execute the command TOPK.INCRBY.io.smallrye.mutiny.Uni<Void>
topkIncrBy(K key, V item, int increment)
Execute the command TOPK.INCRBY.io.smallrye.mutiny.Uni<Void>
topkList(K key)
Execute the command TOPK.LIST.io.smallrye.mutiny.Uni<Void>
topkListWithCount(K key)
Execute the command TOPK.LIST.io.smallrye.mutiny.Uni<Void>
topkQuery(K key, V item)
Execute the command TOPK.QUERY.io.smallrye.mutiny.Uni<Void>
topkQuery(K key, V... items)
Execute the command TOPK.QUERY.io.smallrye.mutiny.Uni<Void>
topkReserve(K key, int topk)
Execute the command TOPK.RESERVE.io.smallrye.mutiny.Uni<Void>
topkReserve(K key, int topk, int width, int depth, double decay)
Execute the command TOPK.RESERVE.-
Methods inherited from interface io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands
getDataSource
-
-
-
-
Method Detail
-
topkAdd
io.smallrye.mutiny.Uni<Void> topkAdd(K key, V item)
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- Parameters:
key
- the name of list where item is added, must not benull
item
- the item to add, must not benull
- Returns:
- A
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkAdd
io.smallrye.mutiny.Uni<Void> topkAdd(K key, V... items)
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- 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
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkIncrBy
io.smallrye.mutiny.Uni<Void> topkIncrBy(K key, V item, int increment)
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- 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:
- A
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkIncrBy
io.smallrye.mutiny.Uni<Void> topkIncrBy(K key, Map<V,Integer> couples)
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- 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
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkList
io.smallrye.mutiny.Uni<Void> topkList(K key)
Execute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k- Parameters:
key
- the name of list, must not benull
- Returns:
- A
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkListWithCount
io.smallrye.mutiny.Uni<Void> topkListWithCount(K key)
Execute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k- Parameters:
key
- the name of list, must not benull
- Returns:
- A
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkQuery
io.smallrye.mutiny.Uni<Void> topkQuery(K key, V item)
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- Parameters:
key
- the name of list, must not benull
item
- the item to check, must not benull
- Returns:
- A
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkQuery
io.smallrye.mutiny.Uni<Void> topkQuery(K key, V... items)
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- 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
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkReserve
io.smallrye.mutiny.Uni<Void> topkReserve(K key, int topk)
Execute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k- Parameters:
key
- the name of list, must not benull
topk
- the number of top occurring items to keep.- Returns:
- A
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkReserve
io.smallrye.mutiny.Uni<Void> topkReserve(K key, int topk, int width, int depth, double decay)
Execute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k- 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)- Returns:
- A
Uni
emittingnull
when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
-