Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

Commit 6ef3fdf

Browse files
fix: migrate monitoring/dashboard/v1 to grpc_service_config (#152)
PiperOrigin-RevId: 320447395 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Jul 9 12:15:09 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: ca88164f0a037c0b8ed88c4a69e0b94fddbf797a Source-Link: googleapis/googleapis@ca88164
1 parent 97e33a3 commit 6ef3fdf

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

Diff for: google-cloud-monitoring-dashboard/src/main/java/com/google/cloud/monitoring/dashboard/v1/stub/DashboardsServiceStubSettings.java

+31-19
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,13 @@ public static class Builder extends StubSettings.Builder<DashboardsServiceStubSe
285285
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
286286
ImmutableMap.builder();
287287
definitions.put(
288-
"idempotent",
288+
"retry_policy_1_codes",
289289
ImmutableSet.copyOf(
290290
Lists.<StatusCode.Code>newArrayList(
291-
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
292-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
291+
StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN)));
292+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
293+
definitions.put(
294+
"no_retry_1_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
293295
RETRYABLE_CODE_DEFINITIONS = definitions.build();
294296
}
295297

@@ -300,15 +302,25 @@ public static class Builder extends StubSettings.Builder<DashboardsServiceStubSe
300302
RetrySettings settings = null;
301303
settings =
302304
RetrySettings.newBuilder()
303-
.setInitialRetryDelay(Duration.ofMillis(100L))
305+
.setInitialRetryDelay(Duration.ofMillis(1000L))
304306
.setRetryDelayMultiplier(1.3)
305-
.setMaxRetryDelay(Duration.ofMillis(60000L))
306-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
307+
.setMaxRetryDelay(Duration.ofMillis(10000L))
308+
.setInitialRpcTimeout(Duration.ofMillis(30000L))
309+
.setRpcTimeoutMultiplier(1.0)
310+
.setMaxRpcTimeout(Duration.ofMillis(30000L))
311+
.setTotalTimeout(Duration.ofMillis(30000L))
312+
.build();
313+
definitions.put("retry_policy_1_params", settings);
314+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
315+
definitions.put("no_retry_params", settings);
316+
settings =
317+
RetrySettings.newBuilder()
318+
.setInitialRpcTimeout(Duration.ofMillis(30000L))
307319
.setRpcTimeoutMultiplier(1.0)
308-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
309-
.setTotalTimeout(Duration.ofMillis(600000L))
320+
.setMaxRpcTimeout(Duration.ofMillis(30000L))
321+
.setTotalTimeout(Duration.ofMillis(30000L))
310322
.build();
311-
definitions.put("default", settings);
323+
definitions.put("no_retry_1_params", settings);
312324
RETRY_PARAM_DEFINITIONS = definitions.build();
313325
}
314326

@@ -353,28 +365,28 @@ private static Builder initDefaults(Builder builder) {
353365

354366
builder
355367
.createDashboardSettings()
356-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
357-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
368+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
369+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
358370

359371
builder
360372
.listDashboardsSettings()
361-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
362-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
373+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
374+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
363375

364376
builder
365377
.getDashboardSettings()
366-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
367-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
378+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
379+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
368380

369381
builder
370382
.deleteDashboardSettings()
371-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
372-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
383+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
384+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
373385

374386
builder
375387
.updateDashboardSettings()
376-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
377-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
388+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
389+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
378390

379391
return builder;
380392
}

Diff for: synth.metadata

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-monitoring-dashboards.git",
7-
"sha": "47da4ab302b855d6307f4d0b44a0502925d227c2"
7+
"sha": "97e33a31aba4a2f134f2f6c61eb7269c6ac51f53"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "3c5166c1db0f1804af7acdbbd79137630a00ce63",
15-
"internalRef": "315496921"
14+
"sha": "ca88164f0a037c0b8ed88c4a69e0b94fddbf797a",
15+
"internalRef": "320447395"
1616
}
1717
},
1818
{

0 commit comments

Comments
 (0)