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

Commit 02583c3

Browse files
committed
lint
Change-Id: I92463834cdc294436608a7184054a2c6324d8f48
1 parent 6f6e8f9 commit 02583c3

3 files changed

Lines changed: 46 additions & 24 deletions

File tree

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
package com.google.cloud.bigtable.gaxx.grpc;
1717

1818
import com.google.api.core.BetaApi;
19-
import com.google.auto.value.AutoValue;
2019
import com.google.api.gax.grpc.ChannelPoolSettings;
21-
import com.google.common.annotations.VisibleForTesting;
20+
import com.google.auto.value.AutoValue;
2221
import com.google.common.base.Preconditions;
2322
import java.time.Duration;
2423

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public TransportChannelProvider withPoolSize(int size) {
106106
public TransportChannel getTransportChannel() throws IOException {
107107
TransportChannel result = transportChannel;
108108
if (transportChannel == null) {
109-
transportChannel = result = createTransportChannel();
109+
transportChannel = result = createTransportChannel();
110110
}
111111
return result;
112112
}
@@ -132,7 +132,8 @@ private TransportChannel createTransportChannel() throws IOException {
132132
}
133133
};
134134

135-
BigtableChannelPoolSettings btPoolSettings = BigtableChannelPoolSettings.copyFrom(delegate.getChannelPoolSettings());
135+
BigtableChannelPoolSettings btPoolSettings =
136+
BigtableChannelPoolSettings.copyFrom(delegate.getChannelPoolSettings());
136137

137138
BigtableChannelPool btChannelPool = BigtableChannelPool.create(btPoolSettings, channelFactory);
138139

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/utils/ChannelPoolCopyTest.java

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
import com.google.api.gax.grpc.ChannelPoolSettings;
66
import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings;
7-
import java.lang.reflect.Modifier;
8-
import java.util.Set;
97
import com.google.common.collect.ImmutableSet;
108
import java.lang.reflect.Method;
9+
import java.lang.reflect.Modifier;
1110
import java.util.Arrays;
11+
import java.util.Set;
1212
import java.util.stream.Collectors;
1313
import org.junit.Rule;
1414
import org.junit.Test;
@@ -33,14 +33,16 @@ public void testToBigtableChannelPoolSettingsAllFieldsSetCopiesCorrectly() throw
3333
.setPreemptiveRefreshEnabled(true)
3434
.build();
3535

36-
BigtableChannelPoolSettings copiedSettings = BigtableChannelPoolSettings.copyFrom(originalSettings);
36+
BigtableChannelPoolSettings copiedSettings =
37+
BigtableChannelPoolSettings.copyFrom(originalSettings);
3738
assertSettingsCopiedCorrectly(originalSettings, copiedSettings);
3839
}
3940

4041
@Test
4142
public void testToBigtableChannelPoolSettingsDefaultValuesCopiesCorrectly() throws Exception {
4243
ChannelPoolSettings originalSettings = ChannelPoolSettings.builder().build();
43-
BigtableChannelPoolSettings copiedSettings = BigtableChannelPoolSettings.copyFrom(originalSettings);
44+
BigtableChannelPoolSettings copiedSettings =
45+
BigtableChannelPoolSettings.copyFrom(originalSettings);
4446
assertSettingsCopiedCorrectly(originalSettings, copiedSettings);
4547
}
4648

@@ -56,25 +58,45 @@ private void assertSettingsCopiedCorrectly(
5658
ChannelPoolSettings originalSettings, BigtableChannelPoolSettings copiedSettings)
5759
throws Exception {
5860

59-
Set<String> supportedGetters = ImmutableSet.of("getMinRpcsPerChannel", "getMaxRpcsPerChannel", "getMinChannelCount", "getMaxChannelCount", "getInitialChannelCount", "isPreemptiveRefreshEnabled", "isStaticSize");
61+
Set<String> supportedGetters =
62+
ImmutableSet.of(
63+
"getMinRpcsPerChannel",
64+
"getMaxRpcsPerChannel",
65+
"getMinChannelCount",
66+
"getMaxChannelCount",
67+
"getInitialChannelCount",
68+
"isPreemptiveRefreshEnabled",
69+
"isStaticSize");
6070

61-
Set<String> actualGetters = Arrays.stream(ChannelPoolSettings.class.getDeclaredMethods())
62-
.filter(method -> Modifier.isPublic(method.getModifiers())
63-
&& Modifier.isAbstract(method.getModifiers())
64-
&& (method.getName().startsWith("get") || method.getName().startsWith("is")))
65-
.map(Method::getName)
66-
.collect(Collectors.toSet());
71+
Set<String> actualGetters =
72+
Arrays.stream(ChannelPoolSettings.class.getDeclaredMethods())
73+
.filter(
74+
method ->
75+
Modifier.isPublic(method.getModifiers())
76+
&& Modifier.isAbstract(method.getModifiers())
77+
&& (method.getName().startsWith("get")
78+
|| method.getName().startsWith("is")))
79+
.map(Method::getName)
80+
.collect(Collectors.toSet());
6781

68-
// If this fails then we need to add support for the additional attributes on the gax ChannelPool
82+
// If this fails then we need to add support for the additional attributes on the gax
83+
// ChannelPool
6984
// Relevant things to update the copier and the other tests in this file
7085
assertThat(supportedGetters).containsAtLeastElementsIn(actualGetters);
7186

72-
assertThat(originalSettings.getInitialChannelCount()).isEqualTo(copiedSettings.getInitialChannelCount());
73-
assertThat(originalSettings.getMaxChannelCount()).isEqualTo(copiedSettings.getMaxChannelCount());
74-
assertThat(originalSettings.getMinChannelCount()).isEqualTo(copiedSettings.getMinChannelCount());
75-
assertThat(originalSettings.getMaxRpcsPerChannel()).isEqualTo(copiedSettings.getMaxRpcsPerChannel());
76-
assertThat(originalSettings.getMinRpcsPerChannel()).isEqualTo(copiedSettings.getMinRpcsPerChannel());
77-
assertThat(originalSettings.getInitialChannelCount()).isEqualTo(copiedSettings.getInitialChannelCount());
78-
assertThat(originalSettings.isPreemptiveRefreshEnabled()).isEqualTo(copiedSettings.isPreemptiveRefreshEnabled());
87+
assertThat(originalSettings.getInitialChannelCount())
88+
.isEqualTo(copiedSettings.getInitialChannelCount());
89+
assertThat(originalSettings.getMaxChannelCount())
90+
.isEqualTo(copiedSettings.getMaxChannelCount());
91+
assertThat(originalSettings.getMinChannelCount())
92+
.isEqualTo(copiedSettings.getMinChannelCount());
93+
assertThat(originalSettings.getMaxRpcsPerChannel())
94+
.isEqualTo(copiedSettings.getMaxRpcsPerChannel());
95+
assertThat(originalSettings.getMinRpcsPerChannel())
96+
.isEqualTo(copiedSettings.getMinRpcsPerChannel());
97+
assertThat(originalSettings.getInitialChannelCount())
98+
.isEqualTo(copiedSettings.getInitialChannelCount());
99+
assertThat(originalSettings.isPreemptiveRefreshEnabled())
100+
.isEqualTo(copiedSettings.isPreemptiveRefreshEnabled());
79101
}
80-
}
102+
}

0 commit comments

Comments
 (0)