Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 64247 invoked from network); 10 Mar 2008 22:56:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2008 22:56:14 -0000 Received: (qmail 86658 invoked by uid 500); 10 Mar 2008 22:56:10 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 86494 invoked by uid 500); 10 Mar 2008 22:56:10 -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 86485 invoked by uid 99); 10 Mar 2008 22:56:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 15:56:10 -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; Mon, 10 Mar 2008 22:55:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 14E60234C08B for ; Mon, 10 Mar 2008 15:54:47 -0700 (PDT) Message-ID: <1171383115.1205189687071.JavaMail.jira@brutus> Date: Mon, 10 Mar 2008 15:54:47 -0700 (PDT) From: "Tsz Wo (Nicholas), SZE (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (HADOOP-2423) The codes in FSDirectory.mkdirs(...) is inefficient. 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-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tsz Wo (Nicholas), SZE updated HADOOP-2423: ------------------------------------------- Attachment: 2423_20080310.patch 1. This is indeed a very good point. The codes becomes not much simpler. 2. Sure. 3. Since path should not have consective "/", split with limit -1 or 0 are the same. So, I think the split with less number of parameters is preferred. 4. Because of (1), the changes of addNode(String path, T newNode, boolean inheritPermission) are reverted. We could make the change from throwing FileNotFoundException to returning null later. 5. Since addChild(...) does not throw FileNotFoundException, nothing to catch now. > The codes in FSDirectory.mkdirs(...) is inefficient. > ---------------------------------------------------- > > Key: HADOOP-2423 > URL: https://issues.apache.org/jira/browse/HADOOP-2423 > Project: Hadoop Core > Issue Type: Improvement > Components: dfs > Affects Versions: 0.15.1 > Reporter: Tsz Wo (Nicholas), SZE > Assignee: Tsz Wo (Nicholas), SZE > Attachments: 2423_20080130.patch, 2423_20080303.patch, 2423_20080304.patch, 2423_20080304b.patch, 2423_20080304c.patch, 2423_20080304d.patch, 2423_20080310.patch > > > FSDirectory.mkdirs(...) creates List v to store all dirs. e.g. > {code} > //Suppose > src = "/foo/bar/bas/" > //Then, > v = {"/", "/foo", "/foo/bar", "/foo/bar/bas"} > {code} > For each directory string *cur* in v, no matter *cur* already exists or not, it will try to do a unprotectedMkdir(cur, ...). Then, *cur* is parsed to byte[][] in INodeDirectory.addNode (...). > We don't need to do the parsing for each string in v. Instead, byte[][] should be stored. Also, the loop should not continue once it finds an existing subdirectory. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.