diff options
author | antirez <antirez@gmail.com> | 2017-12-01 15:04:05 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2017-12-01 15:04:05 +0100 |
commit | 8ac76be5f2d44341a1c7f67645c753aafbde7804 (patch) | |
tree | a1d55a1096a261c504fad644ebddbe8f6de5847f | |
parent | f42df6f43a59fa92a82e651d1c5858bc5e72c3ef (diff) | |
download | redis-8ac76be5f2d44341a1c7f67645c753aafbde7804.tar.gz |
Streams: DEBUG DIGEST support.
-rw-r--r-- | src/debug.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/debug.c b/src/debug.c index 5c3fd3471..5b08475a5 100644 --- a/src/debug.c +++ b/src/debug.c @@ -239,6 +239,27 @@ void computeDatasetDigest(unsigned char *final) { xorDigest(digest,eledigest,20); } hashTypeReleaseIterator(hi); + } else if (o->type == OBJ_STREAM) { + streamIterator si; + streamIteratorStart(&si,o->ptr,NULL,NULL,0); + streamID id; + int64_t numfields; + + while(streamIteratorGetID(&si,&id,&numfields)) { + sds itemid = sdscatfmt(sdsempty(),"%U.%U",id.ms,id.seq); + mixDigest(digest,itemid,sdslen(itemid)); + sdsfree(itemid); + + while(numfields--) { + unsigned char *field, *value; + int64_t field_len, value_len; + streamIteratorGetField(&si,&field,&value, + &field_len,&value_len); + mixDigest(digest,field,field_len); + mixDigest(digest,value,value_len); + } + } + streamIteratorStop(&si); } else if (o->type == OBJ_MODULE) { RedisModuleDigest md; moduleValue *mv = o->ptr; |