From d58e67c217f38ca7b1926882ec48bd7b0c351ea7 Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Thu, 6 Jan 2022 14:43:22 -0500 Subject: [PATCH] docs: update comments (#1188) --- .../java/com/example/storage/ConfigureRetries.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java b/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java index 6c031e540..9d037a821 100644 --- a/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java +++ b/samples/snippets/src/main/java/com/example/storage/ConfigureRetries.java @@ -32,28 +32,27 @@ public static void main(String[] args) { } static void deleteBlob(String bucketName, String blobName) { - // Update the retry settings + // Customize retry behavior RetrySettings retrySettings = StorageOptions.getDefaultRetrySettings() .toBuilder() - // to set the max number of attempts to 10 + // Set the max number of attempts to 10 (initial attempt plus 9 retries) .setMaxAttempts(10) - // to set the backoff multiplier to 3.0 + // Set the backoff multiplier to 3.0 .setRetryDelayMultiplier(3.0) - // to set the max duration of all attempts to 5 minutes + // Set the max duration of all attempts to 5 minutes .setTotalTimeout(Duration.ofMinutes(5)) .build(); StorageOptions alwaysRetryStorageOptions = StorageOptions.newBuilder() - // Configure our options so all requests will be retried even if they are - // non-idempotent. + // Customize retry so all requests are retried even if they are non-idempotent. .setStorageRetryStrategy(StorageRetryStrategy.getUniformStorageRetryStrategy()) // provide the previously configured retrySettings .setRetrySettings(retrySettings) .build(); - // Instantiate a client with our options + // Instantiate a client Storage storage = alwaysRetryStorageOptions.getService(); // Delete the blob