Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/4821#discussion_r25625161
--- Diff:
core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala
---
@@ -45,18 +44,26 @@ class FsHistoryProviderSuite extends FunSuite with
BeforeAndAfter with Matchers
Utils.deleteRecursively(testDir)
}
+ /** Create a fake log file using the new log format used in Spark 1.3+ */
+ private def newLogFile(appId: String, inProgress: Boolean = false): File
= {
+ val ip = if (inProgress) EventLoggingListener.IN_PROGRESS else ""
+ val logUri = EventLoggingListener.getLogPath(testDir.getAbsolutePath,
appId)
+ val logPath = new URI(logUri).getPath + ip
+ new File(logPath)
+ }
+
test("Parse new and old application logs") {
val provider = new FsHistoryProvider(createTestConf())
// Write a new-style application log.
- val newAppComplete = new File(testDir, "new1")
+ val newAppComplete = newLogFile("new1", inProgress = false)
--- End diff --
If you're going to pass the default value explicitly, might be better to
not make it an optional parameter.
---
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]