Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge transferjobinternal #46540

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove child types
  • Loading branch information
jaschrep-msft committed Oct 10, 2024
commit 52c40d6952302c7b0dda2f57b987d7bbbd9d6aa4
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ await checkpointer.AddNewJobAsync(
It.IsAny<StorageResourceContainer>(),
It.IsAny<CancellationToken>()))
.Returns(GetStorageResourceItemsAsyncEnumerable(blobItems));
ServiceToServiceTransferJob transferJob = new ServiceToServiceTransferJob(
TransferJobInternal transferJob = new(
new DataTransfer(id: transferId),
sourceMock.Object,
destinationMock.Object,
ServiceToServiceJobPart.CreateJobPartAsync,
ServiceToServiceJobPart.CreateJobPartAsync,
new DataTransferOptions(),
checkpointer,
DataTransferErrorMode.StopOnAnyFailure,
Expand Down Expand Up @@ -164,10 +166,12 @@ await checkpointer.AddNewJobAsync(
It.IsAny<StorageResourceContainer>(),
It.IsAny<CancellationToken>()))
.Returns(GetStorageResourceItemsAsyncEnumerable(blobItems));
ServiceToServiceTransferJob transferJob = new ServiceToServiceTransferJob(
TransferJobInternal transferJob = new(
new DataTransfer(id: transferId),
sourceMock.Object,
destinationMock.Object,
ServiceToServiceJobPart.CreateJobPartAsync,
ServiceToServiceJobPart.CreateJobPartAsync,
new DataTransferOptions(),
checkpointer,
DataTransferErrorMode.StopOnAnyFailure,
Expand Down
319 changes: 102 additions & 217 deletions sdk/storage/Azure.Storage.DataMovement/src/JobBuilder.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private ServiceToServiceJobPart(
/// Creating transfer job based on a checkpoint file.
/// </summary>
private ServiceToServiceJobPart(
ServiceToServiceTransferJob job,
TransferJobInternal job,
int partNumber,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource,
Expand Down Expand Up @@ -157,7 +157,7 @@ public static async Task<JobPartInternal> CreateJobPartAsync(
/// Called when creating a job part from a checkpoint file on resume.
/// </summary>
public static ServiceToServiceJobPart CreateJobPartFromCheckpoint(
ServiceToServiceTransferJob job,
TransferJobInternal job,
int partNumber,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ internal static StorageResourceItemProperties ToStorageResourceProperties(this F
properties: properties);
}

public static StreamToUriJobPart ToJobPartAsync(
this StreamToUriTransferJob baseJob,
public static StreamToUriJobPart ToStreamToUriJobPartAsync(
this TransferJobInternal baseJob,
Stream planFileStream,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource)
Expand Down Expand Up @@ -53,8 +53,8 @@ public static StreamToUriJobPart ToJobPartAsync(
return jobPart;
}

public static ServiceToServiceJobPart ToJobPartAsync(
this ServiceToServiceTransferJob baseJob,
public static ServiceToServiceJobPart ToServiceToServiceJobPartAsync(
this TransferJobInternal baseJob,
Stream planFileStream,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource)
Expand Down Expand Up @@ -85,8 +85,8 @@ public static ServiceToServiceJobPart ToJobPartAsync(
return jobPart;
}

public static UriToStreamJobPart ToJobPartAsync(
this UriToStreamTransferJob baseJob,
public static UriToStreamJobPart ToUriToStreamJobPartAsync(
this TransferJobInternal baseJob,
Stream planFileStream,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource)
Expand Down Expand Up @@ -117,8 +117,8 @@ public static UriToStreamJobPart ToJobPartAsync(
return jobPart;
}

public static StreamToUriJobPart ToJobPartAsync(
this StreamToUriTransferJob baseJob,
public static StreamToUriJobPart ToStreamToUriJobPartAsync(
this TransferJobInternal baseJob,
Stream planFileStream,
StorageResourceContainer sourceResource,
StorageResourceContainer destinationResource)
Expand Down Expand Up @@ -153,8 +153,8 @@ public static StreamToUriJobPart ToJobPartAsync(
return jobPart;
}

public static ServiceToServiceJobPart ToJobPartAsync(
this ServiceToServiceTransferJob baseJob,
public static ServiceToServiceJobPart ToServiceToServiceJobPartAsync(
this TransferJobInternal baseJob,
Stream planFileStream,
StorageResourceContainer sourceResource,
StorageResourceContainer destinationResource)
Expand Down Expand Up @@ -187,8 +187,8 @@ public static ServiceToServiceJobPart ToJobPartAsync(
return jobPart;
}

public static UriToStreamJobPart ToJobPartAsync(
this UriToStreamTransferJob baseJob,
public static UriToStreamJobPart ToUriToStreamJobPartAsync(
this TransferJobInternal baseJob,
Stream planFileStream,
StorageResourceContainer sourceResource,
StorageResourceContainer destinationResource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private StreamToUriJobPart(
/// Creating transfer job based on a checkpoint file.
/// </summary>
private StreamToUriJobPart(
StreamToUriTransferJob job,
TransferJobInternal job,
int partNumber,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource,
Expand Down Expand Up @@ -157,7 +157,7 @@ public static async Task<JobPartInternal> CreateJobPartAsync(
/// Called when creating a job part from a checkpoint file on resume.
/// </summary>
public static StreamToUriJobPart CreateJobPartFromCheckpoint(
StreamToUriTransferJob job,
TransferJobInternal job,
int partNumber,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Azure.Storage.DataMovement
{
internal abstract class TransferJobInternal : IDisposable
internal class TransferJobInternal : IDisposable
{
internal delegate Task<JobPartInternal> CreateJobPartSingleAsync(
TransferJobInternal job,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private UriToStreamJobPart(
/// Creating transfer job based on a checkpoint file.
/// </summary>
private UriToStreamJobPart(
UriToStreamTransferJob job,
TransferJobInternal job,
int partNumber,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource,
Expand Down Expand Up @@ -159,7 +159,7 @@ public static async Task<JobPartInternal> CreateJobPartAsync(
/// Called when creating a job part from a checkpoint file on resume.
/// </summary>
public static UriToStreamJobPart CreateJobPartFromCheckpoint(
UriToStreamTransferJob job,
TransferJobInternal job,
int partNumber,
StorageResourceItem sourceResource,
StorageResourceItem destinationResource,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private Mock<StorageResourceItem> GetRemoteDestinationResource(bool throwOnDelet

private void AssertBaseSource(Mock<StorageResourceItem> source)
{
source.Verify(b => b.Uri, Times.Exactly(6));
source.Verify(b => b.Uri, Times.Exactly(8));
source.Verify(b => b.ProviderId, Times.Once());
source.Verify(b => b.ResourceId, Times.Once());
source.Verify(b => b.Length, Times.Once());
Expand Down Expand Up @@ -111,7 +111,7 @@ public async Task CleanupAfterFailureAsync()

// Assert
AssertBaseSource(sourceMock);
destMock.Verify(b => b.Uri, Times.Exactly(5));
destMock.Verify(b => b.Uri, Times.Exactly(6));
destMock.Verify(b => b.ProviderId, Times.Once());
destMock.Verify(b => b.ResourceId, Times.Once());
destMock.Verify(b => b.MaxSupportedChunkSize, Times.Exactly(2));
Expand Down Expand Up @@ -154,7 +154,7 @@ public async Task ErrorThrownDuringCleanup()

// Assert
AssertBaseSource(sourceMock);
destMock.Verify(b => b.Uri, Times.Exactly(5));
destMock.Verify(b => b.Uri, Times.Exactly(6));
destMock.Verify(b => b.ProviderId, Times.Once());
destMock.Verify(b => b.ResourceId, Times.Once());
destMock.Verify(b => b.MaxSupportedChunkSize, Times.Exactly(2));
Expand Down
Loading
Loading