internal Saver(FSImageFormatProtobuf.Saver parent, FsImageProto.FileSummary.Builder summary) { this.parent = parent; this.summary = summary; this.context = parent.GetContext(); this.fsn = context.GetSourceNamesystem(); }
/// <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); }