赞
踩
简介: Flink之所以能这么流行,离不开它最重要的四个基石:Checkpoint、State、Time、Window。
Window和时间Time(事件时间)
State和检查点Checkpoint
组织形式
划分官网文档:https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/stream/state/state.html
基本类型
划分Flink中有两种基本的状态:Keyed State 和 Operator State。
1)、Keyed State
2)、Operator State
:
与Key无关的State
,每一个 operator state 都仅与一个 operator 的实例绑定。Operator State 可以用于所有算子,但一般常用于 Source
。KeyedState与OperatorState区别
简介: 有状态计算其实就是需要考虑历史数据
,而历史数据需要搞个地方存储起来。Flink为了方便不同分类的State的存储和管理,提供了如下API/数据结构来存储State。
1)、Keyed State,保存Keyed state的数据结构
2)、Operator State,需要自己实现 CheckpointedFunction
或 ListCheckpointed
接口,保存Operator state的数据结构:ListState<T>
和BroadcastState<K,V>
。
CheckpointedFunction和ListState
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。