Unverified Commit e2fa6aa1 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

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`)
parent 16d206ee
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"arguments": [ "arguments": [
{ {
"name": "pattern", "name": "pattern",
"type": "string", "type": "pattern",
"optional": true "optional": true
} }
] ]
......
{ {
"SHARDCHANNELS": { "SHARDCHANNELS": {
"summary": "List active shard channels", "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).", "complexity": "O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short channels).",
"group": "pubsub", "group": "pubsub",
"since": "7.0.0", "since": "7.0.0",
"arity": -2, "arity": -2,
"container": "PUBSUB", "container": "PUBSUB",
"function": "pubsubCommand", "function": "pubsubCommand",
"command_flags": [ "command_flags": [
"PUBSUB", "PUBSUB",
"LOADING", "LOADING",
"STALE" "STALE"
], ],
"arguments": [ "arguments": [
{ {
"name": "pattern", "name": "pattern",
"type": "string", "type": "pattern",
"optional": true "optional": true
} }
] ]
} }
} }
{ {
"SHARDNUMSUB": { "SHARDNUMSUB": {
"summary": "Get the count of subscribers for shard channels", "summary": "Get the count of subscribers for shard channels",
"complexity": "O(N) for the SHARDNUMSUB subcommand, where N is the number of requested channels", "complexity": "O(N) for the SHARDNUMSUB subcommand, where N is the number of requested channels",
"group": "pubsub", "group": "pubsub",
"since": "7.0.0", "since": "7.0.0",
"arity": -2, "arity": -2,
"container": "PUBSUB", "container": "PUBSUB",
"function": "pubsubCommand", "function": "pubsubCommand",
"command_flags": [ "command_flags": [
"PUBSUB", "PUBSUB",
"LOADING", "LOADING",
"STALE" "STALE"
], ],
"arguments": [ "arguments": [
{ {
"name": "channel", "name": "channel",
"type": "string", "type": "string",
"optional": true, "optional": true,
"multiple": true "multiple": true
} }
] ]
} }
} }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}, },
{ {
"name": "port", "name": "port",
"type": "string" "type": "integer"
} }
] ]
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"SENTINEL", "SENTINEL",
"ONLY_SENTINEL" "ONLY_SENTINEL"
], ],
"arguments":[ "arguments": [
{ {
"name":"set_or_get", "name":"set_or_get",
"type":"oneof", "type":"oneof",
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"arguments": [ "arguments": [
{ {
"name": "pattern", "name": "pattern",
"type": "string" "type": "pattern"
} }
] ]
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
}, },
{ {
"name": "port", "name": "port",
"type": "string" "type": "integer"
} }
] ]
} }
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
"token": "GET", "token": "GET",
"name": "pattern", "name": "pattern",
"key_spec_index": 1, "key_spec_index": 1,
"type": "string", "type": "pattern",
"optional": true, "optional": true,
"multiple": true, "multiple": true,
"multiple_token": true "multiple_token": true
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
"token": "GET", "token": "GET",
"name": "pattern", "name": "pattern",
"key_spec_index": 1, "key_spec_index": 1,
"type": "string", "type": "pattern",
"optional": true, "optional": true,
"multiple": true, "multiple": true,
"multiple_token": true "multiple_token": true
......
{ {
"SPUBLISH": { "SPUBLISH": {
"summary": "Post a message to a shard channel", "summary": "Post a message to a shard channel",
"complexity": "O(N) where N is the number of clients subscribed to the receiving shard channel.", "complexity": "O(N) where N is the number of clients subscribed to the receiving shard channel.",
"group": "pubsub", "group": "pubsub",
"since": "7.0.0", "since": "7.0.0",
"arity": 3, "arity": 3,
"function": "spublishCommand", "function": "spublishCommand",
"command_flags": [ "command_flags": [
"PUBSUB", "PUBSUB",
"LOADING", "LOADING",
"STALE", "STALE",
"FAST", "FAST",
"MAY_REPLICATE" "MAY_REPLICATE"
],
"arguments": [
{
"name": "channel",
"type": "string"
},
{
"name": "message",
"type": "string"
}
],
"key_specs": [
{
"flags": [
"NOT_KEY"
], ],
"begin_search": { "arguments": [
"index": { {
"pos": 1 "name": "channel",
} "type": "string"
}, },
"find_keys": { {
"range": { "name": "message",
"lastkey": 0, "type": "string"
"step": 1, }
"limit": 0 ],
} "key_specs": [
} {
} "flags": [
] "NOT_KEY"
} ],
"begin_search": {
"index": {
"pos": 1
}
},
"find_keys": {
"range": {
"lastkey": 0,
"step": 1,
"limit": 0
}
}
}
]
}
} }
{ {
"SSUBSCRIBE": { "SSUBSCRIBE": {
"summary": "Listen for messages published to the given shard channels", "summary": "Listen for messages published to the given shard channels",
"complexity": "O(N) where N is the number of shard channels to subscribe to.", "complexity": "O(N) where N is the number of shard channels to subscribe to.",
"group": "pubsub", "group": "pubsub",
"since": "7.0.0", "since": "7.0.0",
"arity": -2, "arity": -2,
"function": "ssubscribeCommand", "function": "ssubscribeCommand",
"command_flags": [ "command_flags": [
"PUBSUB", "PUBSUB",
"NOSCRIPT", "NOSCRIPT",
"LOADING", "LOADING",
"STALE" "STALE"
],
"arguments": [
{
"name": "channel",
"type": "string",
"multiple": true
}
],
"key_specs": [
{
"flags": [
"NOT_KEY"
], ],
"begin_search": { "arguments": [
"index": { {
"pos": 1 "name": "channel",
} "type": "string",
}, "multiple": true
"find_keys": { }
"range": { ],
"lastkey": -1, "key_specs": [
"step": 1, {
"limit": 0 "flags": [
} "NOT_KEY"
} ],
} "begin_search": {
] "index": {
} "pos": 1
}
},
"find_keys": {
"range": {
"lastkey": -1,
"step": 1,
"limit": 0
}
}
}
]
}
} }
{ {
"SUNSUBSCRIBE": { "SUNSUBSCRIBE": {
"summary": "Stop listening for messages posted to the given shard channels", "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.", "complexity": "O(N) where N is the number of clients already subscribed to a channel.",
"group": "pubsub", "group": "pubsub",
"since": "7.0.0", "since": "7.0.0",
"arity": -1, "arity": -1,
"function": "sunsubscribeCommand", "function": "sunsubscribeCommand",
"command_flags": [ "command_flags": [
"PUBSUB", "PUBSUB",
"NOSCRIPT", "NOSCRIPT",
"LOADING", "LOADING",
"STALE" "STALE"
],
"arguments": [
{
"name": "channel",
"type": "string",
"optional": true,
"multiple": true
}
],
"key_specs": [
{
"flags": [
"NOT_KEY"
], ],
"begin_search": { "arguments": [
"index": { {
"pos": 1 "name": "channel",
} "type": "string",
}, "optional": true,
"find_keys": { "multiple": true
"range": { }
"lastkey": -1, ],
"step": 1, "key_specs": [
"limit": 0 {
} "flags": [
} "NOT_KEY"
} ],
] "begin_search": {
} "index": {
"pos": 1
}
},
"find_keys": {
"range": {
"lastkey": -1,
"step": 1,
"limit": 0
}
}
}
]
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment