@@ -42,7 +42,7 @@ class DatabaseClientImpl implements DatabaseClient {
4242 private static final String READ_ONLY_TRANSACTION = "CloudSpanner.ReadOnlyTransaction" ;
4343 private static final String PARTITION_DML_TRANSACTION = "CloudSpanner.PartitionDMLTransaction" ;
4444 private final TraceWrapper tracer ;
45- private Attributes commonAttributes ;
45+ private final Attributes databaseAttributes ;
4646 @ VisibleForTesting final String clientId ;
4747 @ VisibleForTesting final SessionPool pool ;
4848 @ VisibleForTesting final MultiplexedSessionDatabaseClient multiplexedSessionDatabaseClient ;
@@ -88,15 +88,15 @@ class DatabaseClientImpl implements DatabaseClient {
8888 boolean useMultiplexedSessionPartitionedOps ,
8989 TraceWrapper tracer ,
9090 boolean useMultiplexedSessionForRW ,
91- Attributes commonAttributes ) {
91+ Attributes databaseAttributes ) {
9292 this .clientId = clientId ;
9393 this .pool = pool ;
9494 this .useMultiplexedSessionBlindWrite = useMultiplexedSessionBlindWrite ;
9595 this .multiplexedSessionDatabaseClient = multiplexedSessionDatabaseClient ;
9696 this .useMultiplexedSessionPartitionedOps = useMultiplexedSessionPartitionedOps ;
9797 this .tracer = tracer ;
9898 this .useMultiplexedSessionForRW = useMultiplexedSessionForRW ;
99- this .commonAttributes = commonAttributes ;
99+ this .databaseAttributes = databaseAttributes ;
100100
101101 this .clientIdToOrdinalMap = new HashMap <String , Integer >();
102102 this .dbId = this .dbIdFromClientId (this .clientId );
@@ -203,7 +203,7 @@ public Timestamp write(final Iterable<Mutation> mutations) throws SpannerExcepti
203203 public CommitResponse writeWithOptions (
204204 final Iterable <Mutation > mutations , final TransactionOption ... options )
205205 throws SpannerException {
206- ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , commonAttributes , options );
206+ ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , databaseAttributes , options );
207207 try (IScope s = tracer .withSpan (span )) {
208208 if (canUseMultiplexedSessionsForRW () && getMultiplexedSessionDatabaseClient () != null ) {
209209 return getMultiplexedSessionDatabaseClient ().writeWithOptions (mutations , options );
@@ -230,7 +230,7 @@ public Timestamp writeAtLeastOnce(final Iterable<Mutation> mutations) throws Spa
230230 public CommitResponse writeAtLeastOnceWithOptions (
231231 final Iterable <Mutation > mutations , final TransactionOption ... options )
232232 throws SpannerException {
233- ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , commonAttributes , options );
233+ ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , databaseAttributes , options );
234234 try (IScope s = tracer .withSpan (span )) {
235235 if (useMultiplexedSessionBlindWrite && getMultiplexedSessionDatabaseClient () != null ) {
236236 return getMultiplexedSessionDatabaseClient ()
@@ -260,7 +260,7 @@ int getNthRequest() {
260260 public ServerStream <BatchWriteResponse > batchWriteAtLeastOnce (
261261 final Iterable <MutationGroup > mutationGroups , final TransactionOption ... options )
262262 throws SpannerException {
263- ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , commonAttributes , options );
263+ ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , databaseAttributes , options );
264264 try (IScope s = tracer .withSpan (span )) {
265265 if (canUseMultiplexedSessionsForRW () && getMultiplexedSessionDatabaseClient () != null ) {
266266 return getMultiplexedSessionDatabaseClient ().batchWriteAtLeastOnce (mutationGroups , options );
@@ -278,7 +278,7 @@ public ServerStream<BatchWriteResponse> batchWriteAtLeastOnce(
278278
279279 @ Override
280280 public ReadContext singleUse () {
281- ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , commonAttributes );
281+ ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , databaseAttributes );
282282 try (IScope s = tracer .withSpan (span )) {
283283 return getMultiplexedSession ().singleUse ();
284284 } catch (RuntimeException e ) {
@@ -290,7 +290,7 @@ public ReadContext singleUse() {
290290
291291 @ Override
292292 public ReadContext singleUse (TimestampBound bound ) {
293- ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , commonAttributes );
293+ ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , databaseAttributes );
294294 try (IScope s = tracer .withSpan (span )) {
295295 return getMultiplexedSession ().singleUse (bound );
296296 } catch (RuntimeException e ) {
@@ -302,7 +302,7 @@ public ReadContext singleUse(TimestampBound bound) {
302302
303303 @ Override
304304 public ReadOnlyTransaction singleUseReadOnlyTransaction () {
305- ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , commonAttributes );
305+ ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , databaseAttributes );
306306 try (IScope s = tracer .withSpan (span )) {
307307 return getMultiplexedSession ().singleUseReadOnlyTransaction ();
308308 } catch (RuntimeException e ) {
@@ -314,7 +314,7 @@ public ReadOnlyTransaction singleUseReadOnlyTransaction() {
314314
315315 @ Override
316316 public ReadOnlyTransaction singleUseReadOnlyTransaction (TimestampBound bound ) {
317- ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , commonAttributes );
317+ ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , databaseAttributes );
318318 try (IScope s = tracer .withSpan (span )) {
319319 return getMultiplexedSession ().singleUseReadOnlyTransaction (bound );
320320 } catch (RuntimeException e ) {
@@ -326,7 +326,7 @@ public ReadOnlyTransaction singleUseReadOnlyTransaction(TimestampBound bound) {
326326
327327 @ Override
328328 public ReadOnlyTransaction readOnlyTransaction () {
329- ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , commonAttributes );
329+ ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , databaseAttributes );
330330 try (IScope s = tracer .withSpan (span )) {
331331 return getMultiplexedSession ().readOnlyTransaction ();
332332 } catch (RuntimeException e ) {
@@ -338,7 +338,7 @@ public ReadOnlyTransaction readOnlyTransaction() {
338338
339339 @ Override
340340 public ReadOnlyTransaction readOnlyTransaction (TimestampBound bound ) {
341- ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , commonAttributes );
341+ ISpan span = tracer .spanBuilder (READ_ONLY_TRANSACTION , databaseAttributes );
342342 try (IScope s = tracer .withSpan (span )) {
343343 return getMultiplexedSession ().readOnlyTransaction (bound );
344344 } catch (RuntimeException e ) {
@@ -350,7 +350,7 @@ public ReadOnlyTransaction readOnlyTransaction(TimestampBound bound) {
350350
351351 @ Override
352352 public TransactionRunner readWriteTransaction (TransactionOption ... options ) {
353- ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , commonAttributes , options );
353+ ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , databaseAttributes , options );
354354 try (IScope s = tracer .withSpan (span )) {
355355 return getMultiplexedSessionForRW ().readWriteTransaction (options );
356356 } catch (RuntimeException e ) {
@@ -362,7 +362,7 @@ public TransactionRunner readWriteTransaction(TransactionOption... options) {
362362
363363 @ Override
364364 public TransactionManager transactionManager (TransactionOption ... options ) {
365- ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , commonAttributes , options );
365+ ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , databaseAttributes , options );
366366 try (IScope s = tracer .withSpan (span )) {
367367 return getMultiplexedSessionForRW ().transactionManager (options );
368368 } catch (RuntimeException e ) {
@@ -374,7 +374,7 @@ public TransactionManager transactionManager(TransactionOption... options) {
374374
375375 @ Override
376376 public AsyncRunner runAsync (TransactionOption ... options ) {
377- ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , commonAttributes , options );
377+ ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , databaseAttributes , options );
378378 try (IScope s = tracer .withSpan (span )) {
379379 return getMultiplexedSessionForRW ().runAsync (options );
380380 } catch (RuntimeException e ) {
@@ -386,7 +386,7 @@ public AsyncRunner runAsync(TransactionOption... options) {
386386
387387 @ Override
388388 public AsyncTransactionManager transactionManagerAsync (TransactionOption ... options ) {
389- ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , commonAttributes , options );
389+ ISpan span = tracer .spanBuilder (READ_WRITE_TRANSACTION , databaseAttributes , options );
390390 try (IScope s = tracer .withSpan (span )) {
391391 return getMultiplexedSessionForRW ().transactionManagerAsync (options );
392392 } catch (RuntimeException e ) {
@@ -449,7 +449,7 @@ private TransactionOption[] withReqId(
449449
450450 private long executePartitionedUpdateWithPooledSession (
451451 final Statement stmt , final UpdateOption ... options ) {
452- ISpan span = tracer .spanBuilder (PARTITION_DML_TRANSACTION , commonAttributes );
452+ ISpan span = tracer .spanBuilder (PARTITION_DML_TRANSACTION , databaseAttributes );
453453 try (IScope s = tracer .withSpan (span )) {
454454 return runWithSessionRetry (
455455 (session , reqId ) -> {
0 commit comments