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

网站建设三原则网页设计与制作教程

网站建设三原则,网页设计与制作教程,wordpress音乐外链,合肥高端网站建设公司哪家好背景 TwoPhaseCommitSinkFunction是flink中基于二阶段事务提交和检查点机制配合使用实现的精准一次的输出数据汇#xff0c;但是想要实现精准一次的输出#xff0c;实际使用中需要注意几个方面#xff0c;否则不仅仅达不到精准一次输出#xff0c;反而可能导致数据丢失但是想要实现精准一次的输出实际使用中需要注意几个方面否则不仅仅达不到精准一次输出反而可能导致数据丢失连至少一次的语义都不能达到 TwoPhaseCommitSinkFunction注意事项 TwoPhaseCommitSinkFunction是通过在两阶段提交协议实现的事务大概简化为一下步骤 1 在收到检查点分隔符的时候开启事务并把记录都写到开启的事务中 2. 开始进行状态的保存时把检查点id对应的事务结束掉做好准备提交的准备并开启下一个事务 public void snapshotState(FunctionSnapshotContext context) throws Exception {// this is like the pre-commit of a 2-phase-commit transaction// we are ready to commit and remember the transactioncheckState(currentTransactionHolder ! null,bug: no transaction object when performing state snapshot);long checkpointId context.getCheckpointId();LOG.debug({} - checkpoint {} triggered, flushing transaction {},name(),context.getCheckpointId(),currentTransactionHolder);//当前检查点对应的事务做好准备比如进行stream.flush等准备好提交事务preCommit(currentTransactionHolder.handle);// 把当前检查点id对应的事务添加到状态中pendingCommitTransactions.put(checkpointId, currentTransactionHolder);LOG.debug({} - stored pending transactions {}, name(), pendingCommitTransactions);currentTransactionHolder beginTransactionInternal();LOG.debug({} - started new transaction {}, name(), currentTransactionHolder);// 把当前检查点id对应的事务添加到状态中state.clear();state.add(new State(this.currentTransactionHolder,new ArrayList(pendingCommitTransactions.values()),userContext));} 收到检查点完成的通知notify方法提交第二步中检查点id对应的事务注意这一步不是每次flink在进行检查点的时候都会通知这种情况下某一次的notify方法就需要把前几次的事务一起进行提交了另外如果提交某个检查点的事务失败那么应用会重启并且在重启后的initSnapshot方法中再次进行事务提交如果还是失败这个过程一直持续 public final void notifyCheckpointComplete(long checkpointId) throws Exception {IteratorMap.EntryLong, TransactionHolderTXN pendingTransactionIterator pendingCommitTransactions.entrySet().iterator();Throwable firstError null;while (pendingTransactionIterator.hasNext()) {Map.EntryLong, TransactionHolderTXN entry pendingTransactionIterator.next();Long pendingTransactionCheckpointId entry.getKey();TransactionHolderTXN pendingTransaction entry.getValue();if (pendingTransactionCheckpointId checkpointId) {continue;}LOG.info({} - checkpoint {} complete, committing transaction {} from checkpoint {},name(),checkpointId,pendingTransaction,pendingTransactionCheckpointId);logWarningIfTimeoutAlmostReached(pendingTransaction);try {// 提交事务commit(pendingTransaction.handle);} catch (Throwable t) {//事务失败时记录异常后面会把异常抛出导致应用重启if (firstError null) {firstError t;}}LOG.debug({} - committed checkpoint transaction {}, name(), pendingTransaction);// 事务成功后移除当前的事务pendingTransactionIterator.remove();}if (firstError ! null) {// 事务提交失败会抛出异常导致job异常中止throw new FlinkRuntimeException(Committing one of transactions failed, logging first encountered failure,firstError);}}总结 1。事务不能提交失败如果失败会导致作业失败然后重新提交如果最终没有成功提交那么数据会丢失 2。数据库服务端的事务超时时间不能设置太短不能仅仅大于检查点的间隔大小原因是上面说的flink有可能丢失检查点完成后的通知消息所以服务端的事务超时时间要设置的足够大.
http://www.dnsts.com.cn/news/248625.html

相关文章:

  • 南宁网站外包无极电影网
  • 深圳中小企业网站建设上海羽贝网站建设
  • 网站建设 江苏南村网站建设
  • 下载做ppt的动画片的好网站广告做网站
  • 建设网站的平台企业网站做优化排名象客
  • 房产网签怎么查询seo搜索引擎优化工资
  • 做网站二级域名随便用吗游标卡尺 东莞网站建设
  • 网站推广哪个好在线制图免费
  • 网站建设问题及解决办法网站手机站怎么做
  • 怎么去管理好一个团队百度seo工作室
  • 站长工具seo排名查询开发一个app软件能赚钱吗
  • 河南省建设集团有限公司网站太原市建设局网站
  • 网站建设的流程推广方案网站建设合作协议书
  • 南昌建设厅网站网络推广简历
  • 电话做网站的推广买公司的网站建设
  • 广州手机网站定制咨询一般做网站用什么语言
  • 学wordpress不需要学DWseo排名如何优化
  • 人寿保险网站扎区门户网站建设
  • 电子商务网站建设基础考试做视频点播网站要多少带宽
  • 自己做电视视频网站吗互动网站建设的主页
  • 做视频网站需要哪些证网页设计与制作实训步骤
  • 网站建设费要交印花税吗怎么给网站wordpress
  • 网站建设规划书有哪些内容网站开发人员工作内容
  • 为什么网站打开是空白网站建设的实际价值
  • 网站建设公司挣钱吗中高风险地区最新名单
  • 河南中国建设银行官网站成都网站制作关键词推广排名
  • 网站转app工具高级版宝安网站公司
  • 网站建设公司资讯生态农庄网站建设
  • 免费建自己域名的网站app网站如何做推广方案
  • 公司做网站多网站开发具备的相关知识