Skip to content

Commit

Permalink
[Storage] [DataMovement] [Archboard feedback] Renamed *CheckpointData…
Browse files Browse the repository at this point in the history
… to *CheckpointDetails (#47776)

* Renamed *CheckpointData to *CheckpointDetails

* Export API

* Updated changelog
  • Loading branch information
amnguye authored Jan 14, 2025
1 parent 9d19f27 commit 9de236f
Show file tree
Hide file tree
Showing 53 changed files with 462 additions and 458 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ protected override async Task<bool> DeleteIfExistsAsync(CancellationToken cancel
return await BlobClient.DeleteIfExistsAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
}

protected override StorageResourceCheckpointData GetSourceCheckpointData()
protected override StorageResourceCheckpointDetails GetSourceCheckpointDetails()
{
return new BlobSourceCheckpointData();
return new BlobSourceCheckpointDetails();
}

protected override StorageResourceCheckpointData GetDestinationCheckpointData()
protected override StorageResourceCheckpointDetails GetDestinationCheckpointDetails()
{
return new BlobDestinationCheckpointData(
return new BlobDestinationCheckpointDetails(
blobType: new(BlobType.Append),
contentType: _options?.ContentType,
contentEncoding: _options?.ContentEncoding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Azure.Storage.DataMovement.Blobs
{
internal class BlobDestinationCheckpointData : StorageResourceCheckpointData
internal class BlobDestinationCheckpointDetails : StorageResourceCheckpointDetails
{
public int Version;

Expand Down Expand Up @@ -66,7 +66,7 @@ internal class BlobDestinationCheckpointData : StorageResourceCheckpointData

public override int Length => CalculateLength();

public BlobDestinationCheckpointData(
public BlobDestinationCheckpointDetails(
DataTransferProperty<BlobType?> blobType,
DataTransferProperty<string> contentType,
DataTransferProperty<string> contentEncoding,
Expand All @@ -77,7 +77,7 @@ public BlobDestinationCheckpointData(
DataTransferProperty<Metadata> metadata,
DataTransferProperty<Tags> tags)
{
Version = DataMovementBlobConstants.DestinationCheckpointData.SchemaVersion;
Version = DataMovementBlobConstants.DestinationCheckpointDetails.SchemaVersion;
BlobType = blobType;
PreserveBlobType = blobType?.Preserve ?? true;
BlobTypeValue = blobType?.Value != default ? blobType.Value : default;
Expand Down Expand Up @@ -117,7 +117,7 @@ protected override void Serialize(Stream stream)
{
Argument.AssertNotNull(stream, nameof(stream));

int currentVariableLengthIndex = DataMovementBlobConstants.DestinationCheckpointData.VariableLengthStartIndex;
int currentVariableLengthIndex = DataMovementBlobConstants.DestinationCheckpointDetails.VariableLengthStartIndex;
BinaryWriter writer = new BinaryWriter(stream);

// Version
Expand Down Expand Up @@ -258,15 +258,15 @@ protected override void Serialize(Stream stream)
}
}

internal static BlobDestinationCheckpointData Deserialize(Stream stream)
internal static BlobDestinationCheckpointDetails Deserialize(Stream stream)
{
Argument.AssertNotNull(stream, nameof(stream));

BinaryReader reader = new BinaryReader(stream);

// Version
int version = reader.ReadInt32();
if (version != DataMovementBlobConstants.DestinationCheckpointData.SchemaVersion)
if (version != DataMovementBlobConstants.DestinationCheckpointDetails.SchemaVersion)
{
throw Errors.UnsupportedJobSchemaVersionHeader(version);
}
Expand Down Expand Up @@ -376,7 +376,7 @@ internal static BlobDestinationCheckpointData Deserialize(Stream stream)
tagsString = reader.ReadBytes(tagsLength).AsString();
}

return new BlobDestinationCheckpointData(
return new BlobDestinationCheckpointDetails(
blobType: preserveBlobType ? new(preserveBlobType) : new(blobType),
contentType: preserveContentType ? new(preserveContentType) : new(contentType),
contentEncoding: preserveContentEncoding ? new(preserveContentEncoding): new(contentEncoding),
Expand All @@ -392,7 +392,7 @@ private int CalculateLength()
{
// Length is calculated based on whether the property is preserved.
// If the property is preserved, the property's length is added to the total length.
int length = DataMovementBlobConstants.DestinationCheckpointData.VariableLengthStartIndex;
int length = DataMovementBlobConstants.DestinationCheckpointDetails.VariableLengthStartIndex;
if (!PreserveContentType)
{
length += ContentTypeBytes.Length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

namespace Azure.Storage.DataMovement.Blobs
{
internal class BlobSourceCheckpointData : StorageResourceCheckpointData
internal class BlobSourceCheckpointDetails : StorageResourceCheckpointDetails
{
public override int Length => 0;

protected override void Serialize(Stream stream)
{
}

internal static BlobSourceCheckpointData Deserialize(Stream stream) => new();
internal static BlobSourceCheckpointDetails Deserialize(Stream stream) => new();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ protected override async IAsyncEnumerable<StorageResource> GetStorageResourcesAs
}
}

protected override StorageResourceCheckpointData GetSourceCheckpointData()
protected override StorageResourceCheckpointDetails GetSourceCheckpointDetails()
{
// Source blob type does not matter for container
return new BlobSourceCheckpointData();
return new BlobSourceCheckpointDetails();
}

protected override StorageResourceCheckpointData GetDestinationCheckpointData()
=> new BlobDestinationCheckpointData(
protected override StorageResourceCheckpointDetails GetDestinationCheckpointDetails()
=> new BlobDestinationCheckpointDetails(
blobType: _options?.BlobType,
contentType: _options?.BlobOptions?.ContentType,
contentEncoding: _options?.BlobOptions?.ContentEncoding,
Expand Down
Loading

0 comments on commit 9de236f

Please sign in to comment.