Skip to content
Permalink
Browse files
fix: remove custom timeout and retry settings (#365)
* fix: remove custom timeout and retry settings
  • Loading branch information
hengfengli committed Jul 22, 2020
1 parent b264100 commit f6afd213430d3f06d9a72c64a5c37172840fed0e
Showing with 3 additions and 41 deletions.
  1. +3 −41 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
.<CreateDatabaseRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetrySettings(longRunningRetrySettings)
.build());
.setPollingAlgorithm(longRunningPollingAlgorithm);
databaseAdminStubSettingsBuilder
.createBackupOperationSettings()
.setPollingAlgorithm(longRunningPollingAlgorithm)
.setInitialCallSettings(
UnaryCallSettings
.<CreateBackupRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetrySettings(longRunningRetrySettings)
.build());
.setPollingAlgorithm(longRunningPollingAlgorithm);
databaseAdminStubSettingsBuilder
.restoreDatabaseOperationSettings()
.setPollingAlgorithm(longRunningPollingAlgorithm)
.setInitialCallSettings(
UnaryCallSettings
.<RestoreDatabaseRequest, OperationSnapshot>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) {

0 comments on commit f6afd21

Please sign in to comment.