File tree Expand file tree Collapse file tree
gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery
gcloud-java-datastore/src/main/java/com/google/gcloud/datastore
gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager
gcloud-java-storage/src/main/java/com/google/gcloud/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717package com .google .gcloud .bigquery ;
1818
1919import com .google .common .collect .ImmutableSet ;
20+ import com .google .gcloud .RetryParams ;
2021import com .google .gcloud .ServiceOptions ;
2122import com .google .gcloud .spi .BigQueryRpc ;
2223import com .google .gcloud .spi .BigQueryRpcFactory ;
@@ -104,8 +105,17 @@ public boolean equals(Object obj) {
104105 return baseEquals (other );
105106 }
106107
108+ /**
109+ * Returns a default {@code BigQueryOptions} instance with the retry strategy defined by
110+ * {@link RetryParams#defaultInstance}. To disable retries, supply {@link RetryParams#noRetries}
111+ * to the {@code BigQueryOptions} builder, like so:
112+ * <pre> {@code
113+ * BigQueryOptions options =
114+ * BigQueryOptions.builder().retryParams(RetryParams.noRetries()).build();
115+ * }
116+ */
107117 public static BigQueryOptions defaultInstance () {
108- return builder ().build ();
118+ return builder ().retryParams ( RetryParams . defaultInstance ()). build ();
109119 }
110120
111121 public static Builder builder () {
Original file line number Diff line number Diff line change 2323import com .google .api .services .datastore .DatastoreV1 .LookupResponse ;
2424import com .google .common .collect .ImmutableSet ;
2525import com .google .common .collect .Iterables ;
26+ import com .google .gcloud .RetryParams ;
2627import com .google .gcloud .ServiceOptions ;
2728import com .google .gcloud .spi .DatastoreRpc ;
2829import com .google .gcloud .spi .DatastoreRpc .DatastoreRpcException ;
@@ -174,10 +175,16 @@ public String namespace() {
174175 }
175176
176177 /**
177- * Returns a default {@code DatastoreOptions} instance.
178+ * Returns a default {@code DatastoreOptions} instance with the retry strategy defined by
179+ * {@link RetryParams#defaultInstance}. To disable retries, supply {@link RetryParams#noRetries}
180+ * to the {@code DatastoreOptions} builder, like so:
181+ * <pre> {@code
182+ * DatastoreOptions options =
183+ * DatastoreOptions.builder().retryParams(RetryParams.noRetries()).build();
184+ * }
178185 */
179186 public static DatastoreOptions defaultInstance () {
180- return builder ().build ();
187+ return builder ().retryParams ( RetryParams . defaultInstance ()). build ();
181188 }
182189
183190 private static String defaultNamespace () {
Original file line number Diff line number Diff line change 1717package com .google .gcloud .resourcemanager ;
1818
1919import com .google .common .collect .ImmutableSet ;
20+ import com .google .gcloud .RetryParams ;
2021import com .google .gcloud .ServiceOptions ;
2122import com .google .gcloud .spi .DefaultResourceManagerRpc ;
2223import com .google .gcloud .spi .ResourceManagerRpc ;
@@ -42,10 +43,16 @@ public ResourceManager create(ResourceManagerOptions options) {
4243 }
4344
4445 /**
45- * Returns a default {@code ResourceManagerOptions} instance.
46+ * Returns a default {@code ResourceManagerOptions} instance with the retry strategy defined
47+ * by {@link RetryParams#defaultInstance}. To disable retries, supply
48+ * {@link RetryParams#noRetries} to the {@code ResourceManagerOptions} builder, like so:
49+ * <pre> {@code
50+ * ResourceManagerOptions options =
51+ * ResourceManagerOptions.builder().retryParams(RetryParams.noRetries()).build();
52+ * }
4653 */
4754 public static ResourceManagerOptions defaultInstance () {
48- return builder ().build ();
55+ return builder ().retryParams ( RetryParams . defaultInstance ()). build ();
4956 }
5057
5158 public static class DefaultResourceManagerRpcFactory implements ResourceManagerRpcFactory {
Original file line number Diff line number Diff line change 1818
1919import com .google .common .base .MoreObjects ;
2020import com .google .common .collect .ImmutableSet ;
21+ import com .google .gcloud .RetryParams ;
2122import com .google .gcloud .ServiceOptions ;
2223import com .google .gcloud .spi .DefaultStorageRpc ;
2324import com .google .gcloud .spi .StorageRpc ;
@@ -114,10 +115,16 @@ public String pathDelimiter() {
114115 }
115116
116117 /**
117- * Returns a default {@code StorageOptions} instance.
118+ * Returns a default {@code StorageOptions} instance with the retry strategy defined by
119+ * {@link RetryParams#defaultInstance}. To disable retries, supply {@link RetryParams#noRetries}
120+ * to the {@code StorageOptions} builder, like so:
121+ * <pre> {@code
122+ * StorageOptions options =
123+ * StorageOptions.builder().retryParams(RetryParams.noRetries()).build();
124+ * }
118125 */
119126 public static StorageOptions defaultInstance () {
120- return builder ().build ();
127+ return builder ().retryParams ( RetryParams . defaultInstance ()). build ();
121128 }
122129
123130 @ SuppressWarnings ("unchecked" )
You can’t perform that action at this time.
0 commit comments