Skip to content

Commit 65c1075

Browse files
authored
initial commit (#47003)
1 parent 313748c commit 65c1075

File tree

6 files changed

+69
-65
lines changed

6 files changed

+69
-65
lines changed

sdk/storage/Azure.Storage.DataMovement/src/JobPartInternal.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ await QueueChunk(
225225
}
226226
catch (Exception ex)
227227
{
228-
await InvokeFailedArg(ex).ConfigureAwait(false);
228+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
229229
}
230230
Interlocked.Increment(ref _completedChunkCount);
231231
await CheckAndUpdateCancellationStateAsync().ConfigureAwait(false);
@@ -234,9 +234,9 @@ await QueueChunk(
234234
}
235235

236236
/// <summary>
237-
/// Processes the job to job parts
237+
/// Processes the job part to chunks
238238
/// </summary>
239-
/// <returns>An IEnumerable that contains the job chunks</returns>
239+
/// <returns>The task that's queueing up the chunks</returns>
240240
public abstract Task ProcessPartToChunkAsync();
241241

242242
/// <summary>
@@ -285,11 +285,11 @@ internal async Task OnTransferStateChangedAsync(DataTransferState transferState)
285285
else if (JobPartStatus.HasCompletedSuccessfully)
286286
{
287287
_progressTracker.IncrementCompletedFiles();
288-
await InvokeSingleCompletedArg().ConfigureAwait(false);
288+
await InvokeSingleCompletedArgAsync().ConfigureAwait(false);
289289
}
290290

291291
// Set the status in the checkpointer
292-
await SetCheckpointerStatus().ConfigureAwait(false);
292+
await SetCheckpointerStatusAsync().ConfigureAwait(false);
293293

294294
await PartTransferStatusEventHandler.RaiseAsync(
295295
new TransferStatusEventArgs(
@@ -313,7 +313,7 @@ internal void ReportBytesWritten(long bytesTransferred)
313313
_progressTracker.IncrementBytesTransferred(bytesTransferred);
314314
}
315315

316-
public async virtual Task InvokeSingleCompletedArg()
316+
public async virtual Task InvokeSingleCompletedArgAsync()
317317
{
318318
if (SingleTransferCompletedEventHandler != null)
319319
{
@@ -334,7 +334,7 @@ await SingleTransferCompletedEventHandler.RaiseAsync(
334334
/// <summary>
335335
/// Invokes Skipped Argument Event.
336336
/// </summary>
337-
public async virtual Task InvokeSkippedArg()
337+
public async virtual Task InvokeSkippedArgAsync()
338338
{
339339
if (TransferSkippedEventHandler != null)
340340
{
@@ -375,7 +375,7 @@ await PartTransferStatusEventHandler.RaiseAsync(
375375
/// <summary>
376376
/// Invokes Failed Argument Event.
377377
/// </summary>
378-
public async virtual Task InvokeFailedArg(Exception ex)
378+
public async virtual Task InvokeFailedArgAsync(Exception ex)
379379
{
380380
if (ex is not OperationCanceledException &&
381381
ex is not TaskCanceledException &&
@@ -485,7 +485,7 @@ await _checkpointer.AddNewJobPartAsync(
485485
}
486486
}
487487

488-
internal async virtual Task SetCheckpointerStatus()
488+
internal async virtual Task SetCheckpointerStatusAsync()
489489
{
490490
await _checkpointer.SetJobPartStatusAsync(
491491
transferId: _dataTransfer.Id,

sdk/storage/Azure.Storage.DataMovement/src/ServiceToServiceJobPart.cs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ public static ServiceToServiceJobPart CreateJobPartFromCheckpoint(
177177
createPreference: createPreference);
178178
}
179179

180+
/// <summary>
181+
/// Processes the job part to chunks
182+
/// </summary>
183+
/// <returns>The task that's queueing up the chunks</returns>
180184
public override async Task ProcessPartToChunkAsync()
181185
{
182186
try
@@ -195,7 +199,7 @@ await _destinationResource.SetPermissionsAsync(
195199
fileLength = sourceProperties.ResourceLength;
196200
if (!fileLength.HasValue)
197201
{
198-
await InvokeFailedArg(Errors.UnableToGetLength()).ConfigureAwait(false);
202+
await InvokeFailedArgAsync(Errors.UnableToGetLength()).ConfigureAwait(false);
199203
return;
200204
}
201205
long length = fileLength.Value;
@@ -244,7 +248,7 @@ await QueueStageBlockRequest(
244248
}
245249
catch (Exception ex)
246250
{
247-
await InvokeFailedArg(ex).ConfigureAwait(false);
251+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
248252
}
249253
}
250254

@@ -269,17 +273,17 @@ await _destinationResource.CopyFromUriAsync(
269273
when (_createMode == StorageResourceCreationPreference.SkipIfExists
270274
&& exception.ErrorCode == "BlobAlreadyExists")
271275
{
272-
await InvokeSkippedArg().ConfigureAwait(false);
276+
await InvokeSkippedArgAsync().ConfigureAwait(false);
273277
}
274278
catch (InvalidOperationException ex)
275279
when (_createMode == StorageResourceCreationPreference.SkipIfExists
276280
&& ex.Message.Contains("Cannot overwrite file."))
277281
{
278-
await InvokeSkippedArg().ConfigureAwait(false);
282+
await InvokeSkippedArgAsync().ConfigureAwait(false);
279283
}
280284
catch (Exception ex)
281285
{
282-
await InvokeFailedArg(ex).ConfigureAwait(false);
286+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
283287
}
284288
}
285289

@@ -316,11 +320,11 @@ await _destinationResource.CopyBlockFromUriAsync(
316320
when (_createMode == StorageResourceCreationPreference.SkipIfExists
317321
&& exception.ErrorCode == "BlobAlreadyExists")
318322
{
319-
await InvokeSkippedArg().ConfigureAwait(false);
323+
await InvokeSkippedArgAsync().ConfigureAwait(false);
320324
}
321325
catch (Exception ex)
322326
{
323-
await InvokeFailedArg(ex).ConfigureAwait(false);
327+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
324328
}
325329
return false;
326330
}
@@ -349,7 +353,7 @@ internal static CommitChunkHandler.Behaviors GetBlockListCommitHandlerBehaviors(
349353
QueuePutBlockTask = jobPart.QueueStageBlockRequest,
350354
QueueCommitBlockTask = jobPart.CompleteTransferAsync,
351355
ReportProgressInBytes = jobPart.ReportBytesWritten,
352-
InvokeFailedHandler = jobPart.InvokeFailedArg,
356+
InvokeFailedHandler = jobPart.InvokeFailedArgAsync,
353357
};
354358
}
355359
#endregion
@@ -372,7 +376,7 @@ await _destinationResource.CompleteTransferAsync(
372376
}
373377
catch (Exception ex)
374378
{
375-
await InvokeFailedArg(ex).ConfigureAwait(false);
379+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
376380
}
377381
}
378382

@@ -456,11 +460,11 @@ await _commitBlockHandler.InvokeEvent(
456460
// before uploading to it.
457461
if (_createMode == StorageResourceCreationPreference.FailIfExists)
458462
{
459-
await InvokeFailedArg(ex).ConfigureAwait(false);
463+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
460464
}
461465
else // (_createMode == StorageResourceCreateMode.Skip)
462466
{
463-
await InvokeSkippedArg().ConfigureAwait(false);
467+
await InvokeSkippedArgAsync().ConfigureAwait(false);
464468
}
465469
}
466470
catch (Exception ex)
@@ -481,21 +485,21 @@ await _commitBlockHandler.InvokeEvent(
481485
{
482486
// If the _commitBlockHandler has been disposed before we call to it
483487
// we should at least filter the exception to error handling just in case.
484-
await InvokeFailedArg(ex).ConfigureAwait(false);
488+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
485489
}
486490
}
487491
}
488492

489-
public override async Task InvokeSkippedArg()
493+
public override async Task InvokeSkippedArgAsync()
490494
{
491495
DisposeHandlers();
492-
await base.InvokeSkippedArg().ConfigureAwait(false);
496+
await base.InvokeSkippedArgAsync().ConfigureAwait(false);
493497
}
494498

495-
public override async Task InvokeFailedArg(Exception ex)
499+
public override async Task InvokeFailedArgAsync(Exception ex)
496500
{
497501
DisposeHandlers();
498-
await base.InvokeFailedArg(ex).ConfigureAwait(false);
502+
await base.InvokeFailedArgAsync(ex).ConfigureAwait(false);
499503
}
500504

501505
internal void DisposeHandlers()

sdk/storage/Azure.Storage.DataMovement/src/StreamToUriJobPart.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public static StreamToUriJobPart CreateJobPartFromCheckpoint(
178178
}
179179

180180
/// <summary>
181-
/// Processes the job to job parts
181+
/// Processes the job part to chunks
182182
/// </summary>
183183
/// <returns>The task that's queueing up the chunks</returns>
184184
public override async Task ProcessPartToChunkAsync()
@@ -244,12 +244,12 @@ await QueueStageBlockRequest(
244244
else
245245
{
246246
// TODO: logging when given the event handler
247-
await InvokeFailedArg(Errors.UnableToGetLength()).ConfigureAwait(false);
247+
await InvokeFailedArgAsync(Errors.UnableToGetLength()).ConfigureAwait(false);
248248
}
249249
}
250250
catch (Exception ex)
251251
{
252-
await InvokeFailedArg(ex).ConfigureAwait(false);
252+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
253253
}
254254
}
255255

@@ -275,16 +275,16 @@ await InitialUploadCall(
275275
catch (RequestFailedException r)
276276
when (r.ErrorCode == "BlobAlreadyExists" && _createMode == StorageResourceCreationPreference.SkipIfExists)
277277
{
278-
await InvokeSkippedArg().ConfigureAwait(false);
278+
await InvokeSkippedArgAsync().ConfigureAwait(false);
279279
}
280280
catch (InvalidOperationException i)
281281
when (i.Message.Contains("Cannot overwrite file.") && _createMode == StorageResourceCreationPreference.SkipIfExists)
282282
{
283-
await InvokeSkippedArg().ConfigureAwait(false);
283+
await InvokeSkippedArgAsync().ConfigureAwait(false);
284284
}
285285
catch (Exception ex)
286286
{
287-
await InvokeFailedArg(ex).ConfigureAwait(false);
287+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
288288
}
289289

290290
// Do not continue if we need to skip or there was an error.
@@ -381,7 +381,7 @@ internal static CommitChunkHandler.Behaviors GetBlockListCommitHandlerBehaviors(
381381
QueuePutBlockTask = jobPart.QueueStageBlockRequest,
382382
QueueCommitBlockTask = jobPart.CompleteTransferAsync,
383383
ReportProgressInBytes = jobPart.ReportBytesWritten,
384-
InvokeFailedHandler = jobPart.InvokeFailedArg,
384+
InvokeFailedHandler = jobPart.InvokeFailedArgAsync,
385385
};
386386
}
387387
#endregion
@@ -453,7 +453,7 @@ await _commitBlockHandler.InvokeEvent(
453453
{
454454
// If the _commitBlockHandler has been disposed before we call to it
455455
// we should at least filter the exception to error handling just in case.
456-
await InvokeFailedArg(ex).ConfigureAwait(false);
456+
await InvokeFailedArgAsync(ex).ConfigureAwait(false);
457457
}
458458
}
459459
}
@@ -555,16 +555,16 @@ private static async Task<Stream> GetOffsetPartitionInternal(
555555
cancellationToken: cancellationToken).ConfigureAwait(false);
556556
}
557557

558-
public override async Task InvokeSkippedArg()
558+
public override async Task InvokeSkippedArgAsync()
559559
{
560560
DisposeHandlers();
561-
await base.InvokeSkippedArg().ConfigureAwait(false);
561+
await base.InvokeSkippedArgAsync().ConfigureAwait(false);
562562
}
563563

564-
public override async Task InvokeFailedArg(Exception ex)
564+
public override async Task InvokeFailedArgAsync(Exception ex)
565565
{
566566
DisposeHandlers();
567-
await base.InvokeFailedArg(ex).ConfigureAwait(false);
567+
await base.InvokeFailedArgAsync(ex).ConfigureAwait(false);
568568
}
569569

570570
internal void DisposeHandlers()

0 commit comments

Comments
 (0)