diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java index 35a288530fa..bc3f513ce0d 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java @@ -19,12 +19,9 @@ import com.google.api.core.ApiFunction; import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.grpc.GrpcInterceptorProvider; -import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.NoCredentials; import com.google.cloud.ServiceDefaults; import com.google.cloud.ServiceOptions; @@ -47,9 +44,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ThreadFactoryBuilder; -import com.google.spanner.admin.database.v1.CreateBackupRequest; -import com.google.spanner.admin.database.v1.CreateDatabaseRequest; -import com.google.spanner.admin.database.v1.RestoreDatabaseRequest; import com.google.spanner.v1.ExecuteSqlRequest.QueryOptions; import io.grpc.CallCredentials; import io.grpc.CompressorRegistry; @@ -331,47 +325,15 @@ private Builder() { .setRpcTimeoutMultiplier(1.5) .setTotalTimeout(Duration.ofHours(48L)) .build()); - RetrySettings longRunningRetrySettings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofSeconds(60L)) - .setMaxRpcTimeout(Duration.ofSeconds(600L)) - .setInitialRetryDelay(Duration.ofSeconds(20L)) - .setMaxRetryDelay(Duration.ofSeconds(45L)) - .setRetryDelayMultiplier(1.5) - .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofHours(48L)) - .build(); databaseAdminStubSettingsBuilder .createDatabaseOperationSettings() - .setPollingAlgorithm(longRunningPollingAlgorithm) - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetrySettings(longRunningRetrySettings) - .build()); + .setPollingAlgorithm(longRunningPollingAlgorithm); databaseAdminStubSettingsBuilder .createBackupOperationSettings() - .setPollingAlgorithm(longRunningPollingAlgorithm) - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetrySettings(longRunningRetrySettings) - .build()); + .setPollingAlgorithm(longRunningPollingAlgorithm); databaseAdminStubSettingsBuilder .restoreDatabaseOperationSettings() - .setPollingAlgorithm(longRunningPollingAlgorithm) - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetrySettings(longRunningRetrySettings) - .build()); - databaseAdminStubSettingsBuilder - .deleteBackupSettings() - .setRetrySettings(longRunningRetrySettings); - databaseAdminStubSettingsBuilder - .updateBackupSettings() - .setRetrySettings(longRunningRetrySettings) - .setRetryableCodes(StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE); + .setPollingAlgorithm(longRunningPollingAlgorithm); } Builder(SpannerOptions options) {