Skip to content

Commit b512686

Browse files
committed
update PR feedback
1 parent dd88e23 commit b512686

File tree

54 files changed

+674
-1483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+674
-1483
lines changed

google-cloud-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<dependency>
107107
<groupId>com.google.api</groupId>
108108
<artifactId>gax</artifactId>
109-
<version>0.0.19</version>
109+
<version>0.0.21</version>
110110
</dependency>
111111
<dependency>
112112
<groupId>com.google.api.grpc</groupId>

google-cloud-core/src/main/java/com/google/cloud/GrpcServiceOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import com.google.api.gax.core.ConnectionSettings;
2222
import com.google.api.gax.core.RetrySettings;
23-
import com.google.api.gax.grpc.UnaryApiCallSettings;
23+
import com.google.api.gax.grpc.UnaryCallSettings;
2424
import com.google.auth.oauth2.GoogleCredentials;
2525
import com.google.cloud.spi.ServiceRpcFactory;
2626
import com.google.common.annotations.VisibleForTesting;
@@ -226,7 +226,7 @@ protected ExecutorFactory<ScheduledExecutorService> executorFactory() {
226226
/**
227227
* Returns a builder for API call settings.
228228
*/
229-
protected UnaryApiCallSettings.Builder apiCallSettings() {
229+
protected UnaryCallSettings.Builder apiCallSettings() {
230230
// todo(mziccard): specify timeout these settings:
231231
// retryParams().retryMaxAttempts(), retryParams().retryMinAttempts()
232232
final RetrySettings.Builder builder = RetrySettings.newBuilder()
@@ -237,7 +237,7 @@ protected UnaryApiCallSettings.Builder apiCallSettings() {
237237
.setInitialRetryDelay(Duration.millis(retryParams().initialRetryDelayMillis()))
238238
.setRetryDelayMultiplier(retryParams().retryDelayBackoffFactor())
239239
.setMaxRetryDelay(Duration.millis(retryParams().maxRetryDelayMillis()));
240-
return UnaryApiCallSettings.newBuilder().setRetrySettingsBuilder(builder);
240+
return UnaryCallSettings.newBuilder().setRetrySettingsBuilder(builder);
241241
}
242242

243243
/**

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
package com.google.cloud.errorreporting.spi.v1beta1;
1515

16-
import com.google.api.gax.grpc.UnaryApiCallable;
16+
import com.google.api.gax.grpc.UnaryCallable;
1717
import com.google.api.gax.protobuf.PathTemplate;
1818
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup;
1919
import com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest;
@@ -83,8 +83,8 @@ public class ErrorGroupServiceApi implements AutoCloseable {
8383
private final ScheduledExecutorService executor;
8484
private final List<AutoCloseable> closeables = new ArrayList<>();
8585

86-
private final UnaryApiCallable<GetGroupRequest, ErrorGroup> getGroupCallable;
87-
private final UnaryApiCallable<UpdateGroupRequest, ErrorGroup> updateGroupCallable;
86+
private final UnaryCallable<GetGroupRequest, ErrorGroup> getGroupCallable;
87+
private final UnaryCallable<UpdateGroupRequest, ErrorGroup> updateGroupCallable;
8888

8989
private static final PathTemplate GROUP_PATH_TEMPLATE =
9090
PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}");
@@ -130,9 +130,9 @@ protected ErrorGroupServiceApi(ErrorGroupServiceSettings settings) throws IOExce
130130
this.channel = settings.getChannelProvider().getOrBuildChannel(this.executor);
131131

132132
this.getGroupCallable =
133-
UnaryApiCallable.create(settings.getGroupSettings(), this.channel, this.executor);
133+
UnaryCallable.create(settings.getGroupSettings(), this.channel, this.executor);
134134
this.updateGroupCallable =
135-
UnaryApiCallable.create(settings.updateGroupSettings(), this.channel, this.executor);
135+
UnaryCallable.create(settings.updateGroupSettings(), this.channel, this.executor);
136136

137137
if (settings.getChannelProvider().shouldAutoClose()) {
138138
closeables.add(
@@ -226,7 +226,7 @@ private final ErrorGroup getGroup(GetGroupRequest request) {
226226
* }
227227
* </code></pre>
228228
*/
229-
public final UnaryApiCallable<GetGroupRequest, ErrorGroup> getGroupCallable() {
229+
public final UnaryCallable<GetGroupRequest, ErrorGroup> getGroupCallable() {
230230
return getGroupCallable;
231231
}
232232

@@ -292,7 +292,7 @@ private final ErrorGroup updateGroup(UpdateGroupRequest request) {
292292
* }
293293
* </code></pre>
294294
*/
295-
public final UnaryApiCallable<UpdateGroupRequest, ErrorGroup> updateGroupCallable() {
295+
public final UnaryCallable<UpdateGroupRequest, ErrorGroup> updateGroupCallable() {
296296
return updateGroupCallable;
297297
}
298298

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import com.google.api.gax.core.RetrySettings;
1818
import com.google.api.gax.grpc.ServiceApiSettings;
1919
import com.google.api.gax.grpc.SimpleCallSettings;
20-
import com.google.api.gax.grpc.UnaryApiCallSettings;
20+
import com.google.api.gax.grpc.UnaryCallSettings;
2121
import com.google.auth.Credentials;
2222
import com.google.common.collect.ImmutableList;
2323
import com.google.common.collect.ImmutableMap;
@@ -74,14 +74,6 @@ public class ErrorGroupServiceSettings extends ServiceApiSettings {
7474
private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES =
7575
ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build();
7676

77-
/** The default connection settings of the service. */
78-
public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS =
79-
ConnectionSettings.newBuilder()
80-
.setServiceAddress(DEFAULT_SERVICE_ADDRESS)
81-
.setPort(DEFAULT_SERVICE_PORT)
82-
.provideCredentialsWith(DEFAULT_SERVICE_SCOPES)
83-
.build();
84-
8577
private final SimpleCallSettings<GetGroupRequest, ErrorGroup> getGroupSettings;
8678
private final SimpleCallSettings<UpdateGroupRequest, ErrorGroup> updateGroupSettings;
8779

@@ -140,7 +132,7 @@ private ErrorGroupServiceSettings(Builder settingsBuilder) throws IOException {
140132

141133
/** Builder for ErrorGroupServiceSettings. */
142134
public static class Builder extends ServiceApiSettings.Builder {
143-
private final ImmutableList<UnaryApiCallSettings.Builder> unaryMethodSettingsBuilders;
135+
private final ImmutableList<UnaryCallSettings.Builder> unaryMethodSettingsBuilders;
144136

145137
private final SimpleCallSettings.Builder<GetGroupRequest, ErrorGroup> getGroupSettings;
146138
private final SimpleCallSettings.Builder<UpdateGroupRequest, ErrorGroup> updateGroupSettings;
@@ -177,15 +169,15 @@ public static class Builder extends ServiceApiSettings.Builder {
177169
}
178170

179171
private Builder() {
180-
super(DEFAULT_CONNECTION_SETTINGS);
172+
super(s_getDefaultConnectionSettingsBuilder().build());
181173

182174
getGroupSettings = SimpleCallSettings.newBuilder(ErrorGroupServiceGrpc.METHOD_GET_GROUP);
183175

184176
updateGroupSettings =
185177
SimpleCallSettings.newBuilder(ErrorGroupServiceGrpc.METHOD_UPDATE_GROUP);
186178

187179
unaryMethodSettingsBuilders =
188-
ImmutableList.<UnaryApiCallSettings.Builder>of(getGroupSettings, updateGroupSettings);
180+
ImmutableList.<UnaryCallSettings.Builder>of(getGroupSettings, updateGroupSettings);
189181
}
190182

191183
private static Builder createDefault() {
@@ -211,12 +203,19 @@ private Builder(ErrorGroupServiceSettings settings) {
211203
updateGroupSettings = settings.updateGroupSettings.toBuilder();
212204

213205
unaryMethodSettingsBuilders =
214-
ImmutableList.<UnaryApiCallSettings.Builder>of(getGroupSettings, updateGroupSettings);
206+
ImmutableList.<UnaryCallSettings.Builder>of(getGroupSettings, updateGroupSettings);
207+
}
208+
209+
private static ConnectionSettings.Builder s_getDefaultConnectionSettingsBuilder() {
210+
return ConnectionSettings.newBuilder()
211+
.setServiceAddress(DEFAULT_SERVICE_ADDRESS)
212+
.setPort(DEFAULT_SERVICE_PORT)
213+
.provideCredentialsWith(DEFAULT_SERVICE_SCOPES);
215214
}
216215

217216
@Override
218-
protected ConnectionSettings getDefaultConnectionSettings() {
219-
return DEFAULT_CONNECTION_SETTINGS;
217+
protected ConnectionSettings.Builder getDefaultConnectionSettingsBuilder() {
218+
return s_getDefaultConnectionSettingsBuilder();
220219
}
221220

222221
@Override
@@ -267,7 +266,7 @@ public Builder setClientLibHeader(String name, String version) {
267266
*
268267
* <p>Note: This method does not support applying settings to streaming methods.
269268
*/
270-
public Builder applyToAllApiMethods(UnaryApiCallSettings.Builder apiCallSettings)
269+
public Builder applyToAllApiMethods(UnaryCallSettings.Builder apiCallSettings)
271270
throws Exception {
272271
super.applyToAllApiMethods(unaryMethodSettingsBuilders, apiCallSettings);
273272
return this;

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceApi.java

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import static com.google.cloud.errorreporting.spi.v1beta1.PagedResponseWrappers.ListEventsPagedResponse;
1717
import static com.google.cloud.errorreporting.spi.v1beta1.PagedResponseWrappers.ListGroupStatsPagedResponse;
1818

19-
import com.google.api.gax.grpc.UnaryApiCallable;
19+
import com.google.api.gax.grpc.UnaryCallable;
2020
import com.google.api.gax.protobuf.PathTemplate;
2121
import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsRequest;
2222
import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsResponse;
@@ -91,14 +91,12 @@ public class ErrorStatsServiceApi implements AutoCloseable {
9191
private final ScheduledExecutorService executor;
9292
private final List<AutoCloseable> closeables = new ArrayList<>();
9393

94-
private final UnaryApiCallable<ListGroupStatsRequest, ListGroupStatsResponse>
95-
listGroupStatsCallable;
96-
private final UnaryApiCallable<ListGroupStatsRequest, ListGroupStatsPagedResponse>
94+
private final UnaryCallable<ListGroupStatsRequest, ListGroupStatsResponse> listGroupStatsCallable;
95+
private final UnaryCallable<ListGroupStatsRequest, ListGroupStatsPagedResponse>
9796
listGroupStatsPagedCallable;
98-
private final UnaryApiCallable<ListEventsRequest, ListEventsResponse> listEventsCallable;
99-
private final UnaryApiCallable<ListEventsRequest, ListEventsPagedResponse>
100-
listEventsPagedCallable;
101-
private final UnaryApiCallable<DeleteEventsRequest, DeleteEventsResponse> deleteEventsCallable;
97+
private final UnaryCallable<ListEventsRequest, ListEventsResponse> listEventsCallable;
98+
private final UnaryCallable<ListEventsRequest, ListEventsPagedResponse> listEventsPagedCallable;
99+
private final UnaryCallable<DeleteEventsRequest, DeleteEventsResponse> deleteEventsCallable;
102100

103101
private static final PathTemplate PROJECT_PATH_TEMPLATE =
104102
PathTemplate.createWithoutUrlEncoding("projects/{project}");
@@ -137,17 +135,17 @@ protected ErrorStatsServiceApi(ErrorStatsServiceSettings settings) throws IOExce
137135
this.channel = settings.getChannelProvider().getOrBuildChannel(this.executor);
138136

139137
this.listGroupStatsCallable =
140-
UnaryApiCallable.create(settings.listGroupStatsSettings(), this.channel, this.executor);
138+
UnaryCallable.create(settings.listGroupStatsSettings(), this.channel, this.executor);
141139
this.listGroupStatsPagedCallable =
142-
UnaryApiCallable.createPagedVariant(
140+
UnaryCallable.createPagedVariant(
143141
settings.listGroupStatsSettings(), this.channel, this.executor);
144142
this.listEventsCallable =
145-
UnaryApiCallable.create(settings.listEventsSettings(), this.channel, this.executor);
143+
UnaryCallable.create(settings.listEventsSettings(), this.channel, this.executor);
146144
this.listEventsPagedCallable =
147-
UnaryApiCallable.createPagedVariant(
145+
UnaryCallable.createPagedVariant(
148146
settings.listEventsSettings(), this.channel, this.executor);
149147
this.deleteEventsCallable =
150-
UnaryApiCallable.create(settings.deleteEventsSettings(), this.channel, this.executor);
148+
UnaryCallable.create(settings.deleteEventsSettings(), this.channel, this.executor);
151149

152150
if (settings.getChannelProvider().shouldAutoClose()) {
153151
closeables.add(
@@ -260,7 +258,7 @@ public final ListGroupStatsPagedResponse listGroupStats(ListGroupStatsRequest re
260258
* }
261259
* </code></pre>
262260
*/
263-
public final UnaryApiCallable<ListGroupStatsRequest, ListGroupStatsPagedResponse>
261+
public final UnaryCallable<ListGroupStatsRequest, ListGroupStatsPagedResponse>
264262
listGroupStatsPagedCallable() {
265263
return listGroupStatsPagedCallable;
266264
}
@@ -294,7 +292,7 @@ public final ListGroupStatsPagedResponse listGroupStats(ListGroupStatsRequest re
294292
* }
295293
* </code></pre>
296294
*/
297-
public final UnaryApiCallable<ListGroupStatsRequest, ListGroupStatsResponse>
295+
public final UnaryCallable<ListGroupStatsRequest, ListGroupStatsResponse>
298296
listGroupStatsCallable() {
299297
return listGroupStatsCallable;
300298
}
@@ -377,8 +375,7 @@ public final ListEventsPagedResponse listEvents(ListEventsRequest request) {
377375
* }
378376
* </code></pre>
379377
*/
380-
public final UnaryApiCallable<ListEventsRequest, ListEventsPagedResponse>
381-
listEventsPagedCallable() {
378+
public final UnaryCallable<ListEventsRequest, ListEventsPagedResponse> listEventsPagedCallable() {
382379
return listEventsPagedCallable;
383380
}
384381

@@ -411,7 +408,7 @@ public final ListEventsPagedResponse listEvents(ListEventsRequest request) {
411408
* }
412409
* </code></pre>
413410
*/
414-
public final UnaryApiCallable<ListEventsRequest, ListEventsResponse> listEventsCallable() {
411+
public final UnaryCallable<ListEventsRequest, ListEventsResponse> listEventsCallable() {
415412
return listEventsCallable;
416413
}
417414

@@ -481,7 +478,7 @@ private final DeleteEventsResponse deleteEvents(DeleteEventsRequest request) {
481478
* }
482479
* </code></pre>
483480
*/
484-
public final UnaryApiCallable<DeleteEventsRequest, DeleteEventsResponse> deleteEventsCallable() {
481+
public final UnaryCallable<DeleteEventsRequest, DeleteEventsResponse> deleteEventsCallable() {
485482
return deleteEventsCallable;
486483
}
487484

0 commit comments

Comments
 (0)