Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/3704#discussion_r21849567
--- Diff:
streaming/src/test/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDDSuite.scala
---
@@ -137,7 +137,12 @@ class WriteAheadLogBackedBlockRDDSuite extends
FunSuite with BeforeAndAfterAll {
blockIds: Seq[BlockId]
): Seq[WriteAheadLogFileSegment] = {
require(blockData.size === blockIds.size)
- val writer = new WriteAheadLogWriter(new File(dir,
Random.nextString(10)).toString, hadoopConf)
+ val logFilePath = {
+ val f = File.createTempFile("wal", null, dir)
+ assert(f.delete())
--- End diff --
This might look race prone (deleting a file and hoping that someone else
won't come along and write it in the meantime), but it should be safe because:
1. Different Jenkins builds will have different temp directories (`dir`).
2. Within a JVM, multiple calls to `createTempFile` will never return the
same pathname ([see
Javadoc](http://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File))).
---
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]