Commit Graph

108 Commits

Author SHA1 Message Date
antirez
a5dce40726 if /dev/urandom is not available use rand() to get a random node name 2011-05-04 10:30:22 +02:00
antirez
c772d9c6e7 take a hashslot -> keys index, will be used for cluster rehasing 2011-04-28 19:00:33 +02:00
Pieter Noordhuis
02e6006532 Explicitly zero zval since it is stored on the stack 2011-04-06 16:39:22 +02:00
Pieter Noordhuis
100ed062c0 Test for ENCODING_SKIPLIST instead of ENCODING_RAW 2011-04-06 16:17:07 +02:00
Pieter Noordhuis
48991620f7 Remove sorted set when empty after ZREMRANGEBY* 2011-03-21 23:54:46 +01:00
Pieter Noordhuis
69298a05eb Offset should be size_t 2011-03-14 10:53:53 +01:00
Pieter Noordhuis
72690afdd2 Remove unused function 2011-03-14 10:53:14 +01:00
Pieter Noordhuis
e53ca04b50 Test for empty inner range when looking for elements in range 2011-03-11 18:18:02 +01:00
Pieter Noordhuis
8588bfa370 Make zzl API unaware of the robj where the ziplist is stored 2011-03-11 17:06:07 +01:00
Pieter Noordhuis
df26a0ae0b Encode sorted set after loading from dump 2011-03-10 17:50:13 +01:00
Pieter Noordhuis
255eebe221 Convert encoding of result when in limits 2011-03-10 17:02:05 +01:00
Pieter Noordhuis
dba3a153a7 Remove comment 2011-03-10 16:53:20 +01:00
Pieter Noordhuis
56ce42faf1 Generic iterator code for usage in ZUNIONSTORE/ZINTERSTORE 2011-03-10 16:34:52 +01:00
Pieter Noordhuis
bbfe232f60 Make zzlLength take a ziplist argument 2011-03-10 16:17:14 +01:00
Pieter Noordhuis
cc4c964b33 Fix used function in ZCARD 2011-03-09 16:13:39 +01:00
Pieter Noordhuis
a669d5e999 Convert encoding when thresholds overflow 2011-03-09 16:13:06 +01:00
Pieter Noordhuis
d1c920c538 Support dual encoding for more commands 2011-03-09 12:37:59 +01:00
Pieter Noordhuis
aff255c81d Support dual encoding for ZRANGEBYSCORE et al 2011-03-09 11:29:21 +01:00
Pieter Noordhuis
4c5f0966b2 Helpers to move around in encoded sorted set 2011-03-09 11:06:31 +01:00
Pieter Noordhuis
63b7b7fb34 Support dual encoding for ZREMRANGEBYRANK 2011-03-09 10:30:55 +01:00
Pieter Noordhuis
5d1b4fb698 Support dual encoding for ZRANGE 2011-03-09 00:12:29 +01:00
Pieter Noordhuis
4a14dbbac2 Look up and remove elements by range 2011-03-08 23:56:33 +01:00
Pieter Noordhuis
9f9b60f974 Typo 2011-03-08 22:14:46 +01:00
Pieter Noordhuis
8218db3dae Little less obfuscation 2011-03-08 21:36:46 +01:00
Pieter Noordhuis
0b10e10444 Support dual encoding in ZREM 2011-03-08 17:11:15 +01:00
Pieter Noordhuis
3ca7532a2d Don't encode element argument when dealing with ziplist 2011-03-08 16:51:41 +01:00
Pieter Noordhuis
21c5b508a4 Initial work for ziplist backed sorted sets 2011-03-08 16:44:22 +01:00
Pieter Noordhuis
45290ad9bb Rename zset range functions 2011-03-08 10:57:53 +01:00
Pieter Noordhuis
8e1b327706 Test for ranges where min > max 2011-03-08 10:57:39 +01:00
Pieter Noordhuis
df278b8b0b Compiler should decide on inlining 2011-03-08 10:57:33 +01:00
Pieter Noordhuis
22b9bf1594 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
a300477368 Undo rename of function names where something went wrong 2011-03-08 10:57:06 +01:00
antirez
cea8c5cd75 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
21dbc6499a merge conflict resolved 2010-10-28 22:59:47 +02:00
Pieter Noordhuis
75b41de8ca Convert objects in the command procs instead of the protocol code 2010-10-17 17:21:41 +02:00
Pieter Noordhuis
7236fdb22f 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
91504b6cbe 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
26f3388d27 Merge branch 'master' into zrevrangebyscore 2010-10-13 20:29:50 +02:00
antirez
50a9fad5d5 two leaks fixed 2010-09-22 17:49:04 +02:00
antirez
beb7756dcb error generation format reverted to the new style after merge 2010-09-22 16:10:13 +02:00
antirez
b882056c93 Merge remote branch 'pietern/zset-mem' 2010-09-22 16:09:33 +02:00
antirez
5ca2f0c498 preventive conflict resolution to merge pietern/zset-mem 2010-09-22 16:09:30 +02:00
Pieter Noordhuis
d433ebc681 Finished code for sorted set memory efficiency 2010-09-16 15:42:36 +02:00
Pieter Noordhuis
25bb8a4452 Add ZREVRANGEBYSCORE and refactor Z*RANGEBYSCORE 2010-09-16 14:38:07 +02:00
Pieter Noordhuis
192fc3376a 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
Pieter Noordhuis
d0a4e24e32 merged code from 184d74ab, 4774a53b, f483ce5f to new file structure 2010-07-05 15:16:33 -04:00
antirez
e2641e09cc redis.c split into many different C files.
networking related stuff moved into networking.c

moved more code

more work on layout of source code

SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;)

cleanly compiling again after the first split, now splitting it in more C files

moving more things around... work in progress

split replication code

splitting more

Sets split

Hash split

replication split

even more splitting

more splitting

minor change
2010-07-01 14:38:51 +02:00