diff --git a/.github/release-please.yml b/.github/release-please.yml
index d03526bce6..67eae62c4b 100644
--- a/.github/release-please.yml
+++ b/.github/release-please.yml
@@ -79,5 +79,12 @@ branches:
- >-
google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java
branch: 2.61.x
+ - bumpMinorPreMajor: true
+ handleGHRelease: true
+ releaseType: java-backport
+ extraFiles:
+ - >-
+ google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java
+ branch: 2.60.x
extraFiles:
- google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java
diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh
index fff56bf5dd..a0b95de6c0 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
@@ -15,8 +15,10 @@ set -e
function get_latest_released_version() {
local group_id=$1
local artifact_id=$2
- json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
- latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
+ group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")"
+ url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml"
+ xml_content=$(curl -s --fail "${url}")
+ latest=$(xmllint --xpath 'metadata/versioning/latest/text()' - <<< "${xml_content}")
if [[ -z "${latest}" ]]; then
echo "The latest version of ${group_id}:${artifact_id} is empty."
echo "The returned json from maven.org is invalid: ${json_content}"
@@ -172,4 +174,4 @@ if [ -z "${pr_num}" ]; then
else
git push
gh pr edit "${pr_num}" --title "${title}" --body "${title}"
-fi
+fi
\ No newline at end of file
diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml
index 1d404a41e4..7be7e5e5f1 100644
--- a/.github/sync-repo-settings.yaml
+++ b/.github/sync-repo-settings.yaml
@@ -197,6 +197,28 @@ branchProtectionRules:
- conformance
- library_generation
- unmanaged_dependency_check
+ - pattern: 2.60.x
+ isAdminEnforced: true
+ requiredApprovingReviewCount: 1
+ requiresCodeOwnerReviews: true
+ requiresStrictStatusChecks: false
+ requiredStatusCheckContexts:
+ - dependencies (17)
+ - lint
+ - clirr
+ - units (11)
+ - units (17)
+ - units (21)
+ - units (24)
+ - 'Kokoro - Test: Integration'
+ - cla/google
+ - 'Kokoro - Test: Java GraalVM Native Image A'
+ - 'Kokoro - Test: Java GraalVM Native Image B'
+ - 'Kokoro - Test: Java GraalVM Native Image C'
+ - javadoc
+ - conformance
+ - library_generation
+ - unmanaged_dependency_check
permissionRules:
- team: yoshi-admins
permission: admin
diff --git a/.github/workflows/update_generation_config.yaml b/.github/workflows/update_generation_config.yaml
index cd2d5fd5a8..7b14069ced 100644
--- a/.github/workflows/update_generation_config.yaml
+++ b/.github/workflows/update_generation_config.yaml
@@ -18,7 +18,6 @@ on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
-
jobs:
update-generation-config:
runs-on: ubuntu-24.04
@@ -30,6 +29,9 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
+ - name: Install Dependencies
+ shell: bash
+ run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: Update params in generation config to latest
shell: bash
run: |
@@ -40,5 +42,4 @@ jobs:
--base_branch "${base_branch}" \
--repo ${{ github.repository }}
env:
- GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
-
+ GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
\ No newline at end of file
diff --git a/generation_config.yaml b/generation_config.yaml
index 75326dc5f2..4e55dbac20 100644
--- a/generation_config.yaml
+++ b/generation_config.yaml
@@ -1,5 +1,5 @@
gapic_generator_version: 2.59.0
-googleapis_commitish: 63161c080e7eb3dd1d4fe76db1fad108b6ac9a27
+googleapis_commitish: 33d5137a234625ed94afd630031321c31bd16143
libraries_bom_version: 26.61.0
template_excludes:
- .gitignore
diff --git a/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml
index a9734b96d4..23ddeafdda 100644
--- a/google-cloud-bigtable/clirr-ignored-differences.xml
+++ b/google-cloud-bigtable/clirr-ignored-differences.xml
@@ -382,4 +382,18 @@
*
*
+
+
+ 7004
+ com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool
+ *create*
+ *
+
+
+
+ 7004
+ com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider
+ *create*
+ *
+
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 7495ca6ceb..c3cdafe0c6 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,7 +15,7 @@
*/
package com.google.cloud.bigtable.data.v2.stub;
-import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
import com.google.api.core.SettableApiFuture;
import com.google.api.gax.grpc.ChannelPrimer;
import com.google.auth.Credentials;
@@ -41,13 +41,13 @@
/**
* A channel warmer that ensures that a Bigtable channel is ready to be used before being added to
- * the active {@link com.google.api.gax.grpc.ChannelPool}.
+ * the active {@link com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPool}.
*
*
This implementation is subject to change in the future, but currently it will prime the
* channel by sending a ReadRow request for a hardcoded, non-existent row key.
*/
-@BetaApi("Channel priming is not currently stable and might change in the future")
-class BigtableChannelPrimer implements ChannelPrimer {
+@InternalApi
+public class BigtableChannelPrimer implements ChannelPrimer {
private static Logger LOG = Logger.getLogger(BigtableChannelPrimer.class.toString());
static final Metadata.Key REQUEST_PARAMS =
@@ -96,10 +96,68 @@ public void primeChannel(ManagedChannel managedChannel) {
}
private void primeChannelUnsafe(ManagedChannel managedChannel) throws IOException {
- sendPrimeRequests(managedChannel);
+ sendPrimeRequestsBlocking(managedChannel);
}
- private void sendPrimeRequests(ManagedChannel managedChannel) {
+ private void sendPrimeRequestsBlocking(ManagedChannel managedChannel) {
+ try {
+ sendPrimeRequestsAsync(managedChannel).get(1, TimeUnit.MINUTES);
+ } catch (Throwable e) {
+ // TODO: Not sure if we should swallow the error here. We are pre-emptively swapping
+ // channels if the new
+ // channel is bad.
+ LOG.log(Level.WARNING, "Failed to prime channel", e);
+ }
+ }
+
+ public SettableApiFuture sendPrimeRequestsAsync(
+ ManagedChannel managedChannel) {
+ ClientCall clientCall =
+ managedChannel.newCall(
+ BigtableGrpc.getPingAndWarmMethod(),
+ CallOptions.DEFAULT
+ .withCallCredentials(callCredentials)
+ .withDeadline(Deadline.after(1, TimeUnit.MINUTES)));
+
+ SettableApiFuture future = SettableApiFuture.create();
+ clientCall.start(
+ new ClientCall.Listener() {
+ private PingAndWarmResponse response;
+
+ @Override
+ public void onMessage(PingAndWarmResponse message) {
+ response = message;
+ }
+
+ @Override
+ public void onClose(Status status, Metadata trailers) {
+ if (status.isOk()) {
+ future.set(response);
+ } else {
+ // Propagate the gRPC error to the future.
+ future.setException(status.asException(trailers));
+ }
+ }
+ },
+ createMetadata(headers, request));
+
+ try {
+ // Send the request message.
+ clientCall.sendMessage(request);
+ // Signal that no more messages will be sent.
+ clientCall.halfClose();
+ // Request the response from the server.
+ clientCall.request(Integer.MAX_VALUE);
+ } catch (Throwable t) {
+ // If sending fails, cancel the call and notify the future.
+ clientCall.cancel("Failed to send priming request", t);
+ future.setException(t);
+ }
+
+ return future;
+ }
+
+ private void sendPrimeRequestsNonBlocking(ManagedChannel managedChannel) {
try {
ClientCall clientCall =
managedChannel.newCall(
@@ -131,8 +189,6 @@ public void onClose(Status status, Metadata trailers) {
clientCall.sendMessage(request);
clientCall.halfClose();
clientCall.request(Integer.MAX_VALUE);
-
- future.get(1, TimeUnit.MINUTES);
} catch (Throwable e) {
// TODO: Not sure if we should swallow the error here. We are pre-emptively swapping
// channels if the new
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 9e8cd19aa9..233294fe4e 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,6 +20,7 @@
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;
@@ -121,20 +122,22 @@ public static BigtableClientContext create(EnhancedBigtableStubSettings settings
setupCookieHolder(transportProvider);
}
+ ChannelPrimer channelPrimer = NoOpChannelPrimer.create();
+
// Inject channel priming if enabled
if (builder.isRefreshingChannel()) {
- transportProvider.setChannelPrimer(
+ channelPrimer =
BigtableChannelPrimer.create(
builder.getProjectId(),
builder.getInstanceId(),
builder.getAppProfileId(),
credentials,
- builder.getHeaderProvider().getHeaders()));
+ builder.getHeaderProvider().getHeaders());
}
BigtableTransportChannelProvider btTransportProvider =
BigtableTransportChannelProvider.create(
- (InstantiatingGrpcChannelProvider) transportProvider.build());
+ (InstantiatingGrpcChannelProvider) transportProvider.build(), channelPrimer);
builder.setTransportChannelProvider(btTransportProvider);
}
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
new file mode 100644
index 0000000000..aed412fd0d
--- /dev/null
+++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java
@@ -0,0 +1,34 @@
+/*
+ * 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.data.v2.stub;
+
+import com.google.api.core.InternalApi;
+import com.google.api.gax.grpc.ChannelPrimer;
+import io.grpc.ManagedChannel;
+
+@InternalApi
+public class NoOpChannelPrimer implements ChannelPrimer {
+ static NoOpChannelPrimer create() {
+ return new NoOpChannelPrimer();
+ }
+
+ private NoOpChannelPrimer() {}
+
+ @Override
+ public void primeChannel(ManagedChannel managedChannel) {
+ // No op
+ }
+}
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 0d2c15a155..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
@@ -17,6 +17,9 @@
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;
@@ -30,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;
@@ -60,17 +65,22 @@ public class BigtableChannelPool extends ManagedChannel {
private final BigtableChannelPoolSettings settings;
private final ChannelFactory channelFactory;
- private final ScheduledExecutorService executor;
+ 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;
public static BigtableChannelPool create(
- BigtableChannelPoolSettings settings, ChannelFactory channelFactory) throws IOException {
+ BigtableChannelPoolSettings settings,
+ ChannelFactory channelFactory,
+ ChannelPrimer channelPrimer)
+ throws IOException {
return new BigtableChannelPool(
- settings, channelFactory, Executors.newSingleThreadScheduledExecutor());
+ settings, channelFactory, channelPrimer, Executors.newSingleThreadScheduledExecutor());
}
/**
@@ -84,15 +94,24 @@ public static BigtableChannelPool create(
BigtableChannelPool(
BigtableChannelPoolSettings settings,
ChannelFactory channelFactory,
+ ChannelPrimer channelPrimer,
ScheduledExecutorService executor)
throws IOException {
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();
for (int i = 0; i < settings.getInitialChannelCount(); i++) {
- initialListBuilder.add(new Entry(channelFactory.createSingleChannel()));
+ ManagedChannel newChannel = channelFactory.createSingleChannel();
+ channelPrimer.primeChannel(newChannel);
+ initialListBuilder.add(new Entry(newChannel));
}
entries.set(initialListBuilder.build());
@@ -316,7 +335,9 @@ private void expand(int desiredSize) {
for (int i = 0; i < desiredSize - localEntries.size(); i++) {
try {
- newEntries.add(new Entry(channelFactory.createSingleChannel()));
+ ManagedChannel newChannel = channelFactory.createSingleChannel();
+ this.channelPrimer.primeChannel(newChannel);
+ newEntries.add(new Entry(newChannel));
} catch (IOException e) {
LOG.log(Level.WARNING, "Failed to add channel", e);
}
@@ -354,7 +375,9 @@ void refresh() {
for (int i = 0; i < newEntries.size(); i++) {
try {
- newEntries.set(i, new Entry(channelFactory.createSingleChannel()));
+ ManagedChannel newChannel = channelFactory.createSingleChannel();
+ this.channelPrimer.primeChannel(newChannel);
+ newEntries.set(i, new Entry(newChannel));
} catch (IOException e) {
LOG.log(Level.WARNING, "Failed to refresh channel, leaving old channel", e);
}
@@ -431,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());
}
@@ -454,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/BigtableTransportChannelProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java
index abbf127636..3c4cf24bca 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,6 +18,7 @@
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;
@@ -38,10 +39,13 @@
public final class BigtableTransportChannelProvider implements TransportChannelProvider {
private final InstantiatingGrpcChannelProvider delegate;
+ private final ChannelPrimer channelPrimer;
private BigtableTransportChannelProvider(
- InstantiatingGrpcChannelProvider instantiatingGrpcChannelProvider) {
+ InstantiatingGrpcChannelProvider instantiatingGrpcChannelProvider,
+ ChannelPrimer channelPrimer) {
delegate = Preconditions.checkNotNull(instantiatingGrpcChannelProvider);
+ this.channelPrimer = channelPrimer;
}
@Override
@@ -63,7 +67,7 @@ public BigtableTransportChannelProvider withExecutor(ScheduledExecutorService ex
public BigtableTransportChannelProvider withExecutor(Executor executor) {
InstantiatingGrpcChannelProvider newChannelProvider =
(InstantiatingGrpcChannelProvider) delegate.withExecutor(executor);
- return new BigtableTransportChannelProvider(newChannelProvider);
+ return new BigtableTransportChannelProvider(newChannelProvider, channelPrimer);
}
@Override
@@ -75,7 +79,7 @@ public boolean needsHeaders() {
public BigtableTransportChannelProvider withHeaders(Map headers) {
InstantiatingGrpcChannelProvider newChannelProvider =
(InstantiatingGrpcChannelProvider) delegate.withHeaders(headers);
- return new BigtableTransportChannelProvider(newChannelProvider);
+ return new BigtableTransportChannelProvider(newChannelProvider, channelPrimer);
}
@Override
@@ -87,7 +91,7 @@ public boolean needsEndpoint() {
public TransportChannelProvider withEndpoint(String endpoint) {
InstantiatingGrpcChannelProvider newChannelProvider =
(InstantiatingGrpcChannelProvider) delegate.withEndpoint(endpoint);
- return new BigtableTransportChannelProvider(newChannelProvider);
+ return new BigtableTransportChannelProvider(newChannelProvider, channelPrimer);
}
@Deprecated
@@ -101,7 +105,7 @@ public boolean acceptsPoolSize() {
public TransportChannelProvider withPoolSize(int size) {
InstantiatingGrpcChannelProvider newChannelProvider =
(InstantiatingGrpcChannelProvider) delegate.withPoolSize(size);
- return new BigtableTransportChannelProvider(newChannelProvider);
+ return new BigtableTransportChannelProvider(newChannelProvider, channelPrimer);
}
/** Expected to only be called once when BigtableClientContext is created */
@@ -130,7 +134,8 @@ public TransportChannel getTransportChannel() throws IOException {
BigtableChannelPoolSettings btPoolSettings =
BigtableChannelPoolSettings.copyFrom(delegate.getChannelPoolSettings());
- BigtableChannelPool btChannelPool = BigtableChannelPool.create(btPoolSettings, channelFactory);
+ BigtableChannelPool btChannelPool =
+ BigtableChannelPool.create(btPoolSettings, channelFactory, channelPrimer);
return GrpcTransportChannel.create(btChannelPool);
}
@@ -149,12 +154,13 @@ public boolean needsCredentials() {
public TransportChannelProvider withCredentials(Credentials credentials) {
InstantiatingGrpcChannelProvider newChannelProvider =
(InstantiatingGrpcChannelProvider) delegate.withCredentials(credentials);
- return new BigtableTransportChannelProvider(newChannelProvider);
+ return new BigtableTransportChannelProvider(newChannelProvider, channelPrimer);
}
/** Creates a BigtableTransportChannelProvider. */
public static BigtableTransportChannelProvider create(
- InstantiatingGrpcChannelProvider instantiatingGrpcChannelProvider) {
- return new BigtableTransportChannelProvider(instantiatingGrpcChannelProvider);
+ InstantiatingGrpcChannelProvider instantiatingGrpcChannelProvider,
+ ChannelPrimer channelPrimer) {
+ return new BigtableTransportChannelProvider(instantiatingGrpcChannelProvider, channelPrimer);
}
}
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..ca6a97423c
--- /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 FAILURE_PERCENT_THRESHOLD = 60;
+ private static final int 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 < 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 >= 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/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json
index 2db58f65db..65cd1d20d5 100644
--- a/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json
+++ b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json
@@ -2870,6 +2870,24 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
+ {
+ "name": "com.google.bigtable.admin.v2.Type$Enum",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
+ {
+ "name": "com.google.bigtable.admin.v2.Type$Enum$Builder",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
{
"name": "com.google.bigtable.admin.v2.Type$Float32",
"queryAllDeclaredConstructors": true,
@@ -2996,6 +3014,24 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
+ {
+ "name": "com.google.bigtable.admin.v2.Type$Proto",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
+ {
+ "name": "com.google.bigtable.admin.v2.Type$Proto$Builder",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
{
"name": "com.google.bigtable.admin.v2.Type$String",
"queryAllDeclaredConstructors": true,
diff --git a/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json
index d55a4566a8..a67b91152d 100644
--- a/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json
+++ b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json
@@ -1925,6 +1925,24 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
+ {
+ "name": "com.google.bigtable.v2.Type$Enum",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
+ {
+ "name": "com.google.bigtable.v2.Type$Enum$Builder",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
{
"name": "com.google.bigtable.v2.Type$Float32",
"queryAllDeclaredConstructors": true,
@@ -2033,6 +2051,24 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
+ {
+ "name": "com.google.bigtable.v2.Type$Proto",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
+ {
+ "name": "com.google.bigtable.v2.Type$Proto$Builder",
+ "queryAllDeclaredConstructors": true,
+ "queryAllPublicConstructors": true,
+ "queryAllDeclaredMethods": true,
+ "allPublicMethods": true,
+ "allDeclaredClasses": true,
+ "allPublicClasses": true
+ },
{
"name": "com.google.bigtable.v2.Type$String",
"queryAllDeclaredConstructors": true,
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 709b482477..f29fa6200a 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
@@ -16,8 +16,10 @@
package com.google.cloud.bigtable.data.v2.stub;
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertThrows;
import com.google.api.core.ApiFunction;
+import com.google.api.core.SettableApiFuture;
import com.google.auth.oauth2.AccessToken;
import com.google.auth.oauth2.OAuth2Credentials;
import com.google.bigtable.v2.BigtableGrpc.BigtableImplBase;
@@ -39,6 +41,8 @@
import java.io.IOException;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
@@ -166,6 +170,35 @@ public void testHeadersAreSent() {
}
}
+ // New test for the async success path
+ @Test
+ public void testAsyncSuccess() throws Exception {
+ SettableApiFuture future = primer.sendPrimeRequestsAsync(channel);
+
+ PingAndWarmResponse response = future.get(1, TimeUnit.SECONDS);
+ assertThat(response).isNotNull();
+ assertThat(future.isDone()).isTrue();
+ }
+
+ // New test for the async failure path
+ @Test
+ public void testAsyncFailure() {
+ // Configure the server to return a gRPC error
+ fakeService.pingAndWarmCallback =
+ new ApiFunction() {
+ @Override
+ public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) {
+ throw new StatusRuntimeException(Status.UNAVAILABLE);
+ }
+ };
+
+ SettableApiFuture future = primer.sendPrimeRequestsAsync(channel);
+
+ ExecutionException e =
+ assertThrows(ExecutionException.class, () -> future.get(5, TimeUnit.SECONDS));
+ assertThat(e).hasCauseThat().hasMessageThat().contains("UNAVAILABLE");
+ }
+
private static class MetadataInterceptor implements ServerInterceptor {
ConcurrentLinkedQueue metadataList = new ConcurrentLinkedQueue<>();
diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java
new file mode 100644
index 0000000000..60bbad5196
--- /dev/null
+++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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.data.v2.stub;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verifyNoInteractions;
+
+import io.grpc.ManagedChannel;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class NoOpChannelPrimerTest {
+ @Test
+ public void primeChannelDoesNothing() {
+ // Create an instance of NoOpChannelPrimer
+ NoOpChannelPrimer primer = NoOpChannelPrimer.create();
+
+ // Create a mock ManagedChannel
+ ManagedChannel mockChannel = mock(ManagedChannel.class);
+
+ // Call the primeChannel method
+ primer.primeChannel(mockChannel);
+
+ // Verify that no interactions occurred with the mock channel.
+ // This confirms the "no-op" behavior.
+ verifyNoInteractions(mockChannel);
+ }
+}
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..7688fb0f60
--- /dev/null
+++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java
@@ -0,0 +1,195 @@
+/*
+ * 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 the external dependencies
+ @Mock private BigtableChannelPrimer mockPrimer;
+ private ListeningScheduledExecutorService executor;
+ @Mock private Clock mockClock;
+
+ // The System Under Test
+ private ChannelPoolHealthChecker healthChecker;
+
+ // Controllable list of channels for the checker to use
+ 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() {
+ // Given: A single channel entry
+ Entry entry = createTestEntry();
+ channelList.add(entry);
+
+ // And a probe that will succeed
+ SettableApiFuture successFuture = SettableApiFuture.create();
+ Mockito.when(mockPrimer.sendPrimeRequestsAsync(entry.getManagedChannel()))
+ .thenReturn(successFuture);
+
+ // When: A probe runs and completes
+ healthChecker.runProbes(); // This will trigger onComplete
+
+ successFuture.set(PingAndWarmResponse.getDefaultInstance());
+
+ // Then: The correct counters are updated
+ assertThat(entry.successfulProbesInWindow.get()).isEqualTo(1);
+ assertThat(entry.failedProbesInWindow.get()).isEqualTo(0);
+ }
+
+ @Test
+ public void testOnComplete_timeoutIsFailure() {
+ // Given: A single channel entry
+ Entry entry = createTestEntry();
+ channelList.add(entry);
+
+ // And a probe that will never complete (to force a timeout)
+ SettableApiFuture hangingFuture = SettableApiFuture.create();
+ Mockito.when(mockPrimer.sendPrimeRequestsAsync(entry.getManagedChannel()))
+ .thenReturn(hangingFuture);
+
+ // When: A probe runs and times out inside onComplete
+ healthChecker.runProbes();
+
+ // Difficult to test timeout without flakes
+ hangingFuture.cancel(true);
+
+ // Then: The failure counter is updated
+ assertThat(entry.failedProbesInWindow.get()).isEqualTo(1);
+ assertThat(entry.successfulProbesInWindow.get()).isEqualTo(0);
+ }
+
+ @Test
+ public void testPruning_removesOldProbesAndCounters() {
+ // Given: An entry with a failed probe
+ Entry entry = createTestEntry();
+ healthChecker.addProbeResult(entry, new ProbeResult(mockClock.instant(), false));
+ assertThat(entry.failedProbesInWindow.get()).isEqualTo(1);
+
+ // When: The clock advances past the WINDOW_DURATION
+ Instant newTime = mockClock.instant().plus(Duration.ofMinutes(6));
+ Mockito.when(mockClock.instant()).thenReturn(newTime);
+ healthChecker.pruneHistoryFor(entry); // Manually call for direct testing
+
+ // Then: The probe is pruned and the counter is decremented
+ assertThat(entry.probeHistory).isEmpty();
+ assertThat(entry.failedProbesInWindow.get()).isEqualTo(0);
+ }
+
+ @Test
+ public void testEviction_selectsWorstChannel() {
+ // --- GIVEN --- 3 channels with different health states
+ Entry healthyEntry = createTestEntry();
+ Entry badEntry = createTestEntry();
+ Entry worseEntry = createTestEntry();
+
+ // 2. Set their state directly to control the outcome of isEntryHealthy()
+ // 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));
+
+ // --- WHEN ---
+ healthChecker.detectAndRemoveOutlierEntries();
+
+ // --- THEN ---
+ // 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() {
+ // --- GIVEN --- A pool of 3 channels.
+ Entry entry1 = createTestEntry();
+ Entry entry2 = createTestEntry();
+ Entry entry3 = createTestEntry();
+ channelList.addAll(Arrays.asList(entry1, entry2, entry3));
+
+ // To make them all unhealthy, set their failure counts high enough
+ // to exceed the 60% failure threshold.
+ // We need at least MIN_PROBES_FOR_EVALUATION (4) total probes.
+ for (Entry entry : channelList) {
+ entry.failedProbesInWindow.set(4); // 4 failures, 0 successes = 100% failure rate
+ }
+
+ healthChecker.detectAndRemoveOutlierEntries();
+
+ // --- THEN ---
+ // The circuit breaker should engage because 3/3 channels (100%) are unhealthy,
+ // which is greater than the 70% threshold.
+ Mockito.verify(entry1.getManagedChannel(), Mockito.never()).enterIdle();
+ Mockito.verify(entry2.getManagedChannel(), Mockito.never()).enterIdle();
+ Mockito.verify(entry3.getManagedChannel(), Mockito.never()).enterIdle();
+ }
+}
diff --git a/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java b/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java
index 247ead57d2..b348a2aed4 100644
--- a/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java
+++ b/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java
@@ -693,10 +693,10 @@ default void readModifyWriteRow(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Returns the current list of partitions that make up the table's
* change stream. The union of partitions will cover the entire keyspace.
* Partitions can be read with `ReadChangeStream`.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
default void generateInitialChangeStreamPartitions(
@@ -712,10 +712,10 @@ default void generateInitialChangeStreamPartitions(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Reads changes from a table's change stream. Changes will
* reflect both user-initiated mutations and mutations that are caused by
* garbage collection.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
default void readChangeStream(
@@ -915,10 +915,10 @@ public void readModifyWriteRow(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Returns the current list of partitions that make up the table's
* change stream. The union of partitions will cover the entire keyspace.
* Partitions can be read with `ReadChangeStream`.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
public void generateInitialChangeStreamPartitions(
@@ -936,10 +936,10 @@ public void generateInitialChangeStreamPartitions(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Reads changes from a table's change stream. Changes will
* reflect both user-initiated mutations and mutations that are caused by
* garbage collection.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
public void readChangeStream(
@@ -1117,10 +1117,10 @@ public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Returns the current list of partitions that make up the table's
* change stream. The union of partitions will cover the entire keyspace.
* Partitions can be read with `ReadChangeStream`.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918")
@@ -1139,10 +1139,10 @@ public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Reads changes from a table's change stream. Changes will
* reflect both user-initiated mutations and mutations that are caused by
* garbage collection.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918")
@@ -1308,10 +1308,10 @@ public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Returns the current list of partitions that make up the table's
* change stream. The union of partitions will cover the entire keyspace.
* Partitions can be read with `ReadChangeStream`.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
public java.util.Iterator
@@ -1328,10 +1328,10 @@ public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow(
*
*
*
- * NOTE: This API is intended to be used by Apache Beam BigtableIO.
* Reads changes from a table's change stream. Changes will
* reflect both user-initiated mutations and mutations that are caused by
* garbage collection.
+ * NOTE: This API is only intended to be used by Apache Beam BigtableIO.
*
*/
public java.util.Iterator readChangeStream(
diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java
index eab6f78322..5188fc860f 100644
--- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java
+++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java
@@ -17385,145 +17385,219 @@ public com.google.bigtable.admin.v2.Type.Struct getDefaultInstanceForType() {
}
}
- public interface ArrayOrBuilder
+ public interface ProtoOrBuilder
extends
- // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Array)
+ // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Proto)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return Whether the elementType field is set.
+ * @return The schemaBundleId.
*/
- boolean hasElementType();
+ java.lang.String getSchemaBundleId();
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return The elementType.
+ * @return The bytes for schemaBundleId.
*/
- com.google.bigtable.admin.v2.Type getElementType();
+ com.google.protobuf.ByteString getSchemaBundleIdBytes();
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string message_name = 2;
+ *
+ * @return The messageName.
*/
- com.google.bigtable.admin.v2.TypeOrBuilder getElementTypeOrBuilder();
+ java.lang.String getMessageName();
+
+ /**
+ *
+ *
+ *
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
+ *
+ *
+ * string message_name = 2;
+ *
+ * @return The bytes for messageName.
+ */
+ com.google.protobuf.ByteString getMessageNameBytes();
}
/**
*
*
*
- * An ordered list of elements of a given type.
- * Values of type `Array` are stored in `Value.array_value`.
+ * A protobuf message type.
+ * Values of type `Proto` are stored in `Value.bytes_value`.
*
*
- * Protobuf type {@code google.bigtable.admin.v2.Type.Array}
+ * Protobuf type {@code google.bigtable.admin.v2.Type.Proto}
*/
- public static final class Array extends com.google.protobuf.GeneratedMessageV3
+ public static final class Proto extends com.google.protobuf.GeneratedMessageV3
implements
- // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Array)
- ArrayOrBuilder {
+ // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Proto)
+ ProtoOrBuilder {
private static final long serialVersionUID = 0L;
- // Use Array.newBuilder() to construct.
- private Array(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ // Use Proto.newBuilder() to construct.
+ private Proto(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
- private Array() {}
+ private Proto() {
+ schemaBundleId_ = "";
+ messageName_ = "";
+ }
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
- return new Array();
+ return new Proto();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Array_descriptor;
+ .internal_static_google_bigtable_admin_v2_Type_Proto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Array_fieldAccessorTable
+ .internal_static_google_bigtable_admin_v2_Type_Proto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- com.google.bigtable.admin.v2.Type.Array.class,
- com.google.bigtable.admin.v2.Type.Array.Builder.class);
+ com.google.bigtable.admin.v2.Type.Proto.class,
+ com.google.bigtable.admin.v2.Type.Proto.Builder.class);
}
- private int bitField0_;
- public static final int ELEMENT_TYPE_FIELD_NUMBER = 1;
- private com.google.bigtable.admin.v2.Type elementType_;
+ public static final int SCHEMA_BUNDLE_ID_FIELD_NUMBER = 1;
+
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object schemaBundleId_ = "";
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return Whether the elementType field is set.
+ * @return The schemaBundleId.
*/
@java.lang.Override
- public boolean hasElementType() {
- return ((bitField0_ & 0x00000001) != 0);
+ public java.lang.String getSchemaBundleId() {
+ java.lang.Object ref = schemaBundleId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ schemaBundleId_ = s;
+ return s;
+ }
}
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return The elementType.
+ * @return The bytes for schemaBundleId.
*/
@java.lang.Override
- public com.google.bigtable.admin.v2.Type getElementType() {
- return elementType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : elementType_;
+ public com.google.protobuf.ByteString getSchemaBundleIdBytes() {
+ java.lang.Object ref = schemaBundleId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ schemaBundleId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
}
+ public static final int MESSAGE_NAME_FIELD_NUMBER = 2;
+
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object messageName_ = "";
+
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string message_name = 2;
+ *
+ * @return The messageName.
*/
@java.lang.Override
- public com.google.bigtable.admin.v2.TypeOrBuilder getElementTypeOrBuilder() {
- return elementType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : elementType_;
+ public java.lang.String getMessageName() {
+ java.lang.Object ref = messageName_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ messageName_ = s;
+ return s;
+ }
+ }
+
+ /**
+ *
+ *
+ *
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
+ *
+ *
+ * string message_name = 2;
+ *
+ * @return The bytes for messageName.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getMessageNameBytes() {
+ java.lang.Object ref = messageName_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ messageName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
}
private byte memoizedIsInitialized = -1;
@@ -17540,8 +17614,11 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (((bitField0_ & 0x00000001) != 0)) {
- output.writeMessage(1, getElementType());
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaBundleId_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schemaBundleId_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(messageName_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, messageName_);
}
getUnknownFields().writeTo(output);
}
@@ -17552,8 +17629,11 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (((bitField0_ & 0x00000001) != 0)) {
- size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getElementType());
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaBundleId_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, schemaBundleId_);
+ }
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(messageName_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, messageName_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
@@ -17565,15 +17645,13 @@ public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
- if (!(obj instanceof com.google.bigtable.admin.v2.Type.Array)) {
+ if (!(obj instanceof com.google.bigtable.admin.v2.Type.Proto)) {
return super.equals(obj);
}
- com.google.bigtable.admin.v2.Type.Array other = (com.google.bigtable.admin.v2.Type.Array) obj;
+ com.google.bigtable.admin.v2.Type.Proto other = (com.google.bigtable.admin.v2.Type.Proto) obj;
- if (hasElementType() != other.hasElementType()) return false;
- if (hasElementType()) {
- if (!getElementType().equals(other.getElementType())) return false;
- }
+ if (!getSchemaBundleId().equals(other.getSchemaBundleId())) return false;
+ if (!getMessageName().equals(other.getMessageName())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -17585,80 +17663,80 @@ public int hashCode() {
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
- if (hasElementType()) {
- hash = (37 * hash) + ELEMENT_TYPE_FIELD_NUMBER;
- hash = (53 * hash) + getElementType().hashCode();
- }
+ hash = (37 * hash) + SCHEMA_BUNDLE_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getSchemaBundleId().hashCode();
+ hash = (37 * hash) + MESSAGE_NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getMessageName().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(java.nio.ByteBuffer data)
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(byte[] data)
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(java.io.InputStream input)
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Array parseDelimitedFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
- public static com.google.bigtable.admin.v2.Type.Array parseDelimitedFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
- public static com.google.bigtable.admin.v2.Type.Array parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Proto parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
@@ -17675,7 +17753,7 @@ public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
- public static Builder newBuilder(com.google.bigtable.admin.v2.Type.Array prototype) {
+ public static Builder newBuilder(com.google.bigtable.admin.v2.Type.Proto prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@@ -17695,74 +17773,62 @@ protected Builder newBuilderForType(
*
*
*
- * An ordered list of elements of a given type.
- * Values of type `Array` are stored in `Value.array_value`.
+ * A protobuf message type.
+ * Values of type `Proto` are stored in `Value.bytes_value`.
*
*
- * Protobuf type {@code google.bigtable.admin.v2.Type.Array}
+ * Protobuf type {@code google.bigtable.admin.v2.Type.Proto}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
- // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Array)
- com.google.bigtable.admin.v2.Type.ArrayOrBuilder {
+ // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Proto)
+ com.google.bigtable.admin.v2.Type.ProtoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Array_descriptor;
+ .internal_static_google_bigtable_admin_v2_Type_Proto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Array_fieldAccessorTable
+ .internal_static_google_bigtable_admin_v2_Type_Proto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- com.google.bigtable.admin.v2.Type.Array.class,
- com.google.bigtable.admin.v2.Type.Array.Builder.class);
+ com.google.bigtable.admin.v2.Type.Proto.class,
+ com.google.bigtable.admin.v2.Type.Proto.Builder.class);
}
- // Construct using com.google.bigtable.admin.v2.Type.Array.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ // Construct using com.google.bigtable.admin.v2.Type.Proto.newBuilder()
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
- getElementTypeFieldBuilder();
- }
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
- elementType_ = null;
- if (elementTypeBuilder_ != null) {
- elementTypeBuilder_.dispose();
- elementTypeBuilder_ = null;
- }
+ schemaBundleId_ = "";
+ messageName_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Array_descriptor;
+ .internal_static_google_bigtable_admin_v2_Type_Proto_descriptor;
}
@java.lang.Override
- public com.google.bigtable.admin.v2.Type.Array getDefaultInstanceForType() {
- return com.google.bigtable.admin.v2.Type.Array.getDefaultInstance();
+ public com.google.bigtable.admin.v2.Type.Proto getDefaultInstanceForType() {
+ return com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance();
}
@java.lang.Override
- public com.google.bigtable.admin.v2.Type.Array build() {
- com.google.bigtable.admin.v2.Type.Array result = buildPartial();
+ public com.google.bigtable.admin.v2.Type.Proto build() {
+ com.google.bigtable.admin.v2.Type.Proto result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
@@ -17770,9 +17836,9 @@ public com.google.bigtable.admin.v2.Type.Array build() {
}
@java.lang.Override
- public com.google.bigtable.admin.v2.Type.Array buildPartial() {
- com.google.bigtable.admin.v2.Type.Array result =
- new com.google.bigtable.admin.v2.Type.Array(this);
+ public com.google.bigtable.admin.v2.Type.Proto buildPartial() {
+ com.google.bigtable.admin.v2.Type.Proto result =
+ new com.google.bigtable.admin.v2.Type.Proto(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
@@ -17780,15 +17846,14 @@ public com.google.bigtable.admin.v2.Type.Array buildPartial() {
return result;
}
- private void buildPartial0(com.google.bigtable.admin.v2.Type.Array result) {
+ private void buildPartial0(com.google.bigtable.admin.v2.Type.Proto result) {
int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
- result.elementType_ =
- elementTypeBuilder_ == null ? elementType_ : elementTypeBuilder_.build();
- to_bitField0_ |= 0x00000001;
+ result.schemaBundleId_ = schemaBundleId_;
+ }
+ if (((from_bitField0_ & 0x00000002) != 0)) {
+ result.messageName_ = messageName_;
}
- result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
@@ -17828,18 +17893,25 @@ public Builder addRepeatedField(
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof com.google.bigtable.admin.v2.Type.Array) {
- return mergeFrom((com.google.bigtable.admin.v2.Type.Array) other);
+ if (other instanceof com.google.bigtable.admin.v2.Type.Proto) {
+ return mergeFrom((com.google.bigtable.admin.v2.Type.Proto) other);
} else {
super.mergeFrom(other);
return this;
}
}
- public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Array other) {
- if (other == com.google.bigtable.admin.v2.Type.Array.getDefaultInstance()) return this;
- if (other.hasElementType()) {
- mergeElementType(other.getElementType());
+ public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Proto other) {
+ if (other == com.google.bigtable.admin.v2.Type.Proto.getDefaultInstance()) return this;
+ if (!other.getSchemaBundleId().isEmpty()) {
+ schemaBundleId_ = other.schemaBundleId_;
+ bitField0_ |= 0x00000001;
+ onChanged();
+ }
+ if (!other.getMessageName().isEmpty()) {
+ messageName_ = other.messageName_;
+ bitField0_ |= 0x00000002;
+ onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
@@ -17869,10 +17941,16 @@ public Builder mergeFrom(
break;
case 10:
{
- input.readMessage(getElementTypeFieldBuilder().getBuilder(), extensionRegistry);
+ schemaBundleId_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
+ case 18:
+ {
+ messageName_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000002;
+ break;
+ } // case 18
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -17892,46 +17970,51 @@ public Builder mergeFrom(
private int bitField0_;
- private com.google.bigtable.admin.v2.Type elementType_;
- private com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>
- elementTypeBuilder_;
+ private java.lang.Object schemaBundleId_ = "";
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return Whether the elementType field is set.
+ * @return The schemaBundleId.
*/
- public boolean hasElementType() {
- return ((bitField0_ & 0x00000001) != 0);
+ public java.lang.String getSchemaBundleId() {
+ java.lang.Object ref = schemaBundleId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ schemaBundleId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
}
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return The elementType.
+ * @return The bytes for schemaBundleId.
*/
- public com.google.bigtable.admin.v2.Type getElementType() {
- if (elementTypeBuilder_ == null) {
- return elementType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : elementType_;
+ public com.google.protobuf.ByteString getSchemaBundleIdBytes() {
+ java.lang.Object ref = schemaBundleId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ schemaBundleId_ = b;
+ return b;
} else {
- return elementTypeBuilder_.getMessage();
+ return (com.google.protobuf.ByteString) ref;
}
}
@@ -17939,20 +18022,19 @@ public com.google.bigtable.admin.v2.Type getElementType() {
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
+ *
+ * @param value The schemaBundleId to set.
+ * @return This builder for chaining.
*/
- public Builder setElementType(com.google.bigtable.admin.v2.Type value) {
- if (elementTypeBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- elementType_ = value;
- } else {
- elementTypeBuilder_.setMessage(value);
+ public Builder setSchemaBundleId(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
}
+ schemaBundleId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
@@ -17962,18 +18044,16 @@ public Builder setElementType(com.google.bigtable.admin.v2.Type value) {
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
+ *
+ * @return This builder for chaining.
*/
- public Builder setElementType(com.google.bigtable.admin.v2.Type.Builder builderForValue) {
- if (elementTypeBuilder_ == null) {
- elementType_ = builderForValue.build();
- } else {
- elementTypeBuilder_.setMessage(builderForValue.build());
- }
- bitField0_ |= 0x00000001;
+ public Builder clearSchemaBundleId() {
+ schemaBundleId_ = getDefaultInstance().getSchemaBundleId();
+ bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
@@ -17982,108 +18062,139 @@ public Builder setElementType(com.google.bigtable.admin.v2.Type.Builder builderF
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The ID of the schema bundle that this proto is defined in.
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string schema_bundle_id = 1;
+ *
+ * @param value The bytes for schemaBundleId to set.
+ * @return This builder for chaining.
*/
- public Builder mergeElementType(com.google.bigtable.admin.v2.Type value) {
- if (elementTypeBuilder_ == null) {
- if (((bitField0_ & 0x00000001) != 0)
- && elementType_ != null
- && elementType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) {
- getElementTypeBuilder().mergeFrom(value);
- } else {
- elementType_ = value;
- }
- } else {
- elementTypeBuilder_.mergeFrom(value);
- }
- if (elementType_ != null) {
- bitField0_ |= 0x00000001;
- onChanged();
+ public Builder setSchemaBundleIdBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
}
+ checkByteStringIsUtf8(value);
+ schemaBundleId_ = value;
+ bitField0_ |= 0x00000001;
+ onChanged();
return this;
}
+ private java.lang.Object messageName_ = "";
+
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string message_name = 2;
+ *
+ * @return The messageName.
*/
- public Builder clearElementType() {
- bitField0_ = (bitField0_ & ~0x00000001);
- elementType_ = null;
- if (elementTypeBuilder_ != null) {
- elementTypeBuilder_.dispose();
- elementTypeBuilder_ = null;
+ public java.lang.String getMessageName() {
+ java.lang.Object ref = messageName_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ messageName_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
}
- onChanged();
- return this;
}
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string message_name = 2;
+ *
+ * @return The bytes for messageName.
*/
- public com.google.bigtable.admin.v2.Type.Builder getElementTypeBuilder() {
- bitField0_ |= 0x00000001;
- onChanged();
- return getElementTypeFieldBuilder().getBuilder();
+ public com.google.protobuf.ByteString getMessageNameBytes() {
+ java.lang.Object ref = messageName_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ messageName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
}
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string message_name = 2;
+ *
+ * @param value The messageName to set.
+ * @return This builder for chaining.
*/
- public com.google.bigtable.admin.v2.TypeOrBuilder getElementTypeOrBuilder() {
- if (elementTypeBuilder_ != null) {
- return elementTypeBuilder_.getMessageOrBuilder();
- } else {
- return elementType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : elementType_;
+ public Builder setMessageName(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
}
+ messageName_ = value;
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
}
/**
*
*
*
- * The type of the elements in the array. This must not be `Array`.
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
*
*
- * .google.bigtable.admin.v2.Type element_type = 1;
+ * string message_name = 2;
+ *
+ * @return This builder for chaining.
*/
- private com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>
- getElementTypeFieldBuilder() {
- if (elementTypeBuilder_ == null) {
- elementTypeBuilder_ =
- new com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>(
- getElementType(), getParentForChildren(), isClean());
- elementType_ = null;
+ public Builder clearMessageName() {
+ messageName_ = getDefaultInstance().getMessageName();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
+ }
+
+ /**
+ *
+ *
+ *
+ * The fully qualified name of the protobuf message, including package. In
+ * the format of "foo.bar.Message".
+ *
+ *
+ * string message_name = 2;
+ *
+ * @param value The bytes for messageName to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMessageNameBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
}
- return elementTypeBuilder_;
+ checkByteStringIsUtf8(value);
+ messageName_ = value;
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
}
@java.lang.Override
@@ -18098,24 +18209,24 @@ public final Builder mergeUnknownFields(
return super.mergeUnknownFields(unknownFields);
}
- // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Array)
+ // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Proto)
}
- // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Array)
- private static final com.google.bigtable.admin.v2.Type.Array DEFAULT_INSTANCE;
+ // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Proto)
+ private static final com.google.bigtable.admin.v2.Type.Proto DEFAULT_INSTANCE;
static {
- DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Array();
+ DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Proto();
}
- public static com.google.bigtable.admin.v2.Type.Array getDefaultInstance() {
+ public static com.google.bigtable.admin.v2.Type.Proto getDefaultInstance() {
return DEFAULT_INSTANCE;
}
- private static final com.google.protobuf.Parser PARSER =
- new com.google.protobuf.AbstractParser() {
+ private static final com.google.protobuf.Parser PARSER =
+ new com.google.protobuf.AbstractParser() {
@java.lang.Override
- public Array parsePartialFrom(
+ public Proto parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
@@ -18135,257 +18246,234 @@ public Array parsePartialFrom(
}
};
- public static com.google.protobuf.Parser parser() {
+ public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
+ public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
- public com.google.bigtable.admin.v2.Type.Array getDefaultInstanceForType() {
+ public com.google.bigtable.admin.v2.Type.Proto getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
- public interface MapOrBuilder
+ public interface EnumOrBuilder
extends
- // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Map)
+ // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Type.Enum)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return Whether the keyType field is set.
+ * @return The schemaBundleId.
*/
- boolean hasKeyType();
+ java.lang.String getSchemaBundleId();
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
- *
- * @return The keyType.
- */
- com.google.bigtable.admin.v2.Type getKeyType();
-
- /**
- *
- *
- *
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
- *
+ * string schema_bundle_id = 1;
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * @return The bytes for schemaBundleId.
*/
- com.google.bigtable.admin.v2.TypeOrBuilder getKeyTypeOrBuilder();
+ com.google.protobuf.ByteString getSchemaBundleIdBytes();
/**
*
*
*
- * The type of the values in a map.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type value_type = 2;
+ * string enum_name = 2;
*
- * @return Whether the valueType field is set.
+ * @return The enumName.
*/
- boolean hasValueType();
+ java.lang.String getEnumName();
/**
*
*
*
- * The type of the values in a map.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type value_type = 2;
- *
- * @return The valueType.
- */
- com.google.bigtable.admin.v2.Type getValueType();
-
- /**
- *
+ * string enum_name = 2;
*
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
+ * @return The bytes for enumName.
*/
- com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder();
+ com.google.protobuf.ByteString getEnumNameBytes();
}
/**
*
*
*
- * A mapping of keys to values of a given type.
- * Values of type `Map` are stored in a `Value.array_value` where each entry
- * is another `Value.array_value` with two elements (the key and the value,
- * in that order).
- * Normally encoded Map values won't have repeated keys, however, clients are
- * expected to handle the case in which they do. If the same key appears
- * multiple times, the _last_ value takes precedence.
+ * A protobuf enum type.
+ * Values of type `Enum` are stored in `Value.int_value`.
*
*
- * Protobuf type {@code google.bigtable.admin.v2.Type.Map}
+ * Protobuf type {@code google.bigtable.admin.v2.Type.Enum}
*/
- public static final class Map extends com.google.protobuf.GeneratedMessageV3
+ public static final class Enum extends com.google.protobuf.GeneratedMessageV3
implements
- // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Map)
- MapOrBuilder {
+ // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Enum)
+ EnumOrBuilder {
private static final long serialVersionUID = 0L;
- // Use Map.newBuilder() to construct.
- private Map(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ // Use Enum.newBuilder() to construct.
+ private Enum(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
- private Map() {}
+ private Enum() {
+ schemaBundleId_ = "";
+ enumName_ = "";
+ }
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
- return new Map();
+ return new Enum();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Map_descriptor;
+ .internal_static_google_bigtable_admin_v2_Type_Enum_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Map_fieldAccessorTable
+ .internal_static_google_bigtable_admin_v2_Type_Enum_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- com.google.bigtable.admin.v2.Type.Map.class,
- com.google.bigtable.admin.v2.Type.Map.Builder.class);
+ com.google.bigtable.admin.v2.Type.Enum.class,
+ com.google.bigtable.admin.v2.Type.Enum.Builder.class);
}
- private int bitField0_;
- public static final int KEY_TYPE_FIELD_NUMBER = 1;
- private com.google.bigtable.admin.v2.Type keyType_;
+ public static final int SCHEMA_BUNDLE_ID_FIELD_NUMBER = 1;
+
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object schemaBundleId_ = "";
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return Whether the keyType field is set.
+ * @return The schemaBundleId.
*/
@java.lang.Override
- public boolean hasKeyType() {
- return ((bitField0_ & 0x00000001) != 0);
+ public java.lang.String getSchemaBundleId() {
+ java.lang.Object ref = schemaBundleId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ schemaBundleId_ = s;
+ return s;
+ }
}
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return The keyType.
+ * @return The bytes for schemaBundleId.
*/
@java.lang.Override
- public com.google.bigtable.admin.v2.Type getKeyType() {
- return keyType_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : keyType_;
+ public com.google.protobuf.ByteString getSchemaBundleIdBytes() {
+ java.lang.Object ref = schemaBundleId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ schemaBundleId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
}
- /**
- *
- *
- *
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
- *
- *
- * .google.bigtable.admin.v2.Type key_type = 1;
- */
- @java.lang.Override
- public com.google.bigtable.admin.v2.TypeOrBuilder getKeyTypeOrBuilder() {
- return keyType_ == null ? com.google.bigtable.admin.v2.Type.getDefaultInstance() : keyType_;
- }
+ public static final int ENUM_NAME_FIELD_NUMBER = 2;
- public static final int VALUE_TYPE_FIELD_NUMBER = 2;
- private com.google.bigtable.admin.v2.Type valueType_;
+ @SuppressWarnings("serial")
+ private volatile java.lang.Object enumName_ = "";
/**
*
*
*
- * The type of the values in a map.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type value_type = 2;
+ * string enum_name = 2;
*
- * @return Whether the valueType field is set.
+ * @return The enumName.
*/
@java.lang.Override
- public boolean hasValueType() {
- return ((bitField0_ & 0x00000002) != 0);
+ public java.lang.String getEnumName() {
+ java.lang.Object ref = enumName_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ enumName_ = s;
+ return s;
+ }
}
/**
*
*
*
- * The type of the values in a map.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type value_type = 2;
- *
- * @return The valueType.
- */
- @java.lang.Override
- public com.google.bigtable.admin.v2.Type getValueType() {
- return valueType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : valueType_;
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
+ * string enum_name = 2;
*
- * .google.bigtable.admin.v2.Type value_type = 2;
+ * @return The bytes for enumName.
*/
@java.lang.Override
- public com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder() {
- return valueType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : valueType_;
+ public com.google.protobuf.ByteString getEnumNameBytes() {
+ java.lang.Object ref = enumName_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ enumName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
}
private byte memoizedIsInitialized = -1;
@@ -18402,11 +18490,11 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (((bitField0_ & 0x00000001) != 0)) {
- output.writeMessage(1, getKeyType());
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaBundleId_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schemaBundleId_);
}
- if (((bitField0_ & 0x00000002) != 0)) {
- output.writeMessage(2, getValueType());
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(enumName_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, enumName_);
}
getUnknownFields().writeTo(output);
}
@@ -18417,11 +18505,11 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (((bitField0_ & 0x00000001) != 0)) {
- size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKeyType());
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaBundleId_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, schemaBundleId_);
}
- if (((bitField0_ & 0x00000002) != 0)) {
- size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValueType());
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(enumName_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, enumName_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
@@ -18433,19 +18521,13 @@ public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
- if (!(obj instanceof com.google.bigtable.admin.v2.Type.Map)) {
+ if (!(obj instanceof com.google.bigtable.admin.v2.Type.Enum)) {
return super.equals(obj);
}
- com.google.bigtable.admin.v2.Type.Map other = (com.google.bigtable.admin.v2.Type.Map) obj;
+ com.google.bigtable.admin.v2.Type.Enum other = (com.google.bigtable.admin.v2.Type.Enum) obj;
- if (hasKeyType() != other.hasKeyType()) return false;
- if (hasKeyType()) {
- if (!getKeyType().equals(other.getKeyType())) return false;
- }
- if (hasValueType() != other.hasValueType()) return false;
- if (hasValueType()) {
- if (!getValueType().equals(other.getValueType())) return false;
- }
+ if (!getSchemaBundleId().equals(other.getSchemaBundleId())) return false;
+ if (!getEnumName().equals(other.getEnumName())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -18457,84 +18539,80 @@ public int hashCode() {
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
- if (hasKeyType()) {
- hash = (37 * hash) + KEY_TYPE_FIELD_NUMBER;
- hash = (53 * hash) + getKeyType().hashCode();
- }
- if (hasValueType()) {
- hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER;
- hash = (53 * hash) + getValueType().hashCode();
- }
+ hash = (37 * hash) + SCHEMA_BUNDLE_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getSchemaBundleId().hashCode();
+ hash = (37 * hash) + ENUM_NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getEnumName().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(java.nio.ByteBuffer data)
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(byte[] data)
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(java.io.InputStream input)
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Map parseDelimitedFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
- public static com.google.bigtable.admin.v2.Type.Map parseDelimitedFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
- public static com.google.bigtable.admin.v2.Type.Map parseFrom(
+ public static com.google.bigtable.admin.v2.Type.Enum parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
@@ -18551,7 +18629,7 @@ public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
- public static Builder newBuilder(com.google.bigtable.admin.v2.Type.Map prototype) {
+ public static Builder newBuilder(com.google.bigtable.admin.v2.Type.Enum prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@@ -18571,85 +18649,62 @@ protected Builder newBuilderForType(
*
*
*
- * A mapping of keys to values of a given type.
- * Values of type `Map` are stored in a `Value.array_value` where each entry
- * is another `Value.array_value` with two elements (the key and the value,
- * in that order).
- * Normally encoded Map values won't have repeated keys, however, clients are
- * expected to handle the case in which they do. If the same key appears
- * multiple times, the _last_ value takes precedence.
+ * A protobuf enum type.
+ * Values of type `Enum` are stored in `Value.int_value`.
*
*
- * Protobuf type {@code google.bigtable.admin.v2.Type.Map}
+ * Protobuf type {@code google.bigtable.admin.v2.Type.Enum}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
- // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Map)
- com.google.bigtable.admin.v2.Type.MapOrBuilder {
+ // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Type.Enum)
+ com.google.bigtable.admin.v2.Type.EnumOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Map_descriptor;
+ .internal_static_google_bigtable_admin_v2_Type_Enum_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Map_fieldAccessorTable
+ .internal_static_google_bigtable_admin_v2_Type_Enum_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- com.google.bigtable.admin.v2.Type.Map.class,
- com.google.bigtable.admin.v2.Type.Map.Builder.class);
+ com.google.bigtable.admin.v2.Type.Enum.class,
+ com.google.bigtable.admin.v2.Type.Enum.Builder.class);
}
- // Construct using com.google.bigtable.admin.v2.Type.Map.newBuilder()
- private Builder() {
- maybeForceBuilderInitialization();
- }
+ // Construct using com.google.bigtable.admin.v2.Type.Enum.newBuilder()
+ private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
- maybeForceBuilderInitialization();
- }
-
- private void maybeForceBuilderInitialization() {
- if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
- getKeyTypeFieldBuilder();
- getValueTypeFieldBuilder();
- }
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
- keyType_ = null;
- if (keyTypeBuilder_ != null) {
- keyTypeBuilder_.dispose();
- keyTypeBuilder_ = null;
- }
- valueType_ = null;
- if (valueTypeBuilder_ != null) {
- valueTypeBuilder_.dispose();
- valueTypeBuilder_ = null;
- }
+ schemaBundleId_ = "";
+ enumName_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.bigtable.admin.v2.TypesProto
- .internal_static_google_bigtable_admin_v2_Type_Map_descriptor;
+ .internal_static_google_bigtable_admin_v2_Type_Enum_descriptor;
}
@java.lang.Override
- public com.google.bigtable.admin.v2.Type.Map getDefaultInstanceForType() {
- return com.google.bigtable.admin.v2.Type.Map.getDefaultInstance();
+ public com.google.bigtable.admin.v2.Type.Enum getDefaultInstanceForType() {
+ return com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance();
}
@java.lang.Override
- public com.google.bigtable.admin.v2.Type.Map build() {
- com.google.bigtable.admin.v2.Type.Map result = buildPartial();
+ public com.google.bigtable.admin.v2.Type.Enum build() {
+ com.google.bigtable.admin.v2.Type.Enum result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
@@ -18657,9 +18712,9 @@ public com.google.bigtable.admin.v2.Type.Map build() {
}
@java.lang.Override
- public com.google.bigtable.admin.v2.Type.Map buildPartial() {
- com.google.bigtable.admin.v2.Type.Map result =
- new com.google.bigtable.admin.v2.Type.Map(this);
+ public com.google.bigtable.admin.v2.Type.Enum buildPartial() {
+ com.google.bigtable.admin.v2.Type.Enum result =
+ new com.google.bigtable.admin.v2.Type.Enum(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
@@ -18667,18 +18722,14 @@ public com.google.bigtable.admin.v2.Type.Map buildPartial() {
return result;
}
- private void buildPartial0(com.google.bigtable.admin.v2.Type.Map result) {
+ private void buildPartial0(com.google.bigtable.admin.v2.Type.Enum result) {
int from_bitField0_ = bitField0_;
- int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
- result.keyType_ = keyTypeBuilder_ == null ? keyType_ : keyTypeBuilder_.build();
- to_bitField0_ |= 0x00000001;
+ result.schemaBundleId_ = schemaBundleId_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
- result.valueType_ = valueTypeBuilder_ == null ? valueType_ : valueTypeBuilder_.build();
- to_bitField0_ |= 0x00000002;
+ result.enumName_ = enumName_;
}
- result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
@@ -18718,21 +18769,25 @@ public Builder addRepeatedField(
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof com.google.bigtable.admin.v2.Type.Map) {
- return mergeFrom((com.google.bigtable.admin.v2.Type.Map) other);
+ if (other instanceof com.google.bigtable.admin.v2.Type.Enum) {
+ return mergeFrom((com.google.bigtable.admin.v2.Type.Enum) other);
} else {
super.mergeFrom(other);
return this;
}
}
- public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Map other) {
- if (other == com.google.bigtable.admin.v2.Type.Map.getDefaultInstance()) return this;
- if (other.hasKeyType()) {
- mergeKeyType(other.getKeyType());
+ public Builder mergeFrom(com.google.bigtable.admin.v2.Type.Enum other) {
+ if (other == com.google.bigtable.admin.v2.Type.Enum.getDefaultInstance()) return this;
+ if (!other.getSchemaBundleId().isEmpty()) {
+ schemaBundleId_ = other.schemaBundleId_;
+ bitField0_ |= 0x00000001;
+ onChanged();
}
- if (other.hasValueType()) {
- mergeValueType(other.getValueType());
+ if (!other.getEnumName().isEmpty()) {
+ enumName_ = other.enumName_;
+ bitField0_ |= 0x00000002;
+ onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
@@ -18762,13 +18817,13 @@ public Builder mergeFrom(
break;
case 10:
{
- input.readMessage(getKeyTypeFieldBuilder().getBuilder(), extensionRegistry);
+ schemaBundleId_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
- input.readMessage(getValueTypeFieldBuilder().getBuilder(), extensionRegistry);
+ enumName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
@@ -18791,48 +18846,51 @@ public Builder mergeFrom(
private int bitField0_;
- private com.google.bigtable.admin.v2.Type keyType_;
- private com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>
- keyTypeBuilder_;
+ private java.lang.Object schemaBundleId_ = "";
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return Whether the keyType field is set.
+ * @return The schemaBundleId.
*/
- public boolean hasKeyType() {
- return ((bitField0_ & 0x00000001) != 0);
+ public java.lang.String getSchemaBundleId() {
+ java.lang.Object ref = schemaBundleId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ schemaBundleId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
}
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string schema_bundle_id = 1;
*
- * @return The keyType.
+ * @return The bytes for schemaBundleId.
*/
- public com.google.bigtable.admin.v2.Type getKeyType() {
- if (keyTypeBuilder_ == null) {
- return keyType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : keyType_;
+ public com.google.protobuf.ByteString getSchemaBundleIdBytes() {
+ java.lang.Object ref = schemaBundleId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ schemaBundleId_ = b;
+ return b;
} else {
- return keyTypeBuilder_.getMessage();
+ return (com.google.protobuf.ByteString) ref;
}
}
@@ -18840,21 +18898,19 @@ public com.google.bigtable.admin.v2.Type getKeyType() {
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string schema_bundle_id = 1;
+ *
+ * @param value The schemaBundleId to set.
+ * @return This builder for chaining.
*/
- public Builder setKeyType(com.google.bigtable.admin.v2.Type value) {
- if (keyTypeBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- keyType_ = value;
- } else {
- keyTypeBuilder_.setMessage(value);
+ public Builder setSchemaBundleId(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
}
+ schemaBundleId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
@@ -18864,19 +18920,16 @@ public Builder setKeyType(com.google.bigtable.admin.v2.Type value) {
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string schema_bundle_id = 1;
+ *
+ * @return This builder for chaining.
*/
- public Builder setKeyType(com.google.bigtable.admin.v2.Type.Builder builderForValue) {
- if (keyTypeBuilder_ == null) {
- keyType_ = builderForValue.build();
- } else {
- keyTypeBuilder_.setMessage(builderForValue.build());
- }
- bitField0_ |= 0x00000001;
+ public Builder clearSchemaBundleId() {
+ schemaBundleId_ = getDefaultInstance().getSchemaBundleId();
+ bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
@@ -18885,85 +18938,72 @@ public Builder setKeyType(com.google.bigtable.admin.v2.Type.Builder builderForVa
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The ID of the schema bundle that this enum is defined in.
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
- */
- public Builder mergeKeyType(com.google.bigtable.admin.v2.Type value) {
- if (keyTypeBuilder_ == null) {
- if (((bitField0_ & 0x00000001) != 0)
- && keyType_ != null
- && keyType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) {
- getKeyTypeBuilder().mergeFrom(value);
- } else {
- keyType_ = value;
- }
- } else {
- keyTypeBuilder_.mergeFrom(value);
- }
- if (keyType_ != null) {
- bitField0_ |= 0x00000001;
- onChanged();
- }
- return this;
- }
-
- /**
- *
- *
- *
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
- *
+ * string schema_bundle_id = 1;
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * @param value The bytes for schemaBundleId to set.
+ * @return This builder for chaining.
*/
- public Builder clearKeyType() {
- bitField0_ = (bitField0_ & ~0x00000001);
- keyType_ = null;
- if (keyTypeBuilder_ != null) {
- keyTypeBuilder_.dispose();
- keyTypeBuilder_ = null;
+ public Builder setSchemaBundleIdBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
}
+ checkByteStringIsUtf8(value);
+ schemaBundleId_ = value;
+ bitField0_ |= 0x00000001;
onChanged();
return this;
}
+ private java.lang.Object enumName_ = "";
+
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string enum_name = 2;
+ *
+ * @return The enumName.
*/
- public com.google.bigtable.admin.v2.Type.Builder getKeyTypeBuilder() {
- bitField0_ |= 0x00000001;
- onChanged();
- return getKeyTypeFieldBuilder().getBuilder();
+ public java.lang.String getEnumName() {
+ java.lang.Object ref = enumName_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ enumName_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
}
/**
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string enum_name = 2;
+ *
+ * @return The bytes for enumName.
*/
- public com.google.bigtable.admin.v2.TypeOrBuilder getKeyTypeOrBuilder() {
- if (keyTypeBuilder_ != null) {
- return keyTypeBuilder_.getMessageOrBuilder();
+ public com.google.protobuf.ByteString getEnumNameBytes() {
+ java.lang.Object ref = enumName_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ enumName_ = b;
+ return b;
} else {
- return keyType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : keyType_;
+ return (com.google.protobuf.ByteString) ref;
}
}
@@ -18971,221 +19011,66 @@ public com.google.bigtable.admin.v2.TypeOrBuilder getKeyTypeOrBuilder() {
*
*
*
- * The type of a map key.
- * Only `Bytes`, `String`, and `Int64` are allowed as key types.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type key_type = 1;
+ * string enum_name = 2;
+ *
+ * @param value The enumName to set.
+ * @return This builder for chaining.
*/
- private com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>
- getKeyTypeFieldBuilder() {
- if (keyTypeBuilder_ == null) {
- keyTypeBuilder_ =
- new com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>(
- getKeyType(), getParentForChildren(), isClean());
- keyType_ = null;
+ public Builder setEnumName(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
}
- return keyTypeBuilder_;
+ enumName_ = value;
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
}
- private com.google.bigtable.admin.v2.Type valueType_;
- private com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>
- valueTypeBuilder_;
-
/**
*
*
*
- * The type of the values in a map.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type value_type = 2;
+ * string enum_name = 2;
*
- * @return Whether the valueType field is set.
+ * @return This builder for chaining.
*/
- public boolean hasValueType() {
- return ((bitField0_ & 0x00000002) != 0);
+ public Builder clearEnumName() {
+ enumName_ = getDefaultInstance().getEnumName();
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
}
/**
*
*
*
- * The type of the values in a map.
+ * The fully qualified name of the protobuf enum message, including package.
+ * In the format of "foo.bar.EnumMessage".
*
*
- * .google.bigtable.admin.v2.Type value_type = 2;
+ * string enum_name = 2;
*
- * @return The valueType.
+ * @param value The bytes for enumName to set.
+ * @return This builder for chaining.
*/
- public com.google.bigtable.admin.v2.Type getValueType() {
- if (valueTypeBuilder_ == null) {
- return valueType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : valueType_;
- } else {
- return valueTypeBuilder_.getMessage();
+ public Builder setEnumNameBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
}
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
- */
- public Builder setValueType(com.google.bigtable.admin.v2.Type value) {
- if (valueTypeBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- valueType_ = value;
- } else {
- valueTypeBuilder_.setMessage(value);
- }
- bitField0_ |= 0x00000002;
- onChanged();
- return this;
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
- */
- public Builder setValueType(com.google.bigtable.admin.v2.Type.Builder builderForValue) {
- if (valueTypeBuilder_ == null) {
- valueType_ = builderForValue.build();
- } else {
- valueTypeBuilder_.setMessage(builderForValue.build());
- }
- bitField0_ |= 0x00000002;
- onChanged();
- return this;
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
- */
- public Builder mergeValueType(com.google.bigtable.admin.v2.Type value) {
- if (valueTypeBuilder_ == null) {
- if (((bitField0_ & 0x00000002) != 0)
- && valueType_ != null
- && valueType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) {
- getValueTypeBuilder().mergeFrom(value);
- } else {
- valueType_ = value;
- }
- } else {
- valueTypeBuilder_.mergeFrom(value);
- }
- if (valueType_ != null) {
- bitField0_ |= 0x00000002;
- onChanged();
- }
- return this;
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
- */
- public Builder clearValueType() {
- bitField0_ = (bitField0_ & ~0x00000002);
- valueType_ = null;
- if (valueTypeBuilder_ != null) {
- valueTypeBuilder_.dispose();
- valueTypeBuilder_ = null;
- }
- onChanged();
- return this;
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
- */
- public com.google.bigtable.admin.v2.Type.Builder getValueTypeBuilder() {
- bitField0_ |= 0x00000002;
- onChanged();
- return getValueTypeFieldBuilder().getBuilder();
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
- */
- public com.google.bigtable.admin.v2.TypeOrBuilder getValueTypeOrBuilder() {
- if (valueTypeBuilder_ != null) {
- return valueTypeBuilder_.getMessageOrBuilder();
- } else {
- return valueType_ == null
- ? com.google.bigtable.admin.v2.Type.getDefaultInstance()
- : valueType_;
- }
- }
-
- /**
- *
- *
- *
- * The type of the values in a map.
- *
- *
- * .google.bigtable.admin.v2.Type value_type = 2;
- */
- private com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>
- getValueTypeFieldBuilder() {
- if (valueTypeBuilder_ == null) {
- valueTypeBuilder_ =
- new com.google.protobuf.SingleFieldBuilderV3<
- com.google.bigtable.admin.v2.Type,
- com.google.bigtable.admin.v2.Type.Builder,
- com.google.bigtable.admin.v2.TypeOrBuilder>(
- getValueType(), getParentForChildren(), isClean());
- valueType_ = null;
- }
- return valueTypeBuilder_;
+ checkByteStringIsUtf8(value);
+ enumName_ = value;
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return this;
}
@java.lang.Override
@@ -19200,24 +19085,24 @@ public final Builder mergeUnknownFields(
return super.mergeUnknownFields(unknownFields);
}
- // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Map)
+ // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Type.Enum)
}
- // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Map)
- private static final com.google.bigtable.admin.v2.Type.Map DEFAULT_INSTANCE;
+ // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Type.Enum)
+ private static final com.google.bigtable.admin.v2.Type.Enum DEFAULT_INSTANCE;
static {
- DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Map();
+ DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Type.Enum();
}
- public static com.google.bigtable.admin.v2.Type.Map getDefaultInstance() {
+ public static com.google.bigtable.admin.v2.Type.Enum getDefaultInstance() {
return DEFAULT_INSTANCE;
}
- private static final com.google.protobuf.Parser