|
32 | 32 | import com.google.api.gax.grpc.GrpcTransportChannel; |
33 | 33 | import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; |
34 | 34 | import com.google.api.gax.longrunning.OperationFuture; |
| 35 | +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; |
35 | 36 | import com.google.api.gax.retrying.ResultRetryAlgorithm; |
36 | 37 | import com.google.api.gax.retrying.RetrySettings; |
37 | 38 | import com.google.api.gax.retrying.TimedAttemptSettings; |
@@ -485,15 +486,28 @@ public GapicSpannerRpc(final SpannerOptions options) { |
485 | 486 | .build(); |
486 | 487 | this.instanceAdminStub = GrpcInstanceAdminStub.create(instanceAdminStubSettings); |
487 | 488 |
|
488 | | - this.databaseAdminStubSettings = |
| 489 | + DatabaseAdminStubSettings.Builder databaseAdminStubSettingsBuilder = |
489 | 490 | options.getDatabaseAdminStubSettings().toBuilder() |
490 | 491 | .setTransportChannelProvider(channelProvider) |
491 | 492 | .setCredentialsProvider(credentialsProvider) |
492 | 493 | .setStreamWatchdogProvider(watchdogProvider) |
493 | 494 | .setTracerFactory( |
494 | 495 | options.getApiTracerFactory( |
495 | | - /* isAdminClient= */ true, isEmulatorEnabled(options, emulatorHost))) |
496 | | - .build(); |
| 496 | + /* isAdminClient= */ true, isEmulatorEnabled(options, emulatorHost))); |
| 497 | + databaseAdminStubSettingsBuilder |
| 498 | + .updateDatabaseDdlOperationSettings() |
| 499 | + .setPollingAlgorithm( |
| 500 | + OperationTimedPollAlgorithm.create( |
| 501 | + RetrySettings.newBuilder() |
| 502 | + .setInitialRetryDelayDuration(Duration.ofMillis(1500L)) |
| 503 | + .setRetryDelayMultiplier(1.3) |
| 504 | + .setMaxRetryDelayDuration(Duration.ofMillis(30000L)) |
| 505 | + .setInitialRpcTimeoutDuration(Duration.ZERO) |
| 506 | + .setRpcTimeoutMultiplier(1.0) |
| 507 | + .setMaxRpcTimeoutDuration(Duration.ZERO) |
| 508 | + .setTotalTimeoutDuration(Duration.ofMillis(86400000L)) |
| 509 | + .build())); |
| 510 | + this.databaseAdminStubSettings = databaseAdminStubSettingsBuilder.build(); |
497 | 511 |
|
498 | 512 | // Automatically retry RESOURCE_EXHAUSTED for GetOperation if auto-throttling of |
499 | 513 | // administrative requests has been set. The GetOperation RPC is called repeatedly by gax |
|
0 commit comments