Skip to content

Commit 2106aae

Browse files
committed
More detailed javadoc for options.retryParams and RetryParams
1 parent 2ffd822 commit 2106aae

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

gcloud-java-core/src/main/java/com/google/gcloud/RetryParams.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public final class RetryParams implements Serializable {
6666
private static final RetryParams NO_RETRIES =
6767
builder().retryMaxAttempts(1).retryMinAttempts(1).build();
6868

69-
7069
/**
7170
* RetryParams builder.
7271
*/
@@ -206,47 +205,53 @@ public static RetryParams getDefaultInstance() {
206205
return DEFAULT_INSTANCE;
207206
}
208207

208+
/**
209+
* Returns an instance of {@code RetryParams} where `retryMaxAttempts` and `retryMinAttempts` are
210+
* set to `1`.
211+
*/
209212
public static RetryParams noRetries() {
210213
return NO_RETRIES;
211214
}
212215

213216
/**
214-
* Returns the retryMinAttempts.
217+
* Returns the retryMinAttempts. Default value is {@link #DEFAULT_RETRY_MIN_ATTEMPTS}.
215218
*/
216219
public int getRetryMinAttempts() {
217220
return retryMinAttempts;
218221
}
219222

220223
/**
221-
* Returns the retryMaxAttempts.
224+
* Returns the retryMaxAttempts. Default value is {@link #DEFAULT_RETRY_MAX_ATTEMPTS}.
222225
*/
223226
public int getRetryMaxAttempts() {
224227
return retryMaxAttempts;
225228
}
226229

227230
/**
228-
* Returns the initialRetryDelayMillis.
231+
* Returns the initialRetryDelayMillis. Default value is
232+
* {@link #DEFAULT_INITIAL_RETRY_DELAY_MILLIS}.
229233
*/
230234
public long getInitialRetryDelayMillis() {
231235
return initialRetryDelayMillis;
232236
}
233237

234238
/**
235-
* Returns the maxRetryDelayMillis.
239+
* Returns the maxRetryDelayMillis. Default values is {@link #DEFAULT_MAX_RETRY_DELAY_MILLIS}.
236240
*/
237241
public long getMaxRetryDelayMillis() {
238242
return maxRetryDelayMillis;
239243
}
240244

241245
/**
242-
* Returns the maxRetryDelayBackoffFactor.
246+
* Returns the maxRetryDelayBackoffFactor. Default values is
247+
* {@link #DEFAULT_RETRY_DELAY_BACKOFF_FACTOR}.
243248
*/
244249
public double getRetryDelayBackoffFactor() {
245250
return retryDelayBackoffFactor;
246251
}
247252

248253
/**
249-
* Returns the totalRetryPeriodMillis.
254+
* Returns the totalRetryPeriodMillis. Default value is {@link #DEFAULT_TOTAL_RETRY_PERIOD_MILLIS}.
250255
*/
251256
public long getTotalRetryPeriodMillis() {
252257
return totalRetryPeriodMillis;

gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.gcloud;
1818

19-
2019
import static com.google.common.base.MoreObjects.firstNonNull;
2120
import static com.google.common.base.Preconditions.checkNotNull;
2221
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -167,7 +166,8 @@ public B authCredentials(AuthCredentials authCredentials) {
167166
}
168167

169168
/**
170-
* Sets configuration parameters for request retries.
169+
* Sets configuration parameters for request retries. If no configuration is set
170+
* {@link RetryParams#noRetries()} is used.
171171
*
172172
* @return the builder.
173173
*/
@@ -367,7 +367,8 @@ public AuthCredentials authCredentials() {
367367
}
368368

369369
/**
370-
* Returns configuration parameters for request retries.
370+
* Returns configuration parameters for request retries. By default requests are not retried:
371+
* {@link RetryParams#noRetries()} is used.
371372
*/
372373
public RetryParams retryParams() {
373374
return retryParams != null ? retryParams : RetryParams.noRetries();

0 commit comments

Comments
 (0)