From 20e012d5f968b026b7e9f41162f616dfbb0cc8cf Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Fri, 1 Aug 2025 09:59:48 -0400 Subject: [PATCH 01/23] feat/idle-channel-eviction Change-Id: I62fe152c293438bf64b657b5b1fe795e22ce9c85 --- .../gaxx/grpc/BigtableChannelPool.java | 29 ++- .../gaxx/grpc/ChannelPoolHealthChecker.java | 220 ++++++++++++++++++ .../grpc/ChannelPoolHealthCheckerTest.java | 192 +++++++++++++++ 3 files changed, 437 insertions(+), 4 deletions(-) create mode 100644 google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java create mode 100644 google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java index da7bd4f956..d9145068fc 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java @@ -18,6 +18,8 @@ import com.google.api.core.InternalApi; import com.google.api.gax.grpc.ChannelFactory; import com.google.api.gax.grpc.ChannelPrimer; +import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPoolHealthChecker.ProbeResult; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -31,9 +33,11 @@ import io.grpc.MethodDescriptor; import io.grpc.Status; import java.io.IOException; +import java.time.Clock; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CancellationException; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -62,11 +66,11 @@ public class BigtableChannelPool extends ManagedChannel { private final BigtableChannelPoolSettings settings; private final ChannelFactory channelFactory; - private final ChannelPrimer channelPrimer; + private ChannelPrimer channelPrimer; private final ScheduledExecutorService executor; - private final Object entryWriteLock = new Object(); @VisibleForTesting final AtomicReference> entries = new AtomicReference<>(); + private ChannelPoolHealthChecker channelPoolHealthChecker; private final AtomicInteger indexTicker = new AtomicInteger(); private final String authority; @@ -96,6 +100,11 @@ public static BigtableChannelPool create( this.settings = settings; this.channelFactory = channelFactory; this.channelPrimer = channelPrimer; + Clock systemClock = Clock.systemUTC(); + this.channelPoolHealthChecker = + new ChannelPoolHealthChecker( + () -> entries.get(), (BigtableChannelPrimer) channelPrimer, executor, systemClock); + this.channelPoolHealthChecker.start(); ImmutableList.Builder initialListBuilder = ImmutableList.builder(); @@ -445,15 +454,27 @@ static class Entry { private final AtomicInteger maxOutstanding = new AtomicInteger(); + @VisibleForTesting + final ConcurrentLinkedQueue probeHistory = new ConcurrentLinkedQueue<>(); + + // we keep both so that we don't have to check size() on the ConcurrentLinkedQueue all the time + AtomicInteger failedProbesInWindow = new AtomicInteger(); + AtomicInteger successfulProbesInWindow = new AtomicInteger(); + // Flag that the channel should be closed once all of the outstanding RPC complete. private final AtomicBoolean shutdownRequested = new AtomicBoolean(); // Flag that the channel has been closed. private final AtomicBoolean shutdownInitiated = new AtomicBoolean(); - private Entry(ManagedChannel channel) { + @VisibleForTesting + Entry(ManagedChannel channel) { this.channel = channel; } + ManagedChannel getManagedChannel() { + return this.channel; + } + int getAndResetMaxOutstanding() { return maxOutstanding.getAndSet(outstandingRpcs.get()); } @@ -468,7 +489,7 @@ private boolean retain() { // register desire to start RPC int currentOutstanding = outstandingRpcs.incrementAndGet(); - // Rough book keeping + // Rough bookkeeping int prevMax = maxOutstanding.get(); if (currentOutstanding > prevMax) { maxOutstanding.incrementAndGet(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java new file mode 100644 index 0000000000..b6c6c62157 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -0,0 +1,220 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.SettableApiFuture; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +/** Stub for a class that will manage the health checking in the BigtableChannelPool */ +public class ChannelPoolHealthChecker { + + // Configuration constants + private static final Duration WINDOW_DURATION = Duration.ofMinutes(5); + static final Duration PROBE_RATE = Duration.ofSeconds(30); + @VisibleForTesting static final Duration PROBE_DEADLINE = Duration.ofMillis(500); + private static final Duration MIN_EVICTION_INTERVAL = Duration.ofMinutes(10); + private static final int MIN_PROBES_FOR_EVALUATION = 4; + private static final int SINGLE_CHANNEL_FAILURE_PERCENT_THRESHOLD = 60; + private static final int POOLWIDE_BAD_CHANNEL_CIRCUITBREAKER_PERCENT = 70; + + /** Inner class to represent the result of a single probe. */ + static class ProbeResult { + final Instant startTime; + final boolean success; + + ProbeResult(Instant startTime, boolean success) { + this.startTime = startTime; + this.success = success; + } + + public boolean isSuccessful() { + return success; + } + } + + // Class fields + private final Supplier> entrySupplier; + private Instant lastEviction; + private ScheduledExecutorService executor; + + private BigtableChannelPrimer channelPrimer; + + private final Clock clock; + + /** Constructor for the pool health checker. */ + public ChannelPoolHealthChecker( + Supplier> entrySupplier, + BigtableChannelPrimer channelPrimer, + ScheduledExecutorService executor, + Clock clock) { + this.entrySupplier = entrySupplier; + this.lastEviction = Instant.MIN; + this.channelPrimer = channelPrimer; + this.executor = executor; + this.clock = clock; + } + + void start() { + Duration initialDelayProbe = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_RATE.toMillis())); + executor.scheduleAtFixedRate( + this::runProbes, + initialDelayProbe.toMillis(), + PROBE_RATE.toMillis(), + TimeUnit.MILLISECONDS); + Duration initialDelayDetect = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_RATE.toMillis())); + executor.scheduleAtFixedRate( + this::detectAndRemoveOutlierEntries, + initialDelayDetect.toMillis(), + PROBE_RATE.toMillis(), + TimeUnit.MILLISECONDS); + } + + /** Stop running health checking (No-op stub) */ + public void stop() { + executor.shutdownNow(); + } + + /** Runs probes on all the channels in the pool. */ + @VisibleForTesting + void runProbes() { + // Method stub, no operation. + for (Entry entry : this.entrySupplier.get()) { + Instant startTime = clock.instant(); + SettableApiFuture probeFuture = + channelPrimer.sendPrimeRequestsAsync(entry.getManagedChannel()); + probeFuture.addListener(() -> onComplete(entry, startTime, probeFuture), executor); + } + } + + /** Callback that will update Entry data on probe complete. */ + @VisibleForTesting + void onComplete( + Entry entry, Instant startTime, SettableApiFuture probeFuture) { + boolean success; + try { + probeFuture.get(PROBE_DEADLINE.toMillis(), TimeUnit.MILLISECONDS); + success = true; + } catch (Exception e) { + success = false; + } + addProbeResult(entry, new ProbeResult(startTime, success)); + } + + @VisibleForTesting + void addProbeResult(Entry entry, ProbeResult result) { + entry.probeHistory.add(result); + if (result.isSuccessful()) { + entry.successfulProbesInWindow.incrementAndGet(); + } else { + entry.failedProbesInWindow.incrementAndGet(); + } + } + + @VisibleForTesting + void pruneHistoryFor(Entry entry) { + Instant windowStart = clock.instant().minus(WINDOW_DURATION); + while (!entry.probeHistory.isEmpty() + && entry.probeHistory.peek().startTime.isBefore(windowStart)) { + ProbeResult removedResult = entry.probeHistory.poll(); + if (removedResult.isSuccessful()) { + entry.successfulProbesInWindow.decrementAndGet(); + } else { + entry.failedProbesInWindow.decrementAndGet(); + } + } + } + + /** Checks if a single entry is currently healthy based on its probe history. */ + @VisibleForTesting + boolean isEntryHealthy(Entry entry) { + pruneHistoryFor(entry); // Ensure window is current before calculation + + int failedProbes = entry.failedProbesInWindow.get(); + int totalProbes = failedProbes + entry.successfulProbesInWindow.get(); + + if (totalProbes < MIN_PROBES_FOR_EVALUATION) { + return true; // Not enough data, assume healthy. + } + + double failureRate = ((double) failedProbes / totalProbes) * 100.0; + return failureRate < SINGLE_CHANNEL_FAILURE_PERCENT_THRESHOLD; + } + + /** + * Finds a channel that is an outlier in terms of health. + * + * @return Entry + */ + @Nullable + @VisibleForTesting + Entry findOutlierEntry() { + if (lastEviction.plus(WINDOW_DURATION).isAfter(clock.instant())) { + return null; + } + + List unhealthyEntries = + this.entrySupplier.get().stream() + .peek(this::pruneHistoryFor) + .filter(entry -> !isEntryHealthy(entry)) + .collect(Collectors.toList()); + + int poolSize = this.entrySupplier.get().size(); + if (unhealthyEntries.isEmpty() || poolSize == 0) { + return null; + } + + // If more than CIRCUITBREAKER_PERCENT of channels are unhealthy we won't evict + double unhealthyPercent = (double) unhealthyEntries.size() / poolSize * 100.0; + if (unhealthyPercent >= POOLWIDE_BAD_CHANNEL_CIRCUITBREAKER_PERCENT) { + return null; + } + + return unhealthyEntries.stream() + .max(Comparator.comparingInt(entry -> entry.failedProbesInWindow.get())) + .orElse(null); + } + + /** Periodically detects and removes outlier channels from the pool. (No-op stub) */ + @VisibleForTesting + void detectAndRemoveOutlierEntries() { + if (clock.instant().isBefore(lastEviction.plus(MIN_EVICTION_INTERVAL))) { + // Primitive but effective rate-limiting. + return; + } + Entry outlier = findOutlierEntry(); + if (outlier != null) { + this.lastEviction = clock.instant(); + outlier.getManagedChannel().enterIdle(); + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java new file mode 100644 index 0000000000..a62cd4d10e --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigtable.gaxx.grpc; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; +import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPoolHealthChecker.ProbeResult; +import com.google.common.collect.ImmutableList; +import com.google.common.util.concurrent.ListeningScheduledExecutorService; +import com.google.common.util.concurrent.testing.TestingExecutors; +import io.grpc.ManagedChannel; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.function.Supplier; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class ChannelPoolHealthCheckerTest { + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); + @Mock private BigtableChannelPrimer mockPrimer; + private ListeningScheduledExecutorService executor; + @Mock private Clock mockClock; + private ChannelPoolHealthChecker healthChecker; + private List channelList; + + @Before + public void setUp() { + executor = TestingExecutors.sameThreadScheduledExecutor(); + channelList = new ArrayList<>(); + Supplier> entrySupplier = () -> ImmutableList.copyOf(channelList); + + healthChecker = new ChannelPoolHealthChecker(entrySupplier, mockPrimer, executor, mockClock); + + // Default the clock to a fixed time + Mockito.when(mockClock.instant()).thenReturn(Instant.parse("2025-08-01T10:00:00Z")); + } + + // Helper method to create test entries + private Entry createTestEntry() { + ManagedChannel mockChannel = Mockito.mock(ManagedChannel.class); + return new Entry(mockChannel); + } + + @After + public void tearDown() { + executor.shutdownNow(); + } + + @Test + public void testOnComplete_successUpdatesCounters() { + Entry entry = createTestEntry(); + channelList.add(entry); + + SettableApiFuture successFuture = SettableApiFuture.create(); + Mockito.when(mockPrimer.sendPrimeRequestsAsync(entry.getManagedChannel())) + .thenReturn(successFuture); + + healthChecker.runProbes(); + + successFuture.set(PingAndWarmResponse.getDefaultInstance()); + + assertThat(entry.successfulProbesInWindow.get()).isEqualTo(1); + assertThat(entry.failedProbesInWindow.get()).isEqualTo(0); + } + + @Test + public void testOnComplete_cancellationIsFailure() { + Entry entry = createTestEntry(); + channelList.add(entry); + + SettableApiFuture hangingFuture = SettableApiFuture.create(); + Mockito.when(mockPrimer.sendPrimeRequestsAsync(entry.getManagedChannel())) + .thenReturn(hangingFuture); + + healthChecker.runProbes(); + + hangingFuture.cancel(true); + + assertThat(entry.failedProbesInWindow.get()).isEqualTo(1); + assertThat(entry.successfulProbesInWindow.get()).isEqualTo(0); + } + + @Test + public void testPruning_removesOldProbesAndCounters() { + Entry entry = createTestEntry(); + healthChecker.addProbeResult(entry, new ProbeResult(mockClock.instant(), false)); + assertThat(entry.failedProbesInWindow.get()).isEqualTo(1); + + Instant newTime = mockClock.instant().plus(Duration.ofMinutes(6)); + Mockito.when(mockClock.instant()).thenReturn(newTime); + healthChecker.pruneHistoryFor(entry); // Manually call for direct testing + + assertThat(entry.probeHistory).isEmpty(); + assertThat(entry.failedProbesInWindow.get()).isEqualTo(0); + } + + @Test + public void testEviction_selectsUnhealthyChannel() { + Entry healthyEntry = createTestEntry(); + Entry badEntry = createTestEntry(); + Entry worseEntry = createTestEntry(); + + // A channel needs at least 4 probes to be considered for eviction + healthyEntry.successfulProbesInWindow.set(10); // 0% failure -> healthy + badEntry.failedProbesInWindow.set(3); // 3/13 = 23% failure -> healthy + badEntry.successfulProbesInWindow.set(10); + worseEntry.failedProbesInWindow.set(10); // 10/10 = 100% failure -> unhealthy + + channelList.addAll(Arrays.asList(healthyEntry, badEntry, worseEntry)); + + healthChecker.detectAndRemoveOutlierEntries(); + + // Assert that only the unhealthy channel was evicted + Mockito.verify(worseEntry.getManagedChannel()).enterIdle(); + Mockito.verify(badEntry.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(healthyEntry.getManagedChannel(), Mockito.never()).enterIdle(); + } + + @Test + public void testEviction_selectsMostUnhealthyChannel() { + Entry healthyEntry = createTestEntry(); + Entry badEntry = createTestEntry(); + Entry worseEntry = createTestEntry(); + + // A channel needs at least 4 probes to be considered for eviction + healthyEntry.successfulProbesInWindow.set(10); // 0% failure -> healthy + badEntry.failedProbesInWindow.set(8); // 8/13 = 61% failure -> unhealthy + badEntry.successfulProbesInWindow.set(10); + worseEntry.failedProbesInWindow.set(10); // 10/10 = 100% failure -> most unhealthy + + channelList.addAll(Arrays.asList(healthyEntry, badEntry, worseEntry)); + + healthChecker.detectAndRemoveOutlierEntries(); + + // Assert that only the unhealthy channel was evicted + Mockito.verify(worseEntry.getManagedChannel()).enterIdle(); + Mockito.verify(badEntry.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(healthyEntry.getManagedChannel(), Mockito.never()).enterIdle(); + } + + @Test + public void testCircuitBreaker_preventsEviction() { + Entry entry1 = createTestEntry(); + Entry entry2 = createTestEntry(); + Entry entry3 = createTestEntry(); + channelList.addAll(Arrays.asList(entry1, entry2, entry3)); + + // Set failure counts to exceed 60% SINGLE_CHANNEL_FAILURE_PERCENT_THRESHOLD with at least + // MIN_PROBES_FOR_EVALUATION (4) failures + for (Entry entry : channelList) { + entry.failedProbesInWindow.set(4); // 4 failures, 0 successes = 100% failure rate + } + + healthChecker.detectAndRemoveOutlierEntries(); + + // The circuit breaker should engage because 3/3 channels (100%) are unhealthy, + // which is greater than the 70% POOLWIDE_BAD_CHANNEL_CIRCUITBREAKER_PERCENT threshold. + Mockito.verify(entry1.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(entry2.getManagedChannel(), Mockito.never()).enterIdle(); + Mockito.verify(entry3.getManagedChannel(), Mockito.never()).enterIdle(); + } +} From d2b61296737cb5b6ab25c61518b2d8f496b2462b Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Wed, 27 Aug 2025 10:39:29 -0400 Subject: [PATCH 02/23] create noop channel primer Change-Id: I8d4212aad0ca7613b6c33d69d925671a090d1609 --- .../data/v2/stub/BigtableChannelPrimer.java | 2 +- .../data/v2/stub/BigtableClientContext.java | 4 +- .../gaxx/grpc/BigtableChannelPool.java | 5 +- .../BigtableTransportChannelProvider.java | 1 - .../gaxx/grpc/ChannelPoolHealthChecker.java | 51 +++++++++---------- .../bigtable/gaxx/grpc/ChannelPrimer.java | 13 +++++ .../grpc/ChannelPoolHealthCheckerTest.java | 2 +- .../bigtable/gaxx/grpc/HealthChecker.java | 22 ++++++++ 8 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java create mode 100644 google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java index 4ace6c7567..7def7a8d9e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java @@ -17,12 +17,12 @@ import com.google.api.core.InternalApi; import com.google.api.core.SettableApiFuture; -import com.google.api.gax.grpc.ChannelPrimer; import com.google.auth.Credentials; import com.google.bigtable.v2.BigtableGrpc; import com.google.bigtable.v2.InstanceName; import com.google.bigtable.v2.PingAndWarmRequest; import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; import io.grpc.CallCredentials; import io.grpc.CallOptions; import io.grpc.ClientCall; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java index 233294fe4e..a7e19ae345 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java @@ -20,7 +20,6 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.api.gax.grpc.ChannelPrimer; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.ClientContext; import com.google.auth.Credentials; @@ -34,6 +33,7 @@ import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider; import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; import com.google.cloud.bigtable.gaxx.grpc.BigtableTransportChannelProvider; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; import io.grpc.ManagedChannelBuilder; import io.grpc.opentelemetry.GrpcOpenTelemetry; import io.opentelemetry.api.OpenTelemetry; @@ -122,7 +122,7 @@ public static BigtableClientContext create(EnhancedBigtableStubSettings settings setupCookieHolder(transportProvider); } - ChannelPrimer channelPrimer = NoOpChannelPrimer.create(); + ChannelPrimer channelPrimer = (ChannelPrimer) NoOpChannelPrimer.create(); // Inject channel priming if enabled if (builder.isRefreshingChannel()) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java index d9145068fc..639ef6fb6b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java @@ -17,8 +17,6 @@ import com.google.api.core.InternalApi; import com.google.api.gax.grpc.ChannelFactory; -import com.google.api.gax.grpc.ChannelPrimer; -import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; import com.google.cloud.bigtable.gaxx.grpc.ChannelPoolHealthChecker.ProbeResult; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; @@ -102,8 +100,7 @@ public static BigtableChannelPool create( this.channelPrimer = channelPrimer; Clock systemClock = Clock.systemUTC(); this.channelPoolHealthChecker = - new ChannelPoolHealthChecker( - () -> entries.get(), (BigtableChannelPrimer) channelPrimer, executor, systemClock); + new ChannelPoolHealthChecker(() -> entries.get(), channelPrimer, executor, systemClock); this.channelPoolHealthChecker.start(); ImmutableList.Builder initialListBuilder = ImmutableList.builder(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java index 3c4cf24bca..ba18994619 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java @@ -18,7 +18,6 @@ import com.google.api.core.InternalApi; import com.google.api.gax.grpc.ChannelFactory; import com.google.api.gax.grpc.ChannelPoolSettings; -import com.google.api.gax.grpc.ChannelPrimer; import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.TransportChannel; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index b6c6c62157..20d0b07f07 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -16,8 +16,8 @@ package com.google.cloud.bigtable.gaxx.grpc; import com.google.api.core.SettableApiFuture; +import com.google.auto.value.AutoValue; import com.google.bigtable.v2.PingAndWarmResponse; -import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; @@ -37,42 +37,47 @@ public class ChannelPoolHealthChecker { // Configuration constants + // Window_Duration is the duration over which we keep probe results private static final Duration WINDOW_DURATION = Duration.ofMinutes(5); - static final Duration PROBE_RATE = Duration.ofSeconds(30); + // Interval at which we probe channel health + static final Duration PROBE_INTERVAL = Duration.ofSeconds(30); + // Timeout deadline for a probe @VisibleForTesting static final Duration PROBE_DEADLINE = Duration.ofMillis(500); + // Minimum interval between new idle channel evictions private static final Duration MIN_EVICTION_INTERVAL = Duration.ofMinutes(10); + // Minimum number of probes that must be sent to a channel before it will be considered for + // eviction private static final int MIN_PROBES_FOR_EVALUATION = 4; + // Percentage of probes that must fail for a channel to be considered unhealthy private static final int SINGLE_CHANNEL_FAILURE_PERCENT_THRESHOLD = 60; + // "Circuitbreaker" - If this or a higher percentage of channels in a pool are bad, we will not + // evict any channels private static final int POOLWIDE_BAD_CHANNEL_CIRCUITBREAKER_PERCENT = 70; /** Inner class to represent the result of a single probe. */ - static class ProbeResult { - final Instant startTime; - final boolean success; + @AutoValue + abstract static class ProbeResult { + abstract Instant startTime(); - ProbeResult(Instant startTime, boolean success) { - this.startTime = startTime; - this.success = success; - } + abstract boolean isSuccessful(); - public boolean isSuccessful() { - return success; + static ProbeResult create(Instant startTime, boolean success) { + return new AutoValue_ChannelPoolHealthChecker_ProbeResult(startTime, success); } } - // Class fields private final Supplier> entrySupplier; private Instant lastEviction; private ScheduledExecutorService executor; - private BigtableChannelPrimer channelPrimer; + private ChannelPrimer channelPrimer; private final Clock clock; /** Constructor for the pool health checker. */ public ChannelPoolHealthChecker( Supplier> entrySupplier, - BigtableChannelPrimer channelPrimer, + ChannelPrimer channelPrimer, ScheduledExecutorService executor, Clock clock) { this.entrySupplier = entrySupplier; @@ -84,18 +89,18 @@ public ChannelPoolHealthChecker( void start() { Duration initialDelayProbe = - Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_RATE.toMillis())); + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); executor.scheduleAtFixedRate( this::runProbes, initialDelayProbe.toMillis(), - PROBE_RATE.toMillis(), + PROBE_INTERVAL.toMillis(), TimeUnit.MILLISECONDS); Duration initialDelayDetect = - Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_RATE.toMillis())); + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); executor.scheduleAtFixedRate( this::detectAndRemoveOutlierEntries, initialDelayDetect.toMillis(), - PROBE_RATE.toMillis(), + PROBE_INTERVAL.toMillis(), TimeUnit.MILLISECONDS); } @@ -127,7 +132,7 @@ void onComplete( } catch (Exception e) { success = false; } - addProbeResult(entry, new ProbeResult(startTime, success)); + addProbeResult(entry, ProbeResult.create(startTime, success)); } @VisibleForTesting @@ -144,7 +149,7 @@ void addProbeResult(Entry entry, ProbeResult result) { void pruneHistoryFor(Entry entry) { Instant windowStart = clock.instant().minus(WINDOW_DURATION); while (!entry.probeHistory.isEmpty() - && entry.probeHistory.peek().startTime.isBefore(windowStart)) { + && entry.probeHistory.peek().startTime().isBefore(windowStart)) { ProbeResult removedResult = entry.probeHistory.poll(); if (removedResult.isSuccessful()) { entry.successfulProbesInWindow.decrementAndGet(); @@ -157,8 +162,6 @@ void pruneHistoryFor(Entry entry) { /** Checks if a single entry is currently healthy based on its probe history. */ @VisibleForTesting boolean isEntryHealthy(Entry entry) { - pruneHistoryFor(entry); // Ensure window is current before calculation - int failedProbes = entry.failedProbesInWindow.get(); int totalProbes = failedProbes + entry.successfulProbesInWindow.get(); @@ -178,10 +181,6 @@ boolean isEntryHealthy(Entry entry) { @Nullable @VisibleForTesting Entry findOutlierEntry() { - if (lastEviction.plus(WINDOW_DURATION).isAfter(clock.instant())) { - return null; - } - List unhealthyEntries = this.entrySupplier.get().stream() .peek(this::pruneHistoryFor) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java new file mode 100644 index 0000000000..9f31d56eee --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java @@ -0,0 +1,13 @@ +package com.google.cloud.bigtable.gaxx.grpc; + +import com.google.api.core.InternalApi; +import com.google.api.core.SettableApiFuture; +import com.google.bigtable.v2.PingAndWarmResponse; +import io.grpc.ManagedChannel; + +@InternalApi("For internal use by google-cloud-java clients only") +public interface ChannelPrimer { + void primeChannel(ManagedChannel var1); + + SettableApiFuture sendPrimeRequestsAsync(ManagedChannel var1); +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java index a62cd4d10e..39bd8a3cec 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java @@ -113,7 +113,7 @@ public void testOnComplete_cancellationIsFailure() { @Test public void testPruning_removesOldProbesAndCounters() { Entry entry = createTestEntry(); - healthChecker.addProbeResult(entry, new ProbeResult(mockClock.instant(), false)); + healthChecker.addProbeResult(entry, ProbeResult.create(mockClock.instant(), false)); assertThat(entry.failedProbesInWindow.get()).isEqualTo(1); Instant newTime = mockClock.instant().plus(Duration.ofMinutes(6)); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java new file mode 100644 index 0000000000..98203f29fd --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java @@ -0,0 +1,22 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigtable.gaxx.grpc; + +public interface HealthChecker { + void start(); + + void stop(); +} From 333e9e9c9be99f37108f845d070cbb7ed6434b65 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Wed, 27 Aug 2025 11:13:07 -0400 Subject: [PATCH 03/23] no-op channel primer changes Change-Id: I9ad5eeaacb02ace9ba3cf7c09b6846dcbc298fb8 --- .../bigtable/data/v2/stub/NoOpChannelPrimer.java | 9 ++++++++- .../gaxx/grpc/ChannelPoolHealthChecker.java | 3 +-- .../cloud/bigtable/gaxx/grpc/ChannelPrimer.java | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java index aed412fd0d..67d571a4ff 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java @@ -16,7 +16,9 @@ package com.google.cloud.bigtable.data.v2.stub; import com.google.api.core.InternalApi; -import com.google.api.gax.grpc.ChannelPrimer; +import com.google.api.core.SettableApiFuture; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; import io.grpc.ManagedChannel; @InternalApi @@ -31,4 +33,9 @@ private NoOpChannelPrimer() {} public void primeChannel(ManagedChannel managedChannel) { // No op } + + @Override + public SettableApiFuture sendPrimeRequestsAsync(ManagedChannel var1) { + return null; + } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index 20d0b07f07..e77ee03a4f 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -67,7 +67,7 @@ static ProbeResult create(Instant startTime, boolean success) { } private final Supplier> entrySupplier; - private Instant lastEviction; + private volatile Instant lastEviction; private ScheduledExecutorService executor; private ChannelPrimer channelPrimer; @@ -112,7 +112,6 @@ public void stop() { /** Runs probes on all the channels in the pool. */ @VisibleForTesting void runProbes() { - // Method stub, no operation. for (Entry entry : this.entrySupplier.get()) { Instant startTime = clock.instant(); SettableApiFuture probeFuture = diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java index 9f31d56eee..b4273dab5e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.google.cloud.bigtable.gaxx.grpc; import com.google.api.core.InternalApi; From 4ddefce10d8a083c7b2e63396f3b50bee99ad91c Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Wed, 27 Aug 2025 11:22:05 -0400 Subject: [PATCH 04/23] update ignored diffs Change-Id: I04698ba82b95c82301e4e9f436401698675d7ea9 --- .../clirr-ignored-differences.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml index 23ddeafdda..fa03e7c287 100644 --- a/google-cloud-bigtable/clirr-ignored-differences.xml +++ b/google-cloud-bigtable/clirr-ignored-differences.xml @@ -396,4 +396,22 @@ *create* * + + + 4001 + com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer + * + + + + 4001 + com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer + * + + + 7005 + com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool + *create* + * + From ba9e039407baafa8d3c4d47f5d310fc24f0f0153 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:00:18 -0400 Subject: [PATCH 05/23] chore: Update generation configuration at Thu Aug 7 02:49:23 UTC 2025 (#2649) * chore: Update generation configuration at Thu Jul 31 02:47:07 UTC 2025 * chore: Update generation configuration at Fri Aug 1 02:54:57 UTC 2025 * chore: Update generation configuration at Sat Aug 2 02:42:43 UTC 2025 * chore: generate libraries at Sat Aug 2 02:43:12 UTC 2025 * chore: Update generation configuration at Tue Aug 5 02:50:25 UTC 2025 * chore: generate libraries at Tue Aug 5 02:50:52 UTC 2025 * chore: Update generation configuration at Wed Aug 6 02:48:20 UTC 2025 * chore: generate libraries at Wed Aug 6 02:48:53 UTC 2025 * chore: Update generation configuration at Thu Aug 7 02:49:23 UTC 2025 --- .github/scripts/update_generation_config.sh | 2 +- .../hermetic_library_generation.yaml | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- README.md | 2 +- generation_config.yaml | 6 +- .../v2/BaseBigtableInstanceAdminClient.java | 2 + .../BaseBigtableInstanceAdminClientTest.java | 9 + .../google/bigtable/admin/v2/AppProfile.java | 18 +- .../admin/v2/AppProfileOrBuilder.java | 6 +- .../google/bigtable/admin/v2/Instance.java | 428 ++++++++++++++++++ .../bigtable/admin/v2/InstanceOrBuilder.java | 113 +++++ .../bigtable/admin/v2/InstanceProto.java | 101 +++-- .../google/bigtable/admin/v2/instance.proto | 15 + 15 files changed, 648 insertions(+), 62 deletions(-) diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh index 3b890a76b2..92efcf8819 100644 --- a/.github/scripts/update_generation_config.sh +++ b/.github/scripts/update_generation_config.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -ex # This script should be run at the root of the repository. # This script is used to update googleapis_commitish, gapic_generator_version, # and libraries_bom_version in generation configuration at the time of running diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 5912d6f069..5a97a43802 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -37,7 +37,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - uses: googleapis/sdk-platform-java/.github/scripts@v2.60.2 + - uses: googleapis/sdk-platform-java/.github/scripts@v2.61.0 if: env.SHOULD_RUN == 'true' with: base_ref: ${{ github.base_ref }} diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 96b4fed86f..783727ef01 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.2" # {x-version-update:google-cloud-shared-dependencies:current} + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.51.0" # {x-version-update:google-cloud-shared-dependencies:current} } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 76f0483314..83c7afee07 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.2" # {x-version-update:google-cloud-shared-dependencies:current} + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.51.0" # {x-version-update:google-cloud-shared-dependencies:current} } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 277aa2338d..3a9bbf8c3a 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.2" # {x-version-update:google-cloud-shared-dependencies:current} + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.51.0" # {x-version-update:google-cloud-shared-dependencies:current} } env_vars: { diff --git a/README.md b/README.md index e08716ae08..8e2349cb53 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.64.0') +implementation platform('com.google.cloud:libraries-bom:26.65.0') implementation 'com.google.cloud:google-cloud-bigtable' ``` diff --git a/generation_config.yaml b/generation_config.yaml index 0885338bf2..4d5df91da1 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ -gapic_generator_version: 2.60.2 -googleapis_commitish: 64e82d17e410ff5e71ab3e040ea393db362f2850 -libraries_bom_version: 26.64.0 +gapic_generator_version: 2.61.0 +googleapis_commitish: b0316578aaf7434e3c5bb93badd252f67aacf8d5 +libraries_bom_version: 26.65.0 template_excludes: - .gitignore - .kokoro/presubmit/integration.cfg diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java index 4de5ebb1e8..46660a8774 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java @@ -644,6 +644,7 @@ public final UnaryCallable listInst * .setCreateTime(Timestamp.newBuilder().build()) * .setSatisfiesPzs(true) * .setSatisfiesPzi(true) + * .putAllTags(new HashMap()) * .build(); * Instance response = baseBigtableInstanceAdminClient.updateInstance(request); * } @@ -679,6 +680,7 @@ public final Instance updateInstance(Instance request) { * .setCreateTime(Timestamp.newBuilder().build()) * .setSatisfiesPzs(true) * .setSatisfiesPzi(true) + * .putAllTags(new HashMap()) * .build(); * ApiFuture future = * baseBigtableInstanceAdminClient.updateInstanceCallable().futureCall(request); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java index 383e8e6aba..ab2d542080 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java @@ -157,6 +157,7 @@ public void createInstanceTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); Operation resultOperation = Operation.newBuilder() @@ -218,6 +219,7 @@ public void createInstanceTest2() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); Operation resultOperation = Operation.newBuilder() @@ -279,6 +281,7 @@ public void getInstanceTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -322,6 +325,7 @@ public void getInstanceTest2() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -445,6 +449,7 @@ public void updateInstanceTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -456,6 +461,7 @@ public void updateInstanceTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); Instance actualResponse = client.updateInstance(request); @@ -473,6 +479,7 @@ public void updateInstanceTest() throws Exception { Assert.assertEquals(request.getCreateTime(), actualRequest.getCreateTime()); Assert.assertEquals(request.getSatisfiesPzs(), actualRequest.getSatisfiesPzs()); Assert.assertEquals(request.getSatisfiesPzi(), actualRequest.getSatisfiesPzi()); + Assert.assertEquals(request.getTagsMap(), actualRequest.getTagsMap()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -493,6 +500,7 @@ public void updateInstanceExceptionTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); client.updateInstance(request); Assert.fail("No exception raised"); @@ -511,6 +519,7 @@ public void partialUpdateInstanceTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setSatisfiesPzs(true) .setSatisfiesPzi(true) + .putAllTags(new HashMap()) .build(); Operation resultOperation = Operation.newBuilder() diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java index 7f44f48469..5f8b3a057a 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java @@ -4707,7 +4707,7 @@ public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting getSingleClu * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return Whether the priority field is set. */ @java.lang.Deprecated @@ -4728,7 +4728,7 @@ public boolean hasPriority() { * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return The enum numeric value on the wire for priority. */ @java.lang.Deprecated @@ -4752,7 +4752,7 @@ public int getPriorityValue() { * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return The priority. */ @java.lang.Deprecated @@ -6386,7 +6386,7 @@ public Builder clearSingleClusterRouting() { * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return Whether the priority field is set. */ @java.lang.Override @@ -6408,7 +6408,7 @@ public boolean hasPriority() { * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return The enum numeric value on the wire for priority. */ @java.lang.Override @@ -6433,7 +6433,7 @@ public int getPriorityValue() { * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @param value The enum numeric value on the wire for priority to set. * @return This builder for chaining. */ @@ -6458,7 +6458,7 @@ public Builder setPriorityValue(int value) { * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return The priority. */ @java.lang.Override @@ -6488,7 +6488,7 @@ public com.google.bigtable.admin.v2.AppProfile.Priority getPriority() { * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @param value The priority to set. * @return This builder for chaining. */ @@ -6516,7 +6516,7 @@ public Builder setPriority(com.google.bigtable.admin.v2.AppProfile.Priority valu * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java index e0250ede66..66bd6fcd50 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java @@ -216,7 +216,7 @@ public interface AppProfileOrBuilder * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return Whether the priority field is set. */ @java.lang.Deprecated @@ -235,7 +235,7 @@ public interface AppProfileOrBuilder * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return The enum numeric value on the wire for priority. */ @java.lang.Deprecated @@ -254,7 +254,7 @@ public interface AppProfileOrBuilder * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See - * google/bigtable/admin/v2/instance.proto;l=406 + * google/bigtable/admin/v2/instance.proto;l=421 * @return The priority. */ @java.lang.Deprecated diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java index b308902511..48d4b3687b 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java @@ -67,6 +67,8 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl switch (number) { case 5: return internalGetLabels(); + case 12: + return internalGetTags(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -878,6 +880,153 @@ public boolean getSatisfiesPzi() { return satisfiesPzi_; } + public static final int TAGS_FIELD_NUMBER = 12; + + private static final class TagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -915,6 +1064,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000004) != 0)) { output.writeBool(11, satisfiesPzi_); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTags(), TagsDefaultEntryHolder.defaultEntry, 12); getUnknownFields().writeTo(output); } @@ -955,6 +1106,16 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, satisfiesPzi_); } + for (java.util.Map.Entry entry : + internalGetTags().getMap().entrySet()) { + com.google.protobuf.MapEntry tags__ = + TagsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, tags__); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -987,6 +1148,7 @@ public boolean equals(final java.lang.Object obj) { if (hasSatisfiesPzi()) { if (getSatisfiesPzi() != other.getSatisfiesPzi()) return false; } + if (!internalGetTags().equals(other.internalGetTags())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1022,6 +1184,10 @@ public int hashCode() { hash = (37 * hash) + SATISFIES_PZI_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzi()); } + if (!internalGetTags().getMap().isEmpty()) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTags().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1149,6 +1315,8 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl switch (number) { case 5: return internalGetLabels(); + case 12: + return internalGetTags(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -1160,6 +1328,8 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFi switch (number) { case 5: return internalGetMutableLabels(); + case 12: + return internalGetMutableTags(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -1207,6 +1377,7 @@ public Builder clear() { } satisfiesPzs_ = false; satisfiesPzi_ = false; + internalGetMutableTags().clear(); return this; } @@ -1272,6 +1443,10 @@ private void buildPartial0(com.google.bigtable.admin.v2.Instance result) { result.satisfiesPzi_ = satisfiesPzi_; to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + } result.bitField0_ |= to_bitField0_; } @@ -1347,6 +1522,8 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Instance other) { if (other.hasSatisfiesPzi()) { setSatisfiesPzi(other.getSatisfiesPzi()); } + internalGetMutableTags().mergeFrom(other.internalGetTags()); + bitField0_ |= 0x00000100; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1427,6 +1604,15 @@ public Builder mergeFrom( bitField0_ |= 0x00000080; break; } // case 88 + case 98: + { + com.google.protobuf.MapEntry tags__ = + input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTags().getMutableMap().put(tags__.getKey(), tags__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 98 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2499,6 +2685,248 @@ public Builder clearSatisfiesPzi() { return this; } + private com.google.protobuf.MapField tags_; + + private com.google.protobuf.MapField internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + private com.google.protobuf.MapField + internalGetMutableTags() { + if (tags_ == null) { + tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry); + } + if (!tags_.isMutable()) { + tags_ = tags_.copy(); + } + bitField0_ |= 0x00000100; + onChanged(); + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTags().getMap().containsKey(key); + } + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getTagsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTags() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableTags().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTags(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTags().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableTags() { + bitField0_ |= 0x00000100; + return internalGetMutableTags().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putTags(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTags().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + + /** + * + * + *
+     * Optional. Input only. Immutable. Tag keys/values directly bound to this
+     * resource. For example:
+     * - "123/environment": "production",
+     * - "123/costCenter": "marketing"
+     *
+     * Tags and Labels (above) are both used to bind metadata to resources, with
+     * different use-cases. See
+     * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+     * in-depth overview on the difference between tags and labels.
+     * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllTags(java.util.Map values) { + internalGetMutableTags().getMutableMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java index 981f2572f7..600b20b9a8 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java @@ -348,4 +348,117 @@ java.lang.String getLabelsOrDefault( * @return The satisfiesPzi. */ boolean getSatisfiesPzi(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + int getTagsCount(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsTags(java.lang.String key); + + /** Use {@link #getTagsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getTags(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getTagsMap(); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. Input only. Immutable. Tag keys/values directly bound to this
+   * resource. For example:
+   * - "123/environment": "production",
+   * - "123/costCenter": "marketing"
+   *
+   * Tags and Labels (above) are both used to bind metadata to resources, with
+   * different use-cases. See
+   * https://cloud.google.com/resource-manager/docs/tags/tags-overview for an
+   * in-depth overview on the difference between tags and labels.
+   * 
+ * + * + * map<string, string> tags = 12 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getTagsOrThrow(java.lang.String key); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java index df921fcbf8..6b13c7cd56 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java @@ -36,6 +36,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -110,7 +114,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "o\022\030google.bigtable.admin.v2\032\037google/api/" + "field_behavior.proto\032\031google/api/resourc" + "e.proto\032%google/bigtable/admin/v2/common" - + ".proto\032\037google/protobuf/timestamp.proto\"\223\005\n" + + ".proto\032\037google/protobuf/timestamp.proto\"\207\006\n" + "\010Instance\022\014\n" + "\004name\030\001 \001(\t\022\031\n" + "\014display_name\030\002 \001(\tB\003\340A\002\022<\n" @@ -121,9 +125,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\013create_time\030\007" + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\037\n\r" + "satisfies_pzs\030\010 \001(\010B\003\340A\003H\000\210\001\001\022\037\n\r" - + "satisfies_pzi\030\013 \001(\010B\003\340A\003H\001\210\001\001\032-\n" + + "satisfies_pzi\030\013 \001(\010B\003\340A\003H\001\210\001\001\022E\n" + + "\004tags\030\014 \003(\0132,.google.bigtable.admin.v2.Instance.TagsEntryB" + + "\t\340A\004\340A\005\340A\001\032-\n" + "\013LabelsEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\032+\n" + + "\tTagsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + "\005value\030\002 \001(\t:\0028\001\"5\n" + "\005State\022\023\n" + "\017STATE_NOT_KNOWN\020\000\022\t\n" @@ -150,14 +159,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\005state\030\003" + " \001(\0162\'.google.bigtable.admin.v2.Cluster.StateB\003\340A\003\022\023\n" + "\013serve_nodes\030\004 \001(\005\022U\n" - + "\023node_scaling_factor\030\t \001(\01623." - + "google.bigtable.admin.v2.Cluster.NodeScalingFactorB\003\340A\005\022I\n" - + "\016cluster_config\030\007 \001(\0132" - + "/.google.bigtable.admin.v2.Cluster.ClusterConfigH\000\022H\n" - + "\024default_storage_type\030\005 \001(\016" - + "2%.google.bigtable.admin.v2.StorageTypeB\003\340A\005\022R\n" - + "\021encryption_config\030\006 \001(\01322.google" - + ".bigtable.admin.v2.Cluster.EncryptionConfigB\003\340A\005\032\270\001\n" + + "\023node_scaling_factor\030\t \001(\01623.goog" + + "le.bigtable.admin.v2.Cluster.NodeScalingFactorB\003\340A\005\022I\n" + + "\016cluster_config\030\007 \001(\0132/.go" + + "ogle.bigtable.admin.v2.Cluster.ClusterConfigH\000\022H\n" + + "\024default_storage_type\030\005 \001(\0162%.g" + + "oogle.bigtable.admin.v2.StorageTypeB\003\340A\005\022R\n" + + "\021encryption_config\030\006 \001(\01322.google.big" + + "table.admin.v2.Cluster.EncryptionConfigB\003\340A\005\032\270\001\n" + "\030ClusterAutoscalingConfig\022L\n" + "\022autoscaling_limits\030\001" + " \001(\0132+.google.bigtable.admin.v2.AutoscalingLimitsB\003\340A\002\022N\n" @@ -179,28 +188,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\037NODE_SCALING_FACTOR_UNSPECIFIED\020\000\022\032\n" + "\026NODE_SCALING_FACTOR_1X\020\001\022\032\n" + "\026NODE_SCALING_FACTOR_2X\020\002:x\352Au\n" - + "$bigtableadmin.googleapis.com/Cluster\022:projects" - + "/{project}/instances/{instance}/clusters/{cluster}*\010clusters2\007clusterB\010\n" + + "$bigtableadmin.googleapis.com/Cluster\022:projects/{pr" + + "oject}/instances/{instance}/clusters/{cluster}*\010clusters2\007clusterB\010\n" + "\006config\"\355\n\n\n" + "AppProfile\022\014\n" + "\004name\030\001 \001(\t\022\014\n" + "\004etag\030\002 \001(\t\022\023\n" + "\013description\030\003 \001(\t\022g\n" - + "\035multi_cluster_routing_use_any\030\005 \001(\0132>.google.bigtable" - + ".admin.v2.AppProfile.MultiClusterRoutingUseAnyH\000\022[\n" - + "\026single_cluster_routing\030\006 \001(\013" - + "29.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingH\000\022E\n" - + "\010priority\030\007 \001(\0162" - + "-.google.bigtable.admin.v2.AppProfile.PriorityB\002\030\001H\001\022T\n" - + "\022standard_isolation\030\013 \001(\013" - + "26.google.bigtable.admin.v2.AppProfile.StandardIsolationH\001\022i\n" + + "\035multi_cluster_routing_use_any\030\005 \001(\0132>.google.bigtable.adm" + + "in.v2.AppProfile.MultiClusterRoutingUseAnyH\000\022[\n" + + "\026single_cluster_routing\030\006 \001(\01329.g" + + "oogle.bigtable.admin.v2.AppProfile.SingleClusterRoutingH\000\022E\n" + + "\010priority\030\007 \001(\0162-.go" + + "ogle.bigtable.admin.v2.AppProfile.PriorityB\002\030\001H\001\022T\n" + + "\022standard_isolation\030\013 \001(\01326.g" + + "oogle.bigtable.admin.v2.AppProfile.StandardIsolationH\001\022i\n" + "\036data_boost_isolation_read_only\030\n" - + " \001(\0132?.google.bigtable.adm" - + "in.v2.AppProfile.DataBoostIsolationReadOnlyH\001\032\257\001\n" + + " \001(\0132?.google.bigtable.admin.v" + + "2.AppProfile.DataBoostIsolationReadOnlyH\001\032\257\001\n" + "\031MultiClusterRoutingUseAny\022\023\n" + "\013cluster_ids\030\001 \003(\t\022b\n" - + "\014row_affinity\030\003 \001(\0132J" - + ".google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinityH\000\032\r\n" + + "\014row_affinity\030\003 \001(\0132J.goo" + + "gle.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinityH\000\032\r\n" + "\013RowAffinityB\n\n" + "\010affinity\032N\n" + "\024SingleClusterRouting\022\022\n\n" @@ -210,8 +219,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\010priority\030\001" + " \001(\0162-.google.bigtable.admin.v2.AppProfile.Priority\032\374\001\n" + "\032DataBoostIsolationReadOnly\022w\n" - + "\025compute_billing_owner\030\001 \001(\0162S.google.bigtable.admin.v2.A" - + "ppProfile.DataBoostIsolationReadOnly.ComputeBillingOwnerH\000\210\001\001\"K\n" + + "\025compute_billing_owner\030\001 \001(\0162S.google.bigtable.admin.v2.AppPr" + + "ofile.DataBoostIsolationReadOnly.ComputeBillingOwnerH\000\210\001\001\"K\n" + "\023ComputeBillingOwner\022%\n" + "!COMPUTE_BILLING_OWNER_UNSPECIFIED\020\000\022\r\n" + "\tHOST_PAYS\020\001B\030\n" @@ -219,10 +228,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\010Priority\022\030\n" + "\024PRIORITY_UNSPECIFIED\020\000\022\020\n" + "\014PRIORITY_LOW\020\001\022\023\n" - + "\017PRIORITY_MEDIUM\020\002\022\021\n\r" + + "\017PRIORITY_MEDIUM\020\002\022\021\n" + + "\r" + "PRIORITY_HIGH\020\003:\211\001\352A\205\001\n" - + "\'bigtableadmin.googleapis.com/AppProfile\022Aprojects/{" - + "project}/instances/{instance}/appProfiles/{app_profile}*\013appProfiles2\n" + + "\'bigtableadmin.googleapis.com/AppProfile\022Aprojects/{proj" + + "ect}/instances/{instance}/appProfiles/{app_profile}*\013appProfiles2\n" + "appProfileB\020\n" + "\016routing_policyB\013\n" + "\tisolation\"\241\003\n" @@ -235,30 +245,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\tstart_key\030\005 \001(\t\022\017\n" + "\007end_key\030\006 \001(\t\022#\n" + "\026node_cpu_usage_percent\030\007 \001(\002B\003\340A\003:\227\001\352A\223\001\n" - + "&bigtableadmin.googleapis.com/HotTablet\022Rprojects/{proj" - + "ect}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}*\n" + + "&bigtableadmin.googleapis.com/HotTablet\022Rprojects/{project}" + + "/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}*\n" + "hotTablets2\thotTablet\"\372\001\n" + "\013LogicalView\022\021\n" + "\004name\030\001 \001(\tB\003\340A\010\022\022\n" + "\005query\030\002 \001(\tB\003\340A\002\022\021\n" + "\004etag\030\003 \001(\tB\003\340A\001\022 \n" + "\023deletion_protection\030\006 \001(\010B\003\340A\001:\216\001\352A\212\001\n" - + "(bigtableadmin.googleapis.com/LogicalView\022Cprojects/{project}/instances/{" - + "instance}/logicalViews/{logical_view}*\014logicalViews2\013logicalView\"\226\002\n" + + "(bigtableadmin.googleapis.com/LogicalView\022Cprojects/{project}/instances/{inst" + + "ance}/logicalViews/{logical_view}*\014logicalViews2\013logicalView\"\226\002\n" + "\020MaterializedView\022\021\n" + "\004name\030\001 \001(\tB\003\340A\010\022\025\n" + "\005query\030\002 \001(\tB\006\340A\002\340A\005\022\021\n" + "\004etag\030\003 \001(\tB\003\340A\001\022\033\n" + "\023deletion_protection\030\006 \001(\010:\247\001\352A\243\001\n" - + "-bigtableadmin.googleapis.com/MaterializedView\022Mprojects/" - + "{project}/instances/{instance}/materiali" - + "zedViews/{materialized_view}*\021materializedViews2\020materializedViewB\313\002\n" + + "-bigtableadmin.googleapis.com/MaterializedView\022Mprojects/{pro" + + "ject}/instances/{instance}/materializedV" + + "iews/{materialized_view}*\021materializedViews2\020materializedViewB\313\002\n" + "\034com.google.bigtable.admin.v2B\r" - + "InstanceProtoP\001Z8cloud.google.com/go/bigtable/admin/apiv2/ad" - + "minpb;adminpb\252\002\036Google.Cloud.Bigtable.Ad" - + "min.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"Google::Cloud::Bigtable::Admin::V2\352Ax\n" - + "!cloudkms.googleapis.com/CryptoKey\022Sprojects/{project}/locations/{location}/keyR" - + "ings/{key_ring}/cryptoKeys/{crypto_key}b\006proto3" + + "InstanceProtoP\001Z8cloud.google.com/go/bigtable/admin/apiv2/adminp" + + "b;adminpb\252\002\036Google.Cloud.Bigtable.Admin." + + "V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"Google::Cloud::Bigtable::Admin::V2\352Ax\n" + + "!cloudkms.googleapis.com/CryptoKey\022Sprojects" + + "/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -283,6 +293,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CreateTime", "SatisfiesPzs", "SatisfiesPzi", + "Tags", }); internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor = internal_static_google_bigtable_admin_v2_Instance_descriptor.getNestedTypes().get(0); @@ -292,6 +303,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor = + internal_static_google_bigtable_admin_v2_Instance_descriptor.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Instance_TagsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_google_bigtable_admin_v2_AutoscalingTargets_fieldAccessorTable = diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto index 5ab1e5c693..5baa006a9c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto @@ -114,6 +114,21 @@ message Instance { // Output only. Reserved for future use. optional bool satisfies_pzi = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // - "123/environment": "production", + // - "123/costCenter": "marketing" + // + // Tags and Labels (above) are both used to bind metadata to resources, with + // different use-cases. See + // https://cloud.google.com/resource-manager/docs/tags/tags-overview for an + // in-depth overview on the difference between tags and labels. + map tags = 12 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; } // The Autoscaling targets for a Cluster. These determine the recommended nodes. From 3646452a738e5a1e07762685febc982f2077fed1 Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Fri, 8 Aug 2025 10:28:07 -0400 Subject: [PATCH 06/23] deps: update shared dependencies (#2654) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- google-cloud-bigtable-bom/pom.xml | 2 +- google-cloud-bigtable-deps-bom/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 97ae2bde94..9d008fd94a 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -14,6 +14,6 @@ jobs: shell: bash run: .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.50.2 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.51.0 with: bom-path: google-cloud-bigtable-bom/pom.xml diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index 028f553395..5dfbb5222b 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.50.2 + 3.51.0 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index a9201bdcb2..c3287da1e1 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -7,7 +7,7 @@ com.google.cloud sdk-platform-java-config - 3.50.2 + 3.51.0 diff --git a/pom.xml b/pom.xml index b29a9c702f..0874890652 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.50.2 + 3.51.0 From b7418699895c2a036d53de21d9a001119205bc8a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 13:29:25 -0400 Subject: [PATCH 07/23] chore(main): release 2.64.0 (#2652) * chore(main): release 2.64.0 * chore: generate libraries at Fri Aug 8 14:28:59 UTC 2025 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot --- CHANGELOG.md | 17 +++++++++++++++++ README.md | 6 +++--- google-cloud-bigtable-bom/pom.xml | 16 ++++++++-------- google-cloud-bigtable-deps-bom/pom.xml | 2 +- google-cloud-bigtable-emulator-core/pom.xml | 4 ++-- google-cloud-bigtable-emulator/pom.xml | 10 +++++----- google-cloud-bigtable/pom.xml | 10 +++++----- .../java/com/google/cloud/bigtable/Version.java | 2 +- grpc-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- grpc-google-cloud-bigtable-v2/pom.xml | 8 ++++---- pom.xml | 12 ++++++------ proto-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- proto-google-cloud-bigtable-v2/pom.xml | 8 ++++---- samples/snapshot/pom.xml | 2 +- test-proxy/pom.xml | 4 ++-- versions.txt | 14 +++++++------- 16 files changed, 74 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79807e6815..4b71d54a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.64.0](https://github.com/googleapis/java-bigtable/compare/v2.63.0...v2.64.0) (2025-08-08) + + +### Features + +* Add tags field to Instance proto (stable branch) ([089d527](https://github.com/googleapis/java-bigtable/commit/089d52700c225015fabfaa763163c5874b96d830)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.61.0 ([089d527](https://github.com/googleapis/java-bigtable/commit/089d52700c225015fabfaa763163c5874b96d830)) + + +### Dependencies + +* Update shared dependencies ([#2654](https://github.com/googleapis/java-bigtable/issues/2654)) ([4b706f4](https://github.com/googleapis/java-bigtable/commit/4b706f4f76a8152556aa99656b440adb30f37a4c)) + ## [2.63.0](https://github.com/googleapis/java-bigtable/compare/v2.62.0...v2.63.0) (2025-07-30) diff --git a/README.md b/README.md index 8e2349cb53..e6de4e17e4 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-bigtable' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigtable:2.63.0' +implementation 'com.google.cloud:google-cloud-bigtable:2.64.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.63.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.64.0" ``` ## Authentication @@ -470,7 +470,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.63.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.64.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index 5dfbb5222b..7c0eaa322b 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 2.63.1-SNAPSHOT + 2.64.0 pom com.google.cloud @@ -63,37 +63,37 @@ com.google.cloud google-cloud-bigtable - 2.63.1-SNAPSHOT + 2.64.0 com.google.cloud google-cloud-bigtable-emulator - 0.200.1-SNAPSHOT + 0.201.0 com.google.cloud google-cloud-bigtable-emulator-core - 0.200.1-SNAPSHOT + 0.201.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.63.1-SNAPSHOT + 2.64.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.63.1-SNAPSHOT + 2.64.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.63.1-SNAPSHOT + 2.64.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.63.1-SNAPSHOT + 2.64.0 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index c3287da1e1..73cfb992ff 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -13,7 +13,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.63.1-SNAPSHOT + 2.64.0 pom Google Cloud Bigtable Dependency BOM diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml index 149b1e4338..179f1b79c9 100644 --- a/google-cloud-bigtable-emulator-core/pom.xml +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -7,12 +7,12 @@ google-cloud-bigtable-parent com.google.cloud - 2.63.1-SNAPSHOT + 2.64.0 Google Cloud Java - Bigtable Emulator Core google-cloud-bigtable-emulator-core - 0.200.1-SNAPSHOT + 0.201.0 A Java wrapper for the Cloud Bigtable emulator. diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index 5f04bea5d1..4b58765562 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.200.1-SNAPSHOT + 0.201.0 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.63.1-SNAPSHOT + 2.64.0 scm:git:git@github.com:googleapis/java-bigtable.git @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import @@ -99,7 +99,7 @@ com.google.cloud google-cloud-bigtable-emulator-core - 0.200.1-SNAPSHOT + 0.201.0 diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 21891924dd..62076927a9 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.63.1-SNAPSHOT + 2.64.0 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.63.1-SNAPSHOT + 2.64.0 - 2.63.1-SNAPSHOT + 2.64.0 google-cloud-bigtable @@ -54,14 +54,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index 5b2717aca0..48692319b1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -20,6 +20,6 @@ @InternalApi("For internal use only") public final class Version { // {x-version-update-start:google-cloud-bigtable:current} - public static String VERSION = "2.63.1-SNAPSHOT"; + public static String VERSION = "2.64.0"; // {x-version-update-end} } diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index e89cb34ce8..e2eb49575b 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.63.1-SNAPSHOT + 2.64.0 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.63.1-SNAPSHOT + 2.64.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index 1e03dc6016..3fde6ce3e1 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.63.1-SNAPSHOT + 2.64.0 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.63.1-SNAPSHOT + 2.64.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import diff --git a/pom.xml b/pom.xml index 0874890652..d45c26f232 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.63.1-SNAPSHOT + 2.64.0 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -156,27 +156,27 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.63.1-SNAPSHOT + 2.64.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.63.1-SNAPSHOT + 2.64.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.63.1-SNAPSHOT + 2.64.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.63.1-SNAPSHOT + 2.64.0 com.google.cloud google-cloud-bigtable - 2.63.1-SNAPSHOT + 2.64.0 diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 491e8d0602..736d9ea67a 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.63.1-SNAPSHOT + 2.64.0 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.63.1-SNAPSHOT + 2.64.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index 3623a30109..0d1c4115c5 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.63.1-SNAPSHOT + 2.64.0 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.63.1-SNAPSHOT + 2.64.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.63.1-SNAPSHOT + 2.64.0 pom import diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fb56cdc73b..06f00b328d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.63.1-SNAPSHOT + 2.64.0 diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml index 294c0123df..5ffcbe7992 100644 --- a/test-proxy/pom.xml +++ b/test-proxy/pom.xml @@ -12,11 +12,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.63.1-SNAPSHOT + 2.64.0 - 2.63.1-SNAPSHOT + 2.64.0 diff --git a/versions.txt b/versions.txt index d6d2b8a291..b1a2b64035 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.63.0:2.63.1-SNAPSHOT -grpc-google-cloud-bigtable-admin-v2:2.63.0:2.63.1-SNAPSHOT -grpc-google-cloud-bigtable-v2:2.63.0:2.63.1-SNAPSHOT -proto-google-cloud-bigtable-admin-v2:2.63.0:2.63.1-SNAPSHOT -proto-google-cloud-bigtable-v2:2.63.0:2.63.1-SNAPSHOT -google-cloud-bigtable-emulator:0.200.0:0.200.1-SNAPSHOT -google-cloud-bigtable-emulator-core:0.200.0:0.200.1-SNAPSHOT +google-cloud-bigtable:2.64.0:2.64.0 +grpc-google-cloud-bigtable-admin-v2:2.64.0:2.64.0 +grpc-google-cloud-bigtable-v2:2.64.0:2.64.0 +proto-google-cloud-bigtable-admin-v2:2.64.0:2.64.0 +proto-google-cloud-bigtable-v2:2.64.0:2.64.0 +google-cloud-bigtable-emulator:0.201.0:0.201.0 +google-cloud-bigtable-emulator-core:0.201.0:0.201.0 From bafedf9497883daa59ffcb1409ca05b398ae6609 Mon Sep 17 00:00:00 2001 From: Sushan Bhattarai Date: Mon, 11 Aug 2025 18:26:25 -0400 Subject: [PATCH 08/23] feat(bigtable): lower the value for max rpc channels as channel resize is slow (1m, 2 channel) (#2656) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …conservative Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigtable/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) - [ ] Rollback plan is reviewed and LGTMed - [ ] All new data plane features have a completed end to end testing plan Fixes # ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). --- .../bigtable/data/v2/stub/EnhancedBigtableStubSettings.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index d994634aa2..31d6f76055 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -446,7 +446,9 @@ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProvi ChannelPoolSettings.builder() .setInitialChannelCount(10) .setMinRpcsPerChannel(1) - .setMaxRpcsPerChannel(50) + // Keep it conservative as we scale the channel size every 1min + // and delta is 2 channels. + .setMaxRpcsPerChannel(25) .setPreemptiveRefreshEnabled(true) .build()) .setMaxInboundMessageSize(MAX_MESSAGE_SIZE) From cbdb4e2a29e4af767128e76ca8aff3afd93b8725 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 16:24:50 +0000 Subject: [PATCH 09/23] chore(main): release 2.64.1-SNAPSHOT (#2655) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- google-cloud-bigtable-bom/pom.xml | 16 ++++++++-------- google-cloud-bigtable-deps-bom/pom.xml | 2 +- google-cloud-bigtable-emulator-core/pom.xml | 4 ++-- google-cloud-bigtable-emulator/pom.xml | 10 +++++----- google-cloud-bigtable/pom.xml | 10 +++++----- .../java/com/google/cloud/bigtable/Version.java | 2 +- grpc-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- grpc-google-cloud-bigtable-v2/pom.xml | 8 ++++---- pom.xml | 12 ++++++------ proto-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- proto-google-cloud-bigtable-v2/pom.xml | 8 ++++---- samples/snapshot/pom.xml | 2 +- test-proxy/pom.xml | 4 ++-- versions.txt | 14 +++++++------- 14 files changed, 54 insertions(+), 54 deletions(-) diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index 7c0eaa322b..eb1a39a45d 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 2.64.0 + 2.64.1-SNAPSHOT pom com.google.cloud @@ -63,37 +63,37 @@ com.google.cloud google-cloud-bigtable - 2.64.0 + 2.64.1-SNAPSHOT com.google.cloud google-cloud-bigtable-emulator - 0.201.0 + 0.201.1-SNAPSHOT com.google.cloud google-cloud-bigtable-emulator-core - 0.201.0 + 0.201.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.64.0 + 2.64.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.64.0 + 2.64.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.64.0 + 2.64.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.64.0 + 2.64.1-SNAPSHOT diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index 73cfb992ff..c06fe7f1ea 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -13,7 +13,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.0 + 2.64.1-SNAPSHOT pom Google Cloud Bigtable Dependency BOM diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml index 179f1b79c9..1cc6bb3fbe 100644 --- a/google-cloud-bigtable-emulator-core/pom.xml +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -7,12 +7,12 @@ google-cloud-bigtable-parent com.google.cloud - 2.64.0 + 2.64.1-SNAPSHOT Google Cloud Java - Bigtable Emulator Core google-cloud-bigtable-emulator-core - 0.201.0 + 0.201.1-SNAPSHOT A Java wrapper for the Cloud Bigtable emulator. diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index 4b58765562..3ceb5c7374 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.201.0 + 0.201.1-SNAPSHOT Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.64.0 + 2.64.1-SNAPSHOT scm:git:git@github.com:googleapis/java-bigtable.git @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import @@ -99,7 +99,7 @@ com.google.cloud google-cloud-bigtable-emulator-core - 0.201.0 + 0.201.1-SNAPSHOT diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 62076927a9..268047803c 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.64.0 + 2.64.1-SNAPSHOT jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.64.0 + 2.64.1-SNAPSHOT - 2.64.0 + 2.64.1-SNAPSHOT google-cloud-bigtable @@ -54,14 +54,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index 48692319b1..2bffa45f34 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -20,6 +20,6 @@ @InternalApi("For internal use only") public final class Version { // {x-version-update-start:google-cloud-bigtable:current} - public static String VERSION = "2.64.0"; + public static String VERSION = "2.64.1-SNAPSHOT"; // {x-version-update-end} } diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index e2eb49575b..cec4dc12e7 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.64.0 + 2.64.1-SNAPSHOT grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.0 + 2.64.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index 3fde6ce3e1..d4409084c6 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.64.0 + 2.64.1-SNAPSHOT grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.0 + 2.64.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import diff --git a/pom.xml b/pom.xml index d45c26f232..02608a0570 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.64.0 + 2.64.1-SNAPSHOT Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -156,27 +156,27 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.64.0 + 2.64.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.64.0 + 2.64.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.64.0 + 2.64.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.64.0 + 2.64.1-SNAPSHOT com.google.cloud google-cloud-bigtable - 2.64.0 + 2.64.1-SNAPSHOT diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 736d9ea67a..6115ca0bd0 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.64.0 + 2.64.1-SNAPSHOT proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.0 + 2.64.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index 0d1c4115c5..b44eb7613e 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.64.0 + 2.64.1-SNAPSHOT proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.0 + 2.64.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.64.0 + 2.64.1-SNAPSHOT pom import diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 06f00b328d..5a6ac51855 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.64.0 + 2.64.1-SNAPSHOT diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml index 5ffcbe7992..235a990963 100644 --- a/test-proxy/pom.xml +++ b/test-proxy/pom.xml @@ -12,11 +12,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.64.0 + 2.64.1-SNAPSHOT - 2.64.0 + 2.64.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index b1a2b64035..704169ee44 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.64.0:2.64.0 -grpc-google-cloud-bigtable-admin-v2:2.64.0:2.64.0 -grpc-google-cloud-bigtable-v2:2.64.0:2.64.0 -proto-google-cloud-bigtable-admin-v2:2.64.0:2.64.0 -proto-google-cloud-bigtable-v2:2.64.0:2.64.0 -google-cloud-bigtable-emulator:0.201.0:0.201.0 -google-cloud-bigtable-emulator-core:0.201.0:0.201.0 +google-cloud-bigtable:2.64.0:2.64.1-SNAPSHOT +grpc-google-cloud-bigtable-admin-v2:2.64.0:2.64.1-SNAPSHOT +grpc-google-cloud-bigtable-v2:2.64.0:2.64.1-SNAPSHOT +proto-google-cloud-bigtable-admin-v2:2.64.0:2.64.1-SNAPSHOT +proto-google-cloud-bigtable-v2:2.64.0:2.64.1-SNAPSHOT +google-cloud-bigtable-emulator:0.201.0:0.201.1-SNAPSHOT +google-cloud-bigtable-emulator-core:0.201.0:0.201.1-SNAPSHOT From 0422092c1e8445c8b439cf99d2b6786d0f160d7b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 15:49:59 -0400 Subject: [PATCH 10/23] chore(main): release 2.65.0 (#2657) * chore(main): release 2.65.0 * chore: generate libraries at Tue Aug 12 16:25:49 UTC 2025 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot --- CHANGELOG.md | 7 +++++++ README.md | 6 +++--- google-cloud-bigtable-bom/pom.xml | 16 ++++++++-------- google-cloud-bigtable-deps-bom/pom.xml | 2 +- google-cloud-bigtable-emulator-core/pom.xml | 4 ++-- google-cloud-bigtable-emulator/pom.xml | 10 +++++----- google-cloud-bigtable/pom.xml | 10 +++++----- .../java/com/google/cloud/bigtable/Version.java | 2 +- grpc-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- grpc-google-cloud-bigtable-v2/pom.xml | 8 ++++---- pom.xml | 12 ++++++------ proto-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- proto-google-cloud-bigtable-v2/pom.xml | 8 ++++---- samples/snapshot/pom.xml | 2 +- test-proxy/pom.xml | 4 ++-- versions.txt | 14 +++++++------- 16 files changed, 64 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b71d54a61..471d2ef201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.65.0](https://github.com/googleapis/java-bigtable/compare/v2.64.0...v2.65.0) (2025-08-12) + + +### Features + +* **bigtable:** Lower the value for max rpc channels as channel resize is slow (1m, 2 channel) ([#2656](https://github.com/googleapis/java-bigtable/issues/2656)) ([d8055c1](https://github.com/googleapis/java-bigtable/commit/d8055c1fb75a616cda1503b92d7cddb9da47d42b)) + ## [2.64.0](https://github.com/googleapis/java-bigtable/compare/v2.63.0...v2.64.0) (2025-08-08) diff --git a/README.md b/README.md index e6de4e17e4..f0632fb704 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-bigtable' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigtable:2.64.0' +implementation 'com.google.cloud:google-cloud-bigtable:2.65.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.64.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.65.0" ``` ## Authentication @@ -470,7 +470,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.64.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.65.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index eb1a39a45d..eff7543e39 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 2.64.1-SNAPSHOT + 2.65.0 pom com.google.cloud @@ -63,37 +63,37 @@ com.google.cloud google-cloud-bigtable - 2.64.1-SNAPSHOT + 2.65.0 com.google.cloud google-cloud-bigtable-emulator - 0.201.1-SNAPSHOT + 0.202.0 com.google.cloud google-cloud-bigtable-emulator-core - 0.201.1-SNAPSHOT + 0.202.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.64.1-SNAPSHOT + 2.65.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.64.1-SNAPSHOT + 2.65.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.64.1-SNAPSHOT + 2.65.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.64.1-SNAPSHOT + 2.65.0 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index c06fe7f1ea..46fadcb3de 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -13,7 +13,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.1-SNAPSHOT + 2.65.0 pom Google Cloud Bigtable Dependency BOM diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml index 1cc6bb3fbe..937195d401 100644 --- a/google-cloud-bigtable-emulator-core/pom.xml +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -7,12 +7,12 @@ google-cloud-bigtable-parent com.google.cloud - 2.64.1-SNAPSHOT + 2.65.0 Google Cloud Java - Bigtable Emulator Core google-cloud-bigtable-emulator-core - 0.201.1-SNAPSHOT + 0.202.0 A Java wrapper for the Cloud Bigtable emulator. diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index 3ceb5c7374..aa19040b19 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.201.1-SNAPSHOT + 0.202.0 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.64.1-SNAPSHOT + 2.65.0 scm:git:git@github.com:googleapis/java-bigtable.git @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import @@ -99,7 +99,7 @@ com.google.cloud google-cloud-bigtable-emulator-core - 0.201.1-SNAPSHOT + 0.202.0 diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 268047803c..5e349a37ef 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.64.1-SNAPSHOT + 2.65.0 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.64.1-SNAPSHOT + 2.65.0 - 2.64.1-SNAPSHOT + 2.65.0 google-cloud-bigtable @@ -54,14 +54,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index 2bffa45f34..feec70ce1f 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -20,6 +20,6 @@ @InternalApi("For internal use only") public final class Version { // {x-version-update-start:google-cloud-bigtable:current} - public static String VERSION = "2.64.1-SNAPSHOT"; + public static String VERSION = "2.65.0"; // {x-version-update-end} } diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index cec4dc12e7..dee0732f44 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.64.1-SNAPSHOT + 2.65.0 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.1-SNAPSHOT + 2.65.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index d4409084c6..e17eec6c6b 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.64.1-SNAPSHOT + 2.65.0 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.1-SNAPSHOT + 2.65.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import diff --git a/pom.xml b/pom.xml index 02608a0570..353760ce24 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.64.1-SNAPSHOT + 2.65.0 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -156,27 +156,27 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.64.1-SNAPSHOT + 2.65.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.64.1-SNAPSHOT + 2.65.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.64.1-SNAPSHOT + 2.65.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.64.1-SNAPSHOT + 2.65.0 com.google.cloud google-cloud-bigtable - 2.64.1-SNAPSHOT + 2.65.0 diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 6115ca0bd0..124107d025 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.64.1-SNAPSHOT + 2.65.0 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.1-SNAPSHOT + 2.65.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index b44eb7613e..8e3b79082d 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.64.1-SNAPSHOT + 2.65.0 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.64.1-SNAPSHOT + 2.65.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.64.1-SNAPSHOT + 2.65.0 pom import diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5a6ac51855..b1b2d2c9fb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.64.1-SNAPSHOT + 2.65.0 diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml index 235a990963..1cb803192b 100644 --- a/test-proxy/pom.xml +++ b/test-proxy/pom.xml @@ -12,11 +12,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.64.1-SNAPSHOT + 2.65.0 - 2.64.1-SNAPSHOT + 2.65.0 diff --git a/versions.txt b/versions.txt index 704169ee44..ceb4c7a572 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.64.0:2.64.1-SNAPSHOT -grpc-google-cloud-bigtable-admin-v2:2.64.0:2.64.1-SNAPSHOT -grpc-google-cloud-bigtable-v2:2.64.0:2.64.1-SNAPSHOT -proto-google-cloud-bigtable-admin-v2:2.64.0:2.64.1-SNAPSHOT -proto-google-cloud-bigtable-v2:2.64.0:2.64.1-SNAPSHOT -google-cloud-bigtable-emulator:0.201.0:0.201.1-SNAPSHOT -google-cloud-bigtable-emulator-core:0.201.0:0.201.1-SNAPSHOT +google-cloud-bigtable:2.65.0:2.65.0 +grpc-google-cloud-bigtable-admin-v2:2.65.0:2.65.0 +grpc-google-cloud-bigtable-v2:2.65.0:2.65.0 +proto-google-cloud-bigtable-admin-v2:2.65.0:2.65.0 +proto-google-cloud-bigtable-v2:2.65.0:2.65.0 +google-cloud-bigtable-emulator:0.202.0:0.202.0 +google-cloud-bigtable-emulator-core:0.202.0:0.202.0 From 171ac40a43964e72dc662511118120c0baf46dad Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 13:44:50 -0400 Subject: [PATCH 11/23] chore(main): release 2.65.1-SNAPSHOT (#2658) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- google-cloud-bigtable-bom/pom.xml | 16 ++++++++-------- google-cloud-bigtable-deps-bom/pom.xml | 2 +- google-cloud-bigtable-emulator-core/pom.xml | 4 ++-- google-cloud-bigtable-emulator/pom.xml | 10 +++++----- google-cloud-bigtable/pom.xml | 10 +++++----- .../java/com/google/cloud/bigtable/Version.java | 2 +- grpc-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- grpc-google-cloud-bigtable-v2/pom.xml | 8 ++++---- pom.xml | 12 ++++++------ proto-google-cloud-bigtable-admin-v2/pom.xml | 8 ++++---- proto-google-cloud-bigtable-v2/pom.xml | 8 ++++---- samples/snapshot/pom.xml | 2 +- test-proxy/pom.xml | 4 ++-- versions.txt | 14 +++++++------- 14 files changed, 54 insertions(+), 54 deletions(-) diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index eff7543e39..a2dfbc2945 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 2.65.0 + 2.65.1-SNAPSHOT pom com.google.cloud @@ -63,37 +63,37 @@ com.google.cloud google-cloud-bigtable - 2.65.0 + 2.65.1-SNAPSHOT com.google.cloud google-cloud-bigtable-emulator - 0.202.0 + 0.202.1-SNAPSHOT com.google.cloud google-cloud-bigtable-emulator-core - 0.202.0 + 0.202.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.65.0 + 2.65.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.65.0 + 2.65.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.65.0 + 2.65.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.65.0 + 2.65.1-SNAPSHOT diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index 46fadcb3de..055ae2337c 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -13,7 +13,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.65.0 + 2.65.1-SNAPSHOT pom Google Cloud Bigtable Dependency BOM diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml index 937195d401..c63adfc8e5 100644 --- a/google-cloud-bigtable-emulator-core/pom.xml +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -7,12 +7,12 @@ google-cloud-bigtable-parent com.google.cloud - 2.65.0 + 2.65.1-SNAPSHOT Google Cloud Java - Bigtable Emulator Core google-cloud-bigtable-emulator-core - 0.202.0 + 0.202.1-SNAPSHOT A Java wrapper for the Cloud Bigtable emulator. diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index aa19040b19..06ba48b212 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.202.0 + 0.202.1-SNAPSHOT Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.65.0 + 2.65.1-SNAPSHOT scm:git:git@github.com:googleapis/java-bigtable.git @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import @@ -99,7 +99,7 @@ com.google.cloud google-cloud-bigtable-emulator-core - 0.202.0 + 0.202.1-SNAPSHOT diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 5e349a37ef..ffaa06614a 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.65.0 + 2.65.1-SNAPSHOT jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.65.0 + 2.65.1-SNAPSHOT - 2.65.0 + 2.65.1-SNAPSHOT google-cloud-bigtable @@ -54,14 +54,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index feec70ce1f..4c9652c5b4 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -20,6 +20,6 @@ @InternalApi("For internal use only") public final class Version { // {x-version-update-start:google-cloud-bigtable:current} - public static String VERSION = "2.65.0"; + public static String VERSION = "2.65.1-SNAPSHOT"; // {x-version-update-end} } diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index dee0732f44..1c37843e27 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.65.0 + 2.65.1-SNAPSHOT grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.65.0 + 2.65.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index e17eec6c6b..41598723dd 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.65.0 + 2.65.1-SNAPSHOT grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.65.0 + 2.65.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import diff --git a/pom.xml b/pom.xml index 353760ce24..830313cc2a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.65.0 + 2.65.1-SNAPSHOT Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -156,27 +156,27 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.65.0 + 2.65.1-SNAPSHOT com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.65.0 + 2.65.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.65.0 + 2.65.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.65.0 + 2.65.1-SNAPSHOT com.google.cloud google-cloud-bigtable - 2.65.0 + 2.65.1-SNAPSHOT diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 124107d025..892c1c3e4a 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.65.0 + 2.65.1-SNAPSHOT proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.65.0 + 2.65.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index 8e3b79082d..0d1c3eaf7c 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.65.0 + 2.65.1-SNAPSHOT proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.65.0 + 2.65.1-SNAPSHOT @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import com.google.cloud google-cloud-bigtable-bom - 2.65.0 + 2.65.1-SNAPSHOT pom import diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b1b2d2c9fb..1ff4e5226c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.65.0 + 2.65.1-SNAPSHOT diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml index 1cb803192b..e32854a031 100644 --- a/test-proxy/pom.xml +++ b/test-proxy/pom.xml @@ -12,11 +12,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.65.0 + 2.65.1-SNAPSHOT - 2.65.0 + 2.65.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index ceb4c7a572..d270ff60e7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.65.0:2.65.0 -grpc-google-cloud-bigtable-admin-v2:2.65.0:2.65.0 -grpc-google-cloud-bigtable-v2:2.65.0:2.65.0 -proto-google-cloud-bigtable-admin-v2:2.65.0:2.65.0 -proto-google-cloud-bigtable-v2:2.65.0:2.65.0 -google-cloud-bigtable-emulator:0.202.0:0.202.0 -google-cloud-bigtable-emulator-core:0.202.0:0.202.0 +google-cloud-bigtable:2.65.0:2.65.1-SNAPSHOT +grpc-google-cloud-bigtable-admin-v2:2.65.0:2.65.1-SNAPSHOT +grpc-google-cloud-bigtable-v2:2.65.0:2.65.1-SNAPSHOT +proto-google-cloud-bigtable-admin-v2:2.65.0:2.65.1-SNAPSHOT +proto-google-cloud-bigtable-v2:2.65.0:2.65.1-SNAPSHOT +google-cloud-bigtable-emulator:0.202.0:0.202.1-SNAPSHOT +google-cloud-bigtable-emulator-core:0.202.0:0.202.1-SNAPSHOT From 862135b6fe4abc97b6cc6e3a70fc84005f5b641d Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Wed, 27 Aug 2025 15:04:58 -0400 Subject: [PATCH 12/23] more noop channel primer changes Change-Id: I3baa8e93bc614efe21f1159a708be36881120e34 --- .../clirr-ignored-differences.xml | 13 +++++++++---- .../data/v2/stub/NoOpChannelPrimer.java | 4 +++- .../gaxx/grpc/ChannelPoolHealthChecker.java | 17 ++++++++++++++--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml index fa03e7c287..4223db6dcb 100644 --- a/google-cloud-bigtable/clirr-ignored-differences.xml +++ b/google-cloud-bigtable/clirr-ignored-differences.xml @@ -397,16 +397,14 @@ * - 4001 com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer - * + com/google/api/gax/grpc/ChannelPrimer - 4001 com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer - * + com/google/api/gax/grpc/ChannelPrimer 7005 @@ -414,4 +412,11 @@ *create* * + + + 7005 + com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider + *create* + * + diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java index 67d571a4ff..2d8b49c5bf 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java @@ -36,6 +36,8 @@ public void primeChannel(ManagedChannel managedChannel) { @Override public SettableApiFuture sendPrimeRequestsAsync(ManagedChannel var1) { - return null; + SettableApiFuture future = SettableApiFuture.create(); + future.set(PingAndWarmResponse.getDefaultInstance()); + return future; } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index e77ee03a4f..aa8830d731 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -18,6 +18,8 @@ import com.google.api.core.SettableApiFuture; import com.google.auto.value.AutoValue; import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; +import com.google.cloud.bigtable.data.v2.stub.NoOpChannelPrimer; import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; @@ -113,9 +115,18 @@ public void stop() { @VisibleForTesting void runProbes() { for (Entry entry : this.entrySupplier.get()) { - Instant startTime = clock.instant(); - SettableApiFuture probeFuture = - channelPrimer.sendPrimeRequestsAsync(entry.getManagedChannel()); + final Instant startTime = clock.instant(); + final SettableApiFuture probeFuture; + + if (channelPrimer instanceof BigtableChannelPrimer) { + BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; + probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel()); + } else if (channelPrimer instanceof NoOpChannelPrimer) { + NoOpChannelPrimer primer = (NoOpChannelPrimer) channelPrimer; + probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel()); + } else { + continue; + } probeFuture.addListener(() -> onComplete(entry, startTime, probeFuture), executor); } } From c0082cf97400e3b71a0d045197b3a6d1b8b1c682 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Wed, 27 Aug 2025 15:10:06 -0400 Subject: [PATCH 13/23] remove outdated comments Change-Id: I11e8da901a93a49009caf4caf0385fd5e3c8091b --- .../cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index aa8830d731..46ff076be4 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -35,7 +35,7 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; -/** Stub for a class that will manage the health checking in the BigtableChannelPool */ +/** Class that manages the health checking in the BigtableChannelPool */ public class ChannelPoolHealthChecker { // Configuration constants @@ -106,7 +106,7 @@ void start() { TimeUnit.MILLISECONDS); } - /** Stop running health checking (No-op stub) */ + /** Stop running health checking */ public void stop() { executor.shutdownNow(); } @@ -213,7 +213,7 @@ Entry findOutlierEntry() { .orElse(null); } - /** Periodically detects and removes outlier channels from the pool. (No-op stub) */ + /** Periodically detects and removes outlier channels from the pool. */ @VisibleForTesting void detectAndRemoveOutlierEntries() { if (clock.instant().isBefore(lastEviction.plus(MIN_EVICTION_INTERVAL))) { From 7a007bf5b1bd26bdb2a7ad591bbef08b91b9e2e3 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Wed, 27 Aug 2025 15:12:12 -0400 Subject: [PATCH 14/23] cleanup Change-Id: Iaa30338d04ba846469fc6152e0683e53573c40ee --- .../cloud/bigtable/data/v2/stub/BigtableClientContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java index a7e19ae345..92a984a015 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java @@ -122,7 +122,7 @@ public static BigtableClientContext create(EnhancedBigtableStubSettings settings setupCookieHolder(transportProvider); } - ChannelPrimer channelPrimer = (ChannelPrimer) NoOpChannelPrimer.create(); + ChannelPrimer channelPrimer = NoOpChannelPrimer.create(); // Inject channel priming if enabled if (builder.isRefreshingChannel()) { From beda46e86dc39dc64c8ca4e9631cab7776ca5f7f Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Thu, 28 Aug 2025 16:04:19 -0400 Subject: [PATCH 15/23] pr feedback Change-Id: Ie0fde53cd17b1feeaaffd15382e936a46d84c5c1 --- .../bigtable/data/v2/stub/NoOpChannelPrimer.java | 4 ++-- .../bigtable/gaxx/grpc/BigtableChannelPool.java | 13 +++++++++---- .../gaxx/grpc/ChannelPoolHealthChecker.java | 13 +++++-------- .../gaxx/grpc/ChannelPoolHealthCheckerTest.java | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java index 2d8b49c5bf..0dc3a8cb63 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java @@ -30,12 +30,12 @@ static NoOpChannelPrimer create() { private NoOpChannelPrimer() {} @Override - public void primeChannel(ManagedChannel managedChannel) { + public void primeChannel(ManagedChannel channel) { // No op } @Override - public SettableApiFuture sendPrimeRequestsAsync(ManagedChannel var1) { + public SettableApiFuture sendPrimeRequestsAsync(ManagedChannel channel) { SettableApiFuture future = SettableApiFuture.create(); future.set(PingAndWarmResponse.getDefaultInstance()); return future; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java index 639ef6fb6b..b3222210e4 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java @@ -451,14 +451,19 @@ static class Entry { private final AtomicInteger maxOutstanding = new AtomicInteger(); + /** + * Queue storing the last 5 minutes of probe results + */ @VisibleForTesting final ConcurrentLinkedQueue probeHistory = new ConcurrentLinkedQueue<>(); - // we keep both so that we don't have to check size() on the ConcurrentLinkedQueue all the time - AtomicInteger failedProbesInWindow = new AtomicInteger(); - AtomicInteger successfulProbesInWindow = new AtomicInteger(); + /** + * Keep both # of failed and # of successful probes so that we don't have to check size() on the ConcurrentLinkedQueue all the time + */ + final AtomicInteger failedProbesInWindow = new AtomicInteger(); + final AtomicInteger successfulProbesInWindow = new AtomicInteger(); - // Flag that the channel should be closed once all of the outstanding RPC complete. + // Flag that the channel should be closed once all the outstanding RPCs complete. private final AtomicBoolean shutdownRequested = new AtomicBoolean(); // Flag that the channel has been closed. private final AtomicBoolean shutdownInitiated = new AtomicBoolean(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index 46ff076be4..feb23bfc87 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -36,13 +36,13 @@ import javax.annotation.Nullable; /** Class that manages the health checking in the BigtableChannelPool */ -public class ChannelPoolHealthChecker { +class ChannelPoolHealthChecker { // Configuration constants // Window_Duration is the duration over which we keep probe results private static final Duration WINDOW_DURATION = Duration.ofMinutes(5); // Interval at which we probe channel health - static final Duration PROBE_INTERVAL = Duration.ofSeconds(30); + private static final Duration PROBE_INTERVAL = Duration.ofSeconds(30); // Timeout deadline for a probe @VisibleForTesting static final Duration PROBE_DEADLINE = Duration.ofMillis(500); // Minimum interval between new idle channel evictions @@ -121,9 +121,6 @@ void runProbes() { if (channelPrimer instanceof BigtableChannelPrimer) { BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel()); - } else if (channelPrimer instanceof NoOpChannelPrimer) { - NoOpChannelPrimer primer = (NoOpChannelPrimer) channelPrimer; - probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel()); } else { continue; } @@ -156,7 +153,7 @@ void addProbeResult(Entry entry, ProbeResult result) { } @VisibleForTesting - void pruneHistoryFor(Entry entry) { + void pruneHistory(Entry entry) { Instant windowStart = clock.instant().minus(WINDOW_DURATION); while (!entry.probeHistory.isEmpty() && entry.probeHistory.peek().startTime().isBefore(windowStart)) { @@ -186,14 +183,14 @@ boolean isEntryHealthy(Entry entry) { /** * Finds a channel that is an outlier in terms of health. * - * @return Entry + * @return the entry to be evicted. Returns null if nothing to evict. */ @Nullable @VisibleForTesting Entry findOutlierEntry() { List unhealthyEntries = this.entrySupplier.get().stream() - .peek(this::pruneHistoryFor) + .peek(this::pruneHistory) .filter(entry -> !isEntryHealthy(entry)) .collect(Collectors.toList()); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java index 39bd8a3cec..6b748b1a59 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java @@ -118,7 +118,7 @@ public void testPruning_removesOldProbesAndCounters() { Instant newTime = mockClock.instant().plus(Duration.ofMinutes(6)); Mockito.when(mockClock.instant()).thenReturn(newTime); - healthChecker.pruneHistoryFor(entry); // Manually call for direct testing + healthChecker.pruneHistory(entry); // Manually call for direct testing assertThat(entry.probeHistory).isEmpty(); assertThat(entry.failedProbesInWindow.get()).isEqualTo(0); From e6cab0c6b37eecda8af0e2e7629c619ede8956b7 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Tue, 2 Sep 2025 11:56:32 -0400 Subject: [PATCH 16/23] fix: lint Change-Id: Ib8c6b56569c17997a126065a6fa00e8bb1604494 --- .../cloud/bigtable/gaxx/grpc/BigtableChannelPool.java | 8 ++++---- .../bigtable/gaxx/grpc/ChannelPoolHealthChecker.java | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java index b3222210e4..41c88c4ab2 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java @@ -451,16 +451,16 @@ static class Entry { private final AtomicInteger maxOutstanding = new AtomicInteger(); - /** - * Queue storing the last 5 minutes of probe results - */ + /** Queue storing the last 5 minutes of probe results */ @VisibleForTesting final ConcurrentLinkedQueue probeHistory = new ConcurrentLinkedQueue<>(); /** - * Keep both # of failed and # of successful probes so that we don't have to check size() on the ConcurrentLinkedQueue all the time + * Keep both # of failed and # of successful probes so that we don't have to check size() on the + * ConcurrentLinkedQueue all the time */ final AtomicInteger failedProbesInWindow = new AtomicInteger(); + final AtomicInteger successfulProbesInWindow = new AtomicInteger(); // Flag that the channel should be closed once all the outstanding RPCs complete. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index feb23bfc87..589cfa9178 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -19,7 +19,6 @@ import com.google.auto.value.AutoValue; import com.google.bigtable.v2.PingAndWarmResponse; import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; -import com.google.cloud.bigtable.data.v2.stub.NoOpChannelPrimer; import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; From c77e876eb4c77b4b40d0fb0856c95d180309d898 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Thu, 4 Sep 2025 14:47:07 -0400 Subject: [PATCH 17/23] fix: pr feedback Change-Id: Ic5f18450c5f60bcf5473e6890b41b006821ddf9d --- .../data/v2/stub/BigtableChannelPrimer.java | 4 +- .../data/v2/stub/NoOpChannelPrimer.java | 3 +- .../gaxx/grpc/BigtableChannelPool.java | 2 +- .../gaxx/grpc/ChannelPoolHealthChecker.java | 68 +++++++++++++------ .../bigtable/gaxx/grpc/ChannelPrimer.java | 4 +- .../v2/stub/BigtableChannelPrimerTest.java | 6 +- .../bigtable/gaxx/grpc/HealthChecker.java | 3 + 7 files changed, 59 insertions(+), 31 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java index 7def7a8d9e..97c6e364c8 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java @@ -15,6 +15,7 @@ */ package com.google.cloud.bigtable.data.v2.stub; +import com.google.api.core.ApiFuture; import com.google.api.core.InternalApi; import com.google.api.core.SettableApiFuture; import com.google.auth.Credentials; @@ -110,8 +111,7 @@ private void sendPrimeRequestsBlocking(ManagedChannel managedChannel) { } } - public SettableApiFuture sendPrimeRequestsAsync( - ManagedChannel managedChannel) { + public ApiFuture sendPrimeRequestsAsync(ManagedChannel managedChannel) { ClientCall clientCall = managedChannel.newCall( BigtableGrpc.getPingAndWarmMethod(), diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java index 0dc3a8cb63..3cb98d9dee 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java @@ -15,6 +15,7 @@ */ package com.google.cloud.bigtable.data.v2.stub; +import com.google.api.core.ApiFuture; import com.google.api.core.InternalApi; import com.google.api.core.SettableApiFuture; import com.google.bigtable.v2.PingAndWarmResponse; @@ -35,7 +36,7 @@ public void primeChannel(ManagedChannel channel) { } @Override - public SettableApiFuture sendPrimeRequestsAsync(ManagedChannel channel) { + public ApiFuture sendPrimeRequestsAsync(ManagedChannel channel) { SettableApiFuture future = SettableApiFuture.create(); future.set(PingAndWarmResponse.getDefaultInstance()); return future; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java index 41c88c4ab2..f50d9360f2 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java @@ -100,7 +100,7 @@ public static BigtableChannelPool create( this.channelPrimer = channelPrimer; Clock systemClock = Clock.systemUTC(); this.channelPoolHealthChecker = - new ChannelPoolHealthChecker(() -> entries.get(), channelPrimer, executor, systemClock); + new ChannelPoolHealthChecker(entries::get, channelPrimer, executor, systemClock); this.channelPoolHealthChecker.start(); ImmutableList.Builder initialListBuilder = ImmutableList.builder(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index 589cfa9178..1390e97102 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -15,28 +15,34 @@ */ package com.google.cloud.bigtable.gaxx.grpc; -import com.google.api.core.SettableApiFuture; +import com.google.api.core.ApiFuture; import com.google.auto.value.AutoValue; import com.google.bigtable.v2.PingAndWarmResponse; import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import com.google.common.util.concurrent.MoreExecutors; import java.time.Clock; import java.time.Duration; import java.time.Instant; import java.util.Comparator; import java.util.List; import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.stream.Collectors; import javax.annotation.Nullable; /** Class that manages the health checking in the BigtableChannelPool */ class ChannelPoolHealthChecker { + private static final Logger logger = Logger.getLogger(ChannelPoolHealthChecker.class.getName()); + // Configuration constants // Window_Duration is the duration over which we keep probe results private static final Duration WINDOW_DURATION = Duration.ofMinutes(5); @@ -69,9 +75,12 @@ static ProbeResult create(Instant startTime, boolean success) { private final Supplier> entrySupplier; private volatile Instant lastEviction; - private ScheduledExecutorService executor; + private final ScheduledExecutorService executor; + + private final ChannelPrimer channelPrimer; - private ChannelPrimer channelPrimer; + private ScheduledFuture probeTaskScheduledFuture; + private ScheduledFuture detectAndRemoveTaskScheduledFuture; private final Clock clock; @@ -89,25 +98,36 @@ public ChannelPoolHealthChecker( } void start() { - Duration initialDelayProbe = - Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); - executor.scheduleAtFixedRate( - this::runProbes, - initialDelayProbe.toMillis(), - PROBE_INTERVAL.toMillis(), - TimeUnit.MILLISECONDS); - Duration initialDelayDetect = - Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); - executor.scheduleAtFixedRate( - this::detectAndRemoveOutlierEntries, - initialDelayDetect.toMillis(), - PROBE_INTERVAL.toMillis(), - TimeUnit.MILLISECONDS); + if (channelPrimer instanceof BigtableChannelPrimer) { + Duration initialDelayProbe = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); + this.probeTaskScheduledFuture = + executor.scheduleAtFixedRate( + this::runProbes, + initialDelayProbe.toMillis(), + PROBE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + Duration initialDelayDetect = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); + this.detectAndRemoveTaskScheduledFuture = + executor.scheduleAtFixedRate( + this::detectAndRemoveOutlierEntries, + initialDelayDetect.toMillis(), + PROBE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + } else { + logger.log(Level.WARNING, "NoOpChannelPrimer was provided, not checking channel health."); + } } /** Stop running health checking */ public void stop() { - executor.shutdownNow(); + if (probeTaskScheduledFuture != null) { + probeTaskScheduledFuture.cancel(true); + } + if (detectAndRemoveTaskScheduledFuture != null) { + detectAndRemoveTaskScheduledFuture.cancel(true); + } } /** Runs probes on all the channels in the pool. */ @@ -115,7 +135,7 @@ public void stop() { void runProbes() { for (Entry entry : this.entrySupplier.get()) { final Instant startTime = clock.instant(); - final SettableApiFuture probeFuture; + final ApiFuture probeFuture; if (channelPrimer instanceof BigtableChannelPrimer) { BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; @@ -123,20 +143,21 @@ void runProbes() { } else { continue; } - probeFuture.addListener(() -> onComplete(entry, startTime, probeFuture), executor); + probeFuture.addListener( + () -> onComplete(entry, startTime, probeFuture), MoreExecutors.directExecutor()); } } /** Callback that will update Entry data on probe complete. */ @VisibleForTesting - void onComplete( - Entry entry, Instant startTime, SettableApiFuture probeFuture) { + void onComplete(Entry entry, Instant startTime, ApiFuture probeFuture) { boolean success; try { probeFuture.get(PROBE_DEADLINE.toMillis(), TimeUnit.MILLISECONDS); success = true; } catch (Exception e) { success = false; + logger.log(Level.WARNING, "Probe failed"); } addProbeResult(entry, ProbeResult.create(startTime, success)); } @@ -219,6 +240,9 @@ void detectAndRemoveOutlierEntries() { Entry outlier = findOutlierEntry(); if (outlier != null) { this.lastEviction = clock.instant(); + outlier.failedProbesInWindow.set(0); + outlier.successfulProbesInWindow.set(0); + outlier.probeHistory.clear(); outlier.getManagedChannel().enterIdle(); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java index b4273dab5e..ae7b71e366 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java @@ -15,8 +15,8 @@ */ package com.google.cloud.bigtable.gaxx.grpc; +import com.google.api.core.ApiFuture; import com.google.api.core.InternalApi; -import com.google.api.core.SettableApiFuture; import com.google.bigtable.v2.PingAndWarmResponse; import io.grpc.ManagedChannel; @@ -24,5 +24,5 @@ public interface ChannelPrimer { void primeChannel(ManagedChannel var1); - SettableApiFuture sendPrimeRequestsAsync(ManagedChannel var1); + ApiFuture sendPrimeRequestsAsync(ManagedChannel var1); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java index f29fa6200a..7913e97540 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertThrows; import com.google.api.core.ApiFunction; -import com.google.api.core.SettableApiFuture; +import com.google.api.core.ApiFuture; import com.google.auth.oauth2.AccessToken; import com.google.auth.oauth2.OAuth2Credentials; import com.google.bigtable.v2.BigtableGrpc.BigtableImplBase; @@ -173,7 +173,7 @@ public void testHeadersAreSent() { // New test for the async success path @Test public void testAsyncSuccess() throws Exception { - SettableApiFuture future = primer.sendPrimeRequestsAsync(channel); + ApiFuture future = primer.sendPrimeRequestsAsync(channel); PingAndWarmResponse response = future.get(1, TimeUnit.SECONDS); assertThat(response).isNotNull(); @@ -192,7 +192,7 @@ public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) { } }; - SettableApiFuture future = primer.sendPrimeRequestsAsync(channel); + ApiFuture future = primer.sendPrimeRequestsAsync(channel); ExecutionException e = assertThrows(ExecutionException.class, () -> future.get(5, TimeUnit.SECONDS)); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java index 98203f29fd..5e8e00b040 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java @@ -15,6 +15,9 @@ */ package com.google.cloud.bigtable.gaxx.grpc; +import com.google.api.core.InternalApi; + +@InternalApi public interface HealthChecker { void start(); From 98fe29ba2a125524545a70f221fe61dcea88fa81 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Tue, 9 Sep 2025 16:46:45 -0400 Subject: [PATCH 18/23] fix: feedback Change-Id: Ib7f24524b6050ec11ca18e5dc624ca8513f99ec8 --- .../clirr-ignored-differences.xml | 7 ++++ .../gaxx/grpc/BigtableChannelPool.java | 4 +-- .../gaxx/grpc/ChannelPoolHealthChecker.java | 21 ++++++------ .../v2/BigtableDataClientFactoryTest.java | 33 ++++++++++--------- 4 files changed, 36 insertions(+), 29 deletions(-) diff --git a/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml index 4223db6dcb..78b0d383b5 100644 --- a/google-cloud-bigtable/clirr-ignored-differences.xml +++ b/google-cloud-bigtable/clirr-ignored-differences.xml @@ -419,4 +419,11 @@ *create* * + + + 7006 + com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer + *sendPrimeRequestsAsync* + com.google.api.core.ApiFuture + diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java index f50d9360f2..c8ced11158 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java @@ -64,11 +64,11 @@ public class BigtableChannelPool extends ManagedChannel { private final BigtableChannelPoolSettings settings; private final ChannelFactory channelFactory; - private ChannelPrimer channelPrimer; + private final ChannelPrimer channelPrimer; private final ScheduledExecutorService executor; private final Object entryWriteLock = new Object(); @VisibleForTesting final AtomicReference> entries = new AtomicReference<>(); - private ChannelPoolHealthChecker channelPoolHealthChecker; + private final ChannelPoolHealthChecker channelPoolHealthChecker; private final AtomicInteger indexTicker = new AtomicInteger(); private final String authority; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index 1390e97102..20d4150dcf 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -21,6 +21,7 @@ import com.google.cloud.bigtable.data.v2.stub.BigtableChannelPrimer; import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool.Entry; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.MoreExecutors; import java.time.Clock; @@ -98,7 +99,9 @@ public ChannelPoolHealthChecker( } void start() { - if (channelPrimer instanceof BigtableChannelPrimer) { + if (!(channelPrimer instanceof BigtableChannelPrimer)) { + logger.log(Level.WARNING, "Provided channelPrimer not an instance of BigtableChannelPrimer, not checking channel health."); + } else { Duration initialDelayProbe = Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); this.probeTaskScheduledFuture = @@ -115,34 +118,30 @@ void start() { initialDelayDetect.toMillis(), PROBE_INTERVAL.toMillis(), TimeUnit.MILLISECONDS); - } else { - logger.log(Level.WARNING, "NoOpChannelPrimer was provided, not checking channel health."); } } /** Stop running health checking */ public void stop() { if (probeTaskScheduledFuture != null) { - probeTaskScheduledFuture.cancel(true); + probeTaskScheduledFuture.cancel(false); } if (detectAndRemoveTaskScheduledFuture != null) { - detectAndRemoveTaskScheduledFuture.cancel(true); + detectAndRemoveTaskScheduledFuture.cancel(false); } } /** Runs probes on all the channels in the pool. */ @VisibleForTesting void runProbes() { + Preconditions.checkState(channelPrimer instanceof BigtableChannelPrimer, "Health checking can only be enabled with BigtableChannelPrimer, found %s", channelPrimer); for (Entry entry : this.entrySupplier.get()) { final Instant startTime = clock.instant(); final ApiFuture probeFuture; - if (channelPrimer instanceof BigtableChannelPrimer) { - BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; - probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel()); - } else { - continue; - } + BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; + probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel()); + probeFuture.addListener( () -> onComplete(entry, startTime, probeFuture), MoreExecutors.directExecutor()); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java index 42746bbecc..278b9a6633 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java @@ -40,6 +40,7 @@ import com.google.common.base.Preconditions; import com.google.common.io.BaseEncoding; import io.grpc.Attributes; +import io.grpc.Grpc; import io.grpc.Metadata; import io.grpc.Server; import io.grpc.ServerCall; @@ -50,9 +51,12 @@ import io.grpc.stub.StreamObserver; import java.io.IOException; import java.lang.reflect.Method; +import java.net.SocketAddress; import java.util.LinkedList; import java.util.List; import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.concurrent.LinkedBlockingDeque; import org.junit.After; import org.junit.Before; @@ -87,6 +91,7 @@ public class BigtableDataClientFactoryTest { private final BlockingQueue setUpAttributes = new LinkedBlockingDeque<>(); private final BlockingQueue terminateAttributes = new LinkedBlockingDeque<>(); private final BlockingQueue requestMetadata = new LinkedBlockingDeque<>(); + private final ConcurrentMap warmedChannels = new ConcurrentHashMap<>(); @Before public void setUp() throws IOException { @@ -101,6 +106,15 @@ public Listener interceptCall( Metadata headers, ServerCallHandler next) { requestMetadata.add(headers); + + // Check if the call is PingAndWarm and mark the channel address as warmed up. + if (BigtableGrpc.getPingAndWarmMethod().equals(call.getMethodDescriptor())) { + SocketAddress remoteAddr = + call.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + if (remoteAddr != null) { + warmedChannels.put(remoteAddr, true); + } + } return next.startCall(call, headers); } }) @@ -249,7 +263,7 @@ public void testCreateForInstanceWithAppProfileHasCorrectSettings() throws Excep @Test public void testCreateWithRefreshingChannel() throws Exception { int poolSize = 3; - BigtableDataSettings.Builder builder = + BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(DEFAULT_PROJECT_ID) .setInstanceId(DEFAULT_INSTANCE_ID) @@ -278,21 +292,8 @@ public void testCreateWithRefreshingChannel() throws Exception { Mockito.verify(executorProvider, Mockito.times(1)).getExecutor(); Mockito.verify(watchdogProvider, Mockito.times(1)).getWatchdog(); - // Make sure that the clients are sharing the same ChannelPool - assertThat(setUpAttributes).hasSize(poolSize); - - // Make sure that prime requests were sent only once per table per connection - assertThat(service.pingAndWarmRequests).hasSize(poolSize); - List expectedRequests = new LinkedList<>(); - for (int i = 0; i < poolSize; i++) { - expectedRequests.add( - PingAndWarmRequest.newBuilder() - .setName(InstanceName.format(DEFAULT_PROJECT_ID, DEFAULT_INSTANCE_ID)) - .setAppProfileId(DEFAULT_APP_PROFILE_ID) - .build()); - } - - assertThat(service.pingAndWarmRequests).containsExactly(expectedRequests.toArray()); + assertThat(warmedChannels).hasSize(poolSize); + assertThat(warmedChannels.values()).doesNotContain(false); // Wait for all the connections to close asynchronously factory.close(); From 69aeeef97d354b77ce9b07d5c95de619ff62cbf0 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Tue, 9 Sep 2025 16:47:57 -0400 Subject: [PATCH 19/23] fix: lint Change-Id: I78712b99a975fb6ec9defcdb6812e955df555e1f --- .../bigtable/gaxx/grpc/ChannelPoolHealthChecker.java | 9 +++++++-- .../bigtable/data/v2/BigtableDataClientFactoryTest.java | 5 +---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index 20d4150dcf..01587292c2 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -100,7 +100,9 @@ public ChannelPoolHealthChecker( void start() { if (!(channelPrimer instanceof BigtableChannelPrimer)) { - logger.log(Level.WARNING, "Provided channelPrimer not an instance of BigtableChannelPrimer, not checking channel health."); + logger.log( + Level.WARNING, + "Provided channelPrimer not an instance of BigtableChannelPrimer, not checking channel health."); } else { Duration initialDelayProbe = Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); @@ -134,7 +136,10 @@ public void stop() { /** Runs probes on all the channels in the pool. */ @VisibleForTesting void runProbes() { - Preconditions.checkState(channelPrimer instanceof BigtableChannelPrimer, "Health checking can only be enabled with BigtableChannelPrimer, found %s", channelPrimer); + Preconditions.checkState( + channelPrimer instanceof BigtableChannelPrimer, + "Health checking can only be enabled with BigtableChannelPrimer, found %s", + channelPrimer); for (Entry entry : this.entrySupplier.get()) { final Instant startTime = clock.instant(); final ApiFuture probeFuture; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java index 278b9a6633..c3d326fbef 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java @@ -27,7 +27,6 @@ import com.google.api.gax.rpc.WatchdogProvider; import com.google.bigtable.v2.BigtableGrpc; import com.google.bigtable.v2.FeatureFlags; -import com.google.bigtable.v2.InstanceName; import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.PingAndWarmRequest; @@ -52,8 +51,6 @@ import java.io.IOException; import java.lang.reflect.Method; import java.net.SocketAddress; -import java.util.LinkedList; -import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -263,7 +260,7 @@ public void testCreateForInstanceWithAppProfileHasCorrectSettings() throws Excep @Test public void testCreateWithRefreshingChannel() throws Exception { int poolSize = 3; - BigtableDataSettings.Builder builder = + BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(DEFAULT_PROJECT_ID) .setInstanceId(DEFAULT_INSTANCE_ID) From 32a7ac03c1d116c272187f2861bf497b49a1396e Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Tue, 9 Sep 2025 17:01:41 -0400 Subject: [PATCH 20/23] move history pruning Change-Id: Ibeae2ce0b790ef2731be541a70fa829e220fa4a8 --- .../cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index 01587292c2..3c1d0900a8 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -174,6 +174,7 @@ void addProbeResult(Entry entry, ProbeResult result) { } else { entry.failedProbesInWindow.incrementAndGet(); } + pruneHistory(entry); } @VisibleForTesting @@ -214,7 +215,6 @@ boolean isEntryHealthy(Entry entry) { Entry findOutlierEntry() { List unhealthyEntries = this.entrySupplier.get().stream() - .peek(this::pruneHistory) .filter(entry -> !isEntryHealthy(entry)) .collect(Collectors.toList()); From 580d5de6cc1897837507b8d89ba5db06c42d26b1 Mon Sep 17 00:00:00 2001 From: Liz Nichols Date: Tue, 9 Sep 2025 17:38:32 -0400 Subject: [PATCH 21/23] fix: nits Change-Id: Ic812e3523a9f29dc612fbdf58ee8f9dbb8a283f4 --- .../gaxx/grpc/ChannelPoolHealthChecker.java | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java index 3c1d0900a8..cb0841e7a1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java @@ -103,24 +103,25 @@ void start() { logger.log( Level.WARNING, "Provided channelPrimer not an instance of BigtableChannelPrimer, not checking channel health."); - } else { - Duration initialDelayProbe = - Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); - this.probeTaskScheduledFuture = - executor.scheduleAtFixedRate( - this::runProbes, - initialDelayProbe.toMillis(), - PROBE_INTERVAL.toMillis(), - TimeUnit.MILLISECONDS); - Duration initialDelayDetect = - Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); - this.detectAndRemoveTaskScheduledFuture = - executor.scheduleAtFixedRate( - this::detectAndRemoveOutlierEntries, - initialDelayDetect.toMillis(), - PROBE_INTERVAL.toMillis(), - TimeUnit.MILLISECONDS); + return; } + + Duration initialDelayProbe = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); + this.probeTaskScheduledFuture = + executor.scheduleAtFixedRate( + this::runProbes, + initialDelayProbe.toMillis(), + PROBE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + Duration initialDelayDetect = + Duration.ofMillis(ThreadLocalRandom.current().nextLong(PROBE_INTERVAL.toMillis())); + this.detectAndRemoveTaskScheduledFuture = + executor.scheduleAtFixedRate( + this::detectAndRemoveOutlierEntries, + initialDelayDetect.toMillis(), + PROBE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); } /** Stop running health checking */ @@ -140,15 +141,13 @@ void runProbes() { channelPrimer instanceof BigtableChannelPrimer, "Health checking can only be enabled with BigtableChannelPrimer, found %s", channelPrimer); - for (Entry entry : this.entrySupplier.get()) { - final Instant startTime = clock.instant(); - final ApiFuture probeFuture; - - BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; - probeFuture = primer.sendPrimeRequestsAsync(entry.getManagedChannel()); + BigtableChannelPrimer primer = (BigtableChannelPrimer) channelPrimer; + for (Entry entry : this.entrySupplier.get()) { + ApiFuture probeFuture = + primer.sendPrimeRequestsAsync(entry.getManagedChannel()); probeFuture.addListener( - () -> onComplete(entry, startTime, probeFuture), MoreExecutors.directExecutor()); + () -> onComplete(entry, clock.instant(), probeFuture), MoreExecutors.directExecutor()); } } @@ -161,7 +160,7 @@ void onComplete(Entry entry, Instant startTime, ApiFuture p success = true; } catch (Exception e) { success = false; - logger.log(Level.WARNING, "Probe failed"); + logger.log(Level.WARNING, "Probe failed", e); } addProbeResult(entry, ProbeResult.create(startTime, success)); } From 111582cb3eae05044e3c8675712d0193e3b34b4e Mon Sep 17 00:00:00 2001 From: nicholsl Date: Wed, 10 Sep 2025 11:51:02 -0400 Subject: [PATCH 22/23] Apply suggestion from @mutianf Co-authored-by: Mattie Fu --- .../java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java index ae7b71e366..2ac65344af 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java @@ -22,7 +22,7 @@ @InternalApi("For internal use by google-cloud-java clients only") public interface ChannelPrimer { - void primeChannel(ManagedChannel var1); + void primeChannel(ManagedChannel channel); ApiFuture sendPrimeRequestsAsync(ManagedChannel var1); } From 6df0856e9dd0a7f1bd45a592ddde7ddfe12e8360 Mon Sep 17 00:00:00 2001 From: nicholsl Date: Wed, 10 Sep 2025 11:51:24 -0400 Subject: [PATCH 23/23] Apply suggestion from @mutianf Co-authored-by: Mattie Fu --- .../java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java index 2ac65344af..ea7cc70175 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java @@ -24,5 +24,5 @@ public interface ChannelPrimer { void primeChannel(ManagedChannel channel); - ApiFuture sendPrimeRequestsAsync(ManagedChannel var1); + ApiFuture sendPrimeRequestsAsync(ManagedChannel channel); }