```scala
package com.gosuncn
import org.apache.flink.streaming.api.scala._
object WordCountStreamingJob {
def main(args: Array[String]) {
val env = StreamExecutionEnvironment.getExecutionEnvironment
// lines.flatMap(_.split(" ")).map((_, 1)).keyBy(0).sum(1).print()
val lines: DataStream[String] = env.socketTextStream("47.52.74.183", 8888)
val words: DataStream[String] = lines.flatMap(_.split(" "))
val wordAndOne: DataStream[(String, Int)] = words.map((_, 1))
val summed: DataStream[(String, Int)] = wordAndOne.keyBy(0).sum(1)
summed.print()
env.execute("WordCountStreamingJob")
}
}
```
- Flink简介
- flink搭建standalone模式与测试
- flink提交任务(界面方式)
- Flink项目初始化
- Java版WordCount(匿名类)
- Java版WordCount(lambda)
- Scala版WordCount
- Java版WordCount[批处理]
- Scala版WordCount[批处理]
- 流处理非并行的Source
- 流处理可并行的Source
- kafka的Source
- Flink算子(Map,FlatMap,Filter)
- Flink算子KeyBy
- Flink算子Reduce和Max与Min
- addSink自定义Sink
- startNewChain和disableChaining
- 资源槽slotSharingGroup
- 计数窗口
- 滚动窗口
- 滑动窗口
- Session窗口
- 按照EventTime作为标准