Skip to content

Commit 9b8e92c

Browse files
committed
Fix code style and add a short comment.
1 parent 0d8f800 commit 9b8e92c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ class Checkpoint(@transient ssc: StreamingContext, val checkpointTime: Time)
4444
val sparkConfPairs = ssc.conf.getAll
4545

4646
def createSparkConf(): SparkConf = {
47-
val reloadConfs = List(
47+
48+
// Reload properties for the checkpoint application since user wants to set a reload property
49+
// or spark had changed its value and user wants to set it back.
50+
val propertiesToReload = List(
4851
"spark.master",
4952
"spark.yarn.keytab",
5053
"spark.yarn.principal")
@@ -53,9 +56,10 @@ class Checkpoint(@transient ssc: StreamingContext, val checkpointTime: Time)
5356
.remove("spark.driver.host")
5457
.remove("spark.driver.port")
5558
val newReloadConf = new SparkConf(loadDefaults = true)
56-
reloadConfs.foreach { conf =>
57-
newReloadConf.getOption(conf)
58-
.foreach(confValue => newSparkConf.set(conf, confValue))
59+
propertiesToReload.foreach { prop =>
60+
newReloadConf.getOption(prop).foreach { value =>
61+
newSparkConf.set(prop, value)
62+
}
5963
}
6064
newSparkConf
6165
}

0 commit comments

Comments
 (0)