Ejemplo n.º 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();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 internal Saver(SaveNamespaceContext context)
 {
     // OutputStream for the section data
     this.context      = context;
     this.saverContext = new FSImageFormatProtobuf.SaverContext();
 }