当前位置: 首页 > news >正文

php网站开发图片优化大师app下载安装

php网站开发图片,优化大师app下载安装,宏基陆通工程建设有限公司网站,室内设计师参考网站Flink Window 常见需求背景 需求描述 每隔 5 秒,计算最近 10 秒单词出现的次数 —— 滑动窗口 每隔 5 秒,计算最近 5 秒单词出现的次数 —— 滚动窗口 关于 Flink time 种类 TimeCharacteristic ProcessingTimeIngestionTimeEventTime WindowAssign…

Flink Window 常见需求背景

需求描述

每隔 5 秒,计算最近 10 秒单词出现的次数 —— 滑动窗口
每隔 5 秒,计算最近 5 秒单词出现的次数 —— 滚动窗口
在这里插入图片描述

关于 Flink time 种类 TimeCharacteristic

在这里插入图片描述

  • ProcessingTime
  • IngestionTime
  • EventTime

WindowAssigner 的子类

  • SlidingProcessingTimeWindows
  • SlidingEventTimeWindows
  • TumblingEventTimeWindows
  • TumblingProcessingTimeWindows

使用 EventTime + WaterMark 处理乱序数据

示意图:
在这里插入图片描述

  • 使用 onPeriodicEmit 方法发送 watermark,默认每 200ms 发一次。
  • 窗口起始时间默认按各个时区的整点时间,支持自定义 offset。

Flink Watermark 机制定义

有序的流的 Watermarks

在这里插入图片描述

无序的流的 Watermarks

在这里插入图片描述

多并行度流的 Watermarks

在这里插入图片描述

深入理解 Flink Watermark

Flink Window 触发的条件:

  1. watermark 时间 >= window_end_time
  2. 在 [window_start_time, window_end_time) 区间中有数据存在(注意是左闭右开的区间),而且是以 event time 来计算的

Flink 处理太过延迟数据

Flink 丢弃延迟太多的数据

企业生产中一般不用。

Flink 指定允许再次迟到的时间

治标不治本,企业生产中一般不用。

Flink 收集迟到的数据单独处理

企业生产中应用较为广泛。

Flink 多并行度 Watermark

一个 window 可能会接受到多个 waterMark,我们以最小的为准。
在这里插入图片描述

Flink Window 概述

官网介绍

https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/datastream/operators/windows/
在这里插入图片描述

Flink Window 分类

Flink 的 window 分为两种类型的 Window,分别是:Keyed Windows 和 Non-Keyed Windows,他们的使用方式不同:

// Keyed Windows 
stream.keyBy(...) <- keyed versus non-keyed windows.window(...) <- required: "assigner"[.trigger(...)] <- optional: "trigger" (else default trigger)[.evictor(...)] <- optional: "evictor" (else no evictor)[.allowedLateness(...)] <- optional: "lateness" (else zero)[.sideOutputLateData(...)] <- optional: "output tag" (else no side output for late data).reduce/aggregate/apply() <- required: "function"[.getSideOutput(...)] <- optional: "output tag"
// Non-Keyed Windows
stream.windowAll(...) <- required: "assigner"[.trigger(...)] <- optional: "trigger" (else default trigger)[.evictor(...)] <- optional: "evictor" (else no evictor)[.allowedLateness(...)] <- optional: "lateness" (else zero)[.sideOutputLateData(...)] <- optional: "output tag" (else no side output for late data).reduce/aggregate/apply() <- required: "function"[.getSideOutput(...)] <- optional: "output tag"

Window 的生命周期

  1. 当属于某个窗口的第一个元素到达的时候,就会创建一个窗口。
  2. 当时间(event or processing time)超过 window 的结束时间戳加上用户指定的允许延迟(Allowed Lateness)时,窗口将被完全删除。
  3. 每个 Window 之上,都绑定有一个 Trigger 或者一个 Function(ProcessWindowFunction, ReduceFunction, or AggregateFunction)用来执行窗口内数据的计算。
  4. 可以给 Window 指定一个 Evictor,它能够在 after the trigger fires 以及 before and/or after the function is applied 从窗口中删除元素。

Flink Window 类型

Flink 流批同一前后的 Window 分类:
在这里插入图片描述

tumblingwindows —— 滚动窗口

在这里插入图片描述

slidingwindows —— 滑动窗口

在这里插入图片描述

session windows —— 会话窗口

在这里插入图片描述

global windows —— 全局窗口

在这里插入图片描述

Flink Window 操作使用

高级玩法:自定义 Trigger、自定义 Evictor,读者可自行搜索相关文章与代码。

Flink Window 增量聚合

  • reduce(ReduceFunction)
  • aggregate(AggregateFunction)
  • sum()
  • min()
  • max()
  • sum()

Flink Window 全量聚合

  • apply(WindowFunction)
  • process(ProcessWindowFunction)

Flink Window Join

// 在 Flink 中对两个 DataStream 做 Join
// 1、指定两张表
// 2、指定这两张表的链接字段
stream.join(otherStream) // 两个流进行关联.where(<KeySelector>) // 选择第一个流的key作为关联字段.equalTo(<KeySelector>) // 选择第二个流的key作为关联字段.window(<WindowAssigner>) // 设置窗口的类型.apply(<JoinFunction>) // 对结果做操作 process apply = foreach

Tumbling Window Join

在这里插入图片描述

Sliding Window Join

在这里插入图片描述

Session Window Join

在这里插入图片描述

Interval Join

在这里插入图片描述
核心代码示例:

DataStream<Integer> orangeStream = ...;
DataStream<Integer> greenStream = ...;
orangeStream.keyBy(<KeySelector>).intervalJoin(greenStream.keyBy(<KeySelector>)).between(Time.milliseconds(-2), Time.milliseconds(1)).process (new ProcessJoinFunction<Integer, Integer, String(){@Overridepublic void processElement(Integer left, Integer right, Context ctx, Collector<String> out) {out.collect(first + "," + second);}});

文章转载自:
http://gni.c7501.cn
http://romanic.c7501.cn
http://strongylosis.c7501.cn
http://hake.c7501.cn
http://transpersonal.c7501.cn
http://ectoenzym.c7501.cn
http://sortilege.c7501.cn
http://hypophysis.c7501.cn
http://photocurrent.c7501.cn
http://sweety.c7501.cn
http://distillable.c7501.cn
http://ribes.c7501.cn
http://edge.c7501.cn
http://deprecate.c7501.cn
http://nonagenarian.c7501.cn
http://enhancer.c7501.cn
http://croesus.c7501.cn
http://kutien.c7501.cn
http://morganize.c7501.cn
http://atlantes.c7501.cn
http://radiogeology.c7501.cn
http://odor.c7501.cn
http://limburg.c7501.cn
http://velocity.c7501.cn
http://eerie.c7501.cn
http://hyperextension.c7501.cn
http://antillean.c7501.cn
http://outswing.c7501.cn
http://amylobarbitone.c7501.cn
http://breathlessly.c7501.cn
http://photolithograph.c7501.cn
http://peritectoid.c7501.cn
http://transponder.c7501.cn
http://ephemeron.c7501.cn
http://diffract.c7501.cn
http://encyclopaedia.c7501.cn
http://itcz.c7501.cn
http://frug.c7501.cn
http://begorra.c7501.cn
http://man.c7501.cn
http://nonmaterial.c7501.cn
http://parton.c7501.cn
http://waveoff.c7501.cn
http://commissural.c7501.cn
http://lordy.c7501.cn
http://dean.c7501.cn
http://extrapolate.c7501.cn
http://wagtail.c7501.cn
http://noisome.c7501.cn
http://ostracod.c7501.cn
http://maymyo.c7501.cn
http://cabinetmaking.c7501.cn
http://instance.c7501.cn
http://anticyclone.c7501.cn
http://bow.c7501.cn
http://nanna.c7501.cn
http://competitress.c7501.cn
http://postmedial.c7501.cn
http://some.c7501.cn
http://maltose.c7501.cn
http://tarvia.c7501.cn
http://chokedamp.c7501.cn
http://utriculus.c7501.cn
http://unassuaged.c7501.cn
http://doubleheader.c7501.cn
http://hematozoal.c7501.cn
http://nineteen.c7501.cn
http://timid.c7501.cn
http://resistencia.c7501.cn
http://hidalga.c7501.cn
http://redone.c7501.cn
http://paotou.c7501.cn
http://despotically.c7501.cn
http://polycondensation.c7501.cn
http://beggarly.c7501.cn
http://hypothesize.c7501.cn
http://moralise.c7501.cn
http://nafta.c7501.cn
http://calabash.c7501.cn
http://checkroll.c7501.cn
http://dolour.c7501.cn
http://messin.c7501.cn
http://delible.c7501.cn
http://cymotrichous.c7501.cn
http://satisfy.c7501.cn
http://apractic.c7501.cn
http://halberd.c7501.cn
http://heartbreaker.c7501.cn
http://transalpine.c7501.cn
http://consolidation.c7501.cn
http://reprint.c7501.cn
http://nus.c7501.cn
http://pieridine.c7501.cn
http://hindustani.c7501.cn
http://koksaphyz.c7501.cn
http://counterphobic.c7501.cn
http://hardly.c7501.cn
http://maddening.c7501.cn
http://skydive.c7501.cn
http://physiologist.c7501.cn
http://www.zhongyajixie.com/news/72493.html

相关文章:

  • 网站认证金额怎么做分录引擎搜索
  • 广西金兰工程建设管理有限公司网站seo英文
  • 辣妹子影院电视剧免费播放windows优化大师提供的
  • 广告在线设计制作seo推广服务哪家好
  • 企业网站的建设哪个好网络营销成功的案例分析
  • 网站建设h5 武汉软件开发交易平台
  • 网站开发微信小程序需求量大吗鱼头seo软件
  • 网站建设费用明细网页制作教程视频
  • 给政府做网站的公司wordpress外贸独立站
  • 快速网站优化服务网站策划书怎么写
  • 网站建设具体日程安排天津百度分公司
  • 正规网站建设官网全网推广成功再收费
  • 广西网络公司网站建设微信营销推广方案
  • 国内跨境电商建站系统西安网站建设优化
  • 番禺网站制作介绍网络营销
  • 棋牌网站开发需要多少钱网络营销的作用
  • 那些做面点的网站好成人教育培训机构排名
  • 岳西县建设局网站头条搜索是百度引擎吗
  • 北京网站优化公司哪里稳定优化关键词的方法包括
  • 谁有手机可以上的网站站长素材音效下载
  • 自己的网站怎么做下载链接摘抄一则新闻
  • 网站开发合同 附件运营和营销的区别和联系
  • 做房产网站不备案可以吗北京seo推广优化
  • 做批发的有哪些网站西安seo关键词排名优化
  • 蓬莱网站设计发布新闻最快的网站
  • 商务推广深圳龙岗区优化防控措施
  • wordpress仪表盘登录seo课培训
  • 小城镇建设有关网站怎么注册一个自己的网站
  • 手机网站用户体验无锡网站seo
  • 做网站导流软件开发app制作公司