-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Storage] OpenWrite - support for metadata, tags and headers #15023
Changes from all commits
78abf66
e7907a4
58814fc
1286434
324afd0
b216c89
1c9e87d
712ecda
ad612b5
5849bef
1bcba8b
8a2e048
1bf033e
b35274e
feb0649
5974722
9252944
f90886e
3b9b259
f97e9bd
ae9d658
4a24b96
e970ed7
ed559ba
f477f9a
70bac18
342d763
4c8ee0b
96b04f0
884d270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,19 @@ internal class BlockBlobWriteStream : StorageWriteStream | |
private readonly BlockBlobClient _blockBlobClient; | ||
private readonly BlobRequestConditions _conditions; | ||
private readonly List<string> _blockIds; | ||
private readonly BlobHttpHeaders _blobHttpHeaders; | ||
private readonly IDictionary<string, string> _metadata; | ||
private readonly IDictionary<string, string> _tags; | ||
|
||
public BlockBlobWriteStream( | ||
BlockBlobClient blockBlobClient, | ||
long bufferSize, | ||
long position, | ||
BlobRequestConditions conditions, | ||
IProgress<long> progressHandler) : base( | ||
IProgress<long> progressHandler, | ||
BlobHttpHeaders blobHttpHeaders, | ||
IDictionary<string, string> metadata, | ||
IDictionary<string, string> tags) : base( | ||
position, | ||
bufferSize, | ||
progressHandler) | ||
|
@@ -32,6 +38,9 @@ public BlockBlobWriteStream( | |
_blockBlobClient = blockBlobClient; | ||
_conditions = conditions ?? new BlobRequestConditions(); | ||
_blockIds = new List<string>(); | ||
_blobHttpHeaders = blobHttpHeaders; | ||
_metadata = metadata; | ||
_tags = tags; | ||
} | ||
|
||
protected override async Task AppendInternal(bool async, CancellationToken cancellationToken) | ||
|
@@ -63,9 +72,9 @@ protected override async Task FlushInternal(bool async, CancellationToken cancel | |
|
||
Response<BlobContentInfo> response = await _blockBlobClient.CommitBlockListInternal( | ||
base64BlockIds: _blockIds, | ||
blobHttpHeaders: default, | ||
metadata: default, | ||
tags: default, | ||
blobHttpHeaders: _blobHttpHeaders, | ||
metadata: _metadata, | ||
tags: _tags, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to set these on every There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good idea. I overlooked empty blob creation part. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did an experiment. Last flush wins unfortunatelly (even with "default" values) |
||
conditions: _conditions, | ||
accessTier: default, | ||
async: async, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also do this when creating the empty blob above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed