Skip to content

Commit 6aa3c95

Browse files
committed
aggregate checksum experimentation
1 parent e73306c commit 6aa3c95

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,15 @@ private Mono<Response<BlockBlobItem>> uploadInChunks(BlockBlobAsyncClient blockB
815815
return responseMono;
816816
})
817817
// We only care about the stageBlock insofar as it was successful, but we need to collect the ids.
818-
.map(x -> blockId);
818+
.map(x -> {
819+
// String headerV = x.getHeaders().getValue("test_context_key");
820+
// if (Objects.equals(headerV, "-1")) {
821+
// System.out.println("does not have context key");
822+
// } else {
823+
// System.out.println("has context key: " + headerV);
824+
// }
825+
return blockId;
826+
});
819827
}, parallelTransferOptions.getMaxConcurrency(), 1)
820828
.collect(Collectors.toList())
821829
.flatMap(ids -> blockBlobAsyncClient

sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/structuredmessage/StructuredMessageEncoder.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,13 @@ private void incrementCurrentSegment() {
261261
public String getEncodedMessageLength() {
262262
return String.valueOf(messageLength);
263263
}
264+
265+
// /**
266+
// * Returns the CRC64 of the message
267+
// *
268+
// * @return The CRC64 of the message
269+
// */
270+
// public long getMessageCRC64() {
271+
// return messageCRC64;
272+
// }
264273
}

sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/policy/StorageContentValidationPolicy.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNex
6161
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) {
6262
applyContentValidation(context);
6363
return next.process();
64+
65+
// long messageCRC64 = applyContentValidation(context);
66+
// return next.process().map(response -> {
67+
// if (messageCRC64 != -1) {
68+
// response.getHeaders().add("test_context_key", String.valueOf(messageCRC64));
69+
// }
70+
// return response;
71+
// });
6472
}
6573

6674
private void applyContentValidation(HttpPipelineCallContext context) {
@@ -115,6 +123,7 @@ private void applyStructuredMessage(HttpPipelineCallContext context) {
115123
// x-ms-structured-content-length
116124
context.getHttpRequest()
117125
.setHeader(STRUCTURED_CONTENT_LENGTH_HEADER_NAME, String.valueOf(unencodedContentLength));
126+
//return structuredMessageEncoder.getMessageCRC64();
118127
}
119128

120129
}

0 commit comments

Comments
 (0)