Permalink
Browse files

Start every sentence on a new line

  • Loading branch information...
1 parent 99169cf commit 339e5130b2f930a5986b8927ad8bb39a261e59ad @pietern pietern committed Jun 19, 2012
Showing with 922 additions and 745 deletions.
  1. +11 −10 commands/append.md
  2. +5 −4 commands/auth.md
  3. +10 −6 commands/bgrewriteaof.md
  4. +6 −4 commands/bgsave.md
  5. +14 −11 commands/bitcount.md
  6. +5 −4 commands/bitop.md
  7. +28 −23 commands/blpop.md
  8. +5 −4 commands/brpop.md
  9. +5 −4 commands/brpoplpush.md
  10. +9 −8 commands/config get.md
  11. +9 −8 commands/config set.md
  12. +2 −2 commands/debug object.md
  13. +2 −2 commands/debug segfault.md
  14. +5 −4 commands/decr.md
  15. +5 −4 commands/decrby.md
  16. +2 −1 commands/del.md
  17. +9 −6 commands/dump.md
  18. +157 −128 commands/eval.md
  19. +44 −38 commands/expire.md
  20. +3 −2 commands/expireat.md
  21. +2 −1 commands/flushall.md
  22. +2 −1 commands/flushdb.md
  23. +4 −3 commands/get.md
  24. +4 −3 commands/getbit.md
  25. +4 −3 commands/getrange.md
  26. +5 −4 commands/getset.md
  27. +6 −5 commands/hdel.md
  28. +3 −3 commands/hgetall.md
  29. +2 −1 commands/hincrby.md
  30. +4 −4 commands/hincrbyfloat.md
  31. +3 −2 commands/hmset.md
  32. +3 −3 commands/hset.md
  33. +3 −2 commands/hsetnx.md
  34. +38 −31 commands/incr.md
  35. +5 −4 commands/incrby.md
  36. +6 −5 commands/incrbyfloat.md
  37. +13 −9 commands/info.md
  38. +10 −7 commands/keys.md
  39. +4 −4 commands/lastsave.md
  40. +6 −5 commands/lindex.md
  41. +3 −3 commands/llen.md
  42. +12 −10 commands/lpush.md
  43. +3 −2 commands/lpushx.md
  44. +16 −13 commands/lrange.md
  45. +2 −2 commands/lrem.md
  46. +2 −2 commands/lset.md
  47. +13 −9 commands/ltrim.md
  48. +4 −3 commands/mget.md
  49. +13 −12 commands/migrate.md
  50. +9 −8 commands/monitor.md
  51. +4 −3 commands/move.md
  52. +6 −5 commands/mset.md
  53. +6 −4 commands/msetnx.md
  54. +2 −2 commands/multi.md
  55. +20 −15 commands/object.md
  56. +3 −2 commands/ping.md
  57. +3 −2 commands/punsubscribe.md
  58. +3 −2 commands/quit.md
  59. +4 −3 commands/rename.md
  60. +2 −2 commands/renamenx.md
  61. +2 −2 commands/restore.md
  62. +21 −17 commands/rpoplpush.md
  63. +12 −10 commands/rpush.md
  64. +3 −2 commands/rpushx.md
  65. +6 −5 commands/sadd.md
  66. +5 −4 commands/save.md
  67. +3 −3 commands/script exists.md
  68. +7 −6 commands/script kill.md
  69. +4 −4 commands/script load.md
  70. +2 −2 commands/select.md
  71. +2 −2 commands/set.md
  72. +15 −12 commands/setbit.md
  73. +5 −5 commands/setex.md
  74. +21 −15 commands/setnx.md
  75. +16 −15 commands/setrange.md
  76. +11 −8 commands/shutdown.md
  77. +3 −3 commands/sinter.md
  78. +8 −7 commands/slaveof.md
  79. +22 −16 commands/slowlog.md
  80. +9 −6 commands/smove.md
  81. +42 −36 commands/sort.md
  82. +6 −5 commands/srem.md
  83. +2 −2 commands/strlen.md
  84. +3 −3 commands/ttl.md
  85. +3 −3 commands/type.md
  86. +3 −2 commands/unsubscribe.md
  87. +10 −7 commands/zadd.md
  88. +7 −6 commands/zincrby.md
  89. +7 −6 commands/zinterstore.md
  90. +16 −13 commands/zrange.md
  91. +12 −11 commands/zrangebyscore.md
  92. +3 −2 commands/zrank.md
  93. +5 −4 commands/zrem.md
  94. +7 −5 commands/zremrangebyrank.md
  95. +2 −2 commands/zrevrange.md
  96. +3 −3 commands/zrevrangebyscore.md
  97. +3 −2 commands/zrevrank.md
  98. +12 −11 commands/zunionstore.md
  99. +6 −1 remarkdown.rb
View
@@ -1,6 +1,7 @@
If `key` already exists and is a string, this command appends the `value` at the
-end of the string. If `key` does not exist it is created and set as an empty
-string, so `APPEND` will be similar to `SET` in this special case.
+end of the string.
+If `key` does not exist it is created and set as an empty string, so `APPEND`
+will be similar to `SET` in this special case.
@return
@@ -17,24 +18,24 @@ string, so `APPEND` will be similar to `SET` in this special case.
## Pattern: Time series
the `APPEND` command can be used to create a very compact representation of a
-list of fixed-size samples, usually referred as _time series_. Every time a new
-sample arrives we can store it using the command
+list of fixed-size samples, usually referred as _time series_.
+Every time a new sample arrives we can store it using the command
APPEND timeseries "fixed-size sample"
Accessing individual elements in the time series is not hard:
* `STRLEN` can be used in order to obtain the number of samples.
-* `GETRANGE` allows for random access of elements. If our time series have an
- associated time information we can easily implement a binary search to get
- range combining `GETRANGE` with the Lua scripting engine available in Redis
- 2.6.
+* `GETRANGE` allows for random access of elements.
+ If our time series have an associated time information we can easily implement
+ a binary search to get range combining `GETRANGE` with the Lua scripting
+ engine available in Redis 2.6.
* `SETRANGE` can be used to overwrite an existing time serie.
The limitations of this pattern is that we are forced into an append-only mode
of operation, there is no way to cut the time series to a given size easily
-because Redis currently lacks a command able to trim string objects. However the
-space efficiency of time series stored in this way is remarkable.
+because Redis currently lacks a command able to trim string objects.
+However the space efficiency of time series stored in this way is remarkable.
Hint: it is possible to switch to a different key based on the current Unix
time, in this way it is possible to have just a relatively small amount of
View
@@ -1,10 +1,11 @@
-Request for authentication in a password protected Redis server. Redis can be
-instructed to require a password before allowing clients to execute commands.
+Request for authentication in a password protected Redis server.
+Redis can be instructed to require a password before allowing clients to execute
+commands.
This is done using the `requirepass` directive in the configuration file.
If `password` matches the password in the configuration file, the server replies
-with the `OK` status code and starts accepting commands. Otherwise, an error is
-returned and the clients needs to try a new password.
+with the `OK` status code and starts accepting commands.
+Otherwise, an error is returned and the clients needs to try a new password.
**Note**: because of the high performance nature of Redis, it is possible to try
a lot of passwords in parallel in very short time, so make sure to generate a
@@ -1,18 +1,22 @@
-Instruct Redis to start an [Append Only File][tpaof] rewrite process. The
-rewrite will create a small optimized version of the current Append Only File.
+Instruct Redis to start an [Append Only File][tpaof] rewrite process.
+The rewrite will create a small optimized version of the current Append Only
+File.
[tpaof]: /topics/persistence#append-only-file
If `BGREWRITEAOF` fails, no data gets lost as the old AOF will be untouched.
The rewrite will be only triggered by Redis if there is not already a background
-process doing persistence. Specifically:
+process doing persistence.
+Specifically:
* If a Redis child is creating a snapshot on disk, the AOF rewrite is
_scheduled_ but not started until the saving child producing the RDB file
- terminates. In this case the `BGREWRITEAOF` will still return an OK code, but
- with an appropriate message. You can check if an AOF rewrite is scheduled
- looking at the `INFO` command starting from Redis 2.6.
+ terminates.
+ In this case the `BGREWRITEAOF` will still return an OK code, but with an
+ appropriate message.
+ You can check if an AOF rewrite is scheduled looking at the `INFO` command
+ starting from Redis 2.6.
* If an AOF rewrite is already in progress the command returns an error and no
AOF rewrite will be scheduled for a later time.
View
@@ -1,7 +1,9 @@
-Save the DB in background. The OK code is immediately returned. Redis forks,
-the parent continues to server the clients, the child saves the DB on disk
-then exit. A client my be able to check if the operation succeeded using the
-`LASTSAVE` command.
+Save the DB in background.
+The OK code is immediately returned.
+Redis forks, the parent continues to server the clients, the child saves the DB
+on disk then exit.
+A client my be able to check if the operation succeeded using the `LASTSAVE`
+command.
Please refer to the [persistence documentation][tp] for detailed information.
View
@@ -1,8 +1,8 @@
Count the number of set bits (population counting) in a string.
-By default all the bytes contained in the string are examined. It is possible
-to specify the counting operation only in an interval passing the additional
-arguments _start_ and _end_.
+By default all the bytes contained in the string are examined.
+It is possible to specify the counting operation only in an interval passing the
+additional arguments _start_ and _end_.
Like for the `GETRANGE` command start and end can contain negative values in
order to index bytes starting from the end of the string, where -1 is the last
@@ -27,13 +27,15 @@ The number of bits set to 1.
## Pattern: real time metrics using bitmaps
Bitmaps are a very space efficient representation of certain kinds of
-information. One example is a web application that needs the history of user
-visits, so that for instance it is possible to determine what users are good
-targets of beta features, or for any other purpose.
+information.
+One example is a web application that needs the history of user visits, so that
+for instance it is possible to determine what users are good targets of beta
+features, or for any other purpose.
-Using the `SETBIT` command this is trivial to accomplish, identifying every
-day with a small progressive integer. For instance day 0 is the first day the
-application was put online, day 1 the next day, and so forth.
+Using the `SETBIT` command this is trivial to accomplish, identifying every day
+with a small progressive integer.
+For instance day 0 is the first day the application was put online, day 1 the
+next day, and so forth.
Every time an user performs a page view, the application can register that in
the current day the user visited the web site using the `SETBIT` command setting
@@ -52,8 +54,9 @@ bitmaps][hbgc212fermurb]".
In the above example of counting days, even after 10 years the application is
online we still have just `365*10` bits of data per user, that is just 456 bytes
-per user. With this amount of data `BITCOUNT` is still as fast as any other O(1)
-Redis command like `GET` or `INCR`.
+per user.
+With this amount of data `BITCOUNT` is still as fast as any other O(1) Redis
+command like `GET` or `INCR`.
When the bitmap is big, there are two alternatives:
View
@@ -41,8 +41,9 @@ size of the longest input string.
## Pattern: real time metrics using bitmaps
`BITOP` is a good complement to the pattern documented in the `BITCOUNT` command
-documentation. Different bitmaps can be combined in order to obtain a target
-bitmap where to perform the population counting operation.
+documentation.
+Different bitmaps can be combined in order to obtain a target bitmap where to
+perform the population counting operation.
See the article called "[Fast easy realtime metrics using Redis
bitmaps][hbgc212fermurb]" for an interesting use cases.
@@ -51,8 +52,8 @@ bitmaps][hbgc212fermurb]" for an interesting use cases.
## Performance considerations
-`BITOP` is a potentially slow command as it runs in O(N) time. Care should be
-taken when running it against long input strings.
+`BITOP` is a potentially slow command as it runs in O(N) time.
+Care should be taken when running it against long input strings.
For real time metrics and statistics involving large inputs a good approach is
to use a slave (with read-only option disabled) where to perform the bit-wise
View
@@ -1,17 +1,19 @@
-`BLPOP` is a blocking list pop primitive. It is the blocking version of `LPOP`
-because it blocks the connection when there are no elements to pop from any of
-the given lists. An element is popped from the head of the first list that is
-non-empty, with the given keys being checked in the order that they are given.
+`BLPOP` is a blocking list pop primitive.
+It is the blocking version of `LPOP` because it blocks the connection when there
+are no elements to pop from any of the given lists.
+An element is popped from the head of the first list that is non-empty, with the
+given keys being checked in the order that they are given.
## Non-blocking behavior
When `BLPOP` is called, if at least one of the specified keys contain a
non-empty list, an element is popped from the head of the list and returned to
the caller together with the `key` it was popped from.
-Keys are checked in the order that they are given. Let's say that the key
-`list1` doesn't exist and `list2` and `list3` hold non-empty lists. Consider the
-following command:
+Keys are checked in the order that they are given.
+Let's say that the key `list1` doesn't exist and `list2` and `list3` hold
+non-empty lists.
+Consider the following command:
BLPOP list1 list2 list3 0
@@ -32,27 +34,29 @@ the client will unblock returning a `nil` multi-bulk value when the specified
timeout has expired without a push operation against at least one of the
specified keys.
-The timeout argument is interpreted as an integer value. A timeout of zero can
-be used to block indefinitely.
+The timeout argument is interpreted as an integer value.
+A timeout of zero can be used to block indefinitely.
## Multiple clients blocking for the same keys
-Multiple clients can block for the same key. They are put into a queue, so the
-first to be served will be the one that started to wait earlier, in a first-
-`!BLPOP` first-served fashion.
+Multiple clients can block for the same key.
+They are put into a queue, so the first to be served will be the one that
+started to wait earlier, in a first- `!BLPOP` first-served fashion.
## `!BLPOP` inside a `!MULTI` / `!EXEC` transaction
`BLPOP` can be used with pipelining (sending multiple commands and reading the
replies in batch), but it does not make sense to use `BLPOP` inside a `MULTI` /
-`EXEC` block. This would require blocking the entire server in order to execute
-the block atomically, which in turn does not allow other clients to perform a
-push operation.
+`EXEC` block.
+This would require blocking the entire server in order to execute the block
+atomically, which in turn does not allow other clients to perform a push
+operation.
The behavior of `BLPOP` inside `MULTI` / `EXEC` when the list is empty is to
-return a `nil` multi-bulk reply, which is the same thing that happens when
-the timeout is reached. If you like science fiction, think of time flowing at
-infinite speed inside a `MULTI` / `EXEC` block.
+return a `nil` multi-bulk reply, which is the same thing that happens when the
+timeout is reached.
+If you like science fiction, think of time flowing at infinite speed inside a
+`MULTI` / `EXEC` block.
@return
@@ -76,11 +80,12 @@ infinite speed inside a `MULTI` / `EXEC` block.
## Pattern: Event notification
Using blocking list operations it is possible to mount different blocking
-primitives. For instance for some application you may need to block waiting for
-elements into a Redis Set, so that as far as a new element is added to the Set,
-it is possible to retrieve it without resort to polling. This would require
-a blocking version of `SPOP` that is not available, but using blocking list
-operations we can easily accomplish this task.
+primitives.
+For instance for some application you may need to block waiting for elements
+into a Redis Set, so that as far as a new element is added to the Set, it is
+possible to retrieve it without resort to polling.
+This would require a blocking version of `SPOP` that is not available, but using
+blocking list operations we can easily accomplish this task.
The consumer will do:
View
@@ -1,7 +1,8 @@
-`BRPOP` is a blocking list pop primitive. It is the blocking version of `RPOP`
-because it blocks the connection when there are no elements to pop from any of
-the given lists. An element is popped from the tail of the first list that is
-non-empty, with the given keys being checked in the order that they are given.
+`BRPOP` is a blocking list pop primitive.
+It is the blocking version of `RPOP` because it blocks the connection when there
+are no elements to pop from any of the given lists.
+An element is popped from the tail of the first list that is non-empty, with the
+given keys being checked in the order that they are given.
See the [BLPOP documentation][cb] for the exact semantics, since `BRPOP` is
identical to `BLPOP` with the only difference being that it pops elements from
@@ -1,7 +1,8 @@
-`BRPOPLPUSH` is the blocking variant of `RPOPLPUSH`. When `source` contains
-elements, this command behaves exactly like `RPOPLPUSH`. When `source` is empty,
-Redis will block the connection until another client pushes to it or until
-`timeout` is reached. A `timeout` of zero can be used to block indefinitely.
+`BRPOPLPUSH` is the blocking variant of `RPOPLPUSH`.
+When `source` contains elements, this command behaves exactly like `RPOPLPUSH`.
+When `source` is empty, Redis will block the connection until another client
+pushes to it or until `timeout` is reached.
+A `timeout` of zero can be used to block indefinitely.
See `RPOPLPUSH` for more information.
@@ -1,14 +1,15 @@
The `CONFIG GET` command is used to read the configuration parameters of a
-running Redis server. Not all the configuration parameters are supported in
-Redis 2.4, while Redis 2.6 can read the whole configuration of a server using
-this command.
+running Redis server.
+Not all the configuration parameters are supported in Redis 2.4, while Redis 2.6
+can read the whole configuration of a server using this command.
The symmetric command used to alter the configuration at run time is `CONFIG
SET`.
-`CONFIG GET` takes a single argument, that is glob style pattern. All the
-configuration parameters matching this parameter are reported as a list of
-key-value pairs. Example:
+`CONFIG GET` takes a single argument, that is glob style pattern.
+All the configuration parameters matching this parameter are reported as a list
+of key-value pairs.
+Example:
redis> config get *max-*-entries*
1) "hash-max-zipmap-entries"
@@ -31,8 +32,8 @@ following important differences:
the `redis.conf` abbreviated form (10k 2gb ... and so forth), everything
should be specified as a well formed 64 bit integer, in the base unit of the
configuration directive.
-* The save parameter is a single string of space separated integers. Every pair
- of integers represent a seconds/modifications threshold.
+* The save parameter is a single string of space separated integers.
+ Every pair of integers represent a seconds/modifications threshold.
For instance what in `redis.conf` looks like:
@@ -1,6 +1,7 @@
The `CONFIG SET` command is used in order to reconfigure the server at run time
-without the need to restart Redis. You can change both trivial parameters or
-switch from one to another persistence option using this command.
+without the need to restart Redis.
+You can change both trivial parameters or switch from one to another persistence
+option using this command.
The list of configuration parameters supported by `CONFIG SET` can be obtained
issuing a `CONFIG GET *` command, that is the symmetrical command used to obtain
@@ -20,8 +21,8 @@ following important differences:
the `redis.conf` abbreviated form (10k 2gb ... and so forth), everything
should be specified as a well formed 64 bit integer, in the base unit of the
configuration directive.
-* The save parameter is a single string of space separated integers. Every pair
- of integers represent a seconds/modifications threshold.
+* The save parameter is a single string of space separated integers.
+ Every pair of integers represent a seconds/modifications threshold.
For instance what in `redis.conf` looks like:
@@ -33,8 +34,8 @@ and after 300 seconds if there are at least 10 changes to the datasets, should
be set using `CONFIG SET` as "900 1 300 10".
It is possible to switch persistence from RDB snapshotting to append only file
-(and the other way around) using the `CONFIG SET` command. For more information
-about how to do that please check [persistence page][tp].
+(and the other way around) using the `CONFIG SET` command.
+For more information about how to do that please check [persistence page][tp].
[tp]: /topics/persistence
@@ -49,5 +50,5 @@ options are not mutually exclusive.
@return
-@status-reply: `OK` when the configuration was set properly. Otherwise an error
-is returned.
+@status-reply: `OK` when the configuration was set properly.
+Otherwise an error is returned.
@@ -1,4 +1,4 @@
-`DEBUG OBJECT` is a debugging command that should not be used by clients. Check
-the `OBJECT` command instead.
+`DEBUG OBJECT` is a debugging command that should not be used by clients.
+Check the `OBJECT` command instead.
@status-reply
@@ -1,4 +1,4 @@
-`DEBUG SEGFAULT` performs an invalid memory access that crashes Redis. It is
-used to simulate bugs during the development.
+`DEBUG SEGFAULT` performs an invalid memory access that crashes Redis.
+It is used to simulate bugs during the development.
@status-reply
View
@@ -1,7 +1,8 @@
-Decrements the number stored at `key` by one. If the key does not exist, it
-is set to `0` before performing the operation. An error is returned if the
-key contains a value of the wrong type or contains a string that can not be
-represented as integer. This operation is limited to **64 bit signed integers**.
+Decrements the number stored at `key` by one.
+If the key does not exist, it is set to `0` before performing the operation.
+An error is returned if the key contains a value of the wrong type or contains a
+string that can not be represented as integer.
+This operation is limited to **64 bit signed integers**.
See `INCR` for extra information on increment/decrement operations.
View
@@ -1,7 +1,8 @@
-Decrements the number stored at `key` by `decrement`. If the key does not exist,
-it is set to `0` before performing the operation. An error is returned if the
-key contains a value of the wrong type or contains a string that can not be
-represented as integer. This operation is limited to 64 bit signed integers.
+Decrements the number stored at `key` by `decrement`.
+If the key does not exist, it is set to `0` before performing the operation.
+An error is returned if the key contains a value of the wrong type or contains a
+string that can not be represented as integer.
+This operation is limited to 64 bit signed integers.
See `INCR` for extra information on increment/decrement operations.
Oops, something went wrong. Retry.

0 comments on commit 339e513

Please sign in to comment.