GetMasterCache() public method

public GetMasterCache ( ) : Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob
return Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob
        public async Task WriteAll()
        {
            var helper = new AzureBlobAppenderHelper(storage, container, options);

            var master = helper.GetMasterCache();

            master.StreamWriteSizeInBytes = 1024 * 1024 * 4;

            using (var masterindex = new MemoryStream())
            {
                var writer = new StreamWriter(masterindex);
                using (var stream = new MemoryStream())
                {
                    foreach (var record in records)
                    {
                        record.WriteContentToStream(stream);
                        var hashhex = string.Join(String.Empty, record.Hash.Select(x => x.ToString("x2")));
                        writer.WriteLine(String.Join("\t", record.Name, record.Version, hashhex, this.options.NamingPolicy.GetStreamPath(record.Name)));
                    }

                    await writer.FlushAsync();

                    stream.Position      = 0;
                    masterindex.Position = 0;

                    await master.CreateOrReplaceAsync();

                    await master.AppendFromStreamAsync(stream);

                    var indexblob = storage.CreateCloudBlobClient().GetContainerReference(container).GetAppendBlobReference(this.options.NamingPolicy.GetIndexPath());
                    await indexblob.CreateOrReplaceAsync();

                    await indexblob.AppendFromStreamAsync(masterindex);

                    var streams = GetNamedStreams(helper);
                    await Task.WhenAll(streams);
                }
            }
        }
        public async Task WriteAll()
        {
            var helper = new AzureBlobAppenderHelper(storage, container, options);

            var master = helper.GetMasterCache();
            master.StreamWriteSizeInBytes = 1024 * 1024 * 4;

            using (var masterindex = new MemoryStream())
            {
                var writer = new StreamWriter(masterindex);
                using (var stream = new MemoryStream())
                {
                    foreach (var record in records)
                    {
                        record.WriteContentToStream(stream);
                        var hashhex = string.Join(String.Empty, record.Hash.Select(x => x.ToString("x2")));
                        writer.WriteLine(String.Join("\t", record.Name, record.Version, hashhex, this.options.NamingPolicy.GetStreamPath(record.Name)));
                    }

                    await writer.FlushAsync();

                    stream.Position = 0;
                    masterindex.Position = 0;

                    await master.CreateOrReplaceAsync();
                    await master.AppendFromStreamAsync(stream);
                    
                    var indexblob = storage.CreateCloudBlobClient().GetContainerReference(container).GetAppendBlobReference(this.options.NamingPolicy.GetIndexPath());
                    await indexblob.CreateOrReplaceAsync();
                    await indexblob.AppendFromStreamAsync(masterindex);

                    var streams = GetNamedStreams(helper);
                    await Task.WhenAll(streams);
                }
            }
        }