[ 
https://issues.apache.org/jira/browse/HADOOP-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz Wo (Nicholas), SZE updated HADOOP-2423:
-------------------------------------------

    Description: 
FSDirectory.mkdirs(...) creates List<String> 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.

  was:FSDirectory.mkdirs(...) creates a list of string storing all  


> The codes in FSDirectory.mkdirs(...) is inefficient.
> ----------------------------------------------------
>
>                 Key: HADOOP-2423
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2423
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: dfs
>    Affects Versions: 0.15.1
>            Reporter: Tsz Wo (Nicholas), SZE
>
> FSDirectory.mkdirs(...) creates List<String> 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.

Reply via email to