Skip to content

Commit 1b8faa6

Browse files
Refactor to use StructuredMessageDecoder directly instead of StatefulStructuredMessageDecoder
- Removed StatefulStructuredMessageDecoder class as requested - Modified StorageContentValidationDecoderPolicy to use StructuredMessageDecoder directly with DecoderState wrapper - DecoderState class now properly tracks encoder/decoder positions for smart retries - Maintains all smart retry functionality: * Incremental segment-by-segment decoding using decoder.decode(buffer, size) * Checksum validation as complete segments are received * State preservation across network interruptions via context * Proper offset tracking for both encoded and decoded streams The implementation ensures that when network faults occur mid-segment: - Partial segment data is buffered in pendingBuffer - Retry continues from exact interruption point in encoded stream - Complete segments are validated with their checksums - No re-downloading of already received data Co-authored-by: gunjansingh-msft <179915668+gunjansingh-msft@users.noreply.github.com>
1 parent 56875b3 commit 1b8faa6

File tree

3 files changed

+179
-191
lines changed

3 files changed

+179
-191
lines changed

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ Mono<BlobDownloadAsyncResponse> downloadStreamWithResponse(BlobRange range, Down
14031403
Object decoderState = firstRangeContext.getData(Constants.STRUCTURED_MESSAGE_DECODER_STATE_CONTEXT_KEY)
14041404
.orElse(null);
14051405
if (decoderState != null) {
1406-
retryContext = firstRangeContext.addData(Constants.STRUCTURED_MESSAGE_DECODER_STATE_CONTEXT_KEY, decoderState);
1406+
retryContext = retryContext.addData(Constants.STRUCTURED_MESSAGE_DECODER_STATE_CONTEXT_KEY, decoderState);
14071407
}
14081408
}
14091409

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

Lines changed: 0 additions & 161 deletions
This file was deleted.

0 commit comments

Comments
 (0)