Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit a1db05a

Browse files
chore: generate libraries at Mon Mar 2 09:05:45 UTC 2026
1 parent b5393d1 commit a1db05a

6 files changed

Lines changed: 23 additions & 13 deletions

File tree

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ public CommitResponse writeAtLeastOnceWithOptions(
301301
ISpan span = tracer.spanBuilder(SpannerImpl.COMMIT);
302302

303303
try (IScope s = tracer.withSpan(span)) {
304-
return spanner.getTransactionRetryHelper().runTxWithRetriesOnAborted(
305-
() -> new CommitResponse(spanner.getRpc().commit(request, getOptions())));
304+
return spanner
305+
.getTransactionRetryHelper()
306+
.runTxWithRetriesOnAborted(
307+
() -> new CommitResponse(spanner.getRpc().commit(request, getOptions())));
306308
} catch (RuntimeException e) {
307309
span.setStatus(e);
308310
throw e;

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ static final class ClosedException extends RuntimeException {
146146
this.dbAdminClient = new DatabaseAdminClientImpl(options.getProjectId(), gapicRpc);
147147
this.instanceClient =
148148
new InstanceAdminClientImpl(options.getProjectId(), gapicRpc, dbAdminClient);
149-
this.transactionRetryHelper = new TransactionRetryHelper(options.getDefaultTransactionRetrySettings());
149+
this.transactionRetryHelper =
150+
new TransactionRetryHelper(options.getDefaultTransactionRetrySettings());
150151
logSpannerOptions(options);
151152
}
152153

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,8 @@ public static class Builder
12191219
private String experimentalHost = null;
12201220
private boolean usePlainText = false;
12211221
private TransactionOptions defaultTransactionOptions = TransactionOptions.getDefaultInstance();
1222-
private RetrySettings defaultTransactionRetrySettings = TransactionRetryHelper.DEFAULT_TRANSACTION_RETRY_SETTINGS;
1222+
private RetrySettings defaultTransactionRetrySettings =
1223+
TransactionRetryHelper.DEFAULT_TRANSACTION_RETRY_SETTINGS;
12231224
private RequestOptions.ClientContext clientContext;
12241225

12251226
private static String createCustomClientLibToken(String token) {
@@ -2080,7 +2081,12 @@ public Builder setDefaultTransactionOptions(
20802081
return this;
20812082
}
20822083

2083-
/** Sets the default {@link RetrySettings} for all read/write transactions that are executed using this client. These settings are used when the client automatically retries an aborted read/write transaction. The default is to retry for up to 24 hours without a limit for the maximum number of attempts. */
2084+
/**
2085+
* Sets the default {@link RetrySettings} for all read/write transactions that are executed
2086+
* using this client. These settings are used when the client automatically retries an aborted
2087+
* read/write transaction. The default is to retry for up to 24 hours without a limit for the
2088+
* maximum number of attempts.
2089+
*/
20842090
public Builder setDefaultTransactionRetrySettings(RetrySettings retrySettings) {
20852091
Preconditions.checkNotNull(retrySettings, "RetrySettings cannot be null");
20862092
this.defaultTransactionRetrySettings = retrySettings;

google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRetryHelper.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@
2424
import com.google.cloud.RetryHelper;
2525
import com.google.cloud.RetryHelper.RetryHelperException;
2626
import com.google.cloud.spanner.ErrorHandler.DefaultErrorHandler;
27-
import com.google.cloud.spanner.v1.stub.SpannerStub;
28-
import com.google.cloud.spanner.v1.stub.SpannerStubSettings;
2927
import com.google.common.annotations.VisibleForTesting;
3028
import com.google.common.base.Throwables;
31-
import com.google.spanner.v1.RollbackRequest;
3229
import io.grpc.Context;
3330
import java.time.Duration;
3431
import java.util.concurrent.Callable;

google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,10 @@ private <T> T runInternal(final TransactionCallable<T> txCallable) {
13571357
throw e;
13581358
}
13591359
};
1360-
return session.getSpanner().getTransactionRetryHelper().runTxWithRetriesOnAborted(retryCallable, session.getErrorHandler());
1360+
return session
1361+
.getSpanner()
1362+
.getTransactionRetryHelper()
1363+
.runTxWithRetriesOnAborted(retryCallable, session.getErrorHandler());
13611364
}
13621365

13631366
@Override

google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionRetryHelperTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public long millisTime() {
5858
}
5959
}
6060

61-
private final TransactionRetryHelper retryHelper = new TransactionRetryHelper(SpannerOptions.DEFAULT_TRANSACTION_RETRY_SETTINGS);
61+
private final TransactionRetryHelper retryHelper =
62+
new TransactionRetryHelper(SpannerOptions.DEFAULT_TRANSACTION_RETRY_SETTINGS);
6263

6364
@Test
6465
public void testRetryDoesNotTimeoutAfterTenMinutes() {
@@ -74,7 +75,8 @@ public void testRetryDoesNotTimeoutAfterTenMinutes() {
7475
};
7576
assertEquals(
7677
2,
77-
retryHelper.runTxWithRetriesOnAborted(
78+
retryHelper
79+
.runTxWithRetriesOnAborted(
7880
callable, SpannerOptions.DEFAULT_TRANSACTION_RETRY_SETTINGS, clock)
7981
.intValue());
8082
}
@@ -120,8 +122,7 @@ public void testCancelledContext() {
120122
SpannerException e =
121123
assertThrows(
122124
SpannerException.class,
123-
() ->
124-
withCancellation.run(() -> retryHelper.runTxWithRetriesOnAborted(callable)));
125+
() -> withCancellation.run(() -> retryHelper.runTxWithRetriesOnAborted(callable)));
125126
assertEquals(ErrorCode.CANCELLED, e.getErrorCode());
126127
}
127128

0 commit comments

Comments
 (0)