K - Key type.V - Value type.public interface RedisTopKCommands<K,V>
| Modifier and Type | Method and Description |
|---|---|
List<String> |
topKAdd(K key,
V... values)
Adds a
value to a Top-k sketch. |
List<String> |
topKAdd(K key,
V value)
Adds a
value to a Top-k sketch. |
List<String> |
topKIncrBy(K key,
IncrementPair<V>... pairs)
Adds a
value to a Top-k sketch. |
List<String> |
topKIncrBy(K key,
V value,
long increment)
Increments the count of a
value in a Top-K sketch by the given increment. |
TopKInfoValue |
topKInfo(K key)
Returns information about the Top-K sketch.
|
List<String> |
topKList(K key)
Returns the full list of values in Top-K sketch.
|
List<TopKListValue> |
topKList(K key,
boolean withCount)
Returns the full list of values in Top-K sketch paired with their count if
withCount is true. |
List<Boolean> |
topKQuery(K key,
V... values)
Checks whether
values are in the Top-K sketch. |
List<Boolean> |
topKQuery(K key,
V value)
Checks whether
value is one of the top-k elements of the sketch. |
String |
topKReserve(K key,
long k)
Initializes a Top-K sketch with specified parameters.
|
String |
topKReserve(K key,
long k,
TopKReserveArgs args)
Initializes a Top-K sketch with specified parameters.
|
List<String> topKAdd(K key, V value)
value to a Top-k sketch. If a value enters the Top-K sketch, the value that is expelled (if any)
is returned. This allows dynamic heavy-hitter detection of values being entered or expelled from Top-K sketch.key - the key.value - the value.null if no value was expelled.List<String> topKAdd(K key, V... values)
value to a Top-k sketch. Multiple values can be added at the same time. If a value enters the
Top-K sketch, the value that is expelled (if any) is returned. This allows dynamic heavy-hitter detection of values being
entered or expelled from Top-K sketch.key - the key.values - the values.null if no value was expelled.List<String> topKIncrBy(K key, V value, long increment)
value in a Top-K sketch by the given increment. If the value enters the
Top-K sketch, the value that is expelled (if any) is returned.key - the key.value - the value.increment - the increment.null if no value was expelled.List<String> topKIncrBy(K key, IncrementPair<V>... pairs)
value to a Top-k sketch. Multiple values can be added at the same time. If a value enters the
Top-K sketch, the value that is expelled (if any) is returned. This allows dynamic heavy-hitter detection of values being
entered or expelled from Top-K sketch.key - the key.pairs - the value and increment pairs.null if no value was expelled.TopKInfoValue topKInfo(K key)
key - the key.TopKInfoValue the information about the sketch.List<String> topKList(K key)
key - the key.List<TopKListValue> topKList(K key, boolean withCount)
withCount is true.key - the key.withCount - whether to return the count of each value.List<Boolean> topKQuery(K key, V value)
value is one of the top-k elements of the sketch.key - the key.value - the value.true means the corresponding value is one of the top-k elements of the sketch,
false otherwise.List<Boolean> topKQuery(K key, V... values)
values are in the Top-K sketch.key - the key.values - the values.true means the corresponding value is one of the top-k elements of the sketch,
false otherwise.String topKReserve(K key, long k)
key - the key.k - the maximum number of values to keep.OK if the sketch was created.String topKReserve(K key, long k, TopKReserveArgs args)
key - the key.k - the maximum number of values to keep.args - the reserve arguments.OK if the sketch was created.Copyright © 2026 lettuce.io. All rights reserved.