Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 98848 invoked from network); 25 Jun 2008 13:24:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2008 13:24:08 -0000 Received: (qmail 89172 invoked by uid 500); 25 Jun 2008 13:24:07 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 89149 invoked by uid 500); 25 Jun 2008 13:24:07 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 89138 invoked by uid 99); 25 Jun 2008 13:24:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 06:24:07 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 13:23:25 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 310FD234C14E for ; Wed, 25 Jun 2008 06:23:45 -0700 (PDT) Message-ID: <49787589.1214400225199.JavaMail.jira@brutus> Date: Wed, 25 Jun 2008 06:23:45 -0700 (PDT) From: "Steve Loughran (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-3591) org.apache.hadoop.fs.FileUtil.checkDependencies may want to use .equals() instead of == In-Reply-To: <584486502.1213803525020.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-3591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608034#action_12608034 ] Steve Loughran commented on HADOOP-3591: ---------------------------------------- well, some of the FileUtil and FsShell operations do equality tests either on instance (very bad) or uri. If we need a robust way to distinguish filesystems *and URI is inadequate*, then the only alternative would be for the far end to provide some unique ID. This could be a persistent ID of the FS itself, or it could be something created whenenver a name node or other filesystem comes up. > 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.