All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.redis.datasource.countmin.ReactiveCountMinCommands Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.redis.datasource.countmin;

import java.util.List;
import java.util.Map;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.smallrye.mutiny.Uni;

/**
 * Allows executing commands from the {@code count-min} group.
 * These commands require the Redis Bloom module (this modules also
 * include Count-Min Sketches) to be installed in the Redis server.
 * 

* See the count-min command list for further information about * these commands. *

* * @param the type of the key * @param the type of the value stored in the sketch */ public interface ReactiveCountMinCommands extends ReactiveRedisCommands { /** * Execute the command CMS.INCRBY. * Summary: Increases the count of item by increment. Multiple items can be increased with one call. * Group: count-min *

* * @param key the name of the sketch, must not be {@code null} * @param value the value, must not be {@code null} * @param increment the increment * @return a uni producing the updated min-count for the added value **/ Uni cmsIncrBy(K key, V value, long increment); /** * Execute the command CMS.INCRBY. * Summary: Increases the count of item by increment. Multiple items can be increased with one call. * Group: count-min *

* * @param key the name of the sketch, must not be {@code null} * @param couples the set of value/increment pair, must not be {@code null}, must not be empty * @return a uni producing a map containing the updated min-count for each added value **/ Uni> cmsIncrBy(K key, Map couples); /** * Execute the command CMS.INITBYDIM. * Summary: Initializes a Count-Min Sketch to dimensions specified by user. * Group: count-min *

* * @param key the name of the sketch, must not be {@code null} * @param width the number of counters in each array. Reduces the error size. * @param depth the number of counter-arrays. Reduces the probability for an error of a certain size (percentage of total * count). * @return a uni producing {@code null} when the operation completes **/ Uni cmsInitByDim(K key, long width, long depth); /** * Execute the command CMS.INITBYPROB. * Summary: Initializes a Count-Min Sketch to accommodate requested tolerances. * Group: count-min *

* * @param key the name of the sketch, must not be {@code null} * @param error estimate size of error. The error is a percent of total counted items (in decimal). This * effects the width of the sketch. * @param probability the desired probability for inflated count. This should be a decimal value between 0 and 1. * @return a uni producing {@code null} when the operation completes **/ Uni cmsInitByProb(K key, double error, double probability); /** * Execute the command CMS.QUERY. * Summary: Returns the count for one or more items in a sketch. * Group: count-min *

* * @param key the name of the sketch, must not be {@code null} * @param item the item to check, must not be {@code null} * @return a uni producing the count for the given item **/ Uni cmsQuery(K key, V item); /** * Execute the command CMS.QUERY. * Summary: Returns the count for one or more items in a sketch. * Group: count-min *

* * @param key the name of the sketch, must not be {@code null} * @param items the items to check, must not be {@code null}, empty or contain {@code null} * @return a uni producing a list containing the count for the corresponding item **/ Uni> cmsQuery(K key, V... items); /** * Execute the command CMS.MERGE. * Summary: Merges several sketches into one sketch. All sketches must have identical width and depth. Weights can * be used to multiply certain sketches. Default weight is 1. * Group: count-min *

* * @param dest The name of destination sketch. Must be initialized, must not be {@code null} * @param src The names of source sketches to be merged. Must not be {@code null}, must not contain {@code null}, * must not be empty. * @param weight The multiple of each sketch. Default =1, can be empty, can be {@code null} * @return a uni producing {@code null} once the operation completes **/ Uni cmsMerge(K dest, List src, List weight); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy