开发流程

1、获取execution environment

StreamExecutionEnvironment是所有流式flink程序的基础
Flink基础学习(二)

  • getExecutionEnvironment() 推荐
  • createLocalEnvironment()
  • createRemoteEnvironment(host:string, port: int, jarFiles: string)

2、加载/创建初始化数据

  • 基于文件
    readTextFile(path)
    readFile(fileInputFormat, path)
    readFile(fileInputFormat, path, watchType, interval, pathFilter)
  • 基于套接字
    socketTextStream
  • 基于集合
    fromCollection(Seq)
    fromCollection(Iterator)
    fromElements(elements:_*)
    fromParallelCollection(SplittableIterator)
    generateSequence(from, to)
  • 自定义数据源
    实现SourceFunction
    实现ParallelSourceFunction
    继承RichParallelSourceFunction

3、数据转换(各类算子)
Flink基础学习(二)
4、指定放置计算结果的位置
Flink基础学习(二)
5、触发程序执行
excute()

6、运行

相关文章:

  • 2022-12-23
  • 2021-08-15
  • 2021-12-21
  • 2021-04-08
  • 2021-08-18
  • 2022-01-14
  • 2021-10-04
  • 2019-01-23
猜你喜欢
  • 2021-12-27
  • 2022-01-17
  • 2021-07-04
  • 2021-09-19
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
相关资源
相似解决方案