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

Doug Cutting commented on HADOOP-3591:
--------------------------------------

Depending on FileSystem equality is a bug.  Even though FileSystem instances 
are cached, it is still possible to have different instances that refer to the 
same files if different user credentials are used to create them.  Equality of 
FileSystem.getUri() should be more reliable, but is still not perfect, as 
foo://[EMAIL PROTECTED]/ and bar://[EMAIL PROTECTED]/ could refer to the same 
files, since foo and bar could be different protocols to access the same data, 
and bar.com's address could be 1.2.3.4.

> org.apache.hadoop.fs.FileUtil.checkDependencies may want to use .equals() 
> instead of ==
> ---------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3591
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3591
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.18.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> org.apache.hadoop.fs.FileUtil.checkDependencies checks for source overwriting 
> dest by first checking for filesystem equality:
> if (srcFS == dstFS) {
>  ..more checks here
>  }
> So, its assuming that you can check filesystem by pointer equality, whereas 
> if you create two filesystems and initialise them, they will still refer to 
> the same remoteFS.
> Consider assuming URI equality ==filesystem equality, and either to do a 
> FileSystem.equals() that checks that , or do the check in 
> FileUtil.getDependencies

-- 
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