victorunique commented on a change in pull request #46:
URL: https://github.com/apache/flink-training/pull/46#discussion_r826470737



##########
File path: README_zh.md
##########
@@ -0,0 +1,274 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Apache Flink 实践练习
+
+与文档中实践练习内容相关的练习。
+
+## 目录
+
+[**设置开发环境**](#set-up-your-development-environment)
+
+1. [软件要求](#software-requirements)
+1. [克隆并构建 flink-training 项目](#clone-and-build-the-flink-training-project)
+1. [将 flink-training 项目导入 
IDE](#import-the-flink-training-project-into-your-ide)
+
+[**使用出租车数据流(taxi data stream)**](#using-the-taxi-data-streams)
+
+1. [出租车车程(taxi ride)事件结构](#schema-of-taxi-ride-events)
+1. [出租车费用(taxi fare)事件结构](#schema-of-taxi-fare-events)
+
+[**如何做练习**](#how-to-do-the-lab-exercises)
+
+1. [了解数据](#learn-about-the-data)
+2. [在 IDE 中运行和调试 Flink 程序](#run-and-debug-flink-programs-in-your-ide)
+3. [练习、测试及解决方案](#exercises-tests-and-solutions)
+
+[**练习**](#lab-exercises)
+
+[**提交贡献**](#contributing)
+
+[**许可证**](#license)
+
+<a name="set-up-your-development-environment"></a>
+
+## 设置开发环境
+
+你需要设置便于进行开发、调试并运行实践练习的示例和解决方案的环境。
+
+<a name="software-requirements"></a>
+
+### 软件要求
+
+Linux、OS X 和 Windows 均可作为 Flink 程序和本地执行的开发环境。 Flink 开发设置需要以下软件,它们应该安装在系统上:
+
+- Git
+- Java 8 或者 Java 11 版本的 JDK (JRE不满足要求;目前不支持其他版本的Java)
+- 支持 Gradle 的 Java (及/或 Scala) 开发IDE
+    - 推荐使用 [IntelliJ](https://www.jetbrains.com/idea/), 但 
[Eclipse](https://www.eclipse.org/downloads/) 或 [Visual Studio 
Code](https://code.visualstudio.com/) (安装 [Java extension 
pack](https://code.visualstudio.com/docs/java/java-tutorial) 插件) 也可以用于Java环境
+    - 为了使用 Scala, 需要使用 IntelliJ (及其 [Scala 
plugin](https://plugins.jetbrains.com/plugin/1347-scala/) 插件)
+
+> **:information_source: Windows 用户须知:** 实践说明中提供的 shell 命令示例适用于 UNIX 环境。
+> 您可能会发现值得在 Windows 环境中设置 cygwin 或 WSL。对于开发 Flink 
作业(jobs),Windows工作的相当好:可以在单机上运行 Flink 集群、提交作业、运行 webUI 并在IDE中执行作业。
+
+<a name="clone-and-build-the-flink-training-project"></a>
+
+### 克隆并构建 flink-training 项目
+
+`flink-training` 仓库包含编程练习的习题、测试和参考解决方案。
+
+> **:information_source: 仓库格局:** 本仓库有几个分支,分别指向不同的 Apache Flink 版本,类似于 
[apache/flink](https://github.com/apache/flink) 仓库:
+> - 每个 Apache Flink 次要版本的发布分支,例如 `release-1.10`,和
+> - 一个指向当前 Flink 版本的 `master` 分支(不是 `flink:master`!)
+>
+> 如果想在当前 Flink 版本以外的版本上工作,请务必签出相应的分支。
+
+从 GitHub 克隆出 `flink-training` 仓库,导航到本地项目仓库并构建它:
+
+```bash
+git clone https://github.com/apache/flink-training.git
+cd flink-training
+./gradlew test shadowJar
+```
+
+如果是第一次构建,将会下载此 Flink 练习项目的所有依赖项。这通常需要几分钟事件,但具体取决于互联网连接速度。
+
+如果所有测试都通过并且构建成功,这说明你的实践练习已经开了一个好头。
+
+<details>
+<summary><strong>:cn: 中国用户: 点击这里了解如何使用本地 Maven 镜像。</strong></summary>
+
+如果你在中国,我们建议将 Maven 存储库配置为使用镜像。 可以通过在 [`build.gradle`](build.gradle) 
文件中取消注释此部分来做到这一点:
+
+```groovy
+    repositories {
+        // for access from China, you may need to uncomment this line
+        maven { url 'https://maven.aliyun.com/repository/public/' }
+        mavenCentral()
+        maven {
+            url "https://repository.apache.org/content/repositories/snapshots/";
+            mavenContent {
+                snapshotsOnly()
+            }
+        }
+    }
+```
+</details>
+
+<details>
+<summary><strong>启用 Scala (可选)</strong></summary>
+这个项目中的练习也可以使用 Scala ,但由于非 Scala 用户报告的一些问题,我们决定默认禁用 Scala。
+可以通过以下的方法修改 [`gradle.properties`](gradle.properties) 文件以重新启用所有 Scala 练习和解决方案:

Review comment:
       ```suggestion
   可以通过以下的方法修改 `gradle.properties` 文件以重新启用所有 Scala 练习和解决方案:
   ```

##########
File path: hourly-tips/README_zh.md
##########
@@ -0,0 +1,82 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# 练习: 窗口分析 (每小时小费)
+
+“每小时小费”练习的任务是确定每小时赚取最多小费的司机。
+最简单的方法是通过两个步骤来解决这个问题:首先使用一个小时长的窗口来计算每个司机在一小时内的总小费,然后从该窗口结果流中找到每小时总小费最多的司机。
+
+请注意,该程序应使用事件时间(event time)。
+
+### 输入数据
+
+本练习的输入数据是由[出租车车费流生成器](../README_zh.md#using-the-taxi-data-streams)生成的 
`TaxiFare` 事件流。
+
+`TaxiFareGenerator` 用时间戳和水位线(watermark)注解生成的 `DataStream<TaxiFare>`。
+因此,无需提供自定义的时间戳和水印分配器即可正确使用事件时间。
+
+### 期望输出
+
+所希望的结果是每小时产生一个 `Tuple3<Long, Long, Float>` 记录的数据流。
+这个记录(`Tuple3<Long, Long, Float>`)应包含该小时结束时的时间戳(对应三元组的第一个元素)、
+该小时内获得小费最多的司机的 driverId(对应三元组的第二个元素)以及他的实际小费总数(对应三元组的第三个元素))。
+
+结果流应打印到标准输出。
+
+## 入门指南
+
+> :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是实用本节中源文件的链接。

Review comment:
       ```suggestion
   > :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是使用本节中源文件的链接。
   ```

##########
File path: rides-and-fares/README_zh.md
##########
@@ -0,0 +1,95 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# 练习: 有状态的增强(车程及车费)
+
+本练习的目标是将每次车程的 `TaxiRide` 和 `TaxiFare` 记录连接在一起。
+
+对于每个不同的 `rideId`,恰好有三个事件:
+
+1. `TaxiRide` START 事件
+1. `TaxiRide` END 事件
+1. 一个 `TaxiFare` 事件(其时间戳恰好与开始时间匹配)
+
+最终的结果应该是 `DataStream<RideAndFare>`,每个不同的 `rideId` 都产生一个 `RideAndFare` 记录。 
+每个 `RideAndFare` 都应该将某个 `rideId` 的 `TaxiRide` START 事件与其匹配的 `TaxiFare` 配对。
+
+### 输入数据
+
+在练习中,你将使用两个数据流,一个使用由 `TaxiRideSource` 生成的 `TaxiRide` 事件,另一个使用由 
`TaxiFareSource` 生成的 `TaxiFare` 事件。
+有关如何使用这些流生成器的信息,请参阅 [使用出租车数据流](../README_zh.md#using-the-taxi-data-streams)。
+
+### 期望输出
+
+所希望的结果是一个 `RideAndFare` 记录的数据流,每个不同的 `rideId` 都有一条这样的记录。 
+本练习设置为忽略 END 事件,你应该连接每次乘车的 START 事件及其相应的车费事件。
+
+一旦具有了相互关联的车程和车费事件,你可以使用 `new RideAndFare(ride, fare)` 方法为输出流创建所需的对象。
+
+流将会被打印到标准输出。
+
+## 入门指南
+
+> :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是实用本节中源文件的链接。

Review comment:
       ```suggestion
   > :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是使用本节中源文件的链接。
   ```

##########
File path: ride-cleansing/README_zh.md
##########
@@ -0,0 +1,98 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# 练习: 过滤流(车程清理)
+
+如果尚未设置 Flink 开发环境,请参阅[指南](../README_zh.md)。
+有关练习的总体介绍,请参阅[如何做练习](../README_zh.md#how-to-do-the-labs)。
+
+"出租车车程清理"练习的任务是通过删除在纽约市以外开始或结束的车程来清理一系列的 `TaxiRide` 事件。
+
+`GeoUtils` 实用程序类提供了一个静态方法 `isInNYC(float lon, float lat)` 来检查某个位置是否在纽约市区域内。
+
+### 输入数据
+
+此练习基于 `TaxiRide` 事件流,如[使用出租车数据流](../README.md#using-the-taxi-data-streams)中所述。
+
+### 期望输出
+
+练习的结果应该是一个 `DataStream<TaxiRide>`,它只包含在 `GeoUtils.isInNYC()` 
定义的纽约市地区开始和结束的出租车车程事件。
+
+结果流应打印到标准输出。
+
+## 入门指南
+
+> :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是实用本节中源文件的链接。

Review comment:
       ```suggestion
   > :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是使用本节中源文件的链接。
   ```

##########
File path: long-ride-alerts/README_zh.md
##########
@@ -0,0 +1,93 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# 练习: `ProcessFunction` 及定时器(长车程警报)
+
+“长车程警报”练习的目标是对于持续超过两个小时的出租车车程发出警报。
+
+这应该使用数据流中提供的事件时间时间戳和水位线来完成。
+
+流是无序的,并且可能会在其 START 事件之前处理车程的 END 事件。
+
+END 事件可能会丢失,但你可以假设没有重复的事件,也没有丢失的 START 事件。
+
+仅仅等待 END 事件并计算持续时间是不够的,因为我们希望尽快收到关于长车程的警报。
+
+最终应该清除创建的任何状态。
+
+### 输入数据
+
+输入数据是出租车乘车事件的 `DataStream`。
+
+### 期望输出
+
+所希望的结果应该是一个 `DataStream<LONG>`,其中包含持续时间超过两小时的车程的 `rideId`。
+
+结果流应打印到标准输出。
+
+## 入门指南
+
+> :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是实用本节中源文件的链接。

Review comment:
       ```suggestion
   > :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是使用本节中源文件的链接。
   ```

##########
File path: rides-and-fares/README_zh.md
##########
@@ -0,0 +1,95 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# 练习: 有状态的增强(车程及车费)
+
+本练习的目标是将每次车程的 `TaxiRide` 和 `TaxiFare` 记录连接在一起。
+
+对于每个不同的 `rideId`,恰好有三个事件:
+
+1. `TaxiRide` START 事件
+1. `TaxiRide` END 事件
+1. 一个 `TaxiFare` 事件(其时间戳恰好与开始时间匹配)
+
+最终的结果应该是 `DataStream<RideAndFare>`,每个不同的 `rideId` 都产生一个 `RideAndFare` 记录。 
+每个 `RideAndFare` 都应该将某个 `rideId` 的 `TaxiRide` START 事件与其匹配的 `TaxiFare` 配对。
+
+### 输入数据
+
+在练习中,你将使用两个数据流,一个使用由 `TaxiRideSource` 生成的 `TaxiRide` 事件,另一个使用由 
`TaxiFareSource` 生成的 `TaxiFare` 事件。
+有关如何使用这些流生成器的信息,请参阅 [使用出租车数据流](../README_zh.md#using-the-taxi-data-streams)。
+
+### 期望输出
+
+所希望的结果是一个 `RideAndFare` 记录的数据流,每个不同的 `rideId` 都有一条这样的记录。 
+本练习设置为忽略 END 事件,你应该连接每次乘车的 START 事件及其相应的车费事件。
+
+一旦具有了相互关联的车程和车费事件,你可以使用 `new RideAndFare(ride, fare)` 方法为输出流创建所需的对象。
+
+流将会被打印到标准输出。
+
+## 入门指南
+
+> :information_source: 最好在 IDE 的 flink-training 项目中找到这些类,而不是实用本节中源文件的链接。
+
+### 练习相关类
+
+- Java:  
[`org.apache.flink.training.exercises.ridesandfares.RidesAndFaresExercise`](src/main/java/org/apache/flink/training/exercises/ridesandfares/RidesAndFaresExercise.java)
+- Scala: 
[`org.apache.flink.training.exercises.ridesandfares.scala.RidesAndFaresExercise`](src/main/scala/org/apache/flink/training/exercises/ridesandfares/scala/RidesAndFaresExercise.scala)
+
+### 集成测试
+
+- Java:  
[`org.apache.flink.training.exercises.ridesandfares.RidesAndFaresIntegrationTest`](src/test/java/org/apache/flink/training/exercises/ridesandfares/RidesAndFaresIntegrationTest.java)
+- Scala: 
[`org.apache.flink.training.exercises.ridesandfares.scala.RidesAndFaresIntegrationTest`](src/test/scala/org/apache/flink/training/exercises/ridesandfares/scala/RidesAndFaresIntegrationTest.scala)
+
+## 实现提示
+
+<details>
+<summary><strong>程序结构</strong></summary>
+
+可以使用 `RichCoFlatMap` 来实现连接操作。请注意,你无法控制每个 rideId 
的车程和车费记录的到达顺序,因此需要存储一个事件,直到与其匹配事件到达。

Review comment:
       ```suggestion
   可以使用 `RichCoFlatMap` 来实现连接操作。请注意,你无法控制每个 rideId 
的车程和车费记录的到达顺序,因此需要存储其中一个事件,直到与其匹配的另一事件到达。
   ```

##########
File path: README_zh.md
##########
@@ -0,0 +1,274 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Apache Flink 实践练习
+
+与文档中实践练习内容相关的练习。
+
+## 目录
+
+[**设置开发环境**](#set-up-your-development-environment)
+
+1. [软件要求](#software-requirements)
+1. [克隆并构建 flink-training 项目](#clone-and-build-the-flink-training-project)
+1. [将 flink-training 项目导入 
IDE](#import-the-flink-training-project-into-your-ide)
+
+[**使用出租车数据流(taxi data stream)**](#using-the-taxi-data-streams)
+
+1. [出租车车程(taxi ride)事件结构](#schema-of-taxi-ride-events)
+1. [出租车费用(taxi fare)事件结构](#schema-of-taxi-fare-events)
+
+[**如何做练习**](#how-to-do-the-lab-exercises)
+
+1. [了解数据](#learn-about-the-data)
+2. [在 IDE 中运行和调试 Flink 程序](#run-and-debug-flink-programs-in-your-ide)
+3. [练习、测试及解决方案](#exercises-tests-and-solutions)
+
+[**练习**](#lab-exercises)
+
+[**提交贡献**](#contributing)
+
+[**许可证**](#license)
+
+<a name="set-up-your-development-environment"></a>
+
+## 设置开发环境
+
+你需要设置便于进行开发、调试并运行实践练习的示例和解决方案的环境。
+
+<a name="software-requirements"></a>
+
+### 软件要求
+
+Linux、OS X 和 Windows 均可作为 Flink 程序和本地执行的开发环境。 Flink 开发设置需要以下软件,它们应该安装在系统上:
+
+- Git
+- Java 8 或者 Java 11 版本的 JDK (JRE不满足要求;目前不支持其他版本的Java)
+- 支持 Gradle 的 Java (及/或 Scala) 开发IDE
+    - 推荐使用 [IntelliJ](https://www.jetbrains.com/idea/), 但 
[Eclipse](https://www.eclipse.org/downloads/) 或 [Visual Studio 
Code](https://code.visualstudio.com/) (安装 [Java extension 
pack](https://code.visualstudio.com/docs/java/java-tutorial) 插件) 也可以用于Java环境
+    - 为了使用 Scala, 需要使用 IntelliJ (及其 [Scala 
plugin](https://plugins.jetbrains.com/plugin/1347-scala/) 插件)
+
+> **:information_source: Windows 用户须知:** 实践说明中提供的 shell 命令示例适用于 UNIX 环境。
+> 您可能会发现值得在 Windows 环境中设置 cygwin 或 WSL。对于开发 Flink 
作业(jobs),Windows工作的相当好:可以在单机上运行 Flink 集群、提交作业、运行 webUI 并在IDE中执行作业。
+
+<a name="clone-and-build-the-flink-training-project"></a>
+
+### 克隆并构建 flink-training 项目
+
+`flink-training` 仓库包含编程练习的习题、测试和参考解决方案。
+
+> **:information_source: 仓库格局:** 本仓库有几个分支,分别指向不同的 Apache Flink 版本,类似于 
[apache/flink](https://github.com/apache/flink) 仓库:
+> - 每个 Apache Flink 次要版本的发布分支,例如 `release-1.10`,和
+> - 一个指向当前 Flink 版本的 `master` 分支(不是 `flink:master`!)
+>
+> 如果想在当前 Flink 版本以外的版本上工作,请务必签出相应的分支。
+
+从 GitHub 克隆出 `flink-training` 仓库,导航到本地项目仓库并构建它:
+
+```bash
+git clone https://github.com/apache/flink-training.git
+cd flink-training
+./gradlew test shadowJar
+```
+
+如果是第一次构建,将会下载此 Flink 练习项目的所有依赖项。这通常需要几分钟事件,但具体取决于互联网连接速度。

Review comment:
       ```suggestion
   如果是第一次构建,将会下载此 Flink 练习项目的所有依赖项。这通常需要几分钟时间,但具体取决于互联网连接速度。
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

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


Reply via email to