Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/5060#discussion_r34661816
--- Diff:
streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala ---
@@ -191,6 +191,34 @@ class CheckpointSuite extends TestSuiteBase {
}
}
+ // This tests if "spark.driver.host" and "spark.driver.port" is set by
user, can be recovered
+ // with correct value.
+ test("correctly recover spark.driver.[host|port] from checkpoint") {
+ val conf = Map("spark.driver.host" -> "localhost", "spark.driver.port"
-> "9999")
+ conf.foreach(kv => System.setProperty(kv._1, kv._2))
+ ssc = new StreamingContext(master, framework, batchDuration)
+ val originalConf = ssc.conf
+ assert(originalConf.get("spark.driver.host") === "localhost")
+ assert(originalConf.get("spark.driver.port") === "9999")
+
+ val cp = new Checkpoint(ssc, Time(1000))
+ ssc.stop()
+
+ // Serialize/deserialize to simulate write to storage and reading it
back
+ val newCp = Utils.deserialize[Checkpoint](Utils.serialize(cp))
+
+ val newCpConf = newCp.createSparkConf()
+ assert(newCpConf.contains("spark.driver.host"))
+ assert(newCpConf.contains("spark.driver.port"))
+ assert(newCpConf.get("spark.driver.host") === "localhost")
--- End diff --
OK, I will update the test
---
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]