Package com.redis.om.spring.ops.pds
Interface CountMinSketchOperations<K>
- All Known Implementing Classes:
CountMinSketchOperationsImpl
public interface CountMinSketchOperations<K>
-
Method Summary
Modifier and TypeMethodDescriptionlongCMS.INCRBY Increases the count of item by incrementCMS.INCRBY Increases the count of one or more item.CMS.INFO Returns width, depth and total count of the sketch.voidcmsInitByDim(K key, long width, long depth) CMS.INITBYDIM Initializes a Count-Min Sketch to dimensions specified by user.voidcmsInitByProb(K key, double error, double probability) CMS.INITBYPROB Initializes a Count-Min Sketch to accommodate requested capacity.voidCMS.MERGE Merges several sketches into one sketch.voidCMS.MERGE Merges several sketches into one sketch.CMS.QUERY Returns count for item.
-
Method Details
-
cmsInitByDim
CMS.INITBYDIM Initializes a Count-Min Sketch to dimensions specified by user.- Parameters:
key- The name of the sketchwidth- Number of counter in each array. Reduces the error sizedepth- Number of counter-arrays. Reduces the probability for an error of a certain size (percentage of total count
-
cmsInitByProb
CMS.INITBYPROB Initializes a Count-Min Sketch to accommodate requested capacity.- Parameters:
key- The name of the sketch.error- Estimate size of error. The error is a percent of total counted items. This effects the width of the sketch.probability- The desired probability for inflated count. This should be a decimal value between 0 and 1. This effects the depth of the sketch. For example, for a desired false positive rate of 0.1% (1 in 1000), error_rate should be set to 0.001. The closer this number is to zero, the greater the memory consumption per item and the more CPU usage per operation.
-
cmsIncrBy
CMS.INCRBY Increases the count of item by increment- Parameters:
key- The name of the sketchitem- The item which counter to be increasedincrement- Counter to be increased by this integer- Returns:
- Count for the item after increment
-
cmsIncrBy
CMS.INCRBY Increases the count of one or more item.- Parameters:
key- The name of the sketchitemIncrements- a Map of the items to be increased and their integer increment- Returns:
- Count of each item after increment
-
cmsQuery
CMS.QUERY Returns count for item. Multiple items can be queried with one call.- Parameters:
key- The name of the sketchitems- The items for which to retrieve the counts- Returns:
- Count for one or more items
-
cmsMerge
CMS.MERGE Merges several sketches into one sketch. All sketches must have identical width and depth.- Parameters:
destKey- The name of destination sketch. Must be initialized.keys- The sketches to be merged
-
cmsMerge
CMS.MERGE 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.- Parameters:
destKey- The name of destination sketch. Must be initialized.keysAndWeights- A map of keys and weights used to multiply the sketch.
-
cmsInfo
CMS.INFO Returns width, depth and total count of the sketch.- Parameters:
key- The name of the sketch- Returns:
- A Map with width, depth and total count.
-