HeartSaVioR commented on a change in pull request #23260: [SPARK-26311][YARN] New feature: custom log URL for stdout/stderr URL: https://github.com/apache/spark/pull/23260#discussion_r248856862
########## File path: core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala ########## @@ -1046,6 +1201,29 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc conf } + private def createTestExecutorInfo( + appId: String, + user: String, + executorSeqNum: Int, + includingLogFiles: Boolean = true): ExecutorInfo = { + val host = s"host$executorSeqNum" + val container = s"container$executorSeqNum" + val cluster = s"cluster$executorSeqNum" + val logUrlPrefix = s"http://$host:8888/$appId/$container/origin" + + val executorLogUrlMap = Map("stdout" -> s"$logUrlPrefix/stdout", + "stderr" -> s"$logUrlPrefix/stderr") + + val executorAttributes = if (includingLogFiles) { + Map("LOG_FILES" -> "stdout,stderr", "CONTAINER_ID" -> container, + "CLUSTER_ID" -> cluster, "USER" -> user) + } else { + Map("CONTAINER_ID" -> container, "CLUSTER_ID" -> cluster, "USER" -> user) + } Review comment: Looks cleaner! Will address. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org