Permalink
Browse files

Merge branch 'master' of github.com:/antirez/redis-doc

  • Loading branch information...
antirez committed Jul 10, 2012
2 parents 55faf47 + 9648f0b commit 9590458d8bf0df2b125488590f23efd886798f76
Showing with 45 additions and 30 deletions.
  1. +4 −4 commands/append.md
  2. +1 −1 commands/auth.md
  3. +1 −1 commands/bgrewriteaof.md
  4. +5 −5 commands/bitcount.md
  5. +8 −8 commands/bitop.md
  6. +3 −2 commands/setnx.md
  7. +16 −3 remarkdown.rb
  8. +7 −6 topics/sentinel-spec.md
View
@@ -18,7 +18,7 @@ GET mykey
## Pattern: Time series
-the `APPEND` command can be used to create a very compact representation of a
+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
@@ -30,12 +30,12 @@ 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
+ If our time series have 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.
+* `SETRANGE` can be used to overwrite an existing time series.
-The limitations of this pattern is that we are forced into an append-only mode
+The limitation 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.
View
@@ -1,4 +1,4 @@
-Request for authentication in a password protected Redis server.
+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.
View
@@ -16,7 +16,7 @@ Specifically:
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.
+ as of 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
@@ -8,7 +8,7 @@ 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
byte, -2 is the penultimate, and so forth.
-Non existing keys are treated as empty strings, so the command will return zero.
+Non-existent keys are treated as empty strings, so the command will return zero.
@return
@@ -25,13 +25,13 @@ BITCOUNT mykey 0 0
BITCOUNT mykey 1 1
```
-## Pattern: real time metrics using bitmaps
+## Pattern: real-time metrics using bitmaps
-Bitmaps are a very space efficient representation of certain kinds of
+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
+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.
+features.
Using the `SETBIT` command this is trivial to accomplish, identifying every day
with a small progressive integer.
View
@@ -20,14 +20,14 @@ When an operation is performed between strings having different lengths, all the
strings shorter than the longest string in the set are treated as if they were
zero-padded up to the length of the longest string.
-The same holds true for non-existing keys, that are considered as a stream of
+The same holds true for non-existent keys, that are considered as a stream of
zero bytes up to the length of the longest string.
@return
@integer-reply
-The size of the string stored into the destination key, that is equal to the
+The size of the string stored in the destination key, that is equal to the
size of the longest input string.
@examples
@@ -43,11 +43,11 @@ GET dest
`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.
+Different bitmaps can be combined in order to obtain a target bitmap where
+the population counting operation is performed.
See the article called "[Fast easy realtime metrics using Redis
-bitmaps][hbgc212fermurb]" for an interesting use cases.
+bitmaps][hbgc212fermurb]" for a interesting use cases.
[hbgc212fermurb]: http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps
@@ -56,6 +56,6 @@ bitmaps][hbgc212fermurb]" for an interesting use cases.
`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
-operations without blocking the master instance.
+For real-time metrics and statistics involving large inputs a good approach is
+to use a slave (with read-only option disabled) where the bit-wise
+operations are performed to avoid blocking the master instance.
View
@@ -39,8 +39,9 @@ retrying to hold the lock until we succeed or some kind of timeout expires.
### Handling deadlocks
In the above locking algorithm there is a problem: what happens if a client
-fails, crashes, or is otherwise not able to release the lock? It's possible to
-detect this condition because the lock key contains a UNIX timestamp.
+fails, crashes, or is otherwise not able to release the lock?
+It's possible to detect this condition because the lock key contains a UNIX
+timestamp.
If such a timestamp is equal to the current Unix time the lock is no longer
valid.
View
@@ -14,7 +14,7 @@ def initialize(input)
:fenced_code_blocks => true,
:superscript => true
- @xml = Nokogiri::XML::Document.parse("<doc>#{markdown.render(input)}</doc>")
+ @xml = Nokogiri::HTML::Document.parse("<doc>#{markdown.render(input)}</doc>")
@links = []
@indent = 0
@@ -26,7 +26,7 @@ def initialize(input)
def to_s
parts = []
- @xml.at("/doc").children.each do |node|
+ @xml.at("//doc").children.each do |node|
parts << format_block_node(node)
parts << flush_links
end
@@ -95,7 +95,7 @@ def format_inline_nodes(nodes)
end
end
- sentences = result.gsub(/\s*\r?\n\s*/, " ").split(/(?<=[^.]\.)\s+/)
+ sentences = result.gsub(/\s*\r?\n\s*/, " ").split(/(?<=(?:[^.]\.)|[?!])\s+/)
sentences = sentences.map do |e|
par(e).chomp
end
@@ -131,6 +131,19 @@ def format_inline_node(node)
@links << [id, href]
"[%s][%s]" % [format_inline_nodes(node.children).chomp, id]
+ when "img"
+ src = node["src"]
+
+ id = src.
+ gsub(/[^\w]/, " ").
+ split(/\s+/).
+ map { |e| e.to_s[0] }.
+ join.
+ downcase
+
+ @links << [id, src]
+
+ "![%s][%s]" % [node["alt"].chomp, id]
else
raise "don't know what to do for inline node #{node.name}"
end
View
@@ -58,7 +58,7 @@ Python program) in an user setup specific way.
In what form it will be shipped
===
-Redis Sentinel is just be a special mode of the redis-server executable.
+Redis Sentinel is just a special mode of the redis-server executable.
If the redis-server is called with "redis-sentinel" as `argv[0]` (for instance
using a symbolic link or copying the file), or if --sentinel option is passed,
@@ -74,6 +74,7 @@ Sentinels networking
===
All the sentinels take persistent connections with:
+
* The monitored masters.
* All its slaves, that are discovered using the master's INFO output.
* All the other Sentinels connected to this master, discovered via Pub/Sub.
@@ -84,7 +85,7 @@ external clients.
Redis Sentinels export a SENTINEL command. Subcommands of the SENTINEL
command are used in order to perform different actions.
-For instnace the `SENTINEL masters` command enumerates all the monitored
+For instance the `SENTINEL masters` command enumerates all the monitored
masters and their states. However Sentinels can also reply to the PING command
as a normal Redis instance, so that it is possible to monitor a Sentinel
considering it a normal Redis instance.
@@ -172,7 +173,7 @@ Sentinel can reach independently this state.
The SENTINEL is-master-down-by-addr command
===
-Sentinels ask other Sentinels the state of a master from their local point
+Sentinels ask other Sentinels for the state of a master from their local point
of view using the `SENTINEL is-master-down-by-addr` command. This command
replies with a boolean value (in the form of a 0 or 1 integer reply, as
a first element of a multi bulk reply).
@@ -199,7 +200,7 @@ and runid, if we can't find a perfect match (same runid and address) inside
the Sentinels table for that master, we remove any other Sentinel with the same
runid OR the same address. And later add the new Sentinel.
-For instance if a Sentienl instance is restarted, the Run ID will be different,
+For instance if a Sentinel instance is restarted, the Run ID will be different,
and the old Sentinel with the same IP address and port pair will be removed.
Starting the failover: Leaders and Observers
@@ -245,7 +246,7 @@ and the subjective leaders of all the other Sentinels with a frequency of
10 HZ, and will flag itself as the Leader if the following conditions happen:
* It is the Subjective Leader of itself.
-* At least N-1 other Sentinels that see the master as down, and are reachable, also thing that it is the Leader. With N being the quorum configured for this master.
+* At least N-1 other Sentinels that see the master as down, and are reachable, also think that it is the Leader. With N being the quorum configured for this master.
* At least 50% + 1 of all the Sentinels involved in the voting process (that are reachable and that also see the master as failing) should agree on the Leader.
So for instance if there are a total of three sentinels, the master is failing,
@@ -279,7 +280,7 @@ time) is given by the random delay used to start the fail over, and the
continuous monitor of the slave instances to detect if another Sentinel
(or an human) started the failover process.
-Morehover the slave to promote is selected using a deterministic process to
+Moreover the slave to promote is selected using a deterministic process to
minimize the chance that two different Sentinels with full vision of the
working slaves may pick two different slaves to promote.

0 comments on commit 9590458

Please sign in to comment.