@@ -32,28 +32,27 @@ public static void main(String[] args) {
3232 }
3333
3434 static void deleteBlob (String bucketName , String blobName ) {
35- // Update the retry settings
35+ // Customize retry behavior
3636 RetrySettings retrySettings =
3737 StorageOptions .getDefaultRetrySettings ()
3838 .toBuilder ()
39- // to set the max number of attempts to 10
39+ // Set the max number of attempts to 10 (initial attempt plus 9 retries)
4040 .setMaxAttempts (10 )
41- // to set the backoff multiplier to 3.0
41+ // Set the backoff multiplier to 3.0
4242 .setRetryDelayMultiplier (3.0 )
43- // to set the max duration of all attempts to 5 minutes
43+ // Set the max duration of all attempts to 5 minutes
4444 .setTotalTimeout (Duration .ofMinutes (5 ))
4545 .build ();
4646
4747 StorageOptions alwaysRetryStorageOptions =
4848 StorageOptions .newBuilder ()
49- // Configure our options so all requests will be retried even if they are
50- // non-idempotent.
49+ // Customize retry so all requests are retried even if they are non-idempotent.
5150 .setStorageRetryStrategy (StorageRetryStrategy .getUniformStorageRetryStrategy ())
5251 // provide the previously configured retrySettings
5352 .setRetrySettings (retrySettings )
5453 .build ();
5554
56- // Instantiate a client with our options
55+ // Instantiate a client
5756 Storage storage = alwaysRetryStorageOptions .getService ();
5857
5958 // Delete the blob
0 commit comments