Skip to content

Commit e82f94e

Browse files
author
Benoy Antony
committed
Use address with scheme, but Allpha version removes the scheme
1 parent 92127c9 commit e82f94e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/YarnRMClientImpl.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.spark.deploy.yarn
1919

2020
import scala.collection.{Map, Set}
21+
import java.net.URI;
2122

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

yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,7 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
189189
if (sc == null) {
190190
finish(FinalApplicationStatus.FAILED, "Timed out waiting for SparkContext.")
191191
} else {
192-
var uiAddress = sc.ui.appUIHostPort
193-
if (yarnConf.get("yarn.http.policy").equals("HTTPS_ONLY")) {
194-
uiAddress = sc.ui.appUIAddress
195-
}
196-
registerAM(uiAddress, securityMgr)
192+
registerAM(sc.ui.appUIAddress, securityMgr)
197193
try {
198194
userThread.join()
199195
} finally {

0 commit comments

Comments
 (0)