当前位置:网站首页>Flink Record has Long.MIN_VALUE timestamp (= no timestamp marker). Is the time characteristic
Flink Record has Long.MIN_VALUE timestamp (= no timestamp marker). Is the time characteristic
2022-08-08 08:13:00 【Allen-1】
1.flink流式处理
解决方案:修改滑动处理时间的时间间隔
.window(TumblingProcessingTimeWindows.of(Time.seconds(2)
2.修改后的代码
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.streaming.api.windowing.assigners.{
TumblingEventTimeWindows, TumblingProcessingTimeWindows}
import org.apache.flink.streaming.api.windowing.time.Time
//flink的watermark字段处理
object Streaming_job {
def main(args: Array[String]): Unit = {
// 创建环境
val env = StreamExecutionEnvironment.getExecutionEnvironment
// 获取本地数据
val text = env.socketTextStream("127.0.0.1", 7777)
// val text = "aaa"
import org.apache.flink.api.scala._
// 开发业务的逻辑
text.flatMap(_.split(" "))
.map((_,1))
.keyBy(0)
.window(TumblingProcessingTimeWindows.of(Time.seconds(2)))
.sum(1)
.print()
.setParallelism(1)
env.execute("Flink Streaming WordCount")
}
}
3.结果展示
参考博客:
https://blog.csdn.net/u010002184/article/details/115726664
http://t.zoukankan.com/-courage-p-14804510.html
边栏推荐
猜你喜欢
随机推荐
你真的了解IP地址吗?
SSRF漏洞
idea big data tools submit flink tasks
蓝牙Mesh的基本概念
阿里巴巴需求交付全流程职责划分
throw和throws区别
Offensive and defensive world - lottery
spark2 sql struct处理
The industry's first "Causal Inference Whole Process" Challenge!WAIC 2022 · Hackathon invites global developer elites to challenge
Django+MySQL+HarmonyOS------------笔记二
音视频入门知识-- --相关名词、术语、概念
ACWing 198. 反素数 题解
【枚举】连续因子
mockserver使用
lvm creates logical volumes
DBeaver 22.1.4 发布,可视化数据库管理平台
微软 .NET Core 3.1 年底将结束支持,请升级到.NET 6
anormly detection资料汇总
在 TensorFlow 中构建 3D-CNN
数据库_JDBC