// Marks the partition populated unless it is already switched.
        async Task TryMarkPartitionPopulatedAsync(string partitionKey, TableRequestOptions requestOptions, OperationContext operationContext)
        {
            var markPopulatedBatch = new TableBatchOperation();

            markPopulatedBatch.Insert(new MTableEntity
            {
                PartitionKey   = partitionKey,
                RowKey         = ROW_KEY_PARTITION_META,
                partitionState = MTablePartitionState.POPULATED
            });
            markPopulatedBatch.Insert(new DynamicTableEntity
            {
                PartitionKey = partitionKey,
                RowKey       = ROW_KEY_PARTITION_POPULATED_ASSERTION
            });
            try
            {
                await oldTable.ExecuteBatchAsync(markPopulatedBatch, requestOptions, operationContext);
            }
            // XXX: Optimization opportunity: if we swap the order of the
            // inserts, we can tell here if the partition is already switched.
            catch (StorageException ex) {
                if (ex.GetHttpStatusCode() != HttpStatusCode.Conflict)
                {
                    throw ChainTableUtils.GenerateInternalException(ex);
                }
            }
            await monitor.AnnotateLastBackendCallAsync();
        }
Пример #2
0
 public override Task <IList <TableResult> > ExecuteBatchAsync(TableBatchOperation batch, TableRequestOptions requestOptions = null, OperationContext operationContext = null)
 {
     //Trace.TraceInformation("{0} calling {1}.ExecuteBatchAsync({2})", callerMachineId, debugName, BetterComparer.ToString(batch));
     return(tableCallEventProxy.ExecuteBatchAsync(batch, requestOptions, operationContext));
 }
Пример #3
0
 public override Task <IList <TableResult> > ExecuteBatchAsync(TableBatchOperation batch, TableRequestOptions requestOptions = null, OperationContext operationContext = null)
 {
     return(annotatableCallProxy.ExecuteBatchAsync(batch, requestOptions, operationContext));
 }