Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could you add zset support? #20

Open
Carl-you opened this issue Aug 15, 2014 · 3 comments
Open

could you add zset support? #20

Carl-you opened this issue Aug 15, 2014 · 3 comments

Comments

@Carl-you
Copy link

could you add zset support

@idyedov
Copy link
Contributor

idyedov commented Aug 22, 2014

sorted sets are a little harder since there's no simple data structure that we can use that will have the same properties/guarantees. Closest I can think of would be a BiMap from guava library, but it doesn't guarantee the sort order (and we don't want to sort on every call to ZRANGE)

as far as I know they're implemented with skiplists in redis internally, but I don't know of any public library that has an implementation that we could use. Let me know if you have any ideas.

@kshchepanovskyi
Copy link
Contributor

I'm going to implement support for zset with the same time complexity guarantees approximately by the end of next month.

Some details about Redis ZSET Underlying Datastructure: http://biais.org/redis-zset-underlying-datastructure/

@pyloque
Copy link

pyloque commented May 23, 2016

I think redis-mock is only for unittest, performance things can be ignored. So the implementation of skiplist is not nessessary,you can just use hashmap instead.zrange/zrank such operation, you can just tranverse the map to get the result.
if you really do need a skiplist library,python has the same library you can refer.
https://github.com/locationlabs/mockredis/blob/master/mockredis/sortedset.py

for lack of zset implementation, I cannot use mockredis at all in my project. so sad ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants