You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/10/14 05:57:00 UTC

[GitHub] [flink] klion26 commented on a change in pull request #13505: [FLINK-19420][docs-zh] Translate "Program Packaging" page into Chinese

klion26 commented on a change in pull request #13505:
URL: https://github.com/apache/flink/pull/13505#discussion_r504417756



##########
File path: docs/dev/packaging.zh.md
##########
@@ -24,36 +24,20 @@ under the License.
 -->
 
 
-As described earlier, Flink programs can be executed on
-clusters by using a `remote environment`. Alternatively, programs can be packaged into JAR Files
-(Java Archives) for execution. Packaging the program is a prerequisite to executing them through the
-[command line interface]({{ site.baseurl }}/ops/cli.html).
-
-### Packaging Programs
-
-To support execution from a packaged JAR file via the command line or web interface, a program must
-use the environment obtained by `StreamExecutionEnvironment.getExecutionEnvironment()`. This environment
-will act as the cluster's environment when the JAR is submitted to the command line or web
-interface. If the Flink program is invoked differently than through these interfaces, the
-environment will act like a local environment.
-
-To package the program, simply export all involved classes as a JAR file. The JAR file's manifest
-must point to the class that contains the program's *entry point* (the class with the public
-`main` method). The simplest way to do this is by putting the *main-class* entry into the
-manifest (such as `main-class: org.apache.flinkexample.MyProgram`). The *main-class* attribute is
-the same one that is used by the Java Virtual Machine to find the main method when executing a JAR
-files through the command `java -jar pathToTheJarFile`. Most IDEs offer to include that attribute
-automatically when exporting JAR files.
+正如之前所描述的,Flink 程序可以使用 `remote environment` 在集群上执行。或者,程序可以被打包成 JAR 文件(Java Archives)执行。如果使用[命令行]({% link ops/cli.zh.md %})的方式执行程序,将程序打包是必需的。
+
+### 打包程序

Review comment:
       标题翻译之后,需要添加 `<a>` 标签,可以参考 [wiki](https://cwiki.apache.org/confluence/display/FLINK/Flink+Translation+Specifications) 锚点可以参考 英文版的 url

##########
File path: docs/dev/packaging.zh.md
##########
@@ -24,36 +24,20 @@ under the License.
 -->
 
 
-As described earlier, Flink programs can be executed on
-clusters by using a `remote environment`. Alternatively, programs can be packaged into JAR Files
-(Java Archives) for execution. Packaging the program is a prerequisite to executing them through the
-[command line interface]({{ site.baseurl }}/ops/cli.html).
-
-### Packaging Programs
-
-To support execution from a packaged JAR file via the command line or web interface, a program must
-use the environment obtained by `StreamExecutionEnvironment.getExecutionEnvironment()`. This environment
-will act as the cluster's environment when the JAR is submitted to the command line or web
-interface. If the Flink program is invoked differently than through these interfaces, the
-environment will act like a local environment.
-
-To package the program, simply export all involved classes as a JAR file. The JAR file's manifest
-must point to the class that contains the program's *entry point* (the class with the public
-`main` method). The simplest way to do this is by putting the *main-class* entry into the
-manifest (such as `main-class: org.apache.flinkexample.MyProgram`). The *main-class* attribute is
-the same one that is used by the Java Virtual Machine to find the main method when executing a JAR
-files through the command `java -jar pathToTheJarFile`. Most IDEs offer to include that attribute
-automatically when exporting JAR files.
+正如之前所描述的,Flink 程序可以使用 `remote environment` 在集群上执行。或者,程序可以被打包成 JAR 文件(Java Archives)执行。如果使用[命令行]({% link ops/cli.zh.md %})的方式执行程序,将程序打包是必需的。
+
+### 打包程序
+
+为了能够通过命令行或 web 界面执行打包的 JAR 文件,程序必须使用通过 `StreamExecutionEnvironment.getExecutionEnvironment()` 获取的 environment。当 JAR 被提交到命令行或 web 界面后,该 environment 会扮演集群环境的角色。如果调用 Flink 程序的方式与上述接口不同,该 environment 会扮演本地环境的角色。
+
+打包程序只要简单地将所有相关的类导出为 JAR 文件,JAR 文件的 manifest 必须指向包含程序*入口点*(拥有公共 `main` 方法)的类。实现的最简单的方法是将 *main-class* 写入 manifest 中(比如 `main-class: org.apache.flinkexample.MyProgram`)。*main-class* 属性与 Java 虚拟机通过指令 `java -jar pathToTheJarFile` 执行 JAR 文件时寻找 main 方法的类是相同的。大多数 IDE 提供了在导出 JAR 文件时自动包含该属性的功能。
 
 ### Summary

Review comment:
       这个标题也翻译下?

##########
File path: docs/dev/packaging.zh.md
##########
@@ -24,36 +24,20 @@ under the License.
 -->
 
 
-As described earlier, Flink programs can be executed on
-clusters by using a `remote environment`. Alternatively, programs can be packaged into JAR Files
-(Java Archives) for execution. Packaging the program is a prerequisite to executing them through the
-[command line interface]({{ site.baseurl }}/ops/cli.html).
-
-### Packaging Programs
-
-To support execution from a packaged JAR file via the command line or web interface, a program must
-use the environment obtained by `StreamExecutionEnvironment.getExecutionEnvironment()`. This environment
-will act as the cluster's environment when the JAR is submitted to the command line or web
-interface. If the Flink program is invoked differently than through these interfaces, the
-environment will act like a local environment.
-
-To package the program, simply export all involved classes as a JAR file. The JAR file's manifest
-must point to the class that contains the program's *entry point* (the class with the public
-`main` method). The simplest way to do this is by putting the *main-class* entry into the
-manifest (such as `main-class: org.apache.flinkexample.MyProgram`). The *main-class* attribute is
-the same one that is used by the Java Virtual Machine to find the main method when executing a JAR
-files through the command `java -jar pathToTheJarFile`. Most IDEs offer to include that attribute
-automatically when exporting JAR files.
+正如之前所描述的,Flink 程序可以使用 `remote environment` 在集群上执行。或者,程序可以被打包成 JAR 文件(Java Archives)执行。如果使用[命令行]({% link ops/cli.zh.md %})的方式执行程序,将程序打包是必需的。
+
+### 打包程序
+
+为了能够通过命令行或 web 界面执行打包的 JAR 文件,程序必须使用通过 `StreamExecutionEnvironment.getExecutionEnvironment()` 获取的 environment。当 JAR 被提交到命令行或 web 界面后,该 environment 会扮演集群环境的角色。如果调用 Flink 程序的方式与上述接口不同,该 environment 会扮演本地环境的角色。
+
+打包程序只要简单地将所有相关的类导出为 JAR 文件,JAR 文件的 manifest 必须指向包含程序*入口点*(拥有公共 `main` 方法)的类。实现的最简单的方法是将 *main-class* 写入 manifest 中(比如 `main-class: org.apache.flinkexample.MyProgram`)。*main-class* 属性与 Java 虚拟机通过指令 `java -jar pathToTheJarFile` 执行 JAR 文件时寻找 main 方法的类是相同的。大多数 IDE 提供了在导出 JAR 文件时自动包含该属性的功能。

Review comment:
       `实现的最简单的方法` -> `实现的最简单方法` 是否会更好一些呢




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org