Skip to content

Commit 00a2578

Browse files
lint(spanner): Apply suggestions from code review
Co-authored-by: Knut Olav Løite <[email protected]>
1 parent 44f1105 commit 00a2578

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public long executePartitionedUpdate(final Statement stmt, final UpdateOption...
320320
return executePartitionedUpdateSession(stmt, options);
321321
}
322322

323-
private long executePartitionedUpdateSession(
323+
private long executePartitionedUpdateWithPooledSession(
324324
final Statement stmt, final UpdateOption... options) {
325325
ISpan span = tracer.spanBuilder(PARTITION_DML_TRANSACTION);
326326
try (IScope s = tracer.withSpan(span)) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ private SessionReference getSessionReference() {
233233
@Override
234234
public long executePartitionedUpdate(Statement stmt, UpdateOption... options) {
235235
try {
236-
SessionReference sessionReference = this.sessionFuture.get();
236+
SessionReference sessionReference = getSessionReference();
237237
return new MultiplexedSessionTransaction(
238-
client, span, sessionReference, NO_CHANNEL_HINT, true)
238+
client, span, sessionReference, NO_CHANNEL_HINT, /* singleUse = */ true)
239239
.executePartitionedUpdate(stmt, options);
240240
} catch (InterruptedException e) {
241241
throw new RuntimeException(e);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ public AsyncTransactionManager transactionManagerAsync(TransactionOption... opti
556556

557557
@Override
558558
public long executePartitionedUpdate(Statement stmt, UpdateOption... options) {
559-
return createMultiplexedSessionTransaction(true).executePartitionedUpdate(stmt, options);
559+
return createMultiplexedSessionTransaction(/* singleUse = */ true).executePartitionedUpdate(stmt, options);
560560
}
561561

562562
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ void createMultiplexedSession(SessionConsumer consumer) {
246246
}
247247

248248
/**
249-
* Create a multiplexed session and returns it. A multiplexed session is not affiliated with any
250-
* GRPC channel. In case of an error on the gRPC calls, the error will be returned.
249+
* Creates a multiplexed session and returns it. A multiplexed session is not affiliated with any
250+
* GRPC channel. In case of an error during the gRPC calls, an exception will be thrown.
251251
*/
252252
SessionImpl createMultiplexedSession() {
253253
ISpan span = spanner.getTracer().spanBuilder(SpannerImpl.CREATE_MULTIPLEXED_SESSION);

0 commit comments

Comments
 (0)