You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Divya Gehlot <di...@gmail.com> on 2016/07/26 11:09:15 UTC
Fwd: FileUtil.fullyDelete does ?
Resending to right list
---------- Forwarded message ----------
From: "Divya Gehlot" <di...@gmail.com>
Date: Jul 26, 2016 6:51 PM
Subject: FileUtil.fullyDelete does ?
To: "user @spark" <us...@spark.apache.org>
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
Re: FileUtil.fullyDelete does ?
Posted by Divya Gehlot <di...@gmail.com>.
What happened in my usecase ?
Even I know what it does :)
Need to know why they are deleting the src And destination file path
On Jul 26, 2016 10:20 PM, "praveenesh kumar" <pr...@gmail.com> wrote:
>
> https://hadoop.apache.org/docs/r2.7.1/api/org/apache/hadoop/fs/FileUtil.html#fullyDelete(java.io.File)
>
> On Tue, Jul 26, 2016 at 12:09 PM, Divya Gehlot <di...@gmail.com>
> wrote:
>
>> Resending to right list
>> ---------- Forwarded message ----------
>> From: "Divya Gehlot" <di...@gmail.com>
>> Date: Jul 26, 2016 6:51 PM
>> Subject: FileUtil.fullyDelete does ?
>> To: "user @spark" <us...@spark.apache.org>
>> 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
>>
>>
>>
>
Re: FileUtil.fullyDelete does ?
Posted by praveenesh kumar <pr...@gmail.com>.
https://hadoop.apache.org/docs/r2.7.1/api/org/apache/hadoop/fs/FileUtil.html#fullyDelete(java.io.File)
On Tue, Jul 26, 2016 at 12:09 PM, Divya Gehlot <di...@gmail.com>
wrote:
> Resending to right list
> ---------- Forwarded message ----------
> From: "Divya Gehlot" <di...@gmail.com>
> Date: Jul 26, 2016 6:51 PM
> Subject: FileUtil.fullyDelete does ?
> To: "user @spark" <us...@spark.apache.org>
> 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
>
>
>