Skip to content

Commit cc6bce4

Browse files
author
Marcelo Vanzin
committed
Some review feedback.
1 parent a722184 commit cc6bce4

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
106106

107107
checkForLogs()
108108

109-
// Treat 0 as "disable the background thread", mostly for testing.
110-
if (UPDATE_INTERVAL_MS > 0) {
109+
// Disable the background thread during tests.
110+
if (!conf.contains("spark.testing")) {
111111
logCheckingThread.setDaemon(true)
112112
logCheckingThread.start()
113113
}
@@ -264,18 +264,20 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
264264
var codecName: String = null
265265
var sparkVersion: String = null
266266

267-
children.foreach(child => child.getPath().getName() match {
268-
case name if name.startsWith(LOG_PREFIX) =>
269-
eventLogPath = child.getPath()
267+
children.foreach { child =>
268+
child.getPath().getName() match {
269+
case name if name.startsWith(LOG_PREFIX) =>
270+
eventLogPath = child.getPath()
270271

271-
case codec if codec.startsWith(COMPRESSION_CODEC_PREFIX) =>
272-
codecName = codec.substring(COMPRESSION_CODEC_PREFIX.length())
272+
case codec if codec.startsWith(COMPRESSION_CODEC_PREFIX) =>
273+
codecName = codec.substring(COMPRESSION_CODEC_PREFIX.length())
273274

274-
case version if version.startsWith(SPARK_VERSION_PREFIX) =>
275-
sparkVersion = version.substring(SPARK_VERSION_PREFIX.length())
275+
case version if version.startsWith(SPARK_VERSION_PREFIX) =>
276+
sparkVersion = version.substring(SPARK_VERSION_PREFIX.length())
276277

277-
case _ =>
278-
})
278+
case _ =>
279+
}
280+
}
279281

280282
val codec = try {
281283
if (codecName != null) {

0 commit comments

Comments
 (0)