Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 70010 invoked from network); 3 Oct 2007 16:13:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Oct 2007 16:13:16 -0000 Received: (qmail 52599 invoked by uid 500); 3 Oct 2007 16:13:03 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 52428 invoked by uid 500); 3 Oct 2007 16:13:02 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 52393 invoked by uid 99); 3 Oct 2007 16:13:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 09:13:01 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 16:13:10 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F2297714218 for ; Wed, 3 Oct 2007 09:12:50 -0700 (PDT) Message-ID: <17878770.1191427970989.JavaMail.jira@brutus> Date: Wed, 3 Oct 2007 09:12:50 -0700 (PDT) From: "Rod Taylor (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Issue Comment Edited: (HADOOP-730) Local file system uses copy to implement rename In-Reply-To: <18309280.1163664517154.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-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532151 ] rbt edited comment on HADOOP-730 at 10/3/07 9:12 AM: ------------------------------------------------------------ Couldn't it try the renameTo() operation and if it fails then fallback to the slower copy&delete method? if (pathToFile(src).renameTo(pathToFile(dst))) { return true; } else { return FileUtil.copy(this, src, this, dst, true, getConf()); } would replace if (useCopyForRename) { return FileUtil.copy(this, src, this, dst, true, getConf()); } else return pathToFile(src).renameTo(pathToFile(dst)); was (Author: rbt): Couldn't it try the renameTo() operation and if it fails then fallback to the slower copy&delete method? if (pathToFile(src).renameTo(pathToFile(dst))) { return true; } else { return FileUtil.copy(this, src, this, dst, true, getConf()); } would replace if (useCopyForRename) { return FileUtil.copy(this, src, this, dst, true, getConf()); } else return pathToFile(src).renameTo(pathToFile(dst)); > Local file system uses copy to implement rename > ----------------------------------------------- > > Key: HADOOP-730 > URL: https://issues.apache.org/jira/browse/HADOOP-730 > Project: Hadoop > Issue Type: Bug > Components: fs > Affects Versions: 0.8.0 > Reporter: Owen O'Malley > Assignee: Owen O'Malley > > There is a variable LocalFileSystem.useCopyForRename that is set to true. When true, the local file system will implement rename as a copy followed by a delete. This is likely a performance problem. Is there a reason that useCopyForRename is set? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.