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>
  • Constructor Details

  • Method Details

    • topkAdd

      public io.smallrye.mutiny.Uni<Void> topkAdd(K key, V item)
      Description copied from interface: ReactiveTransactionalTopKCommands
      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 interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list where item is added, must not be null
      item - the item to add, must not be null
      Returns:
      A Uni emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
    • topkAdd

      public io.smallrye.mutiny.Uni<Void> topkAdd(K key, V... items)
      Description copied from interface: ReactiveTransactionalTopKCommands
      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 interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list where item is added, must not be null
      items - the items to add, must not be null, must not be empty, must not contain null
      Returns:
      A Uni emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
    • topkIncrBy

      public io.smallrye.mutiny.Uni<Void> topkIncrBy(K key, V item, int increment)
      Description copied from interface: ReactiveTransactionalTopKCommands
      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 interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list where item is added, must not be null
      item - the item to add, must not be null
      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 emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
    • topkIncrBy

      public io.smallrye.mutiny.Uni<Void> topkIncrBy(K key, Map<V,Integer> couples)
      Description copied from interface: ReactiveTransactionalTopKCommands
      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 interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list where item is added, must not be null
      couples - The map containing the item / increment, must not be null, must not be empty
      Returns:
      A Uni emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
    • topkList

      public io.smallrye.mutiny.Uni<Void> topkList(K key)
      Description copied from interface: ReactiveTransactionalTopKCommands
      Execute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k

      Specified by:
      topkList in interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list, must not be null
      Returns:
      A Uni emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
    • topkListWithCount

      public io.smallrye.mutiny.Uni<Void> topkListWithCount(K key)
      Description copied from interface: ReactiveTransactionalTopKCommands
      Execute the command TOPK.LIST. Summary: Return full list of items in Top K list. Group: top-k

      Specified by:
      topkListWithCount in interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list, must not be null
      Returns:
      A Uni emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
    • topkQuery

      public io.smallrye.mutiny.Uni<Void> topkQuery(K key, V item)
      Description copied from interface: ReactiveTransactionalTopKCommands
      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 interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list, must not be null
      item - the item to check, must not be null
      Returns:
      A Uni emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.
    • topkQuery

      public io.smallrye.mutiny.Uni<Void> topkQuery(K key, V... items)
      Description copied from interface: ReactiveTransactionalTopKCommands
      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 interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list, must not be null
      items - the items to check, must not be null, must not contain null, must not be empty
      Returns:
      A Uni emitting null when 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)
      Description copied from interface: ReactiveTransactionalTopKCommands
      Execute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k

      Specified by:
      topkReserve in interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list, must not be null
      topk - the number of top occurring items to keep.
      Returns:
      A Uni emitting null when 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: ReactiveTransactionalTopKCommands
      Execute the command TOPK.RESERVE. Summary: Initializes a TopK with specified parameters. Group: top-k

      Specified by:
      topkReserve in interface ReactiveTransactionalTopKCommands<K,V>
      Parameters:
      key - the name of list, must not be null
      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 emitting null when the command has been enqueued successfully in the transaction, a failure otherwise. In the case of failure, the transaction is discarded.