public interface CountMinSketchCommands
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Long> |
cmsIncrBy(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Long> itemIncrements)
CMS.INCRBY Increases the count of one or more item.
|
default long |
cmsIncrBy(java.lang.String key,
java.lang.String item,
long increment)
CMS.INCRBY Increases the count of item by increment
|
java.util.Map<java.lang.String,java.lang.Object> |
cmsInfo(java.lang.String key)
CMS.INFO Returns width, depth and total count of the sketch.
|
java.lang.String |
cmsInitByDim(java.lang.String key,
long width,
long depth)
CMS.INITBYDIM Initializes a Count-Min Sketch to dimensions specified by user.
|
java.lang.String |
cmsInitByProb(java.lang.String key,
double error,
double probability)
CMS.INITBYPROB Initializes a Count-Min Sketch to accommodate requested
capacity.
|
java.lang.String |
cmsMerge(java.lang.String destKey,
java.util.Map<java.lang.String,java.lang.Long> keysAndWeights)
CMS.MERGE Merges several sketches into one sketch.
|
java.lang.String |
cmsMerge(java.lang.String destKey,
java.lang.String... keys)
CMS.MERGE Merges several sketches into one sketch.
|
java.util.List<java.lang.Long> |
cmsQuery(java.lang.String key,
java.lang.String... items)
CMS.QUERY Returns count for item.
|
java.lang.String cmsInitByDim(java.lang.String key, long width, long depth)
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 countjava.lang.String cmsInitByProb(java.lang.String key, double error, double probability)
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.default long cmsIncrBy(java.lang.String key, java.lang.String item, long increment)
key
- The name of the sketchitem
- The item which counter to be increasedincrement
- Counter to be increased by this integerjava.util.List<java.lang.Long> cmsIncrBy(java.lang.String key, java.util.Map<java.lang.String,java.lang.Long> itemIncrements)
key
- The name of the sketchitemIncrements
- a Map of the items to be increased and their integer
incrementjava.util.List<java.lang.Long> cmsQuery(java.lang.String key, java.lang.String... items)
key
- The name of the sketchitems
- The items for which to retrieve the countsjava.lang.String cmsMerge(java.lang.String destKey, java.lang.String... keys)
destKey
- The name of destination sketch. Must be initialized.keys
- The sketches to be mergedjava.lang.String cmsMerge(java.lang.String destKey, java.util.Map<java.lang.String,java.lang.Long> keysAndWeights)
destKey
- The name of destination sketch. Must be initialized.keysAndWeights
- A map of keys and weights used to multiply the sketch.java.util.Map<java.lang.String,java.lang.Object> cmsInfo(java.lang.String key)
key
- The name of the sketchCopyright © 2023. All rights reserved.