private async Task <IndexFat> LoadFatAsync(int length) { var buffer = new byte[length]; await _storageFacade.DownloadRangeAsync(_blobName, buffer); return(JsonSerializer.Deserialize <IndexFat>(buffer)); }
private async Task <BufferPool> LoadBlocksAsync(IImmutableList <Block> blocks) { if (_initialized == null) { throw new InvalidOperationException("InitializeAsync hasn't been called"); } var(start, end) = Block.GetInterval(blocks, _initialized.BlobBlocks); var buffer = BufferPool.Rent((int)(end - start)); await _storageFacade.DownloadRangeAsync( _blobName, buffer.Buffer, start, end - start, _initialized.SnapshotTime); return(buffer); }
private async Task <LogFat> LoadFatAsync(int length, string partitionPath) { var buffer = new byte[length]; await _storageFacade.DownloadRangeAsync(_blobName, buffer); var logFat = JsonSerializer.Deserialize <LogFat>(buffer); if (logFat.PartitionPath != partitionPath) { throw new CosbakException( $"Partition path changed from {logFat.PartitionPath} to {partitionPath}"); } return(logFat); }