Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/2432#discussion_r18313523
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala ---
@@ -43,24 +43,26 @@ import org.apache.spark.util.{FileLogger, JsonProtocol,
Utils}
* spark.eventLog.buffer.kb - Buffer size to use when writing to output
streams
*/
private[spark] class EventLoggingListener(
- appName: String,
+ appId: ApplicationId,
+ logBaseDir: String,
sparkConf: SparkConf,
hadoopConf: Configuration)
extends SparkListener with Logging {
import EventLoggingListener._
- def this(appName: String, sparkConf: SparkConf) =
- this(appName, sparkConf,
SparkHadoopUtil.get.newConfiguration(sparkConf))
+ def this(appId: ApplicationId, logBaseDir: String, sparkConf: SparkConf)
=
+ this(appId, logBaseDir, sparkConf,
SparkHadoopUtil.get.newConfiguration(sparkConf))
private val shouldCompress =
sparkConf.getBoolean("spark.eventLog.compress", false)
private val shouldOverwrite =
sparkConf.getBoolean("spark.eventLog.overwrite", false)
private val testing = sparkConf.getBoolean("spark.eventLog.testing",
false)
private val outputBufferSize =
sparkConf.getInt("spark.eventLog.buffer.kb", 100) * 1024
- private val logBaseDir = sparkConf.get("spark.eventLog.dir",
DEFAULT_LOG_DIR).stripSuffix("/")
- private val name = appName.replaceAll("[ :/]",
"-").replaceAll("[${}'\"]", "_")
- .toLowerCase + "-" + System.currentTimeMillis
- val logDir = Utils.resolveURI(logBaseDir) + "/" + name.stripSuffix("/")
+ val logDir = EventLoggingListener.getLogDirName(logBaseDir, appId)
+ private val name = {
--- End diff --
No need to put this in a variable. This is only used in
`getApplicationLogDir`. Also, you can just do `logDir.split("/").last`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]