예제 #1
0
 internal Saver(FSImageFormatProtobuf.Saver parent, FsImageProto.FileSummary.Builder
                summary)
 {
     this.parent  = parent;
     this.summary = summary;
     this.context = parent.GetContext();
     this.fsn     = context.GetSourceNamesystem();
 }
예제 #2
0
        /// <summary>Save the fsimage to a temp file</summary>
        /// <exception cref="System.IO.IOException"/>
        private FilePath SaveFSImageToTempFile()
        {
            SaveNamespaceContext context = new SaveNamespaceContext(fsn, txid, new Canceler()
                                                                    );

            FSImageFormatProtobuf.Saver saver       = new FSImageFormatProtobuf.Saver(context);
            FSImageCompression          compression = FSImageCompression.CreateCompression(conf);
            FilePath imageFile = GetImageFile(testDir, txid);

            fsn.ReadLock();
            try
            {
                saver.Save(imageFile, compression);
            }
            finally
            {
                fsn.ReadUnlock();
            }
            return(imageFile);
        }