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

Commit 862135b

Browse files
committed
more noop channel primer changes
Change-Id: I3baa8e93bc614efe21f1159a708be36881120e34
1 parent 5b619b1 commit 862135b

3 files changed

Lines changed: 26 additions & 8 deletions

File tree

google-cloud-bigtable/clirr-ignored-differences.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,21 +397,26 @@
397397
<to>*</to>
398398
</difference>
399399
<difference>
400-
<!-- InternalApi was updated -->
401400
<differenceType>4001</differenceType>
402401
<className>com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer</className>
403-
<to>*</to>
402+
<to>com/google/api/gax/grpc/ChannelPrimer</to>
404403
</difference>
405404
<difference>
406-
<!-- InternalApi was updated -->
407405
<differenceType>4001</differenceType>
408406
<className>com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer</className>
409-
<to>*</to>
407+
<to>com/google/api/gax/grpc/ChannelPrimer</to>
410408
</difference>
411409
<difference>
412410
<differenceType>7005</differenceType>
413411
<className>com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool</className>
414412
<method>*create*</method>
415413
<to>*</to>
416414
</difference>
415+
<difference>
416+
<!-- InternalApi was updated -->
417+
<differenceType>7005</differenceType>
418+
<className>com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider</className>
419+
<method>*create*</method>
420+
<to>*</to>
421+
</difference>
417422
</differences>

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public void primeChannel(ManagedChannel managedChannel) {
3636

3737
@Override
3838
public SettableApiFuture<PingAndWarmResponse> sendPrimeRequestsAsync(ManagedChannel var1) {
39-
return null;
39+
SettableApiFuture future = SettableApiFuture.create();
40+
future.set(PingAndWarmResponse.getDefaultInstance());
41+
return future;
4042
}
4143
}

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import com.google.api.core.SettableApiFuture;
1919
import com.google.auto.value.AutoValue;
2020
import com.google.bigtable.v2.PingAndWarmResponse;
21+
import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer;
22+
import com.google.cloud.bigtable.data.v2.stub.NoOpChannelPrimer;
2123
import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry;
2224
import com.google.common.annotations.VisibleForTesting;
2325
import com.google.common.collect.ImmutableList;
@@ -113,9 +115,18 @@ public void stop() {
113115
@VisibleForTesting
114116
void runProbes() {
115117
for (Entry entry : this.entrySupplier.get()) {
116-
Instant startTime = clock.instant();
117-
SettableApiFuture<PingAndWarmResponse> probeFuture =
118-
channelPrimer.sendPrimeRequestsAsync(entry.getManagedChannel());
118+
final Instant startTime = clock.instant();
119+
final SettableApiFuture<PingAndWarmResponse> probeFuture;
120+
121+
if (channelPrimer instanceof BigtableChannelPrimer) {
122+
BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer;
123+
probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel());
124+
} else if (channelPrimer instanceof NoOpChannelPrimer) {
125+
NoOpChannelPrimer primer = (NoOpChannelPrimer) channelPrimer;
126+
probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel());
127+
} else {
128+
continue;
129+
}
119130
probeFuture.addListener(() -> onComplete(entry, startTime, probeFuture), executor);
120131
}
121132
}

0 commit comments

Comments
 (0)