Flink常用API之Collection的Source

网友投稿 274 2022-11-17

Flink常用API之Collection的Source

package sourceimport org.apache.flink.streaming.api.scala.StreamExecutionEnvironment/** * @Author yqq * @Date 2021/12/25 14:58 * @Version 1.0 */case class StationLog(sid:String,callOut:String,callInput:String,callType:String,callTime:Long,duration:Long)object CollectionSource { def main(args: Array[String]): Unit = { val ev: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment ev.setParallelism(1) import org.apache.flink.streaming.api.scala._ val list: DataStream[StationLog] = ev.fromCollection(Array( new StationLog("1001", "10086", "181", "busy", 15551, 0), new StationLog("1002", "10087", "182", "busy", 15552, 0), new StationLog("1003", "10088", "183", "success", 13555, 30), new StationLog("1004", "10089", "184", "success", 15545, 20), new StationLog("1005", "10080", "185", "busy", 15565, 0) )) list.print() ev.execute("array") }}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Flink常用API之转换算子的union算子
下一篇:硬件密码组件的硬件结构、作用及实现应用设计
相关文章

 发表评论

暂时没有评论,来抢沙发吧~