Thanks Todd,

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

I saw this loop:
for (INode child : current.getChildren()) {

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?


On Mon, May 2, 2011 at 3:51 PM, Todd Lipcon <> wrote:
On Mon, May 2, 2011 at 1:20 PM, Thanh Do <> 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 Lipcon
Software Engineer, Cloudera