Esempio n. 1
0
 /// <exception cref="System.IO.IOException"/>
 private void DumpFileUnderConstructionSection(InputStream @in)
 {
     @out.Write("<FileUnderConstructionSection>");
     while (true)
     {
         FsImageProto.FilesUnderConstructionSection.FileUnderConstructionEntry e = FsImageProto.FilesUnderConstructionSection.FileUnderConstructionEntry
                                                                                   .ParseDelimitedFrom(@in);
         if (e == null)
         {
             break;
         }
         @out.Write("<inode>");
         O("id", e.GetInodeId()).O("path", e.GetFullPath());
         @out.Write("</inode>\n");
     }
     @out.Write("</FileUnderConstructionSection>\n");
 }
Esempio n. 2
0
 /// <summary>Load the under-construction files section, and update the lease map</summary>
 /// <exception cref="System.IO.IOException"/>
 internal void LoadFilesUnderConstructionSection(InputStream @in)
 {
     while (true)
     {
         FsImageProto.FilesUnderConstructionSection.FileUnderConstructionEntry entry = FsImageProto.FilesUnderConstructionSection.FileUnderConstructionEntry
                                                                                       .ParseDelimitedFrom(@in);
         if (entry == null)
         {
             break;
         }
         // update the lease manager
         INodeFile file = dir.GetInode(entry.GetInodeId()).AsFile();
         FileUnderConstructionFeature uc = file.GetFileUnderConstructionFeature();
         Preconditions.CheckState(uc != null);
         // file must be under-construction
         fsn.leaseManager.AddLease(uc.GetClientName(), entry.GetFullPath());
     }
 }