You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/04 23:46:59 UTC

[GitHub] [spark] HeartSaVioR commented on a change in pull request #23720: [WIP]: create attributes from live log urls to form a permalink past YARN log aggregation

HeartSaVioR commented on a change in pull request #23720: [WIP]: create attributes from live log urls to form a permalink past YARN log aggregation
URL: https://github.com/apache/spark/pull/23720#discussion_r262293126
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/deploy/history/HistoryAppStatusStore.scala
 ##########
 @@ -63,8 +63,25 @@ private[spark] class HistoryAppStatusStore(
     }
   }
 
+  val STDOUT_URL_GROUPS = conf.get(LIVE_EXECUTOR_LOR_URL_CAPTURING_GROUPS)
+    .map(_.split(","))
+    .getOrElse(Array.empty[String])
+
+  val STDOUT_URL_REGEX = conf.get(LIVE_EXECUTOR_LOG_URL_REGEX)
+    .map(r => new Regex(r, STDOUT_URL_GROUPS: _*))
+
   private def replaceLogUrls(exec: v1.ExecutorSummary, urlPattern: String): v1.ExecutorSummary = {
-    val attributes = exec.attributes
+    val attributes = STDOUT_URL_REGEX.flatMap { regEx =>
+      exec.executorLogs
+        .get("stdout")
+        .flatMap(regEx.findFirstMatchIn)
+        .map { urlMatch =>
+          STDOUT_URL_GROUPS.foldLeft(exec.attributes) { (attribs, groupName) =>
 
 Review comment:
   +1 Let's just use `attributes` if it exists. I can see the case this helps even if attributes are presented: the number of `attributes` are updated which new attributes can be extracted from URL, but at least with current YARN URL we have extracted almost everything so it will unlikely happen.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org