diff options
author | Binbin <binloveplay1314@qq.com> | 2022-03-30 14:39:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-30 09:39:26 +0300 |
commit | e2fa6aa1589ef88322d16872bd6a94cdd21f353f (patch) | |
tree | e4d327d786468e8147f9ea2a60f6970eff5bed2b /src/commands | |
parent | 16d206ee3600dba0b28535cc88f647afc80abbcc (diff) | |
download | redis-e2fa6aa1589ef88322d16872bd6a94cdd21f353f.tar.gz |
command json files cleanups (#10473)
This PR do some command json files cleanups:
1. Add COMMAND TIPS to some commands
- command-docs: add `NONDETERMINISTIC_OUTPUT_ORDER`
- command-info: add `NONDETERMINISTIC_OUTPUT_ORDER`
- command-list: add `NONDETERMINISTIC_OUTPUT_ORDER`
- command: change `NONDETERMINISTIC_OUTPUT` to `NONDETERMINISTIC_OUTPUT_ORDER`
- function-list: add `NONDETERMINISTIC_OUTPUT_ORDER`
- latency-doctor: add `NONDETERMINISTIC_OUTPUT`, `REQUEST_POLICY:ALL_NODES` and `RESPONSE_POLICY:SPECIAL`
- latency-graph: add `NONDETERMINISTIC_OUTPUT`, `REQUEST_POLICY:ALL_NODES` and `RESPONSE_POLICY:SPECIAL`
- memory-doctor: add `REQUEST_POLICY:ALL_SHARDS` and `RESPONSE_POLICY:SPECIAL`
- memory-malloc-stats: add `REQUEST_POLICY:ALL_SHARDS` and `RESPONSE_POLICY:SPECIAL`
- memory-purge: add `REQUEST_POLICY:ALL_SHARDS` and `RESPONSE_POLICY:ALL_SUCCEEDED`
- module-list: add `NONDETERMINISTIC_OUTPUT_ORDER`
- msetnx: add `REQUEST_POLICY:MULTI_SHARD` and `RESPONSE_POLICY:AGG_MIN`
- object-refcount: add `NONDETERMINISTIC_OUTPUT`
3. Only (mostly) indentation and formatting changes:
- cluster-shards
- latency-history
- pubsub-shardchannels
- pubsub-shardnumsub
- spublish
- ssubscribe
- sunsubscribe
4. add doc_flags (DEPRECATED) to cluster-slots, replaced_by `CLUSTER SHARDS` in 7.0
5. command-getkeysandflags: a better summary (the old one is copy from command-getkeys)
6. adjustment of command parameter types
- `port` is integer, not string (`MIGRATE`, `REPLICAOF`, `SLAVEOF`)
- `replicationid` is string, not integer (`PSYNC`)
- `pattern` is pattern, not string (`PUBSUB CHANNELS`, `SENTINEL RESET`, `SORT`, `SORT_RO`)
Diffstat (limited to 'src/commands')
31 files changed, 239 insertions, 196 deletions
diff --git a/src/commands/cluster-shards.json b/src/commands/cluster-shards.json index 89361862d..925ce8bf3 100644 --- a/src/commands/cluster-shards.json +++ b/src/commands/cluster-shards.json @@ -1,18 +1,18 @@ { - "SHARDS": { - "summary": "Get array of cluster slots to node mappings", - "complexity": "O(N) where N is the total number of cluster nodes", - "group": "cluster", - "since": "7.0.0", - "arity": 2, - "container": "CLUSTER", - "function": "clusterCommand", - "history": [], - "command_flags": [ - "STALE" - ], - "command_tips": [ - "NONDETERMINISTIC_OUTPUT" - ] - } + "SHARDS": { + "summary": "Get array of cluster slots to node mappings", + "complexity": "O(N) where N is the total number of cluster nodes", + "group": "cluster", + "since": "7.0.0", + "arity": 2, + "container": "CLUSTER", + "function": "clusterCommand", + "history": [], + "command_flags": [ + "STALE" + ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT" + ] + } } diff --git a/src/commands/cluster-slots.json b/src/commands/cluster-slots.json index 9a94fc2da..6da781755 100644 --- a/src/commands/cluster-slots.json +++ b/src/commands/cluster-slots.json @@ -9,6 +9,9 @@ "function": "clusterCommand", "deprecated_since": "7.0.0", "replaced_by": "`CLUSTER SHARDS`", + "doc_flags": [ + "DEPRECATED" + ], "history": [ [ "4.0.0", diff --git a/src/commands/command-docs.json b/src/commands/command-docs.json index 9d2e20566..68a32f8a1 100644 --- a/src/commands/command-docs.json +++ b/src/commands/command-docs.json @@ -14,6 +14,9 @@ "acl_categories": [ "CONNECTION" ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT_ORDER" + ], "arguments": [ { "name": "command-name", diff --git a/src/commands/command-getkeysandflags.json b/src/commands/command-getkeysandflags.json index 1ac8e990d..44b3ddcb1 100644 --- a/src/commands/command-getkeysandflags.json +++ b/src/commands/command-getkeysandflags.json @@ -1,6 +1,6 @@ { "GETKEYSANDFLAGS": { - "summary": "Extract keys given a full Redis command", + "summary": "Extract keys and access flags given a full Redis command", "complexity": "O(N) where N is the number of arguments to the command", "group": "server", "since": "7.0.0", diff --git a/src/commands/command-info.json b/src/commands/command-info.json index 9291f8912..40d60a3ec 100644 --- a/src/commands/command-info.json +++ b/src/commands/command-info.json @@ -20,6 +20,9 @@ "acl_categories": [ "CONNECTION" ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT_ORDER" + ], "arguments": [ { "name": "command-name", diff --git a/src/commands/command-list.json b/src/commands/command-list.json index ca7cb71ed..49e9558ca 100644 --- a/src/commands/command-list.json +++ b/src/commands/command-list.json @@ -14,6 +14,9 @@ "acl_categories": [ "CONNECTION" ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT_ORDER" + ], "arguments": [ { "name": "filterby", diff --git a/src/commands/command.json b/src/commands/command.json index 83458e30c..0bed04040 100644 --- a/src/commands/command.json +++ b/src/commands/command.json @@ -15,7 +15,7 @@ "CONNECTION" ], "command_tips": [ - "NONDETERMINISTIC_OUTPUT" + "NONDETERMINISTIC_OUTPUT_ORDER" ] } } diff --git a/src/commands/function-list.json b/src/commands/function-list.json index 601299345..6513b80cb 100644 --- a/src/commands/function-list.json +++ b/src/commands/function-list.json @@ -10,6 +10,9 @@ "command_flags": [ "NOSCRIPT" ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT_ORDER" + ], "acl_categories": [ "SCRIPTING" ], diff --git a/src/commands/latency-doctor.json b/src/commands/latency-doctor.json index 2686c0d58..129b32358 100644 --- a/src/commands/latency-doctor.json +++ b/src/commands/latency-doctor.json @@ -12,6 +12,11 @@ "NOSCRIPT", "LOADING", "STALE" + ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT", + "REQUEST_POLICY:ALL_NODES", + "RESPONSE_POLICY:SPECIAL" ] } } diff --git a/src/commands/latency-graph.json b/src/commands/latency-graph.json index 0c8fe69c7..0644c1cb0 100644 --- a/src/commands/latency-graph.json +++ b/src/commands/latency-graph.json @@ -13,6 +13,11 @@ "LOADING", "STALE" ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT", + "REQUEST_POLICY:ALL_NODES", + "RESPONSE_POLICY:SPECIAL" + ], "arguments": [ { "name": "event", diff --git a/src/commands/latency-history.json b/src/commands/latency-history.json index 5d9f17436..6d9267064 100644 --- a/src/commands/latency-history.json +++ b/src/commands/latency-history.json @@ -18,7 +18,7 @@ "REQUEST_POLICY:ALL_NODES", "RESPONSE_POLICY:SPECIAL" ], - "arguments": [ + "arguments": [ { "name": "event", "type": "string" diff --git a/src/commands/memory-doctor.json b/src/commands/memory-doctor.json index 590778a7c..b6691dfa0 100644 --- a/src/commands/memory-doctor.json +++ b/src/commands/memory-doctor.json @@ -8,7 +8,9 @@ "container": "MEMORY", "function": "memoryCommand", "command_tips": [ - "NONDETERMINISTIC_OUTPUT" + "NONDETERMINISTIC_OUTPUT", + "REQUEST_POLICY:ALL_SHARDS", + "RESPONSE_POLICY:SPECIAL" ] } } diff --git a/src/commands/memory-malloc-stats.json b/src/commands/memory-malloc-stats.json index 69265c6e7..5106781fe 100644 --- a/src/commands/memory-malloc-stats.json +++ b/src/commands/memory-malloc-stats.json @@ -8,7 +8,9 @@ "container": "MEMORY", "function": "memoryCommand", "command_tips": [ - "NONDETERMINISTIC_OUTPUT" + "NONDETERMINISTIC_OUTPUT", + "REQUEST_POLICY:ALL_SHARDS", + "RESPONSE_POLICY:SPECIAL" ] } } diff --git a/src/commands/memory-purge.json b/src/commands/memory-purge.json index 7cac7389d..b862534d1 100644 --- a/src/commands/memory-purge.json +++ b/src/commands/memory-purge.json @@ -6,6 +6,10 @@ "since": "4.0.0", "arity": 2, "container": "MEMORY", - "function": "memoryCommand" + "function": "memoryCommand", + "command_tips": [ + "REQUEST_POLICY:ALL_SHARDS", + "RESPONSE_POLICY:ALL_SUCCEEDED" + ] } } diff --git a/src/commands/migrate.json b/src/commands/migrate.json index 5a633e0dc..d07fe4b15 100644 --- a/src/commands/migrate.json +++ b/src/commands/migrate.json @@ -84,7 +84,7 @@ }, { "name": "port", - "type": "string" + "type": "integer" }, { "name": "key_or_empty_string", diff --git a/src/commands/module-list.json b/src/commands/module-list.json index 56a7cd3f5..ed6e7d19b 100644 --- a/src/commands/module-list.json +++ b/src/commands/module-list.json @@ -10,6 +10,9 @@ "command_flags": [ "ADMIN", "NOSCRIPT" + ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT_ORDER" ] } } diff --git a/src/commands/msetnx.json b/src/commands/msetnx.json index 7984598a2..544ac6450 100644 --- a/src/commands/msetnx.json +++ b/src/commands/msetnx.json @@ -13,6 +13,10 @@ "acl_categories": [ "STRING" ], + "command_tips": [ + "REQUEST_POLICY:MULTI_SHARD", + "RESPONSE_POLICY:AGG_MIN" + ], "key_specs": [ { "flags": [ diff --git a/src/commands/object-refcount.json b/src/commands/object-refcount.json index 273dd0759..0f36f5092 100644 --- a/src/commands/object-refcount.json +++ b/src/commands/object-refcount.json @@ -13,6 +13,9 @@ "acl_categories": [ "KEYSPACE" ], + "command_tips": [ + "NONDETERMINISTIC_OUTPUT" + ], "key_specs": [ { "flags": [ diff --git a/src/commands/psync.json b/src/commands/psync.json index 1e0425220..91175a198 100644 --- a/src/commands/psync.json +++ b/src/commands/psync.json @@ -14,7 +14,7 @@ "arguments": [ { "name": "replicationid", - "type": "integer" + "type": "string" }, { "name": "offset", diff --git a/src/commands/pubsub-channels.json b/src/commands/pubsub-channels.json index 2b4e765d1..0522504b1 100644 --- a/src/commands/pubsub-channels.json +++ b/src/commands/pubsub-channels.json @@ -15,7 +15,7 @@ "arguments": [ { "name": "pattern", - "type": "string", + "type": "pattern", "optional": true } ] diff --git a/src/commands/pubsub-shardchannels.json b/src/commands/pubsub-shardchannels.json index 450cd8dcd..3bffa221f 100644 --- a/src/commands/pubsub-shardchannels.json +++ b/src/commands/pubsub-shardchannels.json @@ -1,23 +1,23 @@ { - "SHARDCHANNELS": { - "summary": "List active shard channels", - "complexity": "O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short channels).", - "group": "pubsub", - "since": "7.0.0", - "arity": -2, - "container": "PUBSUB", - "function": "pubsubCommand", - "command_flags": [ - "PUBSUB", - "LOADING", - "STALE" - ], - "arguments": [ - { - "name": "pattern", - "type": "string", - "optional": true - } - ] - } + "SHARDCHANNELS": { + "summary": "List active shard channels", + "complexity": "O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short channels).", + "group": "pubsub", + "since": "7.0.0", + "arity": -2, + "container": "PUBSUB", + "function": "pubsubCommand", + "command_flags": [ + "PUBSUB", + "LOADING", + "STALE" + ], + "arguments": [ + { + "name": "pattern", + "type": "pattern", + "optional": true + } + ] + } } diff --git a/src/commands/pubsub-shardnumsub.json b/src/commands/pubsub-shardnumsub.json index 55f5101ac..8c51549b0 100644 --- a/src/commands/pubsub-shardnumsub.json +++ b/src/commands/pubsub-shardnumsub.json @@ -1,24 +1,24 @@ { - "SHARDNUMSUB": { - "summary": "Get the count of subscribers for shard channels", - "complexity": "O(N) for the SHARDNUMSUB subcommand, where N is the number of requested channels", - "group": "pubsub", - "since": "7.0.0", - "arity": -2, - "container": "PUBSUB", - "function": "pubsubCommand", - "command_flags": [ - "PUBSUB", - "LOADING", - "STALE" - ], - "arguments": [ - { - "name": "channel", - "type": "string", - "optional": true, - "multiple": true - } - ] - } + "SHARDNUMSUB": { + "summary": "Get the count of subscribers for shard channels", + "complexity": "O(N) for the SHARDNUMSUB subcommand, where N is the number of requested channels", + "group": "pubsub", + "since": "7.0.0", + "arity": -2, + "container": "PUBSUB", + "function": "pubsubCommand", + "command_flags": [ + "PUBSUB", + "LOADING", + "STALE" + ], + "arguments": [ + { + "name": "channel", + "type": "string", + "optional": true, + "multiple": true + } + ] + } } diff --git a/src/commands/replicaof.json b/src/commands/replicaof.json index 805b81e4c..6299ea3ff 100644 --- a/src/commands/replicaof.json +++ b/src/commands/replicaof.json @@ -19,7 +19,7 @@ }, { "name": "port", - "type": "string" + "type": "integer" } ] } diff --git a/src/commands/sentinel-config.json b/src/commands/sentinel-config.json index c977341f3..74bcdbd50 100644 --- a/src/commands/sentinel-config.json +++ b/src/commands/sentinel-config.json @@ -12,7 +12,7 @@ "SENTINEL", "ONLY_SENTINEL" ], - "arguments":[ + "arguments": [ { "name":"set_or_get", "type":"oneof", diff --git a/src/commands/sentinel-reset.json b/src/commands/sentinel-reset.json index bf12c6f0a..9c60c6be7 100644 --- a/src/commands/sentinel-reset.json +++ b/src/commands/sentinel-reset.json @@ -15,7 +15,7 @@ "arguments": [ { "name": "pattern", - "type": "string" + "type": "pattern" } ] } diff --git a/src/commands/slaveof.json b/src/commands/slaveof.json index 271eb2d1b..70560f1b6 100644 --- a/src/commands/slaveof.json +++ b/src/commands/slaveof.json @@ -24,7 +24,7 @@ }, { "name": "port", - "type": "string" + "type": "integer" } ] } diff --git a/src/commands/sort.json b/src/commands/sort.json index 01ac2745d..3f077e0e5 100644 --- a/src/commands/sort.json +++ b/src/commands/sort.json @@ -96,7 +96,7 @@ "token": "GET", "name": "pattern", "key_spec_index": 1, - "type": "string", + "type": "pattern", "optional": true, "multiple": true, "multiple_token": true diff --git a/src/commands/sort_ro.json b/src/commands/sort_ro.json index 11336c52c..83b48d1b3 100644 --- a/src/commands/sort_ro.json +++ b/src/commands/sort_ro.json @@ -82,7 +82,7 @@ "token": "GET", "name": "pattern", "key_spec_index": 1, - "type": "string", + "type": "pattern", "optional": true, "multiple": true, "multiple_token": true diff --git a/src/commands/spublish.json b/src/commands/spublish.json index 2cbcdc19a..816ff0ad3 100644 --- a/src/commands/spublish.json +++ b/src/commands/spublish.json @@ -1,46 +1,46 @@ { - "SPUBLISH": { - "summary": "Post a message to a shard channel", - "complexity": "O(N) where N is the number of clients subscribed to the receiving shard channel.", - "group": "pubsub", - "since": "7.0.0", - "arity": 3, - "function": "spublishCommand", - "command_flags": [ - "PUBSUB", - "LOADING", - "STALE", - "FAST", - "MAY_REPLICATE" - ], - "arguments": [ - { - "name": "channel", - "type": "string" - }, - { - "name": "message", - "type": "string" - } - ], - "key_specs": [ - { - "flags": [ - "NOT_KEY" + "SPUBLISH": { + "summary": "Post a message to a shard channel", + "complexity": "O(N) where N is the number of clients subscribed to the receiving shard channel.", + "group": "pubsub", + "since": "7.0.0", + "arity": 3, + "function": "spublishCommand", + "command_flags": [ + "PUBSUB", + "LOADING", + "STALE", + "FAST", + "MAY_REPLICATE" ], - "begin_search": { - "index": { - "pos": 1 - } - }, - "find_keys": { - "range": { - "lastkey": 0, - "step": 1, - "limit": 0 - } - } - } - ] - } + "arguments": [ + { + "name": "channel", + "type": "string" + }, + { + "name": "message", + "type": "string" + } + ], + "key_specs": [ + { + "flags": [ + "NOT_KEY" + ], + "begin_search": { + "index": { + "pos": 1 + } + }, + "find_keys": { + "range": { + "lastkey": 0, + "step": 1, + "limit": 0 + } + } + } + ] + } } diff --git a/src/commands/ssubscribe.json b/src/commands/ssubscribe.json index eb570ea53..c49f801a6 100644 --- a/src/commands/ssubscribe.json +++ b/src/commands/ssubscribe.json @@ -1,42 +1,42 @@ { - "SSUBSCRIBE": { - "summary": "Listen for messages published to the given shard channels", - "complexity": "O(N) where N is the number of shard channels to subscribe to.", - "group": "pubsub", - "since": "7.0.0", - "arity": -2, - "function": "ssubscribeCommand", - "command_flags": [ - "PUBSUB", - "NOSCRIPT", - "LOADING", - "STALE" - ], - "arguments": [ - { - "name": "channel", - "type": "string", - "multiple": true - } - ], - "key_specs": [ - { - "flags": [ - "NOT_KEY" + "SSUBSCRIBE": { + "summary": "Listen for messages published to the given shard channels", + "complexity": "O(N) where N is the number of shard channels to subscribe to.", + "group": "pubsub", + "since": "7.0.0", + "arity": -2, + "function": "ssubscribeCommand", + "command_flags": [ + "PUBSUB", + "NOSCRIPT", + "LOADING", + "STALE" ], - "begin_search": { - "index": { - "pos": 1 - } - }, - "find_keys": { - "range": { - "lastkey": -1, - "step": 1, - "limit": 0 - } - } - } - ] - } + "arguments": [ + { + "name": "channel", + "type": "string", + "multiple": true + } + ], + "key_specs": [ + { + "flags": [ + "NOT_KEY" + ], + "begin_search": { + "index": { + "pos": 1 + } + }, + "find_keys": { + "range": { + "lastkey": -1, + "step": 1, + "limit": 0 + } + } + } + ] + } } diff --git a/src/commands/sunsubscribe.json b/src/commands/sunsubscribe.json index 481415490..5b428237b 100644 --- a/src/commands/sunsubscribe.json +++ b/src/commands/sunsubscribe.json @@ -1,43 +1,43 @@ { - "SUNSUBSCRIBE": { - "summary": "Stop listening for messages posted to the given shard channels", - "complexity": "O(N) where N is the number of clients already subscribed to a channel.", - "group": "pubsub", - "since": "7.0.0", - "arity": -1, - "function": "sunsubscribeCommand", - "command_flags": [ - "PUBSUB", - "NOSCRIPT", - "LOADING", - "STALE" - ], - "arguments": [ - { - "name": "channel", - "type": "string", - "optional": true, - "multiple": true - } - ], - "key_specs": [ - { - "flags": [ - "NOT_KEY" + "SUNSUBSCRIBE": { + "summary": "Stop listening for messages posted to the given shard channels", + "complexity": "O(N) where N is the number of clients already subscribed to a channel.", + "group": "pubsub", + "since": "7.0.0", + "arity": -1, + "function": "sunsubscribeCommand", + "command_flags": [ + "PUBSUB", + "NOSCRIPT", + "LOADING", + "STALE" ], - "begin_search": { - "index": { - "pos": 1 - } - }, - "find_keys": { - "range": { - "lastkey": -1, - "step": 1, - "limit": 0 - } - } - } - ] - } + "arguments": [ + { + "name": "channel", + "type": "string", + "optional": true, + "multiple": true + } + ], + "key_specs": [ + { + "flags": [ + "NOT_KEY" + ], + "begin_search": { + "index": { + "pos": 1 + } + }, + "find_keys": { + "range": { + "lastkey": -1, + "step": 1, + "limit": 0 + } + } + } + ] + } } |