[ 
https://issues.apache.org/jira/browse/HADOOP-6240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753298#action_12753298
 ] 

Suresh Srinivas commented on HADOOP-6240:
-----------------------------------------

The main issue is not throwing IOException instead of returning false. The 
proposal is to throw exception instead of returning false with this change. 
This change in behavior should already be handled at the applications. Other 
issues:
# When different filesystems have different behaviors, the semantics of HDFS 
will be retained. All the other filesystems will be changed to comply with HDFS.
# rename also has the following behavior that is not right:
#* rename(dir1, dir2) has two different behaviors. If dir2 exists then it works 
like move, dir1 is moved to dir2. If dir2 does not exist, dir1 is renamed as 
dir2. Posix has consistent behavior in both the cases. If dir2 does not exist, 
dir1 is renamed as dir2. If dir2 iis empty, dir2 is removed and dir1 is renamed 
as dir2. If dir2 is not empty, rename operation fails.
#* rename(file1, dir2) has two different behaviors. If dir2 exists then it 
works like move, file1 is moved to dir2. If dir2 does not exist, rename fails. 
Posix does not allow src as file and dst as directory.
#* rename(file1, file2) fails if file2 exists. Posix rename removes file2 and 
renames file1 to file2.

For backward compatibility, rename semantics will be retained. New rename2 with 
posix compliant behavior will be added to FileSystem to be used by FileContext. 
I am not a fan of method name rename2 either. Let me know if there are better 
ways of naming the method.


> Rename operation is not consistent between different implementations of 
> FileSystem
> ----------------------------------------------------------------------------------
>
>                 Key: HADOOP-6240
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6240
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>            Reporter: Suresh Srinivas
>            Assignee: Suresh Srinivas
>             Fix For: 0.21.0
>
>
> The rename operation has many scenarios that are not consistently implemented 
> across file systems.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to