pietern/redis — pull request #1 by aitskovi (2012-08-08 06:34:21+00:00)
Title: Add HSCAN Command

Add an HSCAN Command. This is currently using very similar (almost identical) code the scanCommand in db.c. The major difference is dealing with hashes encoded as ziplists. If the t_hash is encoded as a ziplist it returns all keys in the ziplist. This is as if SCAN encountered a large in collision in dictionary. Since dictionaries encoded as zipllists should be fairly small this should be okay, it also follows the semantics of SCAN.

HSCAN similarly to HKEYS does not support a pattern match, instead returning all non expired keys.

Also adds tests for both HSCAN to a large dict (a hash) and a small dict (a ziplist).

Since the code is so similar between HSCAN and SCAN it can probably be refactored into something common, but I wanted to have a running version first.