hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Lipcon (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-1070) Speedup NameNode image loading and saving by storing local file names
Date Fri, 03 Dec 2010 01:44:18 GMT

    [ https://issues.apache.org/jira/browse/HDFS-1070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966385#action_12966385
] 

Todd Lipcon commented on HDFS-1070:
-----------------------------------

Looks pretty good, very nice results!

Few things:

- There's this random empty block in ImageLoaderCurrent:
{code}
+    for(long i = 0; i < numInodes; i++) {
+    }
{code}

- This loop:
{code}
+       // read all children
+       for( int i = in.readInt(); i>0; i--) {
{code}
might be clearer as:
{code}
int numChildren = in.readInt();
for (int i = 0; i < numChildren; i++) {
}
{code}

- This code:
{code}
+        in.read(localName); // read local name
{code}
might have a bad bug since the return value is unchecked. Instead consider IOUtils.readFully()?

> Speedup NameNode image loading and saving by storing local file names
> ---------------------------------------------------------------------
>
>                 Key: HDFS-1070
>                 URL: https://issues.apache.org/jira/browse/HDFS-1070
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: name-node
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.22.0
>
>         Attachments: trunkLocalNameImage.patch, trunkLocalNameImage1.patch, trunkLocalNameImage3.patch
>
>
> Currently each inode stores its full path in the fsimage. I'd propose to store the local
name instead. In order for each inode to identify its parent, all inodes in a directory tree
are stored in the image in in-order. This proposal also requires each directory stores the
number of its children in image.
> This proposal would bring a few benefits as pointed below and therefore speedup the image
loading and saving.
> # Remove the overhead of converting java-UTF8 encoded local name to string-represented
full path then to UTF8 encoded full path when saving to an image and vice versa when loading
the image.
> # Remove the overhead of traversing the full path when inserting the inode to its parent
inode.
> # Reduce the number of temporary java objects during the process of image loading or
saving and  therefore reduce the GC overhead.
> # Reduce the size of an image.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message