Fwd: FileUtil.fullyDelete does ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: FileUtil.fullyDelete does ?

Divya Gehlot

Resending to right list

---------- Forwarded message ----------
From: "Divya Gehlot" <[hidden email]>
Date: Jul 26, 2016 6:51 PM
Subject: FileUtil.fullyDelete does ?
To: "user @spark" <[hidden email]>
Cc:

Hi,
When I am doing the using theFileUtil.copymerge function 
val file = "/tmp/primaryTypes.csv"
FileUtil.fullyDelete(new File(file))
 
val destinationFile= "/tmp/singlePrimaryTypes.csv"
FileUtil.fullyDelete(new File(destinationFile))
 
val counts = partitions.
reduceByKey {case (x,y) => x + y}.
sortBy {case (key, value) => -value}.
map { case (key, value) => Array(key, value).mkString(",") }
 
counts.saveAsTextFile(file)
 
merge(file, destinationFile)

I am wondering here what does  FileUtil.fullyDelete(new File(destinationFile)) do ?
  
does it delete the merged file ....If yes,then how will we access the merged file ..?

Confused here ...


Thanks,
Divya 

Reply | Threaded
Open this post in threaded view
|

Re: FileUtil.fullyDelete does ?

praveenesh kumar

On Tue, Jul 26, 2016 at 12:09 PM, Divya Gehlot <[hidden email]> wrote:

Resending to right list

---------- Forwarded message ----------
From: "Divya Gehlot" <[hidden email]>
Date: Jul 26, 2016 6:51 PM
Subject: FileUtil.fullyDelete does ?
To: "user @spark" <[hidden email]>
Cc:

Hi,
When I am doing the using theFileUtil.copymerge function 
val file = "/tmp/primaryTypes.csv"
FileUtil.fullyDelete(new File(file))
 
val destinationFile= "/tmp/singlePrimaryTypes.csv"
FileUtil.fullyDelete(new File(destinationFile))
 
val counts = partitions.
reduceByKey {case (x,y) => x + y}.
sortBy {case (key, value) => -value}.
map { case (key, value) => Array(key, value).mkString(",") }
 
counts.saveAsTextFile(file)
 
merge(file, destinationFile)

I am wondering here what does  FileUtil.fullyDelete(new File(destinationFile)) do ?
  
does it delete the merged file ....If yes,then how will we access the merged file ..?

Confused here ...


Thanks,
Divya