hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thanh Do <than...@cs.wisc.edu>
Subject Re: fsimage save file
Date Tue, 03 May 2011 01:39:46 GMT
Thanks Todd,

I looked at FSImage.saveImage().
It turns out the order is depth first.

I saw this loop:
*for (INode child : current.getChildren()) {
   ...
   saveInode2Image(..)
}
*
So the order of saving is based on how child list
is organized. According from the code from
INodeDirectory.addChild(), every time we add a child,
we do a binary search to find the appropriate insert location.

So I think the child list is sorted on alphabetical order.
Am I right?

Thanh

On Mon, May 2, 2011 at 3:51 PM, Todd Lipcon <todd@cloudera.com> wrote:

> On Mon, May 2, 2011 at 1:20 PM, Thanh Do <thanhdo@cs.wisc.edu> wrote:
>
>> hi all,
>>
>> perhaps this is a dummy question but
>> can anyone tell me that when
>> the namenode saves a fsimage,
>> are the Inodes saved in an alphabetical order?
>>
>
> Hi Thanh,
>
> They're saved in directory traversal order (can't remember if it's breadth
> first or depth first, but the code should tell you)
>
> -Todd
> --
> Todd Lipcon
> Software Engineer, Cloudera
>

Mime
View raw message