Class ReactiveTransactionalTopKCommandsImpl<K,V>
java.lang.Object
io.quarkus.redis.runtime.datasource.AbstractTransactionalCommands
io.quarkus.redis.runtime.datasource.ReactiveTransactionalTopKCommandsImpl<K,V>
- All Implemented Interfaces:
ReactiveTransactionalRedisCommands,ReactiveTransactionalTopKCommands<K,V>
public class ReactiveTransactionalTopKCommandsImpl<K,V>
extends AbstractTransactionalCommands
implements ReactiveTransactionalTopKCommands<K,V>
-
Field Summary
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractTransactionalCommands
tx -
Constructor Summary
ConstructorsConstructorDescriptionReactiveTransactionalTopKCommandsImpl(ReactiveTransactionalRedisDataSource ds, ReactiveTopKCommandsImpl<K, V> reactive, TransactionHolder tx) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>Execute the command TOPK.ADD.io.smallrye.mutiny.Uni<Void>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>Execute the command TOPK.LIST.io.smallrye.mutiny.Uni<Void>topkListWithCount(K key) Execute the command TOPK.LIST.io.smallrye.mutiny.Uni<Void>Execute the command TOPK.QUERY.io.smallrye.mutiny.Uni<Void>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 class io.quarkus.redis.runtime.datasource.AbstractTransactionalCommands
getDataSource, queuedOrDiscardMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.redis.datasource.ReactiveTransactionalRedisCommands
getDataSource
-
Constructor Details
-
ReactiveTransactionalTopKCommandsImpl
public ReactiveTransactionalTopKCommandsImpl(ReactiveTransactionalRedisDataSource ds, ReactiveTopKCommandsImpl<K, V> reactive, TransactionHolder tx)
-
-
Method Details
-
topkAdd
Description copied from interface:ReactiveTransactionalTopKCommandsExecute 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:
topkAddin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list where item is added, must not benullitem- the item to add, must not benull- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkAdd
Description copied from interface:ReactiveTransactionalTopKCommandsExecute 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:
topkAddin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list where item is added, must not benullitems- the items to add, must not benull, must not be empty, must not containnull- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkIncrBy
Description copied from interface:ReactiveTransactionalTopKCommandsExecute 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:
topkIncrByin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list where item is added, must not benullitem- the item to add, must not benullincrement- 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
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkIncrBy
Description copied from interface:ReactiveTransactionalTopKCommandsExecute 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:
topkIncrByin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list where item is added, must not benullcouples- The map containing the item / increment, must not benull, must not be empty- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkList
Description copied from interface:ReactiveTransactionalTopKCommandsExecute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k- Specified by:
topkListin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list, must not benull- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkListWithCount
Description copied from interface:ReactiveTransactionalTopKCommandsExecute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k- Specified by:
topkListWithCountin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list, must not benull- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkQuery
Description copied from interface:ReactiveTransactionalTopKCommandsExecute 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:
topkQueryin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list, must not benullitem- the item to check, must not benull- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkQuery
Description copied from interface:ReactiveTransactionalTopKCommandsExecute 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:
topkQueryin interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list, must not benullitems- the items to check, must not benull, must not containnull, must not be empty- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkReserve
Description copied from interface:ReactiveTransactionalTopKCommandsExecute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k- Specified by:
topkReservein interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list, must not benulltopk- the number of top occurring items to keep.- Returns:
- A
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-
topkReserve
public io.smallrye.mutiny.Uni<Void> topkReserve(K key, int topk, int width, int depth, double decay) Description copied from interface:ReactiveTransactionalTopKCommandsExecute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k- Specified by:
topkReservein interfaceReactiveTransactionalTopKCommands<K,V> - Parameters:
key- the name of list, must not benulltopk- 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
Uniemittingnullwhen the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
-