Skip to content

Commit

Permalink
Don't use java.io.File since DFS may not be POSIX-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
rnowling committed Nov 20, 2014
1 parent b0ef9ea commit af8ccb7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import org.apache.spark.SparkContext._
object DFSReadWriteTest {

private var localFilePath: File = new File(".")
private var dfsDirPath: File = new File(".")
private var dfsDirPath: String = ""

private val NPARAMS = 2

Expand Down Expand Up @@ -79,7 +79,7 @@ object DFSReadWriteTest {
}

i += 1
dfsDirPath = new File(args(i))
dfsDirPath = args(i)
}

def runLocalWordCount(fileContents: List[String]): Int = {
Expand All @@ -106,7 +106,7 @@ object DFSReadWriteTest {
val sc = new SparkContext(conf)

println("Writing local file to DFS")
val dfsFilename = dfsDirPath.toString() + "/dfs_read_write_test"
val dfsFilename = dfsDirPath + "/dfs_read_write_test"
val fileRDD = sc.parallelize(fileContents)
fileRDD.saveAsTextFile(dfsFilename)

Expand Down

0 comments on commit af8ccb7

Please sign in to comment.