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

怎样设计自己网站域名排名seo公司哪家好

怎样设计自己网站域名,排名seo公司哪家好,网站关键字排名怎么做,做微信营销网站建设背景 GenericWriteAheadSink原理是把接收记录按照检查点进行分段,每个到来的记录都放到对应的分段中,这些分段内的记录是作为算子状态的形式存储和故障恢复的,对于每个分段内的记录列表,flink会在收到检查点完成的通知时把他们都…

背景

GenericWriteAheadSink原理是把接收记录按照检查点进行分段,每个到来的记录都放到对应的分段中,这些分段内的记录是作为算子状态的形式存储和故障恢复的,对于每个分段内的记录列表,flink会在收到检查点完成的通知时把他们都写到外部存储中,本文对其中的检查点完成后是否对应的事务必须成功这个点进行讲解

源码解析GenericWriteAheadSink

首先开始进行checkpoint时代码如下

public void snapshotState(StateSnapshotContext context) throws Exception {super.snapshotState(context);// 把检查点id先放入本地变量中saveHandleInState(context.getCheckpointId(), context.getCheckpointTimestamp());this.checkpointedState.clear();for (PendingCheckpoint pendingCheckpoint : pendingCheckpoints) {// 把本地变量中的检查点存放到算子列表状态中this.checkpointedState.add(pendingCheckpoint);}}private void saveHandleInState(final long checkpointId, final long timestamp) throws Exception {PendingCheckpoint pendingCheckpoint =new PendingCheckpoint(checkpointId, subtaskIdx, timestamp, handle);// 把检查点id先放到   pendingCheckpoints本地变量中 pendingCheckpoints.add(pendingCheckpoint);}

其实接收检查点完成的通知:

public void notifyCheckpointComplete(long checkpointId) throws Exception {super.notifyCheckpointComplete(checkpointId);synchronized (pendingCheckpoints) {Iterator<PendingCheckpoint> pendingCheckpointIt = pendingCheckpoints.iterator();while (pendingCheckpointIt.hasNext()) {PendingCheckpoint pendingCheckpoint = pendingCheckpointIt.next();long pastCheckpointId = pendingCheckpoint.checkpointId;int subtaskId = pendingCheckpoint.subtaskId;long timestamp = pendingCheckpoint.timestamp;StreamStateHandle streamHandle = pendingCheckpoint.stateHandle;//把历史的+当前的还没有成功提交的检查点id对应的事务,重新调用sendValue方法并提交对应检查点的事务if (pastCheckpointId <= checkpointId) {try {// 历史的或者当前的事务未提交if (!committer.isCheckpointCommitted(subtaskId, pastCheckpointId)) {try (FSDataInputStream in = streamHandle.openInputStream()) {// 调用sendValue方法写数据boolean success =sendValues(new ReusingMutableToRegularIteratorWrapper<>(new InputViewIterator<>(new DataInputViewStreamWrapper(in),serializer),serializer),pastCheckpointId,timestamp);if (success) {//提交对应检查点对应的事务committer.commitCheckpoint(subtaskId, pastCheckpointId);streamHandle.discardState();pendingCheckpointIt.remove();}}} else {streamHandle.discardState();pendingCheckpointIt.remove();}} catch (Exception e) {// we have to break here to prevent a new (later) checkpoint// from being committed before this oneLOG.error("Could not commit checkpoint.", e);break;}}}}}

注意这里需要注意的是flink的检查点成功创建后才会使用notify方法进行通知,flink没有保证一定通知,此外通知之后不论这个notify方法中发生了什么异常都不影响flink已经创建了检查点的事实。
对应到我们这个例子,你就会发现在notify方法中有需要把历史检查点已经创建成功但是对应的事务没有提交的事务重新调用一次sendValue方法和提交对应检查点的事务,也就是说不是每一次检查点都能成功的提交事务,如果事务没有提交成功,等待下一次检查点的通知即可,下一个检查点的通知会把历史的检查点重新检测一次.

http://www.hrbkazy.com/news/24479.html

相关文章:

  • 欧美做的爱爱网站游戏优化大师手机版
  • 网站开发作品网络营销策划书800字
  • 做英文题的网站新媒体运营哪个培训机构好
  • 公司网站建设开源平台网站怎么推广出去
  • 广州荔湾网站制作十大经典事件营销案例
  • 中关村手机报价大全手机排行跟我学seo从入门到精通
  • 优化网站制作竞价培训课程
  • html5网站用什么软件成都百度推广代理公司
  • 两学一做网站专栏怎么设置郑州网站建设公司排名
  • 东莞市做网站厂房网络推广平台
  • wordpress image.php河南智能seo快速排名软件
  • 做报废厂房网站怎么做网站性能优化的方法有哪些
  • phpcms动态网站模板推广类软文
  • 金湖网站设计google 优化推广
  • 企业网站备案流程北京百度seo工作室
  • 网站建设官网免费模板怎么引流怎么推广自己的产品
  • 公司网站域名如何续费合肥网络关键词排名
  • 曲阳路街道网站建设怎么联系地推公司
  • wordpress导入tumblr网站如何做seo推广
  • 有没有免费的crm系统班级优化大师使用指南
  • 天动力网站开发企业网站推广方案策划
  • 自建商城网站有哪些平台seo关键词排名优化怎么样
  • 北京企业宣传片制作公司网页怎么优化
  • 户外运动网站模板企业域名查询
  • 做网站和做小程序有什么不同google手机官网
  • 网站建设是学哪个学科一站式网站设计
  • 西安做网站建设资源搜索引擎
  • 网站更新1688网站
  • 婚恋网站开发背景免费浏览网站推广
  • 适合小型工作室做的项目深圳网站设计十年乐云seo