Example #1
0
        internal async Task <int> DeleteTableEntries(string deploymentId)
        {
            if (deploymentId == null)
            {
                throw new ArgumentNullException("deploymentId");
            }

            var entries = await storage.ReadAllTableEntriesForPartitionAsync(deploymentId);

            var entriesList = new List <Tuple <SiloInstanceTableEntry, string> >(entries);

            if (entriesList.Count <= AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS)
            {
                await storage.DeleteTableEntriesAsync(entriesList);
            }
            else
            {
                List <Task> tasks = new List <Task>();
                foreach (var batch in entriesList.BatchIEnumerable(AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS))
                {
                    tasks.Add(storage.DeleteTableEntriesAsync(batch));
                }
                await Task.WhenAll(tasks);
            }
            return(entriesList.Count());
        }
 private async Task DeleteEntriesBatch(List <Tuple <SiloInstanceTableEntry, string> > entriesList)
 {
     if (entriesList.Count <= this.storagePolicyOptions.MaxBulkUpdateRows)
     {
         await storage.DeleteTableEntriesAsync(entriesList);
     }
     else
     {
         var tasks = new List <Task>();
         foreach (var batch in entriesList.BatchIEnumerable(this.storagePolicyOptions.MaxBulkUpdateRows))
         {
             tasks.Add(storage.DeleteTableEntriesAsync(batch));
         }
         await Task.WhenAll(tasks);
     }
 }
 private async Task DeleteEntriesBatch(List <Tuple <SiloInstanceTableEntry, string> > entriesList)
 {
     if (entriesList.Count <= AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS)
     {
         await storage.DeleteTableEntriesAsync(entriesList);
     }
     else
     {
         var tasks = new List <Task>();
         foreach (var batch in entriesList.BatchIEnumerable(AzureTableDefaultPolicies.MAX_BULK_UPDATE_ROWS))
         {
             tasks.Add(storage.DeleteTableEntriesAsync(batch));
         }
         await Task.WhenAll(tasks);
     }
 }
Example #4
0
        internal async Task <int> DeleteTableEntries(string deploymentId)
        {
            if (deploymentId == null)
            {
                throw new ArgumentNullException("deploymentId");
            }

            var entries = await storage.ReadAllTableEntriesForPartitionAsync(deploymentId);

            var entriesList = new List <Tuple <SiloInstanceTableEntry, string> >(entries);
            await storage.DeleteTableEntriesAsync(entriesList);

            return(entriesList.Count());
        }