未验证 提交 19e129d0 编写于 作者: 冉小龙 提交者: GitHub

Fix pulsar admin functions description information (#4846)

* Fix pulsar admin functions description information
Signed-off-by: Nxiaolong.ran <ranxiaolong716@gmail.com>

* fix comments
Signed-off-by: Nxiaolong.ran <ranxiaolong716@gmail.com>
上级 128287e3
...@@ -107,10 +107,10 @@ public class CmdFunctions extends CmdBase { ...@@ -107,10 +107,10 @@ public class CmdFunctions extends CmdBase {
*/ */
@Getter @Getter
abstract class NamespaceCommand extends BaseCommand { abstract class NamespaceCommand extends BaseCommand {
@Parameter(names = "--tenant", description = "The function's tenant") @Parameter(names = "--tenant", description = "The tenant of a Pulsar Function")
protected String tenant; protected String tenant;
@Parameter(names = "--namespace", description = "The function's namespace") @Parameter(names = "--namespace", description = "The namespace of a Pulsar Function")
protected String namespace; protected String namespace;
@Override @Override
...@@ -132,13 +132,13 @@ public class CmdFunctions extends CmdBase { ...@@ -132,13 +132,13 @@ public class CmdFunctions extends CmdBase {
@Parameter(names = "--fqfn", description = "The Fully Qualified Function Name (FQFN) for the function") @Parameter(names = "--fqfn", description = "The Fully Qualified Function Name (FQFN) for the function")
protected String fqfn; protected String fqfn;
@Parameter(names = "--tenant", description = "The function's tenant") @Parameter(names = "--tenant", description = "The tenant of a Pulsar Function")
protected String tenant; protected String tenant;
@Parameter(names = "--namespace", description = "The function's namespace") @Parameter(names = "--namespace", description = "The namespace of a Pulsar Function")
protected String namespace; protected String namespace;
@Parameter(names = "--name", description = "The function's name") @Parameter(names = "--name", description = "The name of a Pulsar Function")
protected String functionName; protected String functionName;
@Override @Override
...@@ -184,18 +184,18 @@ public class CmdFunctions extends CmdBase { ...@@ -184,18 +184,18 @@ public class CmdFunctions extends CmdBase {
abstract class FunctionDetailsCommand extends BaseCommand { abstract class FunctionDetailsCommand extends BaseCommand {
@Parameter(names = "--fqfn", description = "The Fully Qualified Function Name (FQFN) for the function") @Parameter(names = "--fqfn", description = "The Fully Qualified Function Name (FQFN) for the function")
protected String fqfn; protected String fqfn;
@Parameter(names = "--tenant", description = "The function's tenant") @Parameter(names = "--tenant", description = "The tenant of a Pulsar Function")
protected String tenant; protected String tenant;
@Parameter(names = "--namespace", description = "The function's namespace") @Parameter(names = "--namespace", description = "The namespace of a Pulsar Function")
protected String namespace; protected String namespace;
@Parameter(names = "--name", description = "The function's name") @Parameter(names = "--name", description = "The name of a Pulsar Function")
protected String functionName; protected String functionName;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--className", description = "The function's class name", hidden = true) @Parameter(names = "--className", description = "The class name of a Pulsar Function", hidden = true)
protected String DEPRECATED_className; protected String DEPRECATED_className;
@Parameter(names = "--classname", description = "The function's class name") @Parameter(names = "--classname", description = "The class name of a Pulsar Function")
protected String className; protected String className;
@Parameter(names = "--jar", description = "Path to the jar file for the function (if the function is written in Java). It also supports url-path [http/https/file (file protocol assumes that file already exists on worker host)] from which worker can download the package.", listConverter = StringConverter.class) @Parameter(names = "--jar", description = "Path to the JAR file for the function (if the function is written in Java). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)] from which worker can download the package.", listConverter = StringConverter.class)
protected String jarFile; protected String jarFile;
@Parameter( @Parameter(
names = "--py", names = "--py",
...@@ -207,7 +207,7 @@ public class CmdFunctions extends CmdBase { ...@@ -207,7 +207,7 @@ public class CmdFunctions extends CmdBase {
description = "Path to the main Go executable binary for the function (if the function is written in Go)") description = "Path to the main Go executable binary for the function (if the function is written in Go)")
protected String goFile; protected String goFile;
@Parameter(names = {"-i", @Parameter(names = {"-i",
"--inputs"}, description = "The function's input topic or topics (multiple topics can be specified as a comma-separated list)") "--inputs"}, description = "The input topic or topics (multiple topics can be specified as a comma-separated list) of a Pulsar Function")
protected String inputs; protected String inputs;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--topicsPattern", description = "TopicsPattern to consume from list of topics under a namespace that match the pattern. [--input] and [--topic-pattern] are mutually exclusive. Add SerDe class name for a pattern in --custom-serde-inputs (supported for java fun only)", hidden = true) @Parameter(names = "--topicsPattern", description = "TopicsPattern to consume from list of topics under a namespace that match the pattern. [--input] and [--topic-pattern] are mutually exclusive. Add SerDe class name for a pattern in --custom-serde-inputs (supported for java fun only)", hidden = true)
...@@ -215,12 +215,12 @@ public class CmdFunctions extends CmdBase { ...@@ -215,12 +215,12 @@ public class CmdFunctions extends CmdBase {
@Parameter(names = "--topics-pattern", description = "The topic pattern to consume from list of topics under a namespace that match the pattern. [--input] and [--topic-pattern] are mutually exclusive. Add SerDe class name for a pattern in --custom-serde-inputs (supported for java fun only)") @Parameter(names = "--topics-pattern", description = "The topic pattern to consume from list of topics under a namespace that match the pattern. [--input] and [--topic-pattern] are mutually exclusive. Add SerDe class name for a pattern in --custom-serde-inputs (supported for java fun only)")
protected String topicsPattern; protected String topicsPattern;
@Parameter(names = {"-o", "--output"}, description = "The function's output topic (If none is specified, no output is written)") @Parameter(names = {"-o", "--output"}, description = "The output topic of a Pulsar Function (If none is specified, no output is written)")
protected String output; protected String output;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--logTopic", description = "The topic to which the function's logs are produced", hidden = true) @Parameter(names = "--logTopic", description = "The topic to which the logs of a Pulsar Function are produced", hidden = true)
protected String DEPRECATED_logTopic; protected String DEPRECATED_logTopic;
@Parameter(names = "--log-topic", description = "The topic to which the function's logs are produced") @Parameter(names = "--log-topic", description = "The topic to which the logs of a Pulsar Function are produced")
protected String logTopic; protected String logTopic;
@Parameter(names = {"-st", "--schema-type"}, description = "The builtin schema type or custom schema class name to be used for messages output by the function") @Parameter(names = {"-st", "--schema-type"}, description = "The builtin schema type or custom schema class name to be used for messages output by the function")
...@@ -239,9 +239,9 @@ public class CmdFunctions extends CmdBase { ...@@ -239,9 +239,9 @@ public class CmdFunctions extends CmdBase {
@Parameter(names = "--output-serde-classname", description = "The SerDe class to be used for messages output by the function") @Parameter(names = "--output-serde-classname", description = "The SerDe class to be used for messages output by the function")
protected String outputSerdeClassName; protected String outputSerdeClassName;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--functionConfigFile", description = "The path to a YAML config file specifying the function's configuration", hidden = true) @Parameter(names = "--functionConfigFile", description = "The path to a YAML config file that specifies the configuration of a Pulsar Function", hidden = true)
protected String DEPRECATED_fnConfigFile; protected String DEPRECATED_fnConfigFile;
@Parameter(names = "--function-config-file", description = "The path to a YAML config file specifying the function's configuration") @Parameter(names = "--function-config-file", description = "The path to a YAML config file that specifies the configuration of a Pulsar Function")
protected String fnConfigFile; protected String fnConfigFile;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--processingGuarantees", description = "The processing guarantees (aka delivery semantics) applied to the function", hidden = true) @Parameter(names = "--processingGuarantees", description = "The processing guarantees (aka delivery semantics) applied to the function", hidden = true)
...@@ -259,7 +259,7 @@ public class CmdFunctions extends CmdBase { ...@@ -259,7 +259,7 @@ public class CmdFunctions extends CmdBase {
protected Boolean retainOrdering; protected Boolean retainOrdering;
@Parameter(names = "--subs-name", description = "Pulsar source subscription name if user wants a specific subscription-name for input-topic consumer") @Parameter(names = "--subs-name", description = "Pulsar source subscription name if user wants a specific subscription-name for input-topic consumer")
protected String subsName; protected String subsName;
@Parameter(names = "--parallelism", description = "The function's parallelism factor (i.e. the number of function instances to run)") @Parameter(names = "--parallelism", description = "The parallelism factor of a Pulsar Function (i.e. the number of function instances to run)")
protected Integer parallelism; protected Integer parallelism;
@Parameter(names = "--cpu", description = "The cpu in cores that need to be allocated per function instance(applicable only to docker runtime)") @Parameter(names = "--cpu", description = "The cpu in cores that need to be allocated per function instance(applicable only to docker runtime)")
protected Double cpu; protected Double cpu;
...@@ -288,9 +288,9 @@ public class CmdFunctions extends CmdBase { ...@@ -288,9 +288,9 @@ public class CmdFunctions extends CmdBase {
@Parameter(names = "--sliding-interval-duration-ms", description = "The time duration after which the window slides") @Parameter(names = "--sliding-interval-duration-ms", description = "The time duration after which the window slides")
protected Long slidingIntervalDurationMs; protected Long slidingIntervalDurationMs;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--autoAck", description = "Whether or not the framework will automatically acknowledge messages", hidden = true) @Parameter(names = "--autoAck", description = "Whether or not the framework acknowledges messages automatically", hidden = true)
protected Boolean DEPRECATED_autoAck = null; protected Boolean DEPRECATED_autoAck = null;
@Parameter(names = "--auto-ack", description = "Whether or not the framework will automatically acknowledge messages", arity = 1) @Parameter(names = "--auto-ack", description = "Whether or not the framework acknowledges messages automatically", arity = 1)
protected Boolean autoAck; protected Boolean autoAck;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--timeoutMs", description = "The message timeout in milliseconds", hidden = true) @Parameter(names = "--timeoutMs", description = "The message timeout in milliseconds", hidden = true)
...@@ -299,7 +299,7 @@ public class CmdFunctions extends CmdBase { ...@@ -299,7 +299,7 @@ public class CmdFunctions extends CmdBase {
protected Long timeoutMs; protected Long timeoutMs;
@Parameter(names = "--max-message-retries", description = "How many times should we try to process a message before giving up") @Parameter(names = "--max-message-retries", description = "How many times should we try to process a message before giving up")
protected Integer maxMessageRetries; protected Integer maxMessageRetries;
@Parameter(names = "--dead-letter-topic", description = "The topic where all messages which could not be processed successfully are sent") @Parameter(names = "--dead-letter-topic", description = "The topic where messages that are not processed successfully are sent to")
protected String deadLetterTopic; protected String deadLetterTopic;
protected FunctionConfig functionConfig; protected FunctionConfig functionConfig;
protected String userCodeFile; protected String userCodeFile;
...@@ -543,19 +543,19 @@ public class CmdFunctions extends CmdBase { ...@@ -543,19 +543,19 @@ public class CmdFunctions extends CmdBase {
} }
} }
@Parameters(commandDescription = "Run the Pulsar Function locally (rather than deploying it to the Pulsar cluster)") @Parameters(commandDescription = "Run a Pulsar Function locally, rather than deploy to a Pulsar cluster)")
class LocalRunner extends FunctionDetailsCommand { class LocalRunner extends FunctionDetailsCommand {
// TODO: this should become bookkeeper url and it should be fetched from pulsar client. // TODO: this should become BookKeeper URL and it should be fetched from Pulsar client.
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--stateStorageServiceUrl", description = "The URL for the state storage service (by default Apache BookKeeper)", hidden = true) @Parameter(names = "--stateStorageServiceUrl", description = "The URL for the state storage service (the default is Apache BookKeeper)", hidden = true)
protected String DEPRECATED_stateStorageServiceUrl; protected String DEPRECATED_stateStorageServiceUrl;
@Parameter(names = "--state-storage-service-url", description = "The URL for the state storage service (by default Apache BookKeeper)") @Parameter(names = "--state-storage-service-url", description = "The URL for the state storage service (the default is Apache BookKeeper)")
protected String stateStorageServiceUrl; protected String stateStorageServiceUrl;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--brokerServiceUrl", description = "The URL for the Pulsar broker", hidden = true) @Parameter(names = "--brokerServiceUrl", description = "The URL for Pulsar broker", hidden = true)
protected String DEPRECATED_brokerServiceUrl; protected String DEPRECATED_brokerServiceUrl;
@Parameter(names = "--broker-service-url", description = "The URL for the Pulsar broker") @Parameter(names = "--broker-service-url", description = "The URL for Pulsar broker")
protected String brokerServiceUrl; protected String brokerServiceUrl;
// for backwards compatibility purposes // for backwards compatibility purposes
@Parameter(names = "--clientAuthPlugin", description = "Client authentication plugin using which function-process can connect to broker", hidden = true) @Parameter(names = "--clientAuthPlugin", description = "Client authentication plugin using which function-process can connect to broker", hidden = true)
...@@ -628,7 +628,7 @@ public class CmdFunctions extends CmdBase { ...@@ -628,7 +628,7 @@ public class CmdFunctions extends CmdBase {
} }
} }
@Parameters(commandDescription = "Create a Pulsar Function in cluster mode (i.e. deploy it on a Pulsar cluster)") @Parameters(commandDescription = "Create a Pulsar Function in cluster mode (deploy it on a Pulsar cluster)")
class CreateFunction extends FunctionDetailsCommand { class CreateFunction extends FunctionDetailsCommand {
@Override @Override
void runCmd() throws Exception { void runCmd() throws Exception {
...@@ -655,7 +655,7 @@ public class CmdFunctions extends CmdBase { ...@@ -655,7 +655,7 @@ public class CmdFunctions extends CmdBase {
@Parameters(commandDescription = "Check the current status of a Pulsar Function") @Parameters(commandDescription = "Check the current status of a Pulsar Function")
class GetFunctionStatus extends FunctionCommand { class GetFunctionStatus extends FunctionCommand {
@Parameter(names = "--instance-id", description = "The function instanceId (Get-status of all instances if instance-id is not provided") @Parameter(names = "--instance-id", description = "The function instanceId (Get-status of all instances if instance-id is not provided)")
protected String instanceId; protected String instanceId;
@Override @Override
...@@ -671,7 +671,7 @@ public class CmdFunctions extends CmdBase { ...@@ -671,7 +671,7 @@ public class CmdFunctions extends CmdBase {
@Parameters(commandDescription = "Get the current stats of a Pulsar Function") @Parameters(commandDescription = "Get the current stats of a Pulsar Function")
class GetFunctionStats extends FunctionCommand { class GetFunctionStats extends FunctionCommand {
@Parameter(names = "--instance-id", description = "The function instanceId (Get-stats of all instances if instance-id is not provided") @Parameter(names = "--instance-id", description = "The function instanceId (Get-stats of all instances if instance-id is not provided)")
protected String instanceId; protected String instanceId;
@Override @Override
...@@ -688,7 +688,7 @@ public class CmdFunctions extends CmdBase { ...@@ -688,7 +688,7 @@ public class CmdFunctions extends CmdBase {
@Parameters(commandDescription = "Restart function instance") @Parameters(commandDescription = "Restart function instance")
class RestartFunction extends FunctionCommand { class RestartFunction extends FunctionCommand {
@Parameter(names = "--instance-id", description = "The function instanceId (restart all instances if instance-id is not provided") @Parameter(names = "--instance-id", description = "The function instanceId (restart all instances if instance-id is not provided)")
protected String instanceId; protected String instanceId;
@Override @Override
...@@ -709,7 +709,7 @@ public class CmdFunctions extends CmdBase { ...@@ -709,7 +709,7 @@ public class CmdFunctions extends CmdBase {
@Parameters(commandDescription = "Stops function instance") @Parameters(commandDescription = "Stops function instance")
class StopFunction extends FunctionCommand { class StopFunction extends FunctionCommand {
@Parameter(names = "--instance-id", description = "The function instanceId (stop all instances if instance-id is not provided") @Parameter(names = "--instance-id", description = "The function instanceId (stop all instances if instance-id is not provided)")
protected String instanceId; protected String instanceId;
@Override @Override
...@@ -730,7 +730,7 @@ public class CmdFunctions extends CmdBase { ...@@ -730,7 +730,7 @@ public class CmdFunctions extends CmdBase {
@Parameters(commandDescription = "Starts a stopped function instance") @Parameters(commandDescription = "Starts a stopped function instance")
class StartFunction extends FunctionCommand { class StartFunction extends FunctionCommand {
@Parameter(names = "--instance-id", description = "The function instanceId (start all instances if instance-id is not provided") @Parameter(names = "--instance-id", description = "The function instanceId (start all instances if instance-id is not provided)")
protected String instanceId; protected String instanceId;
@Override @Override
...@@ -748,7 +748,7 @@ public class CmdFunctions extends CmdBase { ...@@ -748,7 +748,7 @@ public class CmdFunctions extends CmdBase {
} }
} }
@Parameters(commandDescription = "Delete a Pulsar Function that's running on a Pulsar cluster") @Parameters(commandDescription = "Delete a Pulsar Function that is running on a Pulsar cluster")
class DeleteFunction extends FunctionCommand { class DeleteFunction extends FunctionCommand {
@Override @Override
void runCmd() throws Exception { void runCmd() throws Exception {
...@@ -757,7 +757,7 @@ public class CmdFunctions extends CmdBase { ...@@ -757,7 +757,7 @@ public class CmdFunctions extends CmdBase {
} }
} }
@Parameters(commandDescription = "Update a Pulsar Function that's been deployed to a Pulsar cluster") @Parameters(commandDescription = "Update a Pulsar Function that has been deployed to a Pulsar cluster")
class UpdateFunction extends FunctionDetailsCommand { class UpdateFunction extends FunctionDetailsCommand {
@Parameter(names = "--update-auth-data", description = "Whether or not to update the auth data") @Parameter(names = "--update-auth-data", description = "Whether or not to update the auth data")
...@@ -794,7 +794,7 @@ public class CmdFunctions extends CmdBase { ...@@ -794,7 +794,7 @@ public class CmdFunctions extends CmdBase {
} }
} }
@Parameters(commandDescription = "List all of the Pulsar Functions running under a specific tenant and namespace") @Parameters(commandDescription = "List all Pulsar Functions running under a specific tenant and namespace")
class ListFunctions extends NamespaceCommand { class ListFunctions extends NamespaceCommand {
@Override @Override
void runCmd() throws Exception { void runCmd() throws Exception {
...@@ -849,7 +849,7 @@ public class CmdFunctions extends CmdBase { ...@@ -849,7 +849,7 @@ public class CmdFunctions extends CmdBase {
} }
} }
@Parameters(commandDescription = "Triggers the specified Pulsar Function with a supplied value") @Parameters(commandDescription = "Trigger the specified Pulsar Function with a supplied value")
class TriggerFunction extends FunctionCommand { class TriggerFunction extends FunctionCommand {
// for backward compatibility purposes // for backward compatibility purposes
@Parameter(names = "--triggerValue", description = "The value with which you want to trigger the function", hidden = true) @Parameter(names = "--triggerValue", description = "The value with which you want to trigger the function", hidden = true)
...@@ -857,9 +857,9 @@ public class CmdFunctions extends CmdBase { ...@@ -857,9 +857,9 @@ public class CmdFunctions extends CmdBase {
@Parameter(names = "--trigger-value", description = "The value with which you want to trigger the function") @Parameter(names = "--trigger-value", description = "The value with which you want to trigger the function")
protected String triggerValue; protected String triggerValue;
// for backward compatibility purposes // for backward compatibility purposes
@Parameter(names = "--triggerFile", description = "The path to the file that contains the data with which you'd like to trigger the function", hidden = true) @Parameter(names = "--triggerFile", description = "The path to the file that contains the data with which you want to trigger the function", hidden = true)
protected String DEPRECATED_triggerFile; protected String DEPRECATED_triggerFile;
@Parameter(names = "--trigger-file", description = "The path to the file that contains the data with which you'd like to trigger the function") @Parameter(names = "--trigger-file", description = "The path to the file that contains the data with which you want to trigger the function")
protected String triggerFile; protected String triggerFile;
@Parameter(names = "--topic", description = "The specific topic name that the function consumes from that you want to inject the data to") @Parameter(names = "--topic", description = "The specific topic name that the function consumes from that you want to inject the data to")
protected String topic; protected String topic;
...@@ -921,17 +921,17 @@ public class CmdFunctions extends CmdBase { ...@@ -921,17 +921,17 @@ public class CmdFunctions extends CmdBase {
// for backward compatibility purposes // for backward compatibility purposes
@Parameter( @Parameter(
names = "--destinationFile", names = "--destinationFile",
description = "The file where downloaded contents need to be stored", description = "The file to store downloaded content",
listConverter = StringConverter.class, hidden = true) listConverter = StringConverter.class, hidden = true)
protected String DEPRECATED_destinationFile; protected String DEPRECATED_destinationFile;
@Parameter( @Parameter(
names = "--destination-file", names = "--destination-file",
description = "The file where downloaded contents need to be stored", description = "The file to store downloaded content",
listConverter = StringConverter.class) listConverter = StringConverter.class)
protected String destinationFile; protected String destinationFile;
@Parameter( @Parameter(
names = "--path", names = "--path",
description = "Path where the contents are to be stored", description = "Path to store the content",
listConverter = StringConverter.class, required = false, hidden = true) listConverter = StringConverter.class, required = false, hidden = true)
protected String path; protected String path;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册