提交 0bbdaca6 编写于 作者: A antirez

PFDEBUG TODENSE added.

Converts HyperLogLogs from sparse to dense. Used for testing.
上级 402110f9
......@@ -1427,6 +1427,21 @@ void pfdebugCommand(redisClient *c) {
if (c->argc != 3) goto arityerr;
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 {
addReplyErrorFormat(c,"Unknown PFDEBUG subcommand '%s'", cmd);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册