Skip to content

Commit

Permalink
Use address with scheme, but Allpha version removes the scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoy Antony committed Sep 9, 2014
1 parent 92127c9 commit e82f94e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.deploy.yarn

import scala.collection.{Map, Set}
import java.net.URI;

import org.apache.hadoop.net.NetUtils
import org.apache.hadoop.yarn.api._
Expand Down Expand Up @@ -98,7 +99,7 @@ private class YarnRMClientImpl(args: ApplicationMasterArguments) extends YarnRMC
appMasterRequest.setHost(Utils.localHostName())
appMasterRequest.setRpcPort(0)
//remove the scheme from the url if it exists since Hadoop does not expect scheme
appMasterRequest.setTrackingUrl(uiAddress.replaceAll("^http(\\w)*://", ""))
appMasterRequest.setTrackingUrl(new URI(uiAddress).getAuthority())
resourceManager.registerApplicationMaster(appMasterRequest)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,7 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
if (sc == null) {
finish(FinalApplicationStatus.FAILED, "Timed out waiting for SparkContext.")
} else {
var uiAddress = sc.ui.appUIHostPort
if (yarnConf.get("yarn.http.policy").equals("HTTPS_ONLY")) {
uiAddress = sc.ui.appUIAddress
}
registerAM(uiAddress, securityMgr)
registerAM(sc.ui.appUIAddress, securityMgr)
try {
userThread.join()
} finally {
Expand Down

0 comments on commit e82f94e

Please sign in to comment.