Source:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { Exception e = getOperationException(); if (options.getChunkIdsOnly) { operationCompleted = true; List<StoreKey> chunkIds = e == null && compositeBlobInfo != null ? compositeBlobInfo.getKeys() : null; operationResult = new GetBlobResultInternal(null, chunkIds); } else { long timeElapsed = time.milliseconds() - submissionTimeMs; if (isEncrypted) { routerMetrics.getEncryptedBlobOperationLatencyMs.update(timeElapsed); } else { routerMetrics.getBlobOperationLatencyMs.update(timeElapsed); } if (e == null) { if (blobInfo != null) { if (blobInfo.getBlobProperties().getBlobSize() != totalSize) { if (compositeBlobInfo == null) { routerMetrics.simpleBlobSizeMismatchCount.inc(); logger.debug("Blob size mismatch for simple blob: {}", getBlobIdStr()); } else { routerMetrics.compositeBlobSizeMismatchCount.inc(); logger.debug("Blob size mismatch for composite blob: {}", getBlobIdStr()); } blobInfo.getBlobProperties().setBlobSize(totalSize); } } if (options.getBlobOptions.getOperationType() != GetBlobOptions.OperationType.BlobInfo) { blobDataChannel = new BlobDataReadableStreamChannel(); } else { operationCompleted = true; } operationResult = new GetBlobResultInternal(new GetBlobResult(blobInfo, blobDataChannel), null); } else { blobDataChannel = null; operationResult = null; routerMetrics.onGetBlobError(e, options, isEncrypted); } } NonBlockingRouter.completeOperation(null, getOperationCallback, operationResult, e); } } chunk.postCompletionCleanup(); if (blobDataChannel != null) { blobDataChannel.maybeWriteToChannel(); } }

Target:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { Exception e = getOperationException(); if (options.getChunkIdsOnly) { operationCompleted = true; List<StoreKey> chunkIds = e == null && compositeBlobInfo != null ? compositeBlobInfo.getKeys() : null; operationResult = new GetBlobResultInternal(null, chunkIds); } else { long timeElapsed = time.milliseconds() - submissionTimeMs; if (isEncrypted) { routerMetrics.getEncryptedBlobOperationLatencyMs.update(timeElapsed); } else { routerMetrics.getBlobOperationLatencyMs.update(timeElapsed); } if (e == null) { if (blobInfo != null) { if (blobInfo.getBlobProperties().getBlobSize() != totalSize) { if (compositeBlobInfo != null) { routerMetrics.compositeBlobSizeMismatchCount.inc(); logger.debug("Blob size mismatch for composite blob: {}", getBlobIdStr()); } else if (blobInfo.getBlobProperties().isEncrypted()) { routerMetrics.simpleEncryptedBlobSizeMismatchCount.inc(); logger.debug("Blob size mismatch for simple encrypted blob: {}", getBlobIdStr()); } else { routerMetrics.simpleUnencryptedBlobSizeMismatchCount.inc(); logger.warn("Blob size mismatch for simple unencrypted blob (should not happen): {}", getBlobIdStr()); } blobInfo.getBlobProperties().setBlobSize(totalSize); } } if (options.getBlobOptions.getOperationType() != GetBlobOptions.OperationType.BlobInfo) { blobDataChannel = new BlobDataReadableStreamChannel(); } else { operationCompleted = true; } operationResult = new GetBlobResultInternal(new GetBlobResult(blobInfo, blobDataChannel), null); } else { blobDataChannel = null; operationResult = null; routerMetrics.onGetBlobError(e, options, isEncrypted); } } NonBlockingRouter.completeOperation(null, getOperationCallback, operationResult, e); } } chunk.postCompletionCleanup(); if (blobDataChannel != null) { blobDataChannel.maybeWriteToChannel(); } }