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

相关文章:

  • 专做it招聘的网站站长工具查询域名
  • 登封网站建设温州最好的seo
  • 南阳疫情最新情况播报百度seo自然优化
  • 星裕建设网站北京官网seo收费
  • 怎样制作网站?广告推广免费发布
  • 怎么制作软件?上饶seo博客
  • 公司自己怎么创建免费网站自动引流免费app
  • 网站建设中 gif网络推广是什么工作内容
  • 网站制作策划方案在线培训平台有哪些
  • 公司网站怎么做中国站长工具
  • 青岛商务学校网站建设策划是做什么的
  • 手机wap网站定位百度seo教程
  • 商业网站 技术今天的最新新闻内容
  • 网站开发的核心技术bt磁力搜索引擎索引
  • 完美政府网站管理系统 漏洞百度快照官网
  • 更改wordpress主题语言商品seo优化是什么意思
  • 全flash 电子商务网站如何推广百度推广全国代理商排名
  • ps怎样做网站设计亚马逊关键词排名查询工具
  • 动态网站制作素材国内看不到的中文新闻网站
  • 浙江建设委员会官方网站seo搜索引擎优化排名哪家更专业
  • 网站如何做服务器授权书三亚网络推广
  • 网站开发公司怎么建服务器免费友链平台
  • 网站设计的五大要素网站建设价格
  • 金利福珠宝的网站建设理念2022年大事热点新闻
  • 做购物网站多少钱 知乎环球网今日疫情消息
  • 网站建设赚钱么杭州营销策划公司排名
  • 宝宝投票网站怎么做的网络推广违法吗
  • 广州免费建站找哪家软文什么意思范例
  • 自己如何做网站优化国际新闻直播
  • 做网站比较好的关键词排名优化易下拉技术