102 Commits

Author SHA1 Message Date
Pieter Noordhuis
63080b6f2f Remove unused function 2011-03-14 10:53:14 +01:00
Pieter Noordhuis
dc940c96f0 Test for empty inner range when looking for elements in range 2011-03-11 18:18:02 +01:00
Pieter Noordhuis
8781386c7a Make zzl API unaware of the robj where the ziplist is stored 2011-03-11 17:06:07 +01:00
Pieter Noordhuis
940daef2c4 Encode sorted set after loading from dump 2011-03-10 17:50:13 +01:00
Pieter Noordhuis
8ce571585b Convert encoding of result when in limits 2011-03-10 17:02:05 +01:00
Pieter Noordhuis
301db9955c Remove comment 2011-03-10 16:53:20 +01:00
Pieter Noordhuis
2c8e68ed64 Generic iterator code for usage in ZUNIONSTORE/ZINTERSTORE 2011-03-10 16:34:52 +01:00
Pieter Noordhuis
8a2dda5e3d Make zzlLength take a ziplist argument 2011-03-10 16:17:14 +01:00
Pieter Noordhuis
808e023370 Fix used function in ZCARD 2011-03-09 16:13:39 +01:00
Pieter Noordhuis
921adfba1d Convert encoding when thresholds overflow 2011-03-09 16:13:06 +01:00
Pieter Noordhuis
a8de648365 Support dual encoding for more commands 2011-03-09 12:37:59 +01:00
Pieter Noordhuis
e5d0ac48b6 Support dual encoding for ZRANGEBYSCORE et al 2011-03-09 11:29:21 +01:00
Pieter Noordhuis
136f5a667e Helpers to move around in encoded sorted set 2011-03-09 11:06:31 +01:00
Pieter Noordhuis
810b2108bf Support dual encoding for ZREMRANGEBYRANK 2011-03-09 10:30:55 +01:00
Pieter Noordhuis
bf7aa9f00b Support dual encoding for ZRANGE 2011-03-09 00:12:29 +01:00
Pieter Noordhuis
5250d8347c Look up and remove elements by range 2011-03-08 23:56:33 +01:00
Pieter Noordhuis
f5a3018267 Typo 2011-03-08 22:14:46 +01:00
Pieter Noordhuis
f04e1694f5 Little less obfuscation 2011-03-08 21:36:46 +01:00
Pieter Noordhuis
b7ef5a413a Support dual encoding in ZREM 2011-03-08 17:11:15 +01:00
Pieter Noordhuis
32c4aca960 Don't encode element argument when dealing with ziplist 2011-03-08 16:51:41 +01:00
Pieter Noordhuis
490ea44244 Initial work for ziplist backed sorted sets 2011-03-08 16:44:22 +01:00
Pieter Noordhuis
e534a4c268 Rename zset range functions 2011-03-08 10:57:53 +01:00
Pieter Noordhuis
f68fbab536 Test for ranges where min > max 2011-03-08 10:57:39 +01:00
Pieter Noordhuis
e8521a02bc Compiler should decide on inlining 2011-03-08 10:57:33 +01:00
Pieter Noordhuis
acb51177dc Move logic concerned with zset ranges
This also optimizes ZREVRANGEBYSCORE for pathological cases where a
sorted set contains many elements with the same score. Previously,
it would traverse the list from back to front in such a case.
2011-03-08 10:57:24 +01:00
Pieter Noordhuis
de3fda38b6 Undo rename of function names where something went wrong 2011-03-08 10:57:06 +01:00
antirez
a8d2f3796d touched key for WATCH refactored into a more general thing that can be used also for the cache system. Some more changes towards diskstore working. 2010-12-29 19:39:42 +01:00
antirez
f6b6fda9e4 merge conflict resolved 2010-10-28 22:59:47 +02:00
Pieter Noordhuis
000b46faac Convert objects in the command procs instead of the protocol code 2010-10-17 17:21:41 +02:00
Pieter Noordhuis
4bd7afa4d2 Return error when min and/or max in the sorted set range spec is not a double 2010-10-13 21:59:24 +02:00
Pieter Noordhuis
ce0eab01d5 Make ZREMRANGEBYSCORE accept the same range spec as ZRANGEBYSCORE
This allows to use inclusive/exclusive bounds for min and max when
deleting a range of scores from a sorted set.
2010-10-13 21:43:58 +02:00
Pieter Noordhuis
b18811fd90 Merge branch 'master' into zrevrangebyscore 2010-10-13 20:29:50 +02:00
antirez
0446cc4878 two leaks fixed 2010-09-22 17:49:04 +02:00
antirez
b5528a7055 error generation format reverted to the new style after merge 2010-09-22 16:10:13 +02:00
antirez
9055834aeb Merge remote branch 'pietern/zset-mem' 2010-09-22 16:09:33 +02:00
antirez
0aa2bf3bc1 preventive conflict resolution to merge pietern/zset-mem 2010-09-22 16:09:30 +02:00
Pieter Noordhuis
8a6b28f8b3 Finished code for sorted set memory efficiency 2010-09-16 15:42:36 +02:00
Pieter Noordhuis
7afb5690c7 Add ZREVRANGEBYSCORE and refactor Z*RANGEBYSCORE 2010-09-16 14:38:07 +02:00
Pieter Noordhuis
d2d69815e8 Merge branch 'zset-mem' into zrevrangebyscore 2010-09-16 14:32:30 +02:00
Pieter Noordhuis
3ab203762f Use specialized function to add status and error replies 2010-09-02 23:33:06 +02:00
Pieter Noordhuis
b70d355521 Use existing reply functions where possible 2010-09-02 19:52:04 +02:00
Pieter Noordhuis
0537e7bf80 Use specialized function to add multi bulk reply length 2010-09-02 12:51:14 +02:00
Pieter Noordhuis
b301c1fc2b Wrapper for adding unknown multi bulk length to reply list 2010-08-30 16:39:14 +02:00
Pieter Noordhuis
69ef89f2cf Reference zset score in zskiplistNode from dict entries
This avoids the extra allocation of sizeof(double) for storing the score
of a zset entry in the hash table. Saves sizeof(double) + malloc
overhead = approx. 16 bytes per zset entry.
2010-08-03 20:49:53 +02:00
Pieter Noordhuis
2159782b51 Use flexible array in zskiplistNode to reduce memory usage 2010-08-03 19:22:09 +02:00
Pieter Noordhuis
673e1fb7e4 Change getDoubleFromObject to fail on NaN.
Return an error when the resulting value is not a number (NaN). Fix
ZUNIONSTORE/ZINTERSTORE to clean up when a weight argument is not a
double value.
2010-07-29 23:05:01 +02:00
Pieter Noordhuis
d9e28bcf00 Fix ZUNIONSTORE/ZINTERSTORE to never store a NaN score.
When +inf and -inf are added, the result is NaN. We don't want NaN
scores in a sorted set, so agreed on the result of this operation being
zero.
2010-07-29 23:03:11 +02:00
antirez
cbf7e1070a fix of the fix for the replication bug 2010-07-28 18:56:52 +02:00
antirez
8c1420ff2a Fixed a replication bug in ZINTERSTORE.
In order to trigger the bug what's needed is to call ZINTERSTORE
resulting into an empty set created, bug against a key that already
existed. The command was not propagated, so the replica ended with the
key that the master removed. Sequence of command to reproduce:

redis-cli hset 446 34 905
redis-cli hset 446 393 911
redis-cli zadd 966 0.085412045980529885 652
redis-cli zadd 645 0.25081839284432045 280
redis-cli zinterstore 446 2 966 645
2010-07-28 18:42:02 +02:00
antirez
5b4bff9c17 WATCH is now affected only when write commands actually modify the key content 2010-07-12 12:01:15 +02:00