Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 78884 invoked from network); 17 Sep 2007 21:58:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2007 21:58:07 -0000 Received: (qmail 2937 invoked by uid 500); 17 Sep 2007 21:57:58 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 2907 invoked by uid 500); 17 Sep 2007 21:57:58 -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 2898 invoked by uid 99); 17 Sep 2007 21:57:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2007 14:57:58 -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; Mon, 17 Sep 2007 21:59:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8A1FB714168 for ; Mon, 17 Sep 2007 14:57:43 -0700 (PDT) Message-ID: <7724885.1190066263537.JavaMail.jira@brutus> Date: Mon, 17 Sep 2007 14:57:43 -0700 (PDT) From: "Raghu Angadi (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Assigned: (HADOOP-1910) Extra checks in DFS.create() are not necessary. In-Reply-To: <2432004.1190062963739.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-1910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Raghu Angadi reassigned HADOOP-1910: ------------------------------------ Assignee: Raghu Angadi > Extra checks in DFS.create() are not necessary. > ----------------------------------------------- > > Key: HADOOP-1910 > URL: https://issues.apache.org/jira/browse/HADOOP-1910 > Project: Hadoop > Issue Type: Bug > Components: dfs > Reporter: Raghu Angadi > Assignee: Raghu Angadi > Priority: Minor > Attachments: HADOOP-1910.patch > > > {{DistributedFileSystem.create(path)}} like this : > {code} > public FSDataOutputStream create(Path f, boolean overwrite, > int bufferSize, short replication, long blockSize, > Progressable progress) throws IOException { > if (exists(f) && !overwrite) { > throw new IOException("File already exists:"+f); > } > Path parent = f.getParent(); > if (parent != null && !exists(parent) && !mkdirs(parent)) { > throw new IOException("Mkdirs failed to create " + parent); > } > return new FSDataOutputStream( dfs.create(getPathName(f), overwrite, > replication, blockSize, > progress, bufferSize, ticket)); > } > {code} > This has overhead of 2-3 RPCs to namenode for every create(). The first {{exists()}} is not required because {{overwrite}} flag is passed to Namenode. The second {{exists()}} and {{mkdirs()}} is not required since {{create()}} already does this. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.