cameronlee314 commented on a change in pull request #1239: SAMZA-2421: Add
SystemProducer for Azure Blob Storage
URL: https://github.com/apache/samza/pull/1239#discussion_r362680171
##########
File path:
samza-azure/src/main/java/org/apache/samza/system/azureblob/avro/AzureBlobOutputStream.java
##########
@@ -268,47 +258,53 @@ private synchronized void uploadBlockAsync() {
// call async stageblock and add to future
@Override
public void run() {
- int retryCount = 0;
+ int attemptCount = 0;
byte[] compressedLocalByte = compression.compress(localByte);
int blockSize = compressedLocalByte.length;
- while (retryCount < MAX_ATTEMPT) {
+ while (attemptCount < MAX_ATTEMPT) {
try {
ByteBuffer outputStream = ByteBuffer.wrap(compressedLocalByte, 0,
blockSize);
metrics.updateCompressByteMetrics(blockSize);
LOG.info("{} Upload block start for blob: {} for block size:{}.",
blobAsyncClient.getBlobUrl().toString(), blockId, blockSize);
- // StageBlock generates exception on Failure.
metrics.updateAzureUploadMetrics();
+ // StageBlock generates exception on Failure.
blobAsyncClient.stageBlock(blockIdEncoded,
Flux.just(outputStream), blockSize).block();
break;
} catch (Exception e) {
- retryCount += 1;
+ attemptCount += 1;
String msg = "Upload block for blob: " +
blobAsyncClient.getBlobUrl().toString()
- + " failed for blockid: " + blockId + " due to exception.
RetryCount: " + retryCount;
+ + " failed for blockid: " + blockId + " due to exception.
RetryCount: " + attemptCount;
LOG.error(msg, e);
- if (retryCount == MAX_ATTEMPT) {
- throw new RuntimeException("Exceeded number of retries. Max
attempts is: " + MAX_ATTEMPT, e);
+ if (attemptCount == MAX_ATTEMPT) {
+ throw new AzureException("Exceeded number of retries. Max
attempts is: " + MAX_ATTEMPT, e);
Review comment:
Please use the term "attempt" instead of "retry" in the log messages as
well, just to make sure it is clear.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services