Commit 0bbdaca6 authored by antirez's avatar antirez
Browse files

PFDEBUG TODENSE added.

Converts HyperLogLogs from sparse to dense. Used for testing.
parent 402110f9
...@@ -1427,6 +1427,21 @@ void pfdebugCommand(redisClient *c) { ...@@ -1427,6 +1427,21 @@ void pfdebugCommand(redisClient *c) {
if (c->argc != 3) goto arityerr; if (c->argc != 3) goto arityerr;
addReplyStatus(c,encodingstr[hdr->encoding]); addReplyStatus(c,encodingstr[hdr->encoding]);
}
/* PFDEBUG TODENSE <key> */
else if (!strcasecmp(cmd,"todense")) {
int conv = 0;
if (c->argc != 3) goto arityerr;
if (hdr->encoding == HLL_SPARSE) {
if (hllSparseToDense(o) == REDIS_ERR) {
addReplyError(c,invalid_hll_err);
return;
}
conv = 1;
server.dirty++; /* Force propagation on encoding change. */
}
addReply(c,conv ? shared.cone : shared.czero);
} else { } else {
addReplyErrorFormat(c,"Unknown PFDEBUG subcommand '%s'", cmd); addReplyErrorFormat(c,"Unknown PFDEBUG subcommand '%s'", cmd);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment