Skip to content

Commit 70fc234

Browse files
lint(spanner): Fixes formatting issues and variable categorization.
1 parent 1e22531 commit 70fc234

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

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

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public class BatchClientImpl implements BatchClient {
6565
* This flag is set to true if the server return UNIMPLEMENTED when partitioned transaction is
6666
* executed on a multiplexed session. TODO: Remove once this is guaranteed to be available.
6767
*/
68-
@VisibleForTesting final AtomicBoolean unimplementedForPartitionedOps = new AtomicBoolean(false);
68+
@VisibleForTesting
69+
static final AtomicBoolean unimplementedForPartitionedOps = new AtomicBoolean(false);
6970

7071
BatchClientImpl(SessionClient sessionClient, boolean isMultiplexedSessionEnabled) {
7172
this.sessionClient = checkNotNull(sessionClient);
@@ -113,8 +114,7 @@ public BatchReadOnlyTransaction batchReadOnlyTransaction(TimestampBound bound) {
113114
sessionClient.getSpanner().getOptions().getDirectedReadOptions())
114115
.setSpan(sessionClient.getSpanner().getTracer().getCurrentSpan())
115116
.setTracer(sessionClient.getSpanner().getTracer()),
116-
checkNotNull(bound),
117-
unimplementedForPartitionedOps);
117+
checkNotNull(bound));
118118
}
119119

120120
@Override
@@ -137,8 +137,7 @@ public BatchReadOnlyTransaction batchReadOnlyTransaction(BatchTransactionId batc
137137
sessionClient.getSpanner().getOptions().getDirectedReadOptions())
138138
.setSpan(sessionClient.getSpanner().getTracer().getCurrentSpan())
139139
.setTracer(sessionClient.getSpanner().getTracer()),
140-
batchTransactionId,
141-
unimplementedForPartitionedOps);
140+
batchTransactionId);
142141
}
143142

144143
private boolean canUseMultiplexedSession() {
@@ -163,25 +162,18 @@ private static class BatchReadOnlyTransactionImpl extends MultiUseReadOnlyTransa
163162
implements BatchReadOnlyTransaction {
164163
private final String sessionName;
165164
private final Map<SpannerRpc.Option, ?> options;
166-
final AtomicBoolean unimplementedForPartitionedOps;
167165

168166
BatchReadOnlyTransactionImpl(
169-
MultiUseReadOnlyTransaction.Builder builder,
170-
TimestampBound bound,
171-
AtomicBoolean unimplementedForPartitionedOps) {
167+
MultiUseReadOnlyTransaction.Builder builder, TimestampBound bound) {
172168
super(builder.setTimestampBound(bound));
173-
this.unimplementedForPartitionedOps = unimplementedForPartitionedOps;
174169
this.sessionName = session.getName();
175170
this.options = session.getOptions();
176171
initTransaction();
177172
}
178173

179174
BatchReadOnlyTransactionImpl(
180-
MultiUseReadOnlyTransaction.Builder builder,
181-
BatchTransactionId batchTransactionId,
182-
AtomicBoolean unimplementedForPartitionedOps) {
175+
MultiUseReadOnlyTransaction.Builder builder, BatchTransactionId batchTransactionId) {
183176
super(builder.setTransactionId(batchTransactionId.getTransactionId()));
184-
this.unimplementedForPartitionedOps = unimplementedForPartitionedOps;
185177
this.sessionName = session.getName();
186178
this.options = session.getOptions();
187179
}
@@ -289,7 +281,6 @@ public List<Partition> partitionQuery(
289281

290282
final PartitionQueryRequest request = builder.build();
291283
try {
292-
293284
PartitionResponse response = rpc.partitionQuery(request, options);
294285
ImmutableList.Builder<Partition> partitions = ImmutableList.builder();
295286
for (com.google.spanner.v1.Partition p : response.getPartitionsList()) {
@@ -310,7 +301,7 @@ void maybeMarkUnimplementedForPartitionedOps(SpannerException spannerException)
310301
&& MultiplexedSessionDatabaseClient.verifyErrorMessage(
311302
spannerException,
312303
"Partitioned operations are not supported with multiplexed sessions")) {
313-
this.unimplementedForPartitionedOps.set(true);
304+
unimplementedForPartitionedOps.set(true);
314305
}
315306
}
316307

0 commit comments

Comments
 (0)