Skip to content

Commit

Permalink
docs: update comments (#1188)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWhitehead committed Jan 6, 2022
1 parent 8634c4b commit d58e67c
Showing 1 changed file with 6 additions and 7 deletions.
Expand Up @@ -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
Expand Down

0 comments on commit d58e67c

Please sign in to comment.