Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ class WriteAheadLogBackedBlockRDD[T: ClassTag](
// FileBasedWriteAheadLog will not create any file or directory at that path. Also,
// this dummy directory should not already exist otherwise the WAL will try to recover
// past events from the directory and throw errors.
// Specifically, the nonExistentDirectory will contain a colon in windows, this is invalid
// for hadoop. Remove the drive letter and colon, e.g. "D:" out of this path by default
val nonExistentDirectory = new File(
System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString).getAbsolutePath
System.getProperty("java.io.tmpdir").replaceFirst("[a-zA-Z]:", ""),
UUID.randomUUID().toString).getPath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @Myasuka .
I'm just wondering why do you change getAbsolutePath to getPath together? Is it related to your fix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, getAbsolutePath will still get path with driver letter and colon, which is illegal fro HDFS, that's why I change getAbsolutePath to getPath.

Copy link
Member

@dongjoon-hyun dongjoon-hyun Jun 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, what about this?

val nonExistentDirectory = new File(
  System.getProperty("java.io.tmpdir"), 
  UUID.randomUUID().toString).getAbsolutePath.replaceFirst("[a-zA-Z]:", "")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the same, if you prefer this change, I could add another commit.

writeAheadLog = WriteAheadLogUtils.createLogForReceiver(
SparkEnv.get.conf, nonExistentDirectory, hadoopConf)
dataRead = writeAheadLog.read(partition.walRecordHandle)
Expand Down