If you are trying to use your get_hash_name() as a method of sharding,
you are making a mistake with regards to it's use with hashes (and
really, your conflation of standard set() with hset() is part of
that).
Really, your set() method should be renamed and look something like...
def hset(self, key, field, value):
redis.Redis.hset(self, self.get_hash_name(key), field, value)
Other methods you list should be changed appropriately and similarly.
Is the code you have provided a mistake? What are you trying to do?
Regards,
- Josiah
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>
... so you are really looking for a version of MGET to get the values
of a hash. Just use a sequence of HGET calls over a pipeline. The
redis-py library supports pipelines, and is pretty fast (I've found
non-transactional pipelines to be within 20-40% of the speed of
writing a custom command to do some equivalent operations on the
server).
- Josiah