Skip to content

Commit f968e23

Browse files
committed
chore: run code formatter
1 parent 701ac21 commit f968e23

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

src/main/java/com/google/cloud/spanner/jdbc/JdbcConnection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ static boolean useLegacyValidCheck() {
114114
}
115115

116116
@VisibleForTesting
117-
static Attributes createOpenTelemetryAttributes(DatabaseId databaseId, boolean includeConnectionId) {
117+
static Attributes createOpenTelemetryAttributes(
118+
DatabaseId databaseId, boolean includeConnectionId) {
118119
AttributesBuilder attributesBuilder = Attributes.builder();
119120
// A unique connection ID should only be included for tracing and not for metrics.
120121
if (includeConnectionId) {

src/test/java/com/google/cloud/spanner/jdbc/it/ITOpenTelemetryTest.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import java.util.concurrent.Future;
6262
import java.util.concurrent.ThreadLocalRandom;
6363
import java.util.concurrent.TimeUnit;
64-
import java.util.function.Supplier;
6564
import org.junit.AfterClass;
6665
import org.junit.Before;
6766
import org.junit.BeforeClass;
@@ -146,8 +145,7 @@ public void testGlobalOpenTelemetry() throws Exception {
146145
}
147146

148147
@Test
149-
public void testOpenTelemetryInProperties()
150-
throws Exception {
148+
public void testOpenTelemetryInProperties() throws Exception {
151149
// Make sure there is no Global OpenTelemetry.
152150
GlobalOpenTelemetry.resetForTest();
153151
Properties info = new Properties();
@@ -225,30 +223,35 @@ private void testOpenTelemetry(Connection connection)
225223
assertUpdateResult(statement.executeLargeUpdate(), spannerSql);
226224
}
227225
}
228-
226+
229227
private interface ConnectionProducer {
230228
Connection createConnection() throws SQLException;
231229
}
232-
233-
private void testOpenTelemetryConcurrency(ConnectionProducer connectionProducer) throws Exception {
230+
231+
private void testOpenTelemetryConcurrency(ConnectionProducer connectionProducer)
232+
throws Exception {
234233
int numThreads = 16;
235234
int numIterations = 1000;
236235
ExecutorService executor = Executors.newFixedThreadPool(16);
237236
List<Future<?>> futures = new ArrayList<>(numThreads);
238-
for (int n=0; n<numThreads; n++) {
239-
futures.add(executor.submit((Callable<Void>) () -> {
240-
try (Connection connection = connectionProducer.createConnection(); Statement statement = connection.createStatement()) {
241-
for (int i = 0; i < numIterations; i++) {
242-
UUID uuid = UUID.randomUUID();
243-
String sql = "select '" + uuid + "'";
244-
245-
try (ResultSet resultSet = statement.executeQuery(sql)) {
246-
assertQueryResult(resultSet, sql, uuid, false);
247-
}
248-
}
249-
}
250-
return null;
251-
}));
237+
for (int n = 0; n < numThreads; n++) {
238+
futures.add(
239+
executor.submit(
240+
(Callable<Void>)
241+
() -> {
242+
try (Connection connection = connectionProducer.createConnection();
243+
Statement statement = connection.createStatement()) {
244+
for (int i = 0; i < numIterations; i++) {
245+
UUID uuid = UUID.randomUUID();
246+
String sql = "select '" + uuid + "'";
247+
248+
try (ResultSet resultSet = statement.executeQuery(sql)) {
249+
assertQueryResult(resultSet, sql, uuid, false);
250+
}
251+
}
252+
}
253+
return null;
254+
}));
252255
}
253256
executor.shutdown();
254257
assertTrue(executor.awaitTermination(600L, TimeUnit.SECONDS));

0 commit comments

Comments
 (0)