Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 96566 invoked from network); 4 Sep 2009 00:26:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Sep 2009 00:26:21 -0000 Received: (qmail 45721 invoked by uid 500); 4 Sep 2009 00:26:21 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 45665 invoked by uid 500); 4 Sep 2009 00:26:21 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 45655 invoked by uid 99); 4 Sep 2009 00:26:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 00:26:21 +0000 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; Fri, 04 Sep 2009 00:26:18 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7F40C234C004 for ; Thu, 3 Sep 2009 17:25:57 -0700 (PDT) Message-ID: <664122001.1252023957506.JavaMail.jira@brutus> Date: Thu, 3 Sep 2009 17:25:57 -0700 (PDT) From: "Tom White (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Commented: (HDFS-303) Make contracts of LocalFileSystem and DistributedFileSystem consistent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751240#action_12751240 ] Tom White commented on HDFS-303: -------------------------------- Fixing the API so it doesn't return a boolean to indicate success or failure is a difficult migration problem for the current FileSystem interface, so I suggest that it goes in the new FileSystem interface being designed in HADOOP-4952. 4. bq. When HDFS creates a file under a non-existing path it calls mkdirs() to create missing directories on the path. I think the rename should follow the same pattern. Maybe (although this contradicts your later point about keeping the behaviour simple). I'm OK with either change. 5. bq. My proposal is to fail rename whenever the target file (or directory) exists. We could implement this easily by doing the check in the appropriate FileSystem implementation, so we don't have to worry about the difference between native local filesystems in this case. bq. I suggest to keep this jira as a base one and create a separate one for each of the points (same as HDFS-538). Fine, although we may need to coordinate the testing since it is done by TestLocalFileSystemContract for the local filesystem (which hasn't been added yet, since its tests don't yet pass). > Make contracts of LocalFileSystem and DistributedFileSystem consistent > ---------------------------------------------------------------------- > > Key: HDFS-303 > URL: https://issues.apache.org/jira/browse/HDFS-303 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Tom White > Attachments: hadoop-4114.patch, HDFS-303-common-test-case.patch > > > There are a number of edge cases that the two file system implementations handle differently. In particular: > * When trying to make a directory under an existing file, HDFS throws an IOException while LocalFileSystem doesn't. > * The FileSytem#listStatus(Path) method returns null for a non-existent file on HDFS, while LocalFileSytem returns an empty FileStatus array. > * When trying to rename a non-existent path, LocalFileSystem throws an IOException, while HDFS returns false. > * When renaming a file or directory to a non-existent directory (e.g. /a/b to /c/d, where /c doesn't exist) LocalFileSystem succeeds (returns true) while HDFS fails (false). > * When renaming a file (or directory) as an existing file (or directory) LocalFileSystem succeeds (returns true) while HDFS fails (false). > We should document the expected behaviour for these cases in FileSystem's javadoc, and make sure all implementations conform to it. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.