This is an automated email from the ASF dual-hosted git repository. kkloudas pushed a commit to branch release-1.11 in repository https://gitbox.apache.org/repos/asf/flink.git
commit b4adb22b4d94964145305e8bb2daee8f40a0633a Author: Kostas Kloudas <kklou...@gmail.com> AuthorDate: Mon Jun 8 15:58:50 2020 +0200 [FLINK-18084] Rename the ExecutorCLI to GenericCLI according to docs (cherry picked from commit bdcaea60c61a87bc110316555d4dc7fe38b06047) --- docs/ops/cli.md | 132 ++++++++++----------- docs/ops/cli.zh.md | 132 ++++++++++----------- .../org/apache/flink/client/cli/CliFrontend.java | 2 +- .../cli/{ExecutorCLI.java => GenericCLI.java} | 10 +- .../{ExecutorCLITest.java => GenericCLITest.java} | 12 +- .../flink/kubernetes/cli/KubernetesSessionCli.java | 6 +- .../apache/flink/yarn/FlinkYarnSessionCliTest.java | 4 +- 7 files changed, 149 insertions(+), 149 deletions(-) diff --git a/docs/ops/cli.md b/docs/ops/cli.md index eed5e7d..571cd83 100644 --- a/docs/ops/cli.md +++ b/docs/ops/cli.md @@ -49,17 +49,17 @@ Flink has the concept of executors for defining available deployment targets. Yo available executors in the output of `bin/flink --help`, for example: ``` -Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". +Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". ``` When running one of the `bin/flink` actions, the executor is specified using the `--executor` @@ -453,17 +453,17 @@ Action "run" compiles and runs a program. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -505,17 +505,17 @@ Action "list" lists running and scheduled programs. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -547,17 +547,17 @@ Action "stop" stops a running program with a savepoint (streaming jobs only). -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -590,17 +590,17 @@ Action "cancel" cancels a running program. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -627,17 +627,17 @@ Action "savepoint" triggers savepoints for a running job or disposes existing on -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which diff --git a/docs/ops/cli.zh.md b/docs/ops/cli.zh.md index 765206d..708d88c 100644 --- a/docs/ops/cli.zh.md +++ b/docs/ops/cli.zh.md @@ -49,17 +49,17 @@ Flink has the concept of executors for defining available deployment targets. Yo available executors in the output of `bin/flink --help`, for example: ``` -Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". +Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". ``` When running one of the `bin/flink` actions, the executor is specified using the `--executor` @@ -452,17 +452,17 @@ Action "run" compiles and runs a program. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -504,17 +504,17 @@ Action "list" lists running and scheduled programs. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -546,17 +546,17 @@ Action "stop" stops a running program with a savepoint (streaming jobs only). -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -589,17 +589,17 @@ Action "cancel" cancels a running program. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which @@ -626,17 +626,17 @@ Action "savepoint" triggers savepoints for a running job or disposes existing on -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths for high availability mode - Options for executor mode: - -D <property=value> Generic configuration options for - execution/deployment and for the configured executor. - The available options can be found at - https://ci.apache.org/projects/flink/flink-docs-stabl - e/ops/config.html - -e,--executor <arg> The name of the executor to be used for executing the - given job, which is equivalent to the - "execution.target" config option. The currently - available executors are: "remote", "local", - "kubernetes-session", "yarn-per-job", "yarn-session". + Options for Generic CLI mode: + -D <property=value> Generic configuration options for + execution/deployment and for the configured executor. + The available options can be found at + https://ci.apache.org/projects/flink/flink-docs-stabl + e/ops/config.html + -t,--target <arg> The deployment target for the given application, + which is equivalent to the "execution.target" config + option. The currently available targets are: + "remote", "local", "kubernetes-session", "yarn-per-job", + "yarn-session", "yarn-application" and "kubernetes-application". Options for default mode: -m,--jobmanager <arg> Address of the JobManager (master) to which diff --git a/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java b/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java index a038511..159507e 100644 --- a/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java +++ b/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java @@ -1045,7 +1045,7 @@ public class CliFrontend { public static List<CustomCommandLine> loadCustomCommandLines(Configuration configuration, String configurationDirectory) { List<CustomCommandLine> customCommandLines = new ArrayList<>(); - customCommandLines.add(new ExecutorCLI(configuration, configurationDirectory)); + customCommandLines.add(new GenericCLI(configuration, configurationDirectory)); // Command line interface of the YARN session, with a special initialization here // to prefix all options with y/yarn. diff --git a/flink-clients/src/main/java/org/apache/flink/client/cli/ExecutorCLI.java b/flink-clients/src/main/java/org/apache/flink/client/cli/GenericCLI.java similarity index 93% rename from flink-clients/src/main/java/org/apache/flink/client/cli/ExecutorCLI.java rename to flink-clients/src/main/java/org/apache/flink/client/cli/GenericCLI.java index 152ca33..945779b 100644 --- a/flink-clients/src/main/java/org/apache/flink/client/cli/ExecutorCLI.java +++ b/flink-clients/src/main/java/org/apache/flink/client/cli/GenericCLI.java @@ -44,9 +44,9 @@ import static org.apache.flink.util.Preconditions.checkNotNull; * for further parsing. */ @Internal -public class ExecutorCLI implements CustomCommandLine { +public class GenericCLI implements CustomCommandLine { - private static final Logger LOG = LoggerFactory.getLogger(ExecutorCLI.class); + private static final Logger LOG = LoggerFactory.getLogger(GenericCLI.class); private static final String ID = "Generic CLI"; @@ -57,9 +57,9 @@ public class ExecutorCLI implements CustomCommandLine { "currently available executors are: " + getExecutorFactoryNames() + "."); private final Option targetOption = new Option("t", "target", true, - "The name of the executor to be used for executing the given job, which is equivalent " + + "The deployment target for the given application, which is equivalent " + "to the \"" + DeploymentOptions.TARGET.key() + "\" config option. The " + - "currently available executors are: " + getExecutorFactoryNames() + + "currently available targets are: " + getExecutorFactoryNames() + ", \"yarn-application\" and \"kubernetes-application\"."); /** @@ -79,7 +79,7 @@ public class ExecutorCLI implements CustomCommandLine { private final String configurationDir; - public ExecutorCLI(final Configuration configuration, final String configDir) { + public GenericCLI(final Configuration configuration, final String configDir) { this.baseConfiguration = new UnmodifiableConfiguration(checkNotNull(configuration)); this.configurationDir = checkNotNull(configDir); } diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/ExecutorCLITest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/GenericCLITest.java similarity index 94% rename from flink-clients/src/test/java/org/apache/flink/client/cli/ExecutorCLITest.java rename to flink-clients/src/test/java/org/apache/flink/client/cli/GenericCLITest.java index daa6cd3..7e214cd 100644 --- a/flink-clients/src/test/java/org/apache/flink/client/cli/ExecutorCLITest.java +++ b/flink-clients/src/test/java/org/apache/flink/client/cli/GenericCLITest.java @@ -39,9 +39,9 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; /** - * Unit tests for the {@link ExecutorCLI}. + * Unit tests for the {@link GenericCLI}. */ -public class ExecutorCLITest { +public class GenericCLITest { @Rule public TemporaryFolder tmp = new TemporaryFolder(); @@ -52,7 +52,7 @@ public class ExecutorCLITest { public void initOptions() { testOptions = new Options(); - final ExecutorCLI cliUnderTest = new ExecutorCLI( + final GenericCLI cliUnderTest = new GenericCLI( new Configuration(), tmp.getRoot().getAbsolutePath()); cliUnderTest.addGeneralOptions(testOptions); @@ -64,7 +64,7 @@ public class ExecutorCLITest { final Configuration loadedConfig = new Configuration(); loadedConfig.set(DeploymentOptions.TARGET, expectedExecutorName); - final ExecutorCLI cliUnderTest = new ExecutorCLI( + final GenericCLI cliUnderTest = new GenericCLI( loadedConfig, tmp.getRoot().getAbsolutePath()); final CommandLine emptyCommandLine = CliFrontendParser.parse(testOptions, new String[0], true); @@ -96,7 +96,7 @@ public class ExecutorCLITest { "-D" + CoreOptions.DEFAULT_PARALLELISM.key() + "=5" }; - final ExecutorCLI cliUnderTest = new ExecutorCLI( + final GenericCLI cliUnderTest = new GenericCLI( loadedConfig, tmp.getRoot().getAbsolutePath()); final CommandLine commandLine = CliFrontendParser.parse(testOptions, args, true); @@ -124,7 +124,7 @@ public class ExecutorCLITest { final ConfigOption<Integer> configOption = key("test.int").intType().noDefaultValue(); final int expectedValue = 42; - final ExecutorCLI cliUnderTest = new ExecutorCLI( + final GenericCLI cliUnderTest = new GenericCLI( new Configuration(), tmp.getRoot().getAbsolutePath()); diff --git a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/cli/KubernetesSessionCli.java b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/cli/KubernetesSessionCli.java index 36fc950..b8c1067 100644 --- a/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/cli/KubernetesSessionCli.java +++ b/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/cli/KubernetesSessionCli.java @@ -23,7 +23,7 @@ import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.client.cli.AbstractCustomCommandLine; import org.apache.flink.client.cli.CliArgsException; import org.apache.flink.client.cli.CliFrontend; -import org.apache.flink.client.cli.ExecutorCLI; +import org.apache.flink.client.cli.GenericCLI; import org.apache.flink.client.deployment.ClusterClientFactory; import org.apache.flink.client.deployment.ClusterClientServiceLoader; import org.apache.flink.client.deployment.ClusterDescriptor; @@ -66,7 +66,7 @@ public class KubernetesSessionCli { private final Configuration baseConfiguration; - private final ExecutorCLI cli; + private final GenericCLI cli; private final ClusterClientServiceLoader clusterClientServiceLoader; public KubernetesSessionCli(Configuration configuration, String configDir) { @@ -76,7 +76,7 @@ public class KubernetesSessionCli { public KubernetesSessionCli(Configuration configuration, ClusterClientServiceLoader clusterClientServiceLoader, String configDir) { this.baseConfiguration = new UnmodifiableConfiguration(checkNotNull(configuration)); this.clusterClientServiceLoader = checkNotNull(clusterClientServiceLoader); - this.cli = new ExecutorCLI(baseConfiguration, configDir); + this.cli = new GenericCLI(baseConfiguration, configDir); } public Configuration getEffectiveConfiguration(String[] args) throws CliArgsException { diff --git a/flink-yarn/src/test/java/org/apache/flink/yarn/FlinkYarnSessionCliTest.java b/flink-yarn/src/test/java/org/apache/flink/yarn/FlinkYarnSessionCliTest.java index b275e7f..5818023 100644 --- a/flink-yarn/src/test/java/org/apache/flink/yarn/FlinkYarnSessionCliTest.java +++ b/flink-yarn/src/test/java/org/apache/flink/yarn/FlinkYarnSessionCliTest.java @@ -22,7 +22,7 @@ import org.apache.flink.client.cli.CliArgsException; import org.apache.flink.client.cli.CliFrontend; import org.apache.flink.client.cli.CliFrontendParser; import org.apache.flink.client.cli.CustomCommandLine; -import org.apache.flink.client.cli.ExecutorCLI; +import org.apache.flink.client.cli.GenericCLI; import org.apache.flink.client.deployment.ClusterClientFactory; import org.apache.flink.client.deployment.ClusterClientServiceLoader; import org.apache.flink.client.deployment.ClusterSpecification; @@ -194,7 +194,7 @@ public class FlinkYarnSessionCliTest extends TestLogger { true); final CustomCommandLine customCommandLine = cli.validateAndGetActiveCommandLine(commandLine); - assertTrue(customCommandLine instanceof ExecutorCLI); + assertTrue(customCommandLine instanceof GenericCLI); } private void validateYarnCLIisActive(Configuration configuration) throws FlinkException, CliArgsException {