Package io.toro.martini.redis
Class RedisHLLMethods
- java.lang.Object
-
- io.toro.martini.redis.RedisBaseMethods
-
- io.toro.martini.redis.RedisHLLMethods
-
public class RedisHLLMethods extends io.toro.martini.redis.RedisBaseMethods
Methods for HyperLogLog (PF* commands).
-
-
Constructor Summary
Constructors Constructor Description RedisHLLMethods(io.toro.martini.database.DataSourceManager dataSourceManager)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Long
pfadd(String connectionName, Object key, GloopExecutionContext context, Object... values)
Adds the specified elements to the specified HyperLogLog.static Future<Long>
pfaddAsync(String connectionName, Object key, GloopExecutionContext context, Object... values)
Asynchronously adds the specified elements to the specified hyperLogLog.static Long
pfcount(String connectionName, GloopExecutionContext context, Object... keys)
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).static Future<Long>
pfcountAsync(String connectionName, GloopExecutionContext context, Object... keys)
Asynchronously return the approximated cardinality of the set(s) observed by the hyperLogLog at key(s).static String
pfmerge(String connectionName, Object destkey, GloopExecutionContext context, Object... sourcekeys)
Merge N different HyperLogLogs into a single one.static Future<String>
pfmergeAsync(String connectionName, Object destkey, GloopExecutionContext context, Object... sourcekeys)
Asynchronously merge n different hyperLogLogs into a single one.
-
-
-
Constructor Detail
-
RedisHLLMethods
@Autowired RedisHLLMethods(io.toro.martini.database.DataSourceManager dataSourceManager)
-
-
Method Detail
-
pfadd
@GloopParameter(name="redisPfaddOutput") public static Long pfadd(@GloopParameter(allowNull=false) String connectionName, @GloopParameter(allowNull=false) Object key, GloopExecutionContext context, @GloopParameter(allowNull=false) Object... values)
Adds the specified elements to the specified HyperLogLog.- Parameters:
connectionName
- The Martini Runtime Redis connection pool namekey
- the keyvalues
- the values- Returns:
- Long integer-reply specifically: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.
-
pfaddAsync
@GloopParameter(name="redisFuturePfaddOutput") public static Future<Long> pfaddAsync(@GloopParameter(allowNull=false) String connectionName, @GloopParameter(allowNull=false) Object key, GloopExecutionContext context, @GloopParameter(allowNull=false) Object... values)
Asynchronously adds the specified elements to the specified hyperLogLog.- Parameters:
connectionName
- The Martini Runtime Redis connection pool namekey
- the keyvalues
- the values- Returns:
- long integer-reply specifically: 1 if at least 1 hyperLogLog internal register was altered. 0 otherwise.
-
pfmerge
@GloopParameter(name="redisPfmergeOutput") public static String pfmerge(@GloopParameter(allowNull=false) String connectionName, @GloopParameter(allowNull=false) Object destkey, GloopExecutionContext context, @GloopParameter(allowNull=false) Object... sourcekeys)
Merge N different HyperLogLogs into a single one.- Parameters:
connectionName
- The Martini Runtime Redis connection pool namedestkey
- the destination keysourcekeys
- the source key- Returns:
- String simple-string-reply The command just returns
OK
.
-
pfmergeAsync
@GloopParameter(name="redisFuturePfmergeOutput") public static Future<String> pfmergeAsync(@GloopParameter(allowNull=false) String connectionName, @GloopParameter(allowNull=false) Object destkey, GloopExecutionContext context, @GloopParameter(allowNull=false) Object... sourcekeys)
Asynchronously merge n different hyperLogLogs into a single one.- Parameters:
connectionName
- The Martini Runtime Redis connection pool namedestkey
- the destination keysourcekeys
- the source key- Returns:
- string simple-string-reply the command just returns
oK
.
-
pfcount
@GloopParameter(name="redisPfcountOutput") public static Long pfcount(@GloopParameter(allowNull=false) String connectionName, GloopExecutionContext context, @GloopParameter(allowNull=false) Object... keys)
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).- Parameters:
connectionName
- The Martini Runtime Redis connection pool namekeys
- the keys- Returns:
- Long integer-reply specifically: The approximated number of unique elements observed via
PFADD
.
-
pfcountAsync
@GloopParameter(name="redisFuturePfcountOutput") public static Future<Long> pfcountAsync(@GloopParameter(allowNull=false) String connectionName, GloopExecutionContext context, @GloopParameter(allowNull=false) Object... keys)
Asynchronously return the approximated cardinality of the set(s) observed by the hyperLogLog at key(s).- Parameters:
connectionName
- The Martini Runtime Redis connection pool namekeys
- the keys- Returns:
- long integer-reply specifically: the approximated number of unique elements observed via
pFADD
.
-
-