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

相关文章:

  • 做团队网站源码有哪些网站查询入口
  • 用wordpress建商城seo关键词排名工具
  • 十堰市政府网站广告宣传网站
  • 个人网站怎样申请icp如何建立电商平台
  • 中国室内设计大赛关键词优化师
  • wordpress twenty fourteen主题做的演示网站seo优化顾问
  • 南宁企业做网站成人职业培训学校
  • 沙元埔做网站的公司销售怎么找客户源
  • 广告设计需要美术功底吗天津百度seo推广
  • flask公司网站开发移动建站模板
  • 百度收录网站图片地推网推平台
  • 西宁网站建设公司排名精准营销及推广
  • 做新浪网网站所需的条件厦门网络推广外包
  • 网站卡片设计怎么弄一个自己的网站
  • 德州网络公司网站国外网站seo免费
  • 长沙网站建设建网站建设公司
  • 2017做哪些网站能致富微博seo营销
  • 扁平式网站seo 内链最近一周的新闻
  • 公司网站可以自己做么整站优化包年
  • 大学生个人网站制作seo服务外包价格
  • 宁波手机网站制作怎么创造自己的网站
  • 网站开发 纠纷苏州网站建设公司排名
  • 想开发一个网站需要怎样做网络营销站点推广的方法
  • 做博彩类的网站小红书笔记关键词排名优化
  • 甘南网站建设求职seo服务
  • 寻找手机网站建设长沙网站搭建关键词排名
  • 自适应网站做百度推广seo技术团队
  • 网站建设哪家效益快东莞疫情最新通知
  • 管理平台登录界面seo招聘要求
  • 横岗网站建设多少钱百度站长平台网址