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

北京微网站建设设计服务国外媒体报道

北京微网站建设设计服务,国外媒体报道,游戏网站设计,网站建设哪家公司好招聘背景 目前spark的repartition()方法是随机分配数据到下游,这会导致一个问题,有时候如果我们用repartition方法的时候,如果任务发生了重试,就有可能导致任务的数据不准确,那这个时候改怎么解决这个问题呢? …

背景

目前spark的repartition()方法是随机分配数据到下游,这会导致一个问题,有时候如果我们用repartition方法的时候,如果任务发生了重试,就有可能导致任务的数据不准确,那这个时候改怎么解决这个问题呢?

分析

在Spark RDD中存在着名为outputDeterministicLevel的变量,如下:

private[spark] final lazy val outputDeterministicLevel: DeterministicLevel.Value = {if (isReliablyCheckpointed) {DeterministicLevel.DETERMINATE} else {getOutputDeterministicLevel}}

那么该变量的作用是什么呢?让我们分析一下:
改变量最终会被StageisIndeterminate方法调用:

 def isIndeterminate: Boolean = {rdd.outputDeterministicLevel == DeterministicLevel.INDETERMINATE}

而该方法会被DAGScheduler调用,有两处地方会被调用:

  • submitMissingTasks中调用
   private def submitMissingTasks(stage: Stage, jobId: Int): Unit = {logDebug("submitMissingTasks(" + stage + ")")// Before find missing partition, do the intermediate state clean work first.// The operation here can make sure for the partially completed intermediate stage,// `findMissingPartitions()` returns all partitions every time.stage match {case sms: ShuffleMapStage if stage.isIndeterminate && !sms.isAvailable =>mapOutputTracker.unregisterAllMapOutput(sms.shuffleDep.shuffleId)case _ =>}

该方法主要用于在重新提交失败的stage时候,用来判断是否需要重新计算上游的所有任务。

  • handleTaskCompletion中调用
      case FetchFailed(bmAddress, shuffleId, _, mapIndex, _, failureMessage) =>。。。val noResubmitEnqueued = !failedStages.contains(failedStage)failedStages += failedStagefailedStages += mapStageif (noResubmitEnqueued) {// If the map stage is INDETERMINATE, which means the map tasks may return// different result when re-try, we need to re-try all the tasks of the failed// stage and its succeeding stages, because the input data will be changed after the// map tasks are re-tried.// Note that, if map stage is UNORDERED, we are fine. The shuffle partitioner is// guaranteed to be determinate, so the input data of the reducers will not change// even if the map tasks are re-tried.if (mapStage.isIndeterminate) {

这里如果任务Fetch失败了,根据该shuffle所对应的上游stage是不是isIndeterminate来向DAGScheduler提交ResubmitFailedStages事件,从而调用submitMissingTasks方法进行上游所有任务或者单个任务的重试。

再回到outputDeterministicLevel变量,该变量会调用getOutputDeterministicLevel方法进行循环调用上游的outputDeterministicLevel变量来确定outputDeterministicLevel的值。

结论

所以根据以上分析,我们可以改写对应的RDD的outputDeterministicLevel变量或者getOutputDeterministicLevel方法来进行stage任务的全部重试与否

http://www.qdjiajiao.com/news/2555.html

相关文章:

  • 河北省城乡住房建设厅网站seo公司排名
  • 台州网站推广排名外贸网站有哪些平台
  • 网店代运营网站中国十大门户网站排行
  • 做网站的高手seo服务顾问
  • 网上营销推广seo学院培训班
  • 深圳航空公司订票电话西昌seo快速排名
  • 南昌做微信网站百度电脑版下载安装
  • WordPress站群模版微营销系统
  • 息壤备案网站客服2345网址大全浏览器
  • 银川网站设计建设b站推广形式
  • 深圳住房和城乡建设局网站首页百度大数据官网
  • 网站维保方法合肥seo优化外包公司
  • 网上学习做网站seo关键词查询工具
  • 餐饮行业做微信网站有什么好处珠海优化seo
  • 购物商城网站建设流程百度seo优化培训
  • c 做网站百度搜索工具
  • 怎么验证网站备案密码是否正确广州营销课程培训班
  • 网站做关键词首页人民网疫情最新消息
  • 西安哪家做网站靠谱专业提升关键词排名工具
  • 深圳做装修网站费用多少钱杭州网站运营十年乐云seo
  • 网页设计公司金华seo在线排名优化
  • 怎么从阿里巴巴做网站上海今日头条新闻
  • 手机营销型网站制作加强服务保障 满足群众急需需求
  • 门户网站代做代运营套餐价格表
  • 开发一个完整的动态网站竞价网站推广
  • 网站怎么做推广企业网站模板下载
  • 网站建设与网页制作教程巨量算数数据分析入口
  • 网站推广优化教程seo指的是搜索引擎营销
  • 多用户商场源码下载最新seo自动优化软件
  • 网站是如何建立的百度关键词优化查询