Skip to content

Commit 1645ea5

Browse files
Removes public API for transactional hashing for upcoming GA release (Azure#27259)
* revert transactional checksums * revert part 2 * exportapi * fix md5 false condition * fix mock * fix datalake mock * fix accidental file deletion * changelog Co-authored-by: jschrepp-MSFT <[email protected]> Co-authored-by: Sean McCullough <[email protected]>
1 parent 35eb8d5 commit 1645ea5

File tree

67 files changed

+2703
-2442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2703
-2442
lines changed

sdk/storage/Azure.Storage.Blobs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Fixed a bug where BlobBaseClient.DownloadTo() would result in an ObjectDisposedException on .NET Framework in certain network conditions.
77
- Added nullable version of `BlobProperties.CopyStatus` called `BlobCopyStatus`, allowing a null value when Storage doesn't return a value.
88
- Fixed a bug where BlobContainerClient.GetProperties() would throw an ArgumentNullException when the AccessPolicy was null
9+
- Removed preview support for SDK-calculated transactional checksums on data transfer.
910

1011
## 12.11.0-beta.3 (2022-02-07)
1112
- Added support for service version 2021-04-10.

sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ public partial class AppendBlobAppendBlockOptions
265265
public AppendBlobAppendBlockOptions() { }
266266
public Azure.Storage.Blobs.Models.AppendBlobRequestConditions Conditions { get { throw null; } set { } }
267267
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
268-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
269268
}
270269
public partial class AppendBlobCreateOptions
271270
{
@@ -283,7 +282,6 @@ public AppendBlobOpenWriteOptions() { }
283282
public long? BufferSize { get { throw null; } set { } }
284283
public Azure.Storage.Blobs.Models.AppendBlobRequestConditions OpenConditions { get { throw null; } set { } }
285284
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
286-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
287285
}
288286
public partial class AppendBlobRequestConditions : Azure.Storage.Blobs.Models.BlobRequestConditions
289287
{
@@ -509,7 +507,6 @@ public BlobDownloadOptions() { }
509507
public Azure.Storage.Blobs.Models.BlobRequestConditions Conditions { get { throw null; } set { } }
510508
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
511509
public Azure.HttpRange Range { get { throw null; } set { } }
512-
public Azure.Storage.DownloadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
513510
}
514511
public partial class BlobDownloadResult
515512
{
@@ -529,7 +526,6 @@ public partial class BlobDownloadToOptions
529526
public BlobDownloadToOptions() { }
530527
public Azure.Storage.Blobs.Models.BlobRequestConditions Conditions { get { throw null; } set { } }
531528
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
532-
public Azure.Storage.DownloadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
533529
public Azure.Storage.StorageTransferOptions TransferOptions { get { throw null; } set { } }
534530
}
535531
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
@@ -808,7 +804,6 @@ public BlobOpenReadOptions(bool allowModifications) { }
808804
public int? BufferSize { get { throw null; } set { } }
809805
public Azure.Storage.Blobs.Models.BlobRequestConditions Conditions { get { throw null; } set { } }
810806
public long Position { get { throw null; } set { } }
811-
public Azure.Storage.DownloadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
812807
}
813808
public partial class BlobOpenWriteOptions
814809
{
@@ -819,7 +814,6 @@ public BlobOpenWriteOptions() { }
819814
public Azure.Storage.Blobs.Models.BlobRequestConditions OpenConditions { get { throw null; } set { } }
820815
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
821816
public System.Collections.Generic.IDictionary<string, string> Tags { get { throw null; } set { } }
822-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
823817
}
824818
public partial class BlobProperties
825819
{
@@ -1128,7 +1122,6 @@ public BlobUploadOptions() { }
11281122
public System.Collections.Generic.IDictionary<string, string> Metadata { get { throw null; } set { } }
11291123
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
11301124
public System.Collections.Generic.IDictionary<string, string> Tags { get { throw null; } set { } }
1131-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
11321125
public Azure.Storage.StorageTransferOptions TransferOptions { get { throw null; } set { } }
11331126
}
11341127
public partial class BlockBlobOpenWriteOptions
@@ -1140,14 +1133,12 @@ public BlockBlobOpenWriteOptions() { }
11401133
public Azure.Storage.Blobs.Models.BlobRequestConditions OpenConditions { get { throw null; } set { } }
11411134
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
11421135
public System.Collections.Generic.IDictionary<string, string> Tags { get { throw null; } set { } }
1143-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
11441136
}
11451137
public partial class BlockBlobStageBlockOptions
11461138
{
11471139
public BlockBlobStageBlockOptions() { }
11481140
public Azure.Storage.Blobs.Models.BlobRequestConditions Conditions { get { throw null; } set { } }
11491141
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
1150-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
11511142
}
11521143
public partial class BlockInfo
11531144
{
@@ -1299,7 +1290,6 @@ public PageBlobOpenWriteOptions() { }
12991290
public Azure.Storage.Blobs.Models.PageBlobRequestConditions OpenConditions { get { throw null; } set { } }
13001291
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
13011292
public long? Size { get { throw null; } set { } }
1302-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
13031293
}
13041294
public partial class PageBlobRequestConditions : Azure.Storage.Blobs.Models.BlobRequestConditions
13051295
{
@@ -1321,7 +1311,6 @@ public partial class PageBlobUploadPagesOptions
13211311
public PageBlobUploadPagesOptions() { }
13221312
public Azure.Storage.Blobs.Models.PageBlobRequestConditions Conditions { get { throw null; } set { } }
13231313
public System.IProgress<long> ProgressHandler { get { throw null; } set { } }
1324-
public Azure.Storage.UploadTransactionalHashingOptions TransactionalHashingOptions { get { throw null; } set { } }
13251314
}
13261315
public partial class PageInfo
13271316
{

sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,20 +1010,22 @@ public virtual Response<BlobAppendInfo> AppendBlock(
10101010
{
10111011
options = new AppendBlobAppendBlockOptions()
10121012
{
1013-
TransactionalHashingOptions = transactionalContentHash != default
1014-
? new UploadTransactionalHashingOptions()
1015-
{
1016-
Algorithm = TransactionalHashAlgorithm.MD5,
1017-
PrecalculatedHash = transactionalContentHash
1018-
}
1019-
: default,
1013+
// TODO #27253
1014+
//TransactionalHashingOptions = transactionalContentHash != default
1015+
// ? new UploadTransactionalHashingOptions()
1016+
// {
1017+
// Algorithm = TransactionalHashAlgorithm.MD5,
1018+
// PrecalculatedHash = transactionalContentHash
1019+
// }
1020+
// : default,
10201021
Conditions = conditions,
10211022
ProgressHandler = progressHandler
10221023
};
10231024
}
10241025
return AppendBlockInternal(
10251026
content,
10261027
options,
1028+
transactionalContentHash,
10271029
false, // async
10281030
cancellationToken)
10291031
.EnsureCompleted();
@@ -1085,20 +1087,22 @@ public virtual async Task<Response<BlobAppendInfo>> AppendBlockAsync(
10851087
{
10861088
options = new AppendBlobAppendBlockOptions()
10871089
{
1088-
TransactionalHashingOptions = transactionalContentHash != default
1089-
? new UploadTransactionalHashingOptions()
1090-
{
1091-
Algorithm = TransactionalHashAlgorithm.MD5,
1092-
PrecalculatedHash = transactionalContentHash
1093-
}
1094-
: default,
1090+
// TODO #27253
1091+
//TransactionalHashingOptions = transactionalContentHash != default
1092+
// ? new UploadTransactionalHashingOptions()
1093+
// {
1094+
// Algorithm = TransactionalHashAlgorithm.MD5,
1095+
// PrecalculatedHash = transactionalContentHash
1096+
// }
1097+
// : default,
10951098
Conditions = conditions,
10961099
ProgressHandler = progressHandler
10971100
};
10981101
}
10991102
return await AppendBlockInternal(
11001103
content,
11011104
options,
1105+
transactionalContentHash,
11021106
true, // async
11031107
cancellationToken)
11041108
.ConfigureAwait(false);
@@ -1141,6 +1145,7 @@ public virtual Response<BlobAppendInfo> AppendBlock(
11411145
AppendBlockInternal(
11421146
content,
11431147
options,
1148+
transactionalContentMD5: default,
11441149
false, // async
11451150
cancellationToken)
11461151
.EnsureCompleted();
@@ -1182,6 +1187,7 @@ public virtual async Task<Response<BlobAppendInfo>> AppendBlockAsync(
11821187
await AppendBlockInternal(
11831188
content,
11841189
options,
1190+
transactionalContentMD5: default,
11851191
true, // async
11861192
cancellationToken)
11871193
.ConfigureAwait(false);
@@ -1204,6 +1210,9 @@ await AppendBlockInternal(
12041210
/// <param name="options">
12051211
/// Optional parameters.
12061212
/// </param>
1213+
/// <param name="transactionalContentMD5">
1214+
/// Transactional MD5 for content verification.
1215+
/// </param>
12071216
/// <param name="async">
12081217
/// Whether to invoke the operation asynchronously.
12091218
/// </param>
@@ -1222,6 +1231,7 @@ await AppendBlockInternal(
12221231
internal async Task<Response<BlobAppendInfo>> AppendBlockInternal(
12231232
Stream content,
12241233
AppendBlobAppendBlockOptions options,
1234+
byte[] transactionalContentMD5,
12251235
bool async,
12261236
CancellationToken cancellationToken)
12271237
{
@@ -1250,7 +1260,8 @@ internal async Task<Response<BlobAppendInfo>> AppendBlockInternal(
12501260
Errors.VerifyStreamPosition(content, nameof(content));
12511261

12521262
// compute hash BEFORE attaching progress handler
1253-
ContentHasher.GetHashResult hashResult = ContentHasher.GetHashOrDefault(content, options?.TransactionalHashingOptions);
1263+
// TODO #27253
1264+
//ContentHasher.GetHashResult hashResult = ContentHasher.GetHashOrDefault(content, options?.TransactionalHashingOptions);
12541265

12551266
content = content.WithNoDispose().WithProgress(options?.ProgressHandler);
12561267

@@ -1261,8 +1272,9 @@ internal async Task<Response<BlobAppendInfo>> AppendBlockInternal(
12611272
response = await AppendBlobRestClient.AppendBlockAsync(
12621273
contentLength: (content.Length - content.Position),
12631274
body: content,
1264-
transactionalContentCrc64: hashResult?.StorageCrc64,
1265-
transactionalContentMD5: hashResult?.MD5,
1275+
// TODO #27253
1276+
//transactionalContentCrc64: hashResult?.StorageCrc64,
1277+
transactionalContentMD5: transactionalContentMD5, //hashResult?.MD5,
12661278
leaseId: options?.Conditions?.LeaseId,
12671279
maxSize: options?.Conditions?.IfMaxSizeLessThanOrEqual,
12681280
appendPosition: options?.Conditions?.IfAppendPositionEqual,
@@ -1283,8 +1295,9 @@ internal async Task<Response<BlobAppendInfo>> AppendBlockInternal(
12831295
response = AppendBlobRestClient.AppendBlock(
12841296
contentLength: (content.Length - content.Position),
12851297
body: content,
1286-
transactionalContentCrc64: hashResult?.StorageCrc64,
1287-
transactionalContentMD5: hashResult?.MD5,
1298+
// TODO #27253
1299+
//transactionalContentCrc64: hashResult?.StorageCrc64,
1300+
transactionalContentMD5: transactionalContentMD5, //hashResult?.MD5,
12881301
leaseId: options?.Conditions?.LeaseId,
12891302
maxSize: options?.Conditions?.IfMaxSizeLessThanOrEqual,
12901303
appendPosition: options?.Conditions?.IfAppendPositionEqual,
@@ -2050,8 +2063,10 @@ private async Task<Stream> OpenWriteInternal(
20502063
bufferSize: options?.BufferSize ?? Constants.DefaultBufferSize,
20512064
position: position,
20522065
conditions: conditions,
2053-
progressHandler: options?.ProgressHandler,
2054-
hashingOptions: options?.TransactionalHashingOptions);
2066+
progressHandler: options?.ProgressHandler
2067+
// TODO #27253
2068+
//options?.TransactionalHashingOptions
2069+
);
20552070
}
20562071
catch (Exception ex)
20572072
{

sdk/storage/Azure.Storage.Blobs/src/AppendBlobWriteStream.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ public AppendBlobWriteStream(
2020
long bufferSize,
2121
long position,
2222
AppendBlobRequestConditions conditions,
23-
IProgress<long> progressHandler,
24-
UploadTransactionalHashingOptions hashingOptions) : base(
23+
IProgress<long> progressHandler
24+
// TODO #27253
25+
//UploadTransactionalHashingOptions hashingOptions
26+
) : base(
2527
position,
2628
bufferSize,
27-
progressHandler,
28-
hashingOptions)
29+
progressHandler
30+
// TODO #27253
31+
//hashingOptions
32+
)
2933
{
3034
ValidateBufferSize(bufferSize);
3135
_appendBlobClient = appendBlobClient;
@@ -44,10 +48,13 @@ protected override async Task AppendInternal(
4448
content: _buffer,
4549
new AppendBlobAppendBlockOptions()
4650
{
47-
TransactionalHashingOptions = _hashingOptions,
51+
// TODO #27253
52+
//TransactionalHashingOptions = _hashingOptions,
4853
Conditions = _conditions,
4954
ProgressHandler = _progressHandler
5055
},
56+
// TODO #27253
57+
transactionalContentMD5: default,
5158
async: async,
5259
cancellationToken: cancellationToken)
5360
.ConfigureAwait(false);

0 commit comments

Comments
 (0)