溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

spark如何合并github

發(fā)布時間:2021-12-16 16:12:02 來源:億速云 閱讀:135 作者:小新 欄目:大數(shù)據(jù)

小編給大家分享一下spark如何合并github,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

最近在做內(nèi)部spark版本升級的工作,涉及到github 上合并pr的工作,具體的是spark 2.x升級到spark 3.0.1時兼容hdfs cdh-2.6.0-5.13.1,報編譯錯誤

[INFO] Compiling 25 Scala sources to /Users/libinsong/Documents/codes/tongdun/spark-3.0/resource-managers/yarn/target/scala-2.12/classes ...
[ERROR] [Error] resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:298: value setRolledLogsIncludePattern is not a member of org.apache.hadoop.yarn.api.records.LogAggregationContext
[ERROR] [Error] resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:300: value setRolledLogsExcludePattern is not a member of org.apache.hadoop.yarn.api.records.LogAggregationContext
[ERROR] [Error] resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:551: not found: value isLocalUri
[ERROR] [Error] resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:1367: not found: value isLocalUri
[ERROR] four errors found

具體的解決方法github spark pr 已經(jīng)給出了解決方法,修改相應的代碼就行,但是僅僅是修改的話,我們可以選擇一種更加優(yōu)雅的方式(以git cherry-pick方式),
現(xiàn)在簡單的分享一下:

直接找到setRolledLogsIncludePattern一行,

 sparkConf.get(ROLLED_LOG_INCLUDE_PATTERN).foreach { includePattern =>
      try {
        val logAggregationContext = Records.newRecord(classOf[LogAggregationContext])
        logAggregationContext.setRolledLogsIncludePattern(includePattern)
        sparkConf.get(ROLLED_LOG_EXCLUDE_PATTERN).foreach { excludePattern =>
          logAggregationContext.setRolledLogsExcludePattern(excludePattern)
        }
        appContext.setLogAggregationContext(logAggregationContext)
      } catch {
        case NonFatal(e) =>
          logWarning(s"Ignoring ${ROLLED_LOG_INCLUDE_PATTERN.key} because the version of YARN " +
            "does not support it", e)
      }
    }
    appContext.setUnmanagedAM(isClientUnmanagedAMEnabled)

    sparkConf.get(APPLICATION_PRIORITY).foreach { appPriority =>
      appContext.setPriority(Priority.newInstance(appPriority))
    }
    appContext
  }

發(fā)現(xiàn)master上的代碼并不是我們想要的,這個時候我們就可以使用git blame,在github上為
spark如何合并github

這樣我們就能發(fā)現(xiàn)該代碼有多次修改,找到對應[SPARK-19545][YARN] Fix compile issue for Spark on Yarn when building… 點擊進去
spark如何合并github
找到對應的commitId
spark如何合并github

執(zhí)行命令 git cherry-pick 8e8afb3a3468aa743d13e23e10e77e94b772b2ed 就能把該commit 追加到自己的工作目錄下
這樣既能不需要手動修改代碼,也能很好的保存了原始的commit的信息,以便追蹤

看完了這篇文章,相信你對“spark如何合并github”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI