vanzin commented on a change in pull request #23260: [SPARK-26311][CORE] New 
feature: apply custom log URL pattern for executor log URLs in SHS
URL: https://github.com/apache/spark/pull/23260#discussion_r251159630
 
 

 ##########
 File path: 
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala
 ##########
 @@ -457,9 +463,39 @@ private object YarnClusterDriver extends Logging with 
Matchers {
             s"Driver logs contain sensitive info (${SECRET_PASSWORD}): 
\n${log} "
           )
         }
+
+        val yarnConf = new YarnConfiguration(sc.hadoopConfiguration)
+        val httpAddress = 
System.getenv(ApplicationConstants.Environment.NM_HOST.name()) +
+          ":" + 
System.getenv(ApplicationConstants.Environment.NM_HTTP_PORT.name())
+
+        // lookup appropriate http scheme for container log urls
+        val yarnHttpPolicy = yarnConf.get(
+          YarnConfiguration.YARN_HTTP_POLICY_KEY,
+          YarnConfiguration.YARN_HTTP_POLICY_DEFAULT
+        )
+        val httpScheme = if (yarnHttpPolicy == "HTTPS_ONLY") "https://"; else 
"http://";
+
         val containerId = YarnSparkHadoopUtil.getContainerId
         val user = Utils.getCurrentUserName()
         
assert(urlStr.endsWith(s"/node/containerlogs/$containerId/$user/stderr?start=-4096"))
+
+        assert(listener.driverAttributes.nonEmpty)
+        val driverAttributes = listener.driverAttributes.get
+        val clusterId: Option[String] = try {
 
 Review comment:
   `getClusterId`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to