Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untrademark json files #26

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/commands/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
This directory contains JSON files, one for each of Redis commands.
This directory contains JSON files, one for each command.

Each JSON contains all the information about the command itself, but these JSON files are not to be used directly!
Any third party who needs access to command information must get it from `COMMAND INFO` and `COMMAND DOCS`.
The output can be extracted in a JSON format by using `redis-cli --json`, in the same manner as in `utils/generate-commands-json.py`.

The JSON files are used to generate commands.def (and https://github.com/redis/redis-doc/blob/master/commands.json) in Redis, and
The JSON files are used to generate commands.def within this repo and JSON files for documentation, and
despite looking similar to the output of `COMMAND` there are some fields and flags that are implicitly populated, and that's the
reason one shouldn't rely on the raw files.

The structure of each JSON is somewhat documented in https://redis.io/commands/command-docs/ and https://redis.io/commands/command/

The `reply_schema` section is a standard JSON Schema (see https://json-schema.org/) that describes the reply of each command.
It is designed to someday be used to auto-generate code in client libraries, but is not yet mature and is not exposed externally.

2 changes: 1 addition & 1 deletion src/commands/append.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"APPEND": {
"summary": "Appends a string to the value of a key. Creates the key if it doesn't exist.",
"complexity": "O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.",
"complexity": "O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by the server will double the free space available on every reallocation.",
"group": "string",
"since": "2.0.0",
"arity": 3,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cluster.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"CLUSTER": {
"summary": "A container for Redis Cluster commands.",
"summary": "A container for Cluster commands.",
"complexity": "Depends on subcommand.",
"group": "cluster",
"since": "3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/command-count.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"CONNECTION"
],
"reply_schema": {
"description": "Number of total commands in this Redis server.",
"description": "Number of total commands in this server.",
"type": "integer"
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/commands/command-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"type": "string"
},
"since": {
"description": "the Redis version that added the command (or for module commands, the module version).",
"description": "the server verion that added the command (or for module commands, the module version).",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "the server verion that added the command (or for module commands, the module version).",
"description": "the server version that added the command (or for module commands, the module version).",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I misspelled in the mass replace. 😪

"type": "string"
},
"group": {
Expand Down Expand Up @@ -118,7 +118,7 @@
}
},
"deprecated_since": {
"description": "the Redis version that deprecated the command (or for module commands, the module version)",
"description": "the server verion that deprecated the command (or for module commands, the module version)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "the server verion that deprecated the command (or for module commands, the module version)",
"description": "the server version that deprecated the command (or for module commands, the module version)",

"type": "string"
},
"replaced_by": {
Expand All @@ -135,7 +135,7 @@
"items": [
{
"type": "string",
"description": "The Redis version that the entry applies to."
"description": "The server verion that the entry applies to."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "The server verion that the entry applies to."
"description": "The server version that the entry applies to."

},
{
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/command-getkeys.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"CONNECTION"
],
"reply_schema": {
"description": "List of keys from the given Redis command.",
"description": "List of keys from the given command.",
"type": "array",
"items": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/commands/command-getkeysandflags.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"CONNECTION"
],
"reply_schema": {
"description": "List of keys from the given Redis command and their usage flags.",
"description": "List of keys from the given command and their usage flags.",
"type": "array",
"uniqueItems": true,
"items": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/command-list.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"LIST": {
"summary": "Returns a list of command names.",
"complexity": "O(N) where N is the total number of Redis commands",
"complexity": "O(N) where N is the total number of commands",
"group": "server",
"since": "7.0.0",
"arity": -2,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/command.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"COMMAND": {
"summary": "Returns detailed information about all commands.",
"complexity": "O(N) where N is the total number of Redis commands",
"complexity": "O(N) where N is the total number of commands",
"group": "server",
"since": "2.8.13",
"arity": -1,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/dump.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DUMP": {
"summary": "Returns a serialized representation of the value stored at a key.",
"complexity": "O(1) to access the key and additional O(N*M) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1).",
"complexity": "O(1) to access the key and additional O(N*M) to serialize it, where N is the number of objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1).",
"group": "generic",
"since": "2.6.0",
"arity": 2,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/hello.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"HELLO": {
"summary": "Handshakes with the Redis server.",
"summary": "Handshakes with the server.",
"complexity": "O(1)",
"group": "connection",
"since": "6.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/lolwut.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"LOLWUT": {
"summary": "Displays computer art and the Redis version",
"summary": "Displays computer art and the server verion",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"summary": "Displays computer art and the server verion",
"summary": "Displays computer art and the server version",

"group": "server",
"since": "5.0.0",
"arity": -1,
Expand All @@ -11,7 +11,7 @@
],
"reply_schema": {
"type": "string",
"description": "String containing the generative computer art, and a text with the Redis version."
"description": "String containing the generative computer art, and a text with the server verion."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "String containing the generative computer art, and a text with the server verion."
"description": "String containing the generative computer art, and a text with the server version."

},
"arguments": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/commands/migrate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MIGRATE": {
"summary": "Atomically transfers a key from one Redis instance to another.",
"summary": "Atomically transfers a key from one instance to another.",
"complexity": "This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed.",
"group": "generic",
"since": "2.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/object-encoding.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ENCODING": {
"summary": "Returns the internal encoding of a Redis object.",
"summary": "Returns the internal encoding of an object.",
"complexity": "O(1)",
"group": "generic",
"since": "2.2.3",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/object-freq.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FREQ": {
"summary": "Returns the logarithmic access frequency counter of a Redis object.",
"summary": "Returns the logarithmic access frequency counter of an object.",
"complexity": "O(1)",
"group": "generic",
"since": "4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/object-idletime.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"IDLETIME": {
"summary": "Returns the time since the last access to a Redis object.",
"summary": "Returns the time since the last access to an object.",
"complexity": "O(1)",
"group": "generic",
"since": "2.2.3",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/publish.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
],
"reply_schema": {
"description": "the number of clients that received the message. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count",
"description": "the number of clients that received the message. Note that in a Cluster, only clients that are connected to the same node as the publishing client are included in the count",
"type": "integer",
"minimum": 0
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/readonly.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"READONLY": {
"summary": "Enables read-only queries for a connection to a Redis Cluster replica node.",
"summary": "Enables read-only queries for a connection to a Cluster replica node.",
"complexity": "O(1)",
"group": "cluster",
"since": "3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/restore-asking.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"RESTORE-ASKING": {
"summary": "An internal command for migrating keys in a cluster.",
"complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).",
"complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).",
"group": "server",
"since": "3.0.0",
"arity": -4,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/restore.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"RESTORE": {
"summary": "Creates a key from the serialized representation of a value.",
"complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).",
"complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).",
"group": "generic",
"since": "2.6.0",
"arity": -4,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-ckquorum.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"CKQUORUM": {
"summary": "Checks for a Redis Sentinel quorum.",
"summary": "Checks for a Sentinel quorum.",
"group": "sentinel",
"since": "2.8.4",
"arity": 3,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"CONFIG": {
"summary": "Configures Redis Sentinel.",
"summary": "Configures Sentinel.",
"complexity": "O(N) when N is the number of configuration parameters provided",
"group": "sentinel",
"since": "6.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-debug.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"DEBUG": {
"summary": "Lists or updates the current configurable parameters of Redis Sentinel.",
"summary": "Lists or updates the current configurable parameters of Sentinel.",
"complexity": "O(N) where N is the number of configurable parameters",
"group": "sentinel",
"since": "7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-failover.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FAILOVER": {
"summary": "Forces a Redis Sentinel failover.",
"summary": "Forces a Sentinel failover.",
"group": "sentinel",
"since": "2.8.4",
"arity": 3,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-flushconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FLUSHCONFIG": {
"summary": "Rewrites the Redis Sentinel configuration file.",
"summary": "Rewrites the Sentinel configuration file.",
"complexity": "O(1)",
"group": "sentinel",
"since": "2.8.4",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-get-master-addr-by-name.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"GET-MASTER-ADDR-BY-NAME": {
"summary": "Returns the port and address of a master Redis instance.",
"summary": "Returns the port and address of a master instance.",
"complexity": "O(1)",
"group": "sentinel",
"since": "2.8.4",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-is-master-down-by-addr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"IS-MASTER-DOWN-BY-ADDR": {
"summary": "Determines whether a master Redis instance is down.",
"summary": "Determines whether a master instance is down.",
"complexity": "O(1)",
"group": "sentinel",
"since": "2.8.4",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-master.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MASTER": {
"summary": "Returns the state of a master Redis instance.",
"summary": "Returns the state of a master instance.",
"complexity": "O(1)",
"group": "sentinel",
"since": "2.8.4",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/sentinel-masters.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MASTERS": {
"summary": "Returns a list of monitored Redis masters.",
"summary": "Returns a list of monitored masters.",
"complexity": "O(N) where N is the number of masters",
"group": "sentinel",
"since": "2.8.4",
Expand All @@ -14,7 +14,7 @@
],
"reply_schema": {
"type": "array",
"description": "List of monitored Redis masters, and their state.",
"description": "List of monitored masters, and their state.",
"items": {
"type": "object",
"additionalProperties": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-myid.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MYID": {
"summary": "Returns the Redis Sentinel instance ID.",
"summary": "Returns the Sentinel instance ID.",
"complexity": "O(1)",
"group": "sentinel",
"since": "6.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-pending-scripts.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"PENDING-SCRIPTS": {
"summary": "Returns information about pending scripts for Redis Sentinel.",
"summary": "Returns information about pending scripts for Sentinel.",
"group": "sentinel",
"since": "2.8.4",
"arity": 2,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-replicas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"REPLICAS": {
"summary": "Returns a list of the monitored Redis replicas.",
"summary": "Returns a list of the monitored replicas.",
"complexity": "O(N) where N is the number of replicas",
"group": "sentinel",
"since": "5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-reset.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"RESET": {
"summary": "Resets Redis masters by name matching a pattern.",
"summary": "Resets masters by name matching a pattern.",
"complexity": "O(N) where N is the number of monitored masters",
"group": "sentinel",
"since": "2.8.4",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel-set.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SET": {
"summary": "Changes the configuration of a monitored Redis master.",
"summary": "Changes the configuration of a monitored master.",
"complexity": "O(1)",
"group": "sentinel",
"since": "2.8.4",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sentinel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SENTINEL": {
"summary": "A container for Redis Sentinel commands.",
"summary": "A container for Sentinel commands.",
"complexity": "Depends on subcommand.",
"group": "sentinel",
"since": "2.8.4",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/shutdown.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SHUTDOWN": {
"summary": "Synchronously saves the database(s) to disk and shuts down the Redis server.",
"summary": "Synchronously saves the database(s) to disk and shuts down the server.",
"complexity": "O(N) when saving, where N is the total number of keys in all databases when saving data, otherwise O(1)",
"group": "server",
"since": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/slaveof.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SLAVEOF": {
"summary": "Sets a Redis server as a replica of another, or promotes it to being a master.",
"summary": "Sets a server as a replica of another, or promotes it to being a master.",
"complexity": "O(1)",
"group": "server",
"since": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/spublish.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
],
"reply_schema": {
"description": "the number of clients that received the message. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count",
"description": "the number of clients that received the message. Note that in a Cluster, only clients that are connected to the same node as the publishing client are included in the count",
"type": "integer",
"minimum": 0
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/swapdb.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SWAPDB": {
"summary": "Swaps two Redis databases.",
"summary": "Swaps two databases.",
"complexity": "O(N) where N is the count of clients watching or blocking on keys from both databases.",
"group": "server",
"since": "4.0.0",
Expand Down
Loading