Permalink
Browse files

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

  • Loading branch information...
2 parents 07eec3f + 36b3565 commit e4be1fcbd7b8c00f37c02fd9295c00d1a1adc809 @pietern pietern committed Apr 14, 2011
Showing with 314 additions and 87 deletions.
  1. +32 −4 clients.json
  2. +17 −0 commands.json
  3. +39 −2 commands/config get.md
  4. +45 −2 commands/config set.md
  5. +0 −72 commands/config.md
  6. +59 −0 commands/object.md
  7. +4 −3 commands/srandmember.md
  8. +117 −3 topics/data-types.md
  9. +1 −1 topics/pubsub.md
View
@@ -35,14 +35,22 @@
},
{
- "name": "erldis",
+ "name": "Erldis",
"language": "Erlang",
"repository": "http://github.com/japerk/erldis",
"description": "",
"authors": ["dialtone_","japerk"]
},
{
+ "name": "Eredis",
+ "language": "Erlang",
+ "repository": "https://github.com/wooga/eredis",
+ "description": "Redis client with a focus on performance",
+ "authors": ["wooga"]
+ },
+
+ {
"name": "Go-Redis",
"language": "Go",
"repository": "http://github.com/alphazero/Go-Redis",
@@ -115,7 +123,8 @@
"language": "Lua",
"repository": "http://github.com/nrk/redis-lua",
"description": "",
- "authors": ["JoL1hAHN"]
+ "authors": ["JoL1hAHN"],
+ "recommended": true
},
{
@@ -235,7 +244,8 @@
"language": "Scala",
"repository": "https://github.com/debasishg/scala-redis",
"description": "Apparently a fork of the original client from @alejandrocrosa",
- "authors": ["debasishg"]
+ "authors": ["debasishg"],
+ "recommended": true
},
{
@@ -259,7 +269,25 @@
"language": "C#",
"url": "https://github.com/ServiceStack/ServiceStack.Redis",
"description": "This is a fork and improvement of the original C# client written by Miguel De Icaza.",
- "authors": ["demisbellot"]
+ "authors": ["demisbellot"],
+ "recommended": true
+ },
+
+ {
+ "name": "Booksleeve",
+ "language": "C#",
+ "url": "http://code.google.com/p/booksleeve/",
+ "description": "This client was developed by Stack Exchange for very high performance needs.",
+ "authors": ["marcgravell"],
+ "recommended": true
+ },
+
+ {
+ "name": "Sider",
+ "language": "C#",
+ "url": "http://nuget.org/List/Packages/Sider",
+ "description": "Minimalistic client for C#/.NET 4.0",
+ "authors": ["chakrit"]
},
{
View
@@ -761,6 +761,23 @@
"since": "1.1.95",
"group": "transactions"
},
+ "OBJECT": {
+ "summary": "Inspect the internals of Redis objects",
+ "since": "2.2.3",
+ "group": "generic",
+ "arguments": [
+ {
+ "name": "subcommand",
+ "type": "string"
+ },
+ {
+ "name": "arguments",
+ "type": "string",
+ "optional": true,
+ "multiple": true
+ }
+ ]
+ },
"PERSIST": {
"summary": "Remove the expiration from a key",
"arguments": [
View
@@ -1,7 +1,44 @@
@complexity
+Not applicable.
+
@description
-@examples
+The CONFIG GET ommand is used to read the configuration parameters of a running
+Redis server. Not all the configuration parameters are supported.
+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:
+
+ redis> config get *max-*-entries*
+ 1) "hash-max-zipmap-entries"
+ 2) "512"
+ 3) "list-max-ziplist-entries"
+ 4) "512"
+ 5) "set-max-intset-entries"
+ 6) "512"
+
+You can obtain a list of all the supported configuration parameters typing
+`CONFIG GET *` in an open redis-cli prompt.
+
+All the supported parameters have the same meaning of the equivalent
+configuration parameter used in the [redis.conf](http://github.com/antirez/redis/raw/2.2/redis.conf) file, with the following important differences:
+
+* Where bytes or other quantities are specified, it is not possible to use 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.
+
+For instance what in redis.conf looks like:
+
+ save 900 1
+ save 300 10
+
+that means, save after 900 seconds if there is at least 1 change to the
+dataset, and after 300 seconds if there are at least 10 changes to the
+datasets, will be reported by `CONFIG GET` as "900 1 300 10".
+
+@return
-@return
+The return type of the command is a @bulk-reply.
View
@@ -1,7 +1,50 @@
@complexity
+Not applicable.
+
@description
-@examples
+The `CONFIG SET` command is used in order to reconfigure the server at runtime
+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 informations about the configuration of a running
+Redis instance.
+
+All the configuration parameters set using `CONFIG SET` are immediately loaded
+by Redis that will start acting as specified starting from the next command
+executed.
+
+All the supported parameters have the same meaning of the equivalent
+configuration parameter used in the [redis.conf](http://github.com/antirez/redis/raw/2.2/redis.conf) file, with the following important differences:
+
+* Where bytes or other quantities are specified, it is not possible to use 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.
+
+For instance what in redis.conf looks like:
+
+ save 900 1
+ save 300 10
+
+that means, save after 900 seconds if there is at least 1 change to the
+dataset, 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 form .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](/topics/persistence).
+
+In general what you should know is that setting the *appendonly* parameter to
+*yes* will start a background process to save the initial append only file
+(obtained from the in memory data set), and will append all the subsequent
+commands on the append only file, thus obtaining exactly the same effect of
+a Redis server that started with AOF turned on since the start.
+
+You can have both the AOF enabled with .rdb snapshotting if you want, the
+two options are not mutually exclusive.
+
+@return
-@return
+@status-reply: `OK` when the configuration was set properly. Otherwise an error is returned.
View
@@ -1,72 +0,0 @@
-
-
-The CONFIG command is able to retrieve or alter the configuration of a running
-Redis server. Not all the configuration parameters are supported.
-
-CONFIG has two sub commands, `GET` and `SET`. The `GET` command is used to read
-the configuration, while the `SET` command is used to alter the configuration.
-
-## CONFIG `GET` pattern
-
-CONFIG `GET` returns the current configuration parameters. This sub command
-only accepts 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-cli config get '*'
- 1. dbfilename
- 2. dump.rdb
- 3. requirepass
- 4. (nil)
- 5. masterauth
- 6. (nil)
- 7. maxmemory
- 8. 0\n
- 9. appendfsync
- 10. everysec
- 11. save
- 12. 3600 1 300 100 60 10000
-
- $ redis-cli config get 'm*'
- 1. masterauth
- 2. (nil)
- 3. maxmemory
- 4. 0\n
-
-The return type of the command is a @bulk-reply.
-
-## CONFIG `SET` parameter value
-
-CONFIG `SET` is used in order to reconfigure the server, setting a specific
-configuration parameter to a new value.
-
-The list of configuration parameters supported by CONFIG `SET` can be
-obtained issuing a CONFIG `GET` * command.
-
-The configuration set using CONFIG `SET` is immediately loaded by the Redis
-server that will start acting as specified starting from the next command.
-
-Example:
- $ ./redis-cli
- SET x 10
- OK
- CONFIG set maxmemory 200
- OK
- SET y 20
- (error) ERR command not allowed when used memory 'maxmemory'
- CONFIG set maxmemory 0
- OK
- SET y 20
- OK
-
-## Parameters value forma
-
-The value of the configuration parameter is the same as the one of the
-same parameter in the Redis configuration file, with the following exceptions:
-
-* The save paramter is a list of space-separated integers. Every pair of integers specify the time and number of changes limit to trigger a save. For instance the command CONFIG `SET` save 3600 10 60 10000 will configure the server to issue a background saving of the RDB file every 3600 seconds if there are at least 10 changes in the dataset, and every 60 seconds if there are at least 10000 changes. To completely disable automatic snapshots just set the parameter as an empty string.
-* All the integer parameters representing memory are returned and accepted only using bytes as unit.
-
-## See Also
-
-The `INFO` command can be used in order to read configuriaton parameters
-that are not available in the CONFIG command.
View
@@ -0,0 +1,59 @@
+@complexity
+
+O(1) for all the currently implemented subcommands.
+
+The `OBJECT` command allows to inspect the internals of Redis Objects associated
+with keys. It is useful for debugging or to understand if your keys are using
+the specially encoded data types to save space. Your application may also use
+the information reported by the `OBJECT` command to implement application level
+key eviction policies when using Redis as a Cache.
+
+The `OBJECT` command supports multiple sub commands:
+
+* `OBJECT REFCOUNT <key>` returns the number of references of the value associated with the specified key. This command is mainly useful for debugging.
+* `OBJECT ENCODING <key>` returns the kind of internal representation used in order to store the value associated with a key.
+* `OBJECT IDLETIME <key>` returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations). While the value is returned in seconds the actual resolution of this timer is 10 seconds, but may vary in future implementations.
+
+Objects can be encoded in different ways:
+
+* Strings can be encoded as `raw` (normal string encoding) or `int` (strings representing integers in a 64 bit signed interval are encoded in this way in order to save space).
+* Lists can be encoded as `ziplist` or `linkedlist`. The `ziplist` is the special representation that is used to save space for small lists.
+* Sets can be encoded as `intset` or `hashtable`. The `intset` is a special encoding used for small sets composed solely of integers.
+* Hashes can be encoded as `zipmap` or `hashtable`. The `zipmap` is a special encoding used for small hashes.
+* Sorted Sets can be encoded as `ziplist` or `skiplist` format. As for the List type small sorted sets can be specially encoded using `ziplist`, while the `skiplist` encoding is the one that works with sorted sets of any size.
+
+All the specially encoded types are automatically converted to the general type once you perform an operation that makes it no possible for Redis to retain the space saving encoding.
+
+@return
+
+Different return values are used for different subcommands.
+
+* Subcommands `refcount` and `idletime` returns integers.
+* Subcommand `encoding` returns a bulk reply.
+
+If the object you try to inspect is missing, a null bulk reply is returned.
+
+@examples
+
+ redis> lpush mylist "Hello World"
+ (integer) 4
+ redis> object refcount mylist
+ (integer) 1
+ redis> object encoding mylist
+ "ziplist"
+ redis> object idletime mylist
+ (integer) 10
+
+In the following example you can see how the encoding changes once Redis is no longer able to use the space saving encoding.
+
+ redis> set foo 1000
+ OK
+ redis> object encoding foo
+ "int"
+ redis> append foo bar
+ (integer) 7
+ redis> get foo
+ "1000bar"
+ redis> object encoding foo
+ "raw"
+
View
@@ -3,10 +3,11 @@
O(1)
-Returns a random element from the set value stored at `key`.
+Return a random element from the set value stored at `key`.
-This operation is similar to `SPOP`, that also removes the randomly
-selected element.
+This operation is similar to `SPOP`, however while `SPOP` also removes the
+randomly selected element from the set, `SRANDMEMBER` will just return a random
+element without altering the original set in any way.
@return
Oops, something went wrong.

0 comments on commit e4be1fc

Please sign in to comment.