当前位置: 首页 > 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.hotlads.com/news/1967.html

相关文章:

  • 汽车类网站百度查重免费
  • 南宁网站建设 超薄网络网络竞价托管公司
  • 动态网站开发技术包括企业管理培训班
  • 青岛建设厅官方网站上海专业做网站
  • 宝塔做网站可以用什么端口优秀网站网页设计
  • 涞源县住房和城乡建设局网站上海网站seo公司
  • 做网站用什么字体字号什么是seo推广
  • 广州网站建设推荐乐云seo关键词排名推广软件
  • 北京手机专业网站建设公司aso推广优化
  • 描写做网站专业的句子指数型基金是什么意思
  • 商城网站开发报价方案抚顺seo
  • 英文网站建设 招标办理培训机构需要具备的条件
  • 苹果cms网站广告怎么做2021拉新推广佣金排行榜
  • 写作的网站有哪些网络营销案例成功案例
  • 室内设计师联盟网系统优化的意义
  • 定制网站前准备网络广告的概念
  • 宁波建设网站公司推荐产品推广方式都有哪些
  • 邯郸网站建设哪家专业seo的优化技巧有哪些
  • app制作网站制作完快手秒赞秒评网站推广
  • 龙岗区网站建设建设网站公司
  • 网站防止被采集广州营销课程培训班
  • 芜湖网站建设公司江苏网站推广
  • 国内最有趣的25个网站万能bt搜索引擎
  • 淄博论坛网站建设小程序推广平台
  • 国外中文网站域名注册商免费发帖推广网站
  • 校园网站建设计划书关键词林俊杰mp3免费下载
  • 搭建网站需要什么软件网络销售每天做什么
  • 做网站挣钱么seo网站推广技术
  • 404源码网htmlseo sem
  • 网站建设公司 跨界鱼科技专业方象科技专注于什么领域