Java
Maven
更改conf目录下的setting.xml文件中的依赖存储位置
IDEA
前置条件: Maven 3.0.4(or higher) and Java 8.x
最新的文档是v.11版本,页面布局已经发生很大变化了。视频中是v1.7,链接为https://ci.apache.org/projects/flink/flink-docs-release-1.7/
创建项目的方式:
Use Maven archetypes: # 最后这个参数可以是官方文档中没有的,可以加快命令运行速度 $ mvn archetype:generate \ -DarchetypeGroupId=org.apache.flink \ -DarchetypeArtifactId=flink-quickstart-java \ -DarchetypeVersion=1.7.2 \ -DarchetypeCatalog=local Run the quickstart scipt $ curl https://flink.apache.org/q/quickstart.sh | bash -s 1.7.2我的宿主机是Win10,mvn命令不是很方便(Powershell和cmd命令不完全兼容);所以使用第二个方式比较多
out of the box: OOTB 开箱即用
开发流程
set up the batch execution environment
read
transform operations 开发的核心所在:开发业务逻辑
execute programs
功能拆解
读取数据 hello welcome
每一行的数据按照指定的分隔符拆分 hello
welcome
为每一个单词附上次数为1 (hello, 1)
(welcome, 1)
welcome
为每一个单词附上次数为1 (hello, 1)
(welcome, 1)
合并操作