hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Duxbury <br...@rapleaf.com>
Subject Re: rename return values
Date Tue, 30 Sep 2008 23:47:48 GMT
It's very interesting that the Java File API doesn't return  
exceptions, but that doesn't mean it's a good interface. The fact  
that there IS further exceptional information somewhere in the system  
but that it is currently ignored is sort of troubling. Perhaps, at  
least, we could add an overload that WILL throw an exception if there  
is one to report.

-Bryan

On Sep 30, 2008, at 1:53 PM, Chris Douglas wrote:

> FileSystem::rename doesn't always have the cause, per  
> java.io.File::renameTo:
>
> http://java.sun.com/javase/6/docs/api/java/io/File.html#renameTo 
> (java.io.File)
>
> Even if it did, it's not clear to FileSystem that the failure to  
> rename is fatal/exceptional to the application. -C
>
> On Sep 30, 2008, at 1:37 PM, Bryan Duxbury wrote:
>
>> Hey all,
>>
>> Why is it that FileSystem.rename returns true or false instead of  
>> throwing an exception? It seems incredibly inconvenient to get a  
>> false result and then have to go poring over the namenode logs  
>> looking for the actual error message. I had this case recently  
>> where I'd forgotten to create the parent directories, but I had no  
>> idea it was failing since there were no exceptions.
>>
>> -Bryan
>


Mime
View raw message