[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-16 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r314920585
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、Mac OS X、和 Windows__ 环境中运行。为了能够运行 Flink 唯一要求是安装 __Java 8.x__ 
。 Windows 用户,请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib` 目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
+
+
+
+还可以通过检查 `logs` 目录中的日志文件来验证系统是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 
上看到分别用[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)编写的
 SocketWindowWordCount 的完整代码。
 
 Review comment:
   
![image](https://user-images.githubusercontent.com/22651167/63203413-d833b800-c0c1-11e9-886d-87016a4cd881.png)
   运行一下 `build_docs.sh` 看看效果,英文中括号后面跟小括号是超链接,如果超链接的文本内容是英文,要和前后的中文之间留有空格。


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-16 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r314919768
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、Mac OS X、和 Windows__ 环境中运行。为了能够运行 Flink 唯一要求是安装 __Java 8.x__ 
。 Windows 用户,请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib` 目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
+
+
+
+还可以通过检查 `logs` 目录中的日志文件来验证系统是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 
上看到分别用[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)编写的
 SocketWindowWordCount 的完整代码。
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// the port to connect to
+final int 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-16 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r314919426
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、Mac OS X、和 Windows__ 环境中运行。为了能够运行 Flink 唯一要求是安装 __Java 8.x__ 
。 Windows 用户,请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib` 目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
+
+
+
+还可以通过检查 `logs` 目录中的日志文件来验证系统是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 
上看到分别用[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)编写的
 SocketWindowWordCount 的完整代码。
 
 Review comment:
   ```suggestion
   你可以在 Github 上看到分别用 
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 和 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 编写的 SocketWindowWordCount 示例程序的完整代码。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-16 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313786797
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
 
 Review comment:
   ```suggestion
   检查位于 [http://localhost:8081](http://localhost:8081) 的 __web 调度界面__ 
以确保一切正常运行。Web 界面上会仅显示一个可用的 TaskManager 实例。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-16 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r314919093
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、Mac OS X、和 Windows__ 环境中运行。为了能够运行 Flink 唯一要求是安装 __Java 8.x__ 
。 Windows 用户,请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)上面描述了如何在 windows 上以本地模式运行 Flink。
 
 Review comment:
   ```suggestion
   Flink 可以在 __Linux、Mac OS X 和 Windows__ 环境中运行。运行 Flink 的唯一要求是安装 __Java 
8.x__。Windows 用户请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/zh/tutorials/flink_on_windows.html),上面描述了如何在 windows 上以本地模式运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313782330
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
 
 Review comment:
   ```suggestion
   Flink 可以在 __Linux、Mac OS X 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__。Windows 用户,请查阅[在 Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html),上面描述了如何在 windows 上以本地模式运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313790563
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
+
+
+
+还可以通过检查 `logs` 目录中的日志文件来验证系统是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用 
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 样例的完整源码。
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// the port to connect to
+

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313789732
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
+
+
+
+还可以通过检查 `logs` 目录中的日志文件来验证系统是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用 
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 样例的完整源码。
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// the port to connect to
+

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313788535
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
+
+
+
+还可以通过检查 `logs` 目录中的日志文件来验证系统是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用 
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 样例的完整源码。
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// the port to connect to
+

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313786797
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+检查位于[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
 
 Review comment:
   ```suggestion
   检查位于 [http://localhost:8081](http://localhost:8081) 的 __web 
调度界面__以确保一切正常运行。Web 界面上会仅显示一个可用的 TaskManager 实例。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313786369
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
 
 Review comment:
   ```suggestion
   对于 MacOS X 用户,Flink 可以通过 [Homebrew](https://brew.sh/) 进行安装。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313782330
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
 
 Review comment:
   ```suggestion
   Flink 可以在 __Linux、Mac OS X、和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__。Windows 用户,请查阅[在 Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html),上面描述了如何在 windows 上以本地模式运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313784205
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
 
 Review comment:
   ```suggestion
   对于 MacOS X 用户,Flink 可以通过 [Homebrew](https://brew.sh/) 进行安装。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313784205
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
+2. 进入下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
 
 Review comment:
   ```suggestion
   对于 MacOS X 用户,Flink 可以通过 [Homebrew](https://brew.sh/) 进行安装。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313783466
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,应该输出如下内容:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
 
 Review comment:
   ```suggestion
   1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib` 目录。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-14 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r313782330
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+只需要几个简单的步骤即可启动并运行 Flink 示例程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux、 Mac OS X、 和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__ 。 Windows 用户, 请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
 
 Review comment:
   ```suggestion
   Flink 可以在 __Linux、Mac OS X、和 Windows__ 环境中运行。为了能够运行 Flink 唯一的要求是安装 __Java 
8.x__。Windows 用户,请查阅[在  Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html),上面描述了如何在 windows 上以本地模式运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309581645
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309580130
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309579053
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309569346
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309570136
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309562144
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
 
 Review comment:
   ```suggestion
   检查位于[http://localhost:8081](http://localhost:8081)的 __web 
调度界面__以确保一切正常运行。Web 界面上会仅显示一个可用的 TaskManager 实例。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309562144
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
 
 Review comment:
   ```suggestion
   检查[http://localhost:8081](http://localhost:8081)的 __web 调度界面__以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309559058
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
 
 Review comment:
   ```suggestion
   对于 MacOS X 用户,Flink 可以通过[Homebrew](https://brew.sh/)进行安装。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309552519
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
 
 Review comment:
   ```suggestion
   Flink 可以在 __Linux、Mac OS X 和 Windows__ 环境中运行。为了能够运行 Flink,唯一的要求是安装 __Java 
8.x__。 Windows 用户,请查阅[在 Windows 上运行 Flink]({{ site.baseurl 
}}/tutorials/flink_on_windows.html) 指南,该指南介绍了如何在 windows 上以本地设置运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309552519
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
 
 Review comment:
   ```suggestion
   Flink 可以在 __Linux、Mac OS X,和 Windows__ 环境中运行。为了能够运行 Flink,唯一的要求是安装 __Java 
8.x__。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html) 指南,该指南介绍了如何在 windows 上以本地设置运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309558637
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
 
 Review comment:
   ```suggestion
   1. 从[下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309559579
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
 
 Review comment:
   ```suggestion
   从我们的[代码仓库](http://flink.apache.org/community.html#source-code)中克隆源码,例如:
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309562144
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
 
 Review comment:
   ```suggestion
   检查[http://localhost:8081](http://localhost:8081)的 __web 调度界面__ 以确保一切正常运行。Web 
界面上会仅显示一个可用的 TaskManager 实例。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309565582
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
 
 Review comment:
   ```suggestion
   你可以在 Github 上看到分别用 
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 样例的完整源码。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309579053
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309581645
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309580421
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309580130
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309579053
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309570136
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309569346
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
+
+
+
+{% highlight scala %}
+object SocketWindowWordCount {
+
+def main(args: Array[String]) : Unit = {
+
+// the port to connect to
+val port: Int = try {
+ParameterTool.fromArgs(args).getInt("port")
+} catch {
+case e: Exception => {
+System.err.println("No port specified. Please run 
'SocketWindowWordCount --port '")
+return
+}
+}
+
+// get the execution environment
+val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment
+
+// get input data by connecting to the socket
+val text = env.socketTextStream("localhost", port, '\n')
+
+// parse the data, group it, window it, and aggregate the counts
+val windowCounts = text
+.flatMap { w => w.split("\\s") }
+.map { w => WordWithCount(w, 1) }
+.keyBy("word")
+.timeWindow(Time.seconds(5), Time.seconds(1))
+.sum("count")
+
+// print the results with a single thread, rather than in parallel
+windowCounts.print().setParallelism(1)
+
+env.execute("Socket Window WordCount")
+}
+
+// Data type for words with count
+case class WordWithCount(word: String, count: Long)
+}
+{% endhighlight %}
+
+
+{% highlight java %}
+public class SocketWindowWordCount {
+
+public static void main(String[] args) throws Exception {
+
+// 

[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309565582
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
 
 Review comment:
   ```suggestion
   你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 
和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 样例的完整源码。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309565582
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
+
+{% highlight bash %}
+$ tail log/flink-*-standalonesession-*.log
+INFO ... - Rest endpoint listening at localhost:8081
+INFO ... - http://localhost:8081 was granted leadership ...
+INFO ... - Web frontend listening at http://localhost:8081.
+INFO ... - Starting RPC endpoint for StandaloneResourceManager at 
akka://flink/user/resourcemanager .
+INFO ... - Starting RPC endpoint for StandaloneDispatcher at 
akka://flink/user/dispatcher .
+INFO ... - ResourceManager 
akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership ...
+INFO ... - Starting the SlotManager.
+INFO ... - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was 
granted leadership ...
+INFO ... - Recovering all persisted jobs.
+INFO ... - Registering TaskManager ... under ... at the SlotManager.
+{% endhighlight %}
+
+## 阅读代码
+
+你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 and 
[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 的完整样例
 
 Review comment:
   ```suggestion
   你可以在 Github 上看到分别用  
[scala](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/scala/org/apache/flink/streaming/scala/examples/socket/SocketWindowWordCount.scala)
 
和[java](https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java)
 书写的 SocketWindowWordCount 示例的完整源码。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309564411
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
+
+
+
+你也可以检查 log 文件来确认程序是否正在运行:
 
 Review comment:
   ```suggestion
   还可以通过检查 `logs` 目录中的日志文件来验证系统是否正在运行:
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309562144
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
+
+{% highlight bash %}
+$ git clone https://github.com/apache/flink.git
+$ cd flink
+$ mvn clean package -DskipTests # this will take up to 10 minutes
+$ cd build-target   # this is where Flink is installed to
+{% endhighlight %}
+{% endif %}
+
+### 启动 Flink 本地集群
+
+{% highlight bash %}
+$ ./bin/start-cluster.sh  # Start Flink
+{% endhighlight %}
+
+通过  [http://localhost:8081](http://localhost:8081) 检查 __Dispatcher's web 
frontend__ 以确保所有的程序已经启动并正在运行。Web 界面上会显示一个可用的 TaskManager 实例。
 
 Review comment:
   ```suggestion
   检查  [http://localhost:8081](http://localhost:8081) 的 __web 调度界面__ 
以确保一切正常运行。Web 界面上会仅显示一个可用的 TaskManager 实例。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309559579
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
+
+{% highlight bash %}
+$ brew install apache-flink
+...
+​$ flink --version
+Version: 1.2.0, Commit ID: 1c659cf
+{% endhighlight %}
+
+
+
+
+{% else %}
+### 下载和编译
+从我们的 [repositories](http://flink.apache.org/community.html#source-code) 
中下载源码,比如:
 
 Review comment:
   ```suggestion
   从我们的某个 [代码仓库](http://flink.apache.org/community.html#source-code) 中克隆源码,例如:
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309559058
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
+3. 解压下载的文件。
+
+
+{% highlight bash %}
+$ cd ~/Downloads# Go to download directory
+​$ tar xzf flink-*.tgz   # Unpack the downloaded archive
+$ cd flink-{{site.version}}
+{% endhighlight %}
+
+
+
+对于 MacOS X 用户, Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
 
 Review comment:
   ```suggestion
   对于 MacOS X 用户,Flink 可以通过 [Homebrew](https://brew.sh/)进行安装。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309558637
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
 
 Review comment:
   ```suggestion
   1. 从 [下载页](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何喜欢的 Scala 
版本。针对某些特性,你可能还需要下载预捆绑的 Hadoop jar 包并将它们放入 `/lib`  目录。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309558772
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
+
+{% highlight bash %}
+java version "1.8.0_111"
+Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
+Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
+{% endhighlight %}
+
+{% if site.is_stable %}
+
+
+1. 从 [downloads 
page](http://flink.apache.org/downloads.html)下载二进制文件。你可以选择任何你喜欢的 Hadoop/Scala 
组合。如果你仅仅想在本地使用,那么任何的 Hadoop 版本都可以。
+2. 去下载后的目录。
 
 Review comment:
   ```suggestion
   2. 进入下载的目录。
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309553198
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
+
+你可以用下面的命令来检查一下是否正确的安装了 Java 程序:
+
+{% highlight bash %}
+java -version
+{% endhighlight %}
+
+如果你已经安装了 Java 8,它的输出应该是这个样子的:
 
 Review comment:
   ```suggestion
   如果你已经安装了 Java 8,应该输出如下内容:
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309552519
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 Flink 程序。
+
+## 安装:下载并启动 Flink 
+
+Flink 可以在 __Linux, Mac OS X, and Windows__ 环境中运行。要想运行 Flink 仅仅需要安装 __Java 
8.x__ 。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html)  上面描述了如何在 windows 上以本地模式运行 Flink。
 
 Review comment:
   ```suggestion
   Flink 可以在 __Linux、Mac OS X,,和 Windows__ 环境中运行。为了能够运行 Flink,唯一的要求是安装 __Java 
8.x__。 Windows 用户, 请查看 [Flink on Windows]({{ site.baseurl 
}}/tutorials/flink_on_windows.html) 指南,该指南介绍了如何在 windows 上以本地设置运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] YngwieWang commented on a change in pull request #7751: [FLINK-11608] [docs] Translate the "Local Setup Tutorial" page into Chinese

2019-08-01 Thread GitBox
YngwieWang commented on a change in pull request #7751:  [FLINK-11608] [docs] 
Translate the "Local Setup Tutorial" page into Chinese
URL: https://github.com/apache/flink/pull/7751#discussion_r309550809
 
 

 ##
 File path: docs/tutorials/local_setup.zh.md
 ##
 @@ -0,0 +1,288 @@
+---
+title: "本地安装教程"
+nav-title: 'Local Setup'
+nav-parent_id: setuptutorials
+nav-pos: 10
+---
+
+
+* This will be replaced by the TOC
+{:toc}
+
+通过几个简单的步骤来启动并运行 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services