public async Task Backup(IPersistentUploader uploader, EventArgs _) { await m_init; Log.WriteLine($"{nameof(ServiceFabricBackupManager)}: Creating ServiceFabric backup data."); var dsc = new BackupDescription(async(bi, ct) => { var fname = Path.Combine(TrinityConfig.StorageRoot, Path.GetRandomFileName()); Log.WriteLine($"{nameof(ServiceFabricBackupManager)}: Compressing ServiceFabric backup data."); ZipFile.CreateFromDirectory(bi.Directory, fname); using (var f = File.OpenRead(fname)) { Log.WriteLine($"{nameof(ServiceFabricBackupManager)}: Uploading ServiceFabric backup data."); await uploader.UploadMetadataAsync(MetadataKey, f); } Log.WriteLine($"{nameof(ServiceFabricBackupManager)}: Backed up ServiceFabric backup data."); return(true); }); await m_svc.Backup(dsc); }
private unsafe Task _Upload(IEnumerable <CellInfo> cells, IPersistentUploader uploader, long estimated_size) { var payload_chunk = InMemoryDataChunk.New(cells, (int)estimated_size); return(uploader.UploadAsync(payload_chunk)); }