Skip to content
Snippets Groups Projects
Commit 0e8203f4 authored by Prashant Sharma's avatar Prashant Sharma Committed by Patrick Wendell
Browse files

[SPARK-2924] Required by scala 2.11, only one fun/ctor amongst overriden...

[SPARK-2924] Required by scala 2.11, only one fun/ctor amongst overriden alternatives, can have default argument(s).

...riden alternatives, can have default argument.

Author: Prashant Sharma <prashant.s@imaginea.com>

Closes #2750 from ScrapCodes/SPARK-2924/default-args-removed and squashes the following commits:

d9785c3 [Prashant Sharma] [SPARK-2924] Required by scala 2.11, only one function/ctor amongst overriden alternatives, can have default argument.
parent 1d72a308
No related branches found
No related tags found
No related merge requests found
......@@ -51,12 +51,27 @@ private[spark] class FileLogger(
def this(
logDir: String,
sparkConf: SparkConf,
compress: Boolean = false,
overwrite: Boolean = true) = {
compress: Boolean,
overwrite: Boolean) = {
this(logDir, sparkConf, SparkHadoopUtil.get.newConfiguration(sparkConf), compress = compress,
overwrite = overwrite)
}
def this(
logDir: String,
sparkConf: SparkConf,
compress: Boolean) = {
this(logDir, sparkConf, SparkHadoopUtil.get.newConfiguration(sparkConf), compress = compress,
overwrite = true)
}
def this(
logDir: String,
sparkConf: SparkConf) = {
this(logDir, sparkConf, SparkHadoopUtil.get.newConfiguration(sparkConf), compress = false,
overwrite = true)
}
private val dateFormat = new ThreadLocal[SimpleDateFormat]() {
override def initialValue(): SimpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss")
}
......
......@@ -74,13 +74,13 @@ class FileLoggerSuite extends FunSuite with BeforeAndAfter {
test("Logging when directory already exists") {
// Create the logging directory multiple times
new FileLogger(logDirPathString, new SparkConf, overwrite = true).start()
new FileLogger(logDirPathString, new SparkConf, overwrite = true).start()
new FileLogger(logDirPathString, new SparkConf, overwrite = true).start()
new FileLogger(logDirPathString, new SparkConf, compress = false, overwrite = true).start()
new FileLogger(logDirPathString, new SparkConf, compress = false, overwrite = true).start()
new FileLogger(logDirPathString, new SparkConf, compress = false, overwrite = true).start()
// If overwrite is not enabled, an exception should be thrown
intercept[IOException] {
new FileLogger(logDirPathString, new SparkConf, overwrite = false).start()
new FileLogger(logDirPathString, new SparkConf, compress = false, overwrite = false).start()
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment