Exemple #1
0
 public static BlobAppendOnlyStore CreateAppendOnlyStore(this IAzureStorageConfig config, string s)
 {
     var client = config.CreateBlobClient();
     var store = new BlobAppendOnlyStore(client.GetContainerReference(s));
     store.InitializeWriter();
     return store;
 }
        public void Setup()
        {
            _name = Guid.NewGuid().ToString().ToLowerInvariant();
            CloudStorageAccount cloudStorageAccount = ConnectionConfig.StorageAccount;
            var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
            _blobContainer = cloudBlobClient.GetContainerReference(_name);

            _appendOnly = new BlobAppendOnlyStore(_blobContainer);
            _appendOnly.InitializeWriter();
        }
 void CreateCacheFiles()
 {
     const string msg = "test messages";
     for (int index = 0; index < DataFileCount; index++)
     {
         for (int i = 0; i < FileMessagesCount; i++)
         {
             _appendOnly.Append("test-key" + index, Encoding.UTF8.GetBytes(msg + i));
         }
     }
     CloudStorageAccount cloudStorageAccount = ConnectionConfig.StorageAccount;
     var blobCLient = cloudStorageAccount.CreateCloudBlobClient();
     var blobContainer = blobCLient.GetContainerReference(_name);
     _appendOnly = new BlobAppendOnlyStore(blobContainer);
     _appendOnly.InitializeWriter();
 }