-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-19430][docs-zh] Translate page datastream_tutorial into Chinese #13498
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 36e941c (Fri Feb 19 07:31:47 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
Hi @dianfu, Could you help have a review in your free time, Thank you~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wangxlong Thanks for the PR! Have left a few comments. As most of the content of this page is similar to https://ci.apache.org/projects/flink/flink-docs-master/zh/try-flink/datastream_api.html, you can refer to it when translating this page.
If you get stuck, check out the [community support resources](https://flink.apache.org/zh/community.html). | ||
In particular, Apache Flink's [user mailing list](https://flink.apache.org/zh/community.html#mailing-lists) consistently ranks as one of the most active of any Apache project and a great way to get help quickly. | ||
如果你有疑惑,可以查阅 [community support resources](https://flink.apache.org/zh/community.html)。 | ||
特别是,Apache Flink [user mailing list](https://flink.apache.org/zh/community.html#mailing-lists) 一直是最活跃的Apache项目之一,也是快速获得帮助的好方法。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
特别是,Apache Flink [user mailing list](https://flink.apache.org/zh/community.html#mailing-lists) 一直是最活跃的Apache项目之一,也是快速获得帮助的好方法。 | |
特别是,Apache Flink [用户邮件列表](https://flink.apache.org/zh/community.html#mailing-lists) 一直被评为所有Apache项目中最活跃的一个,也是快速获得帮助的好方法。 |
|
||
If you get stuck, check out the [community support resources](https://flink.apache.org/zh/community.html). | ||
In particular, Apache Flink's [user mailing list](https://flink.apache.org/zh/community.html#mailing-lists) consistently ranks as one of the most active of any Apache project and a great way to get help quickly. | ||
如果你有疑惑,可以查阅 [community support resources](https://flink.apache.org/zh/community.html)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果你有疑惑,可以查阅 [community support resources](https://flink.apache.org/zh/community.html)。 | |
如果你有疑惑,可以查阅 [社区支持资源](https://flink.apache.org/zh/community.html)。 |
|
||
## How To Follow Along | ||
## 如何跟进 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## 如何跟进 | |
## 怎样跟着教程练习 |
|
||
If you want to follow along, you will require a computer with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
首先,你需要在你的电脑上准备以下环境:
|
||
* Java 8 or 11 | ||
* Python 3.5, 3.6 or 3.7 | ||
|
||
Using Python DataStream API requires installing PyFlink, which is available on [PyPI](https://pypi.org/project/apache-flink/) and can be easily installed using `pip`. | ||
使用 Python DataStream API 需要安装 PyFlink,安装地址 [PyPI](https://pypi.org/project/apache-flink/) ,同时也可以使用 `pip` 快速安装。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用 Python DataStream API 需要安装 PyFlink,安装地址 [PyPI](https://pypi.org/project/apache-flink/) ,同时也可以使用 `pip` 快速安装。 | |
使用 Python DataStream API 需要安装 PyFlink,PyFlink 发布在 [PyPI](https://pypi.org/project/apache-flink/) 上,可以通过 `pip` 快速安装。 |
|
||
{% highlight bash %} | ||
$ python -m pip install apache-flink | ||
{% endhighlight %} | ||
|
||
Once PyFlink is installed, you can move on to write a Python DataStream job. | ||
一旦 PyFlink 安装完成之后,你可以开始编写 Python DataStream 作业。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一旦 PyFlink 安装完成之后,你可以开始编写 Python DataStream 作业。 | |
一旦 PyFlink 安装完成之后,你就可以开始编写 Python DataStream 作业了。 |
|
||
DataStream API applications begin by declaring an execution environment (`StreamExecutionEnvironment`), the context in which a streaming program is executed. This is what you will use to set the properties of your job (e.g. default parallelism, restart strategy), create your sources and finally trigger the execution of the job. | ||
DataStream API 应用程序首先声明一个执行环境(`StreamExecutionEnvironment`),是流式程序执行的上下文。你将使用它来设置作业的属性(例如默认并行性、重启策略)、创建源,并最终触发作业的执行。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataStream API 应用程序首先声明一个执行环境(`StreamExecutionEnvironment`),是流式程序执行的上下文。你将使用它来设置作业的属性(例如默认并行性、重启策略)、创建源,并最终触发作业的执行。 | |
DataStream API 应用程序首先需要声明一个执行环境(`StreamExecutionEnvironment`),这是流式程序执行的上下文。你将通过它来设置作业的属性(例如默认并发度、重启策略等)、创建源、并最终触发作业的执行。 |
|
||
{% highlight python %} | ||
ds.add_sink(StreamingFileSink | ||
.for_row_format('/tmp/output', SimpleStringEncoder()) | ||
.build()) | ||
{% endhighlight %} | ||
|
||
The last step is to execute the actual PyFlink DataStream API job. PyFlink applications are built lazily and shipped to the cluster for execution only once fully formed. To execute an application, you simply call `env.execute(job_name)`. | ||
最后一步是执行真实的 PyFlink DataStream API 作业。PyFlink applications 是惰性构建的,并且只有完全构建之后才会提交给集群执行。要执行一个应用程序,你只需简单的调用 `env.execute(job_name)`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最后一步是执行真实的 PyFlink DataStream API 作业。PyFlink applications 是惰性构建的,并且只有完全构建之后才会提交给集群执行。要执行一个应用程序,你只需简单的调用 `env.execute(job_name)`。 | |
最后一步是执行真实的 PyFlink DataStream API 作业。PyFlink applications 是懒加载的,并且只有在完全构建之后才会提交给集群上执行。要执行一个应用程序,你只需简单地调用 `env.execute(job_name)`。 |
|
||
{% highlight bash %} | ||
$ find /tmp/output -type f -exec cat {} \; | ||
1,aaa | ||
2,bbb | ||
{% endhighlight %} | ||
|
||
This walkthrough gives you the foundations to get started writing your own PyFlink DataStream API programs. To learn more about the Python DataStream API, please refer to [Flink Python API Docs]({{ site.pythondocs_baseurl }}/api/python) for more details. | ||
本教程为你开始编写自己的 PyFlink DataStream API 程序提供了基础。为了了解更多关于 Python DataStream API 的使用,请查阅 [Flink Python API Docs]({{ site.pythondocs_baseurl }}/api/python)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本教程为你开始编写自己的 PyFlink DataStream API 程序提供了基础。为了了解更多关于 Python DataStream API 的使用,请查阅 [Flink Python API Docs]({{ site.pythondocs_baseurl }}/api/python)。 | |
本教程为你开始编写自己的 PyFlink DataStream API 程序提供了基础。如果需要了解更多关于 Python DataStream API 的使用,请查阅 [Flink Python API Docs]({{ site.pythondocs_baseurl }}/api/python)。 |
@dianfu Thank you for reminder and patient review. Updated~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What is the purpose of the change
Translate page datastream_tutorial into Chinese
Brief change log
Translate page datastream_tutorial into Chinese, The doc is located at /dev/python/user-guide/datastream_tutorial.zh.md
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: ( no)Documentation