2.flink的Word Count小程序

创建项目

打开IDEA,新建一个新的项目,如图所示

填写项目GAV(groupId artifactId Version)

配置你maven设置

设置你的项目地址

创建一个Object

开始编写我们的WordCount

1.在pom文件,添加Flink依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!-- flink -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-java</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.11</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-clients_2.11</artifactId>
<version>${flink.version}</version>
</dependency>

2.在刚刚新建的object上面编写,我的object是WordCountApp