예제 #1
0
            /// <exception cref="System.IO.IOException"/>
            internal void LoadINodeDirectorySection(InputStream @in)
            {
                IList <INodeReference> refList = parent.GetLoaderContext().GetRefList();

                while (true)
                {
                    FsImageProto.INodeDirectorySection.DirEntry e = FsImageProto.INodeDirectorySection.DirEntry
                                                                    .ParseDelimitedFrom(@in);
                    // note that in is a LimitedInputStream
                    if (e == null)
                    {
                        break;
                    }
                    INodeDirectory p = dir.GetInode(e.GetParent()).AsDirectory();
                    foreach (long id in e.GetChildrenList())
                    {
                        INode child = dir.GetInode(id);
                        AddToParent(p, child);
                    }
                    foreach (int refId in e.GetRefChildrenList())
                    {
                        INodeReference @ref = refList[refId];
                        AddToParent(p, @ref);
                    }
                }
            }
예제 #2
0
 /// <exception cref="System.IO.IOException"/>
 private void DumpINodeDirectorySection(InputStream @in)
 {
     @out.Write("<INodeDirectorySection>");
     while (true)
     {
         FsImageProto.INodeDirectorySection.DirEntry e = FsImageProto.INodeDirectorySection.DirEntry
                                                         .ParseDelimitedFrom(@in);
         // note that in is a LimitedInputStream
         if (e == null)
         {
             break;
         }
         @out.Write("<directory>");
         O("parent", e.GetParent());
         foreach (long id in e.GetChildrenList())
         {
             O("inode", id);
         }
         foreach (int refId in e.GetRefChildrenList())
         {
             O("inodereference-index", refId);
         }
         @out.Write("</directory>\n");
     }
     @out.Write("</INodeDirectorySection>\n");
 }