diff --git a/generation_config.yaml b/generation_config.yaml index e52d30a27e40..5d82f26a02e3 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.68.0 -googleapis_commitish: cd090841ab172574e740c214c99df00aef9c0dee +googleapis_commitish: f5cb7afc40b63d52f43bc306cb9b64a87b681aea libraries_bom_version: 26.79.0 template_excludes: - .gitignore diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 139be4144750..a133d702590f 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -159,15 +159,9 @@ google-http-client-gson runtime - io.grpc grpc-stub - runtime io.grpc @@ -217,6 +211,10 @@ io.opentelemetry opentelemetry-api + + io.opentelemetry + opentelemetry-context + io.opentelemetry opentelemetry-sdk diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java index f19726e2a315..61ab4cc12c12 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java @@ -74,6 +74,10 @@ public final class BigtableDataClientFactory implements AutoCloseable { */ public static BigtableDataClientFactory create(BigtableDataSettings defaultSettings) throws IOException { + BigtableDataSettings.Builder builder = defaultSettings.toBuilder(); + builder.stubSettings().setSessionsEnabled(false); + defaultSettings = builder.build(); + BigtableClientContext sharedClientContext = BigtableClientContext.create(defaultSettings.getStubSettings()); ClientOperationSettings perOpSettings = defaultSettings.getStubSettings().getPerOpSettings(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java index 535c9d99931a..96aef5334a39 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java @@ -133,6 +133,7 @@ public static Builder newBuilderForEmulator(String hostname, int port) { .setMetricsProvider( NoopMetricsProvider.INSTANCE) // disable exporting metrics for emulator .disableInternalMetrics() + .setSessionsEnabled(false) .setTransportChannelProvider( InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(256 * 1024 * 1024) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewAsync.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewAsync.java new file mode 100644 index 000000000000..3edacf7766e0 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewAsync.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; + +public class AuthorizedViewAsync implements AutoCloseable, Closeable { + + private final TableBase base; + + static AuthorizedViewAsync createAndStart( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String tableId, + String viewId, + Permission permission, + Metrics metrics, + ScheduledExecutorService executorService) { + + AuthorizedViewName viewName = + AuthorizedViewName.builder() + .setProjectId(clientInfo.getInstanceName().getProjectId()) + .setInstanceId(clientInfo.getInstanceName().getInstanceId()) + .setTableId(tableId) + .setAuthorizedViewId(viewId) + .build(); + + OpenAuthorizedViewRequest openRequest = + OpenAuthorizedViewRequest.newBuilder() + .setAuthorizedViewName(viewName.toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .setPermission(permission) + .build(); + + TableBase base = + TableBase.createAndStart( + openRequest, + VRpcDescriptor.AUTHORIZED_VIEW_SESSION, + VRpcDescriptor.READ_ROW_AUTH_VIEW, + VRpcDescriptor.MUTATE_ROW_AUTH_VIEW, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + viewName.toString(), + metrics, + executorService); + + return new AuthorizedViewAsync(base); + } + + AuthorizedViewAsync(TableBase viewBase) { + this.base = viewBase; + } + + public SessionPool getSessionPool() { + return base.getSessionPool(); + } + + public CompletableFuture readRow( + SessionReadRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.readRow(req, f, deadline); + return f; + } + + public CompletableFuture mutateRow( + SessionMutateRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.mutateRow(req, f, deadline); + return f; + } + + @Override + public void close() { + this.base.close(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewName.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewName.java new file mode 100644 index 000000000000..d239b5055aa6 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewName.java @@ -0,0 +1,118 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import java.util.List; + +@AutoValue +public abstract class AuthorizedViewName { + + public abstract String getProjectId(); + + public abstract String getInstanceId(); + + public abstract String getTableId(); + + public abstract String getAuthorizedViewId(); + + public InstanceName getInstanceName() { + return InstanceName.builder() + .setProjectId(getProjectId()) + .setInstanceId(getInstanceId()) + .build(); + } + + public TableName getTableName() { + return TableName.builder() + .setProjectId(getProjectId()) + .setInstanceId(getInstanceId()) + .setTableId(getTableId()) + .build(); + } + + @Override + public final String toString() { + return String.format("%s/authorizedViews/%s", getTableName(), getAuthorizedViewId()); + } + + public static AuthorizedViewName of( + String projectId, String instanceId, String tableId, String viewId) { + return builder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .setTableId(tableId) + .setAuthorizedViewId(viewId) + .build(); + } + + public static Builder builder() { + return new AutoValue_AuthorizedViewName.Builder(); + } + + public static AuthorizedViewName parse(String name) { + List parts = Splitter.on('/').splitToList(name); + Preconditions.checkArgument(parts.size() == 8, "Invalid authorized view name: %s", name); + Preconditions.checkArgument( + "projects".equals(parts.get(0)), + "Invalid authorized view name: %s, must start with projects/", + name); + Preconditions.checkArgument( + !parts.get(1).isEmpty(), "Invalid authorized view name %s, must have a project id", name); + Preconditions.checkArgument( + "instances".equals(parts.get(2)), + "Invalid authorized view name: %s, must start with projects/$PROJECT_ID/instances/", + name); + Preconditions.checkArgument( + !parts.get(3).isEmpty(), "Invalid authorized view name %s, must have an instance id", name); + Preconditions.checkArgument( + "tables".equals(parts.get(4)), + "Invalid authorized view name: %s, must start with projects/$PROJECT_ID/instances/$INSTANCE_ID/tables", + name); + Preconditions.checkArgument( + !parts.get(5).isEmpty(), "Invalid authorized view name %s, must have table id", name); + Preconditions.checkArgument( + "authorizedViews".equals(parts.get(6)), + "Invalid authorized view name: %s, must start with projects/$PROJECT_ID/instances/$INSTANCE_ID/tables/$TABLE_ID/authorizedViews", + name); + Preconditions.checkArgument( + !parts.get(7).isEmpty(), + "Invalid authorized view name %s, must have authorized view id", + name); + + return builder() + .setProjectId(parts.get(1)) + .setInstanceId(parts.get(3)) + .setTableId(parts.get(5)) + .setAuthorizedViewId(parts.get(7)) + .build(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setProjectId(String projectId); + + public abstract Builder setInstanceId(String instanceId); + + public abstract Builder setTableId(String tableId); + + public abstract Builder setAuthorizedViewId(String viewId); + + public abstract AuthorizedViewName build(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ChannelProviders.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ChannelProviders.java new file mode 100644 index 000000000000..945e08ab47fb --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ChannelProviders.java @@ -0,0 +1,319 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.bigtable.v2.FeatureFlags; +import com.google.cloud.bigtable.data.v2.internal.channels.DirectPathIpInterceptor; +import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects.ToStringHelper; +import com.google.common.collect.ImmutableList; +import io.grpc.ChannelCredentials; +import io.grpc.CompositeChannelCredentials; +import io.grpc.Grpc; +import io.grpc.ManagedChannelBuilder; +import io.grpc.TlsChannelCredentials; +import io.grpc.alts.AltsChannelCredentials; +import io.grpc.alts.GoogleDefaultChannelCredentials; +import io.grpc.auth.MoreCallCredentials; +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.Random; +import java.util.function.Function; + +public abstract class ChannelProviders { + public static final String DEFAULT_HOST = "bigtable.googleapis.com"; + + public interface ChannelProvider { + + ManagedChannelBuilder newChannelBuilder(); + + Optional getFallback(); + + FeatureFlags updateFeatureFlags(FeatureFlags featureFlags); + + boolean isSingleEndpoint(); + } + + public static class CloudPath implements ChannelProvider { + private final String host; + private final int port; + private final ChannelCredentials credentials; + + public CloudPath(String endpoint) throws IOException { + this(endpoint, GoogleCredentials.getApplicationDefault()); + } + + public CloudPath(String endpoint, Credentials credentials) { + this.credentials = + CompositeChannelCredentials.create( + TlsChannelCredentials.create(), MoreCallCredentials.from(credentials)); + String host = endpoint; + int port = 443; + + int sepI = endpoint.lastIndexOf(":"); + if (sepI > 0) { + host = endpoint.substring(0, sepI); + port = Integer.parseInt(endpoint.substring(sepI + 1)); + } + this.host = host; + this.port = port; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return Grpc.newChannelBuilderForAddress(host, port, credentials); + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .addValue(String.format("%s:%d", host, port)) + .toString(); + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags; + } + } + + public static class DirectAccess implements ChannelProvider { + private final String endpoint; + private final ChannelCredentials credentials; + private final Optional fallback; + + public DirectAccess(String endpoint) throws IOException { + this(endpoint, GoogleCredentials.getApplicationDefault()); + } + + public DirectAccess(String endpoint, Credentials credentials) { + this(endpoint, credentials, Optional.empty()); + } + + private DirectAccess( + String endpoint, Credentials credentials, Optional fallback) { + this.endpoint = endpoint; + this.credentials = + GoogleDefaultChannelCredentials.newBuilder() + .callCredentials(MoreCallCredentials.from(credentials)) + .build(); + this.fallback = fallback; + } + + public static DirectAccess withFallback(String endpoint) throws IOException { + return DirectAccess.withFallback(endpoint, GoogleCredentials.getApplicationDefault()); + } + + public static DirectAccess withFallback(String endpoint, Credentials credentials) { + Optional fallback = Optional.of(new CloudPath(endpoint, credentials)); + return new DirectAccess(endpoint, credentials, fallback); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return Grpc.newChannelBuilder("google-c2p:///" + endpoint, credentials) + .intercept(new DirectPathIpInterceptor(true)); + } + + public String getEndpoint() { + return endpoint; + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder() + .setTrafficDirectorEnabled(true) + .setDirectAccessRequested(true) + .build(); + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + @Override + public Optional getFallback() { + return fallback; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).addValue(endpoint).toString(); + } + } + + public static class RawDirectPath implements ChannelProvider { + private final List endpoints; + ChannelCredentials credentials; + + public RawDirectPath(List endpoints) throws IOException { + this(endpoints, GoogleCredentials.getApplicationDefault()); + } + + public RawDirectPath(List endpoints, Credentials credentials) { + this.endpoints = ImmutableList.copyOf(endpoints); + this.credentials = + CompositeChannelCredentials.create( + AltsChannelCredentials.create(), MoreCallCredentials.from(credentials)); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + int endpointI = new Random().nextInt(endpoints.size()); + String endpoint = endpoints.get(endpointI); + int portSplit = endpoint.lastIndexOf(":"); + String host = endpoint.substring(0, portSplit); + int port = Integer.parseInt(endpoint.substring(portSplit + 1)); + + return Grpc.newChannelBuilderForAddress(host, port, credentials); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder().setDirectAccessRequested(true).build(); + } + + @Override + public boolean isSingleEndpoint() { + return endpoints.size() <= 1; + } + + @Override + public String toString() { + ToStringHelper stringHelper = MoreObjects.toStringHelper(this); + endpoints.forEach(stringHelper::addValue); + return stringHelper.toString(); + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } + } + + public static class EmulatorChannelProvider implements ChannelProvider { + + private final String host; + private final int port; + + public EmulatorChannelProvider(String host, int port) { + this.host = host; + this.port = port; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return ManagedChannelBuilder.forAddress(host, port).usePlaintext(); + } + + @Override + public boolean isSingleEndpoint() { + return true; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .addValue(String.format("%s:%d", host, port)) + .toString(); + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags; + } + } + + public static class ForwardingChannelProvider implements ChannelProvider { + private final ChannelProvider delegate; + + public ForwardingChannelProvider(ChannelProvider delegate) { + this.delegate = delegate; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return delegate.newChannelBuilder(); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return delegate.updateFeatureFlags(featureFlags); + } + + @Override + public boolean isSingleEndpoint() { + return delegate.isSingleEndpoint(); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).addValue(delegate).toString(); + } + + @Override + public Optional getFallback() { + return delegate.getFallback(); + } + } + + /** + * ConfiguredChannelProvider is responsible for applying a custom options to the channel builder. + * It is meant to be used only during client construction phase and not during client + * configuration phase. + */ + public static class ConfiguredChannelProvider extends ForwardingChannelProvider { + private final Function, ManagedChannelBuilder> configurator; + + public ConfiguredChannelProvider( + ChannelProvider delegate, + Function, ManagedChannelBuilder> configurator) { + super(delegate); + this.configurator = configurator; + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + return configurator.apply(super.newChannelBuilder()); + } + + @Override + public Optional getFallback() { + return super.getFallback() + .flatMap(cb -> Optional.of(new ConfiguredChannelProvider(cb, configurator))); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Client.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Client.java new file mode 100644 index 000000000000..82ddff08c3cb --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Client.java @@ -0,0 +1,284 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ConfiguredChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SwitchingChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricsImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.opencensus.stats.Stats; +import io.opencensus.tags.Tags; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import java.io.IOException; +import java.util.Collections; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +public class Client implements AutoCloseable { + public static final FeatureFlags BASE_FEATURE_FLAGS = + FeatureFlags.newBuilder() + .setReverseScans(false) + .setMutateRowsRateLimit(false) + .setMutateRowsRateLimit2(false) + .setLastScannedRowResponses(false) + .setRoutingCookie(true) + .setRetryInfo(true) + .setClientSideMetricsEnabled(true) + // These are set by the channel provider + // .setTrafficDirectorEnabled(true) + // .setDirectAccessRequested(true) + .setPeerInfo(true) + .setSessionsCompatible(true) + .build(); + // gRPC keep-alive interval 60 seconds. + public static final int KEEPALIVE_TIME_MS = 60000; + // gRPC keep-alive timeout 10 seconds. + public static final int KEEPALIVE_TIMEOUT_MS = 10000; + + private final FeatureFlags featureFlags; + private final ClientInfo clientInfo; + private final Resource backgroundExecutor; + + private final CallOptions defaultCallOptions; + private final ChannelPool channelPool; + private final Resource metrics; + private final Resource configManager; + + private final Set> sessionPools = Collections.newSetFromMap(new WeakHashMap<>()); + + public static Client create(ClientSettings settings) throws IOException { + FeatureFlags featureFlags = + settings.getChannelProvider().updateFeatureFlags(BASE_FEATURE_FLAGS); + + ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName(settings.getInstanceName()) + .setAppProfileId(settings.getAppProfileId()) + .build(); + + ScheduledExecutorService backgroundExecutor = Executors.newScheduledThreadPool(4); + + // TODO: compat layer: get this from settings + String universeDomain = "googleapis.com"; + + Metrics metrics; + if (settings.getChannelProvider() instanceof ChannelProviders.EmulatorChannelProvider) { + metrics = new NoopMetrics(); + } else { + GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); + MetricRegistry registry = new MetricRegistry(); + OpenTelemetrySdk otel = + MetricsImpl.createBuiltinOtel( + registry, clientInfo, credentials, null, universeDomain, backgroundExecutor); + metrics = + new MetricsImpl( + registry, + clientInfo, + BaseApiTracerFactory.getInstance(), + otel, + null, + Tags.getTagger(), + Stats.getStatsRecorder(), + backgroundExecutor); + metrics.start(); + } + + ClientConfigurationManager configManager = null; + + try { + configManager = + new ClientConfigurationManager( + featureFlags, + clientInfo, + settings.getChannelProvider(), + metrics.getDebugTagTracer(), + backgroundExecutor); + configManager.start().get(); + metrics.getDebugTagTracer().setClientConfigurationManager(configManager); + } catch (Exception e) { + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } + if (configManager != null) { + configManager.close(); + } + metrics.close(); + backgroundExecutor.shutdown(); + throw new RuntimeException("Failed to fetch initial config", e); + } + + if (configManager.areSessionsRequired()) { + featureFlags = featureFlags.toBuilder().setSessionsCompatible(true).build(); + } + + return new Client( + featureFlags, + clientInfo, + settings.getChannelProvider(), + Resource.createOwned(metrics, metrics::close), + Resource.createOwned(configManager, configManager::close), + Resource.createOwned(backgroundExecutor, backgroundExecutor::shutdown)); + } + + public Client( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + Resource metrics, + Resource configManager, + Resource bgExecutor) + throws IOException { + this.featureFlags = featureFlags; + this.clientInfo = clientInfo; + this.metrics = metrics; + this.configManager = configManager; + this.backgroundExecutor = bgExecutor; + + defaultCallOptions = CallOptions.DEFAULT; + + ChannelProvider configuredChannelProvider = + new ConfiguredChannelProvider( + channelProvider, + channelBuilder -> + metrics + .get() + .configureGrpcChannel(channelBuilder) + .keepAliveTime(KEEPALIVE_TIME_MS, TimeUnit.MILLISECONDS) + .keepAliveTimeout(KEEPALIVE_TIMEOUT_MS, TimeUnit.MILLISECONDS) + // TODO: consider localizing this for large reads + .maxInboundMessageSize(256 * 1024 * 1024)); + + channelPool = + new SwitchingChannelPool( + configuredChannelProvider, + configManager.get(), + metrics.get(), + backgroundExecutor.get()); + channelPool.start(); + } + + @Override + public void close() { + sessionPools.forEach( + pool -> + pool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("Client closing") + .build())); + metrics.close(); + channelPool.close(); + configManager.close(); + backgroundExecutor.close(); + } + + public TableAsync openTableAsync(String tableId, Permission permission) { + TableAsync tableAsync = + TableAsync.createAndStart( + featureFlags, + clientInfo, + configManager.get(), + channelPool, + defaultCallOptions, + tableId, + permission, + metrics.get(), + backgroundExecutor.get()); + sessionPools.add(tableAsync.getSessionPool()); + return tableAsync; + } + + public AuthorizedViewAsync openAuthorizedViewAsync( + String tableId, String viewId, OpenAuthorizedViewRequest.Permission permission) { + AuthorizedViewAsync viewAsync = + AuthorizedViewAsync.createAndStart( + featureFlags, + clientInfo, + configManager.get(), + channelPool, + defaultCallOptions, + tableId, + viewId, + permission, + metrics.get(), + backgroundExecutor.get()); + sessionPools.add(viewAsync.getSessionPool()); + return viewAsync; + } + + public MaterializedViewAsync openMaterializedViewAsync( + String viewId, OpenMaterializedViewRequest.Permission permission) { + MaterializedViewAsync viewAsync = + MaterializedViewAsync.createAndStart( + featureFlags, + clientInfo, + configManager.get(), + channelPool, + defaultCallOptions, + viewId, + permission, + metrics.get(), + backgroundExecutor.get()); + sessionPools.add(viewAsync.getSessionPool()); + return viewAsync; + } + + public static class Resource { + private T value; + private Runnable closer; + + public static Resource createOwned(T value, Runnable closer) { + return new Resource<>(value, closer); + } + + public static Resource createShared(T value) { + return new Resource<>(value, () -> {}); + } + + private Resource(T value, Runnable closer) { + this.value = value; + this.closer = closer; + } + + public void close() { + this.closer.run(); + } + + public T get() { + return value; + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ClientSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ClientSettings.java new file mode 100644 index 000000000000..6b4448945eef --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/ClientSettings.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.auto.value.AutoValue; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.DirectAccess; +import java.io.IOException; +import javax.annotation.Nullable; + +@AutoValue +public abstract class ClientSettings { + public abstract ChannelProvider getChannelProvider(); + + public abstract InstanceName getInstanceName(); + + public abstract String getAppProfileId(); + + public static Builder builder() { + return new AutoValue_ClientSettings.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setChannelProvider(ChannelProvider channelProvider); + + @Nullable + abstract ChannelProvider getChannelProvider(); + + public abstract Builder setInstanceName(InstanceName name); + + public abstract Builder setAppProfileId(String appProfileId); + + abstract ClientSettings autoBuild(); // not public + + public ClientSettings build() { + if (getChannelProvider() != null) { + return autoBuild(); + } + + Credentials creds; + try { + creds = GoogleCredentials.getApplicationDefault(); + } catch (IOException e) { + throw new RuntimeException("Failed to create default credentials"); + } + + if (getChannelProvider() == null) { + setChannelProvider(DirectAccess.withFallback(ChannelProviders.DEFAULT_HOST, creds)); + } + return autoBuild(); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java index 01dfed2d72bf..e30710362a30 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewAsync.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewAsync.java new file mode 100644 index 000000000000..70023645efc2 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewAsync.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; + +public class MaterializedViewAsync implements AutoCloseable, Closeable { + + private final TableBase base; + + public static MaterializedViewAsync createAndStart( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String viewId, + OpenMaterializedViewRequest.Permission permission, + Metrics metrics, + ScheduledExecutorService executorService) { + + MaterializedViewName viewName = + MaterializedViewName.builder() + .setProjectId(clientInfo.getInstanceName().getProjectId()) + .setInstanceId(clientInfo.getInstanceName().getInstanceId()) + .setMaterializedViewId(viewId) + .build(); + + OpenMaterializedViewRequest openReq = + OpenMaterializedViewRequest.newBuilder() + .setMaterializedViewName(viewName.toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .setPermission(permission) + .build(); + + TableBase base = + TableBase.createAndStart( + openReq, + VRpcDescriptor.MATERIALIZED_VIEW_SESSION, + VRpcDescriptor.READ_ROW_MAT_VIEW, + null, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + viewId, + metrics, + executorService); + + return new MaterializedViewAsync(base); + } + + MaterializedViewAsync(TableBase base) { + this.base = base; + } + + public SessionPool getSessionPool() { + return base.getSessionPool(); + } + + @Override + public void close() { + base.close(); + } + + public CompletableFuture readRow( + SessionReadRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.readRow(req, f, deadline); + return f; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewName.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewName.java new file mode 100644 index 000000000000..5429584d0676 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewName.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import java.util.List; + +@AutoValue +public abstract class MaterializedViewName { + public abstract String getProjectId(); + + public abstract String getInstanceId(); + + public abstract String getMaterializedViewId(); + + public InstanceName getInstanceName() { + return InstanceName.builder() + .setProjectId(getProjectId()) + .setInstanceId(getInstanceId()) + .build(); + } + + public static MaterializedViewName of(String projectId, String instanceId, String viewId) { + return builder() + .setProjectId(projectId) + .setInstanceId(instanceId) + .setMaterializedViewId(viewId) + .build(); + } + + public static Builder builder() { + return new AutoValue_MaterializedViewName.Builder(); + } + + public static MaterializedViewName parse(String name) { + List parts = Splitter.on('/').splitToList(name); + Preconditions.checkArgument(parts.size() == 6, "Invalid materialized view name: %s", name); + Preconditions.checkArgument( + "projects".equals(parts.get(0)), + "Invalid materialized view name: %s, must start with projects/", + name); + Preconditions.checkArgument( + !parts.get(1).isEmpty(), "Invalid materialized view name %s, must have a project id", name); + Preconditions.checkArgument( + "instances".equals(parts.get(2)), + "Invalid materialized view name: %s, must start with projects/$PROJECT_ID/instances/", + name); + Preconditions.checkArgument( + !parts.get(3).isEmpty(), + "Invalid materialized view name %s, must have an instance id", + name); + Preconditions.checkArgument( + "materializedViews".equals(parts.get(4)), + "Invalid materialized view name: %s, must start with projects/$PROJECT_ID/instances/$INSTANCE_ID/materializedViews", + name); + Preconditions.checkArgument( + !parts.get(5).isEmpty(), "Invalid materialized view name %s, must have table id", name); + return MaterializedViewName.builder() + .setProjectId(parts.get(1)) + .setInstanceId(parts.get(3)) + .setMaterializedViewId(parts.get(5)) + .build(); + } + + @Override + public final String toString() { + return String.format("%s/materializedViews/%s", getInstanceName(), getMaterializedViewId()); + } + + @AutoValue.Builder + public abstract static class Builder { + + public abstract Builder setProjectId(String projectId); + + public abstract Builder setInstanceId(String instanceId); + + public abstract Builder setMaterializedViewId(String viewId); + + public abstract MaterializedViewName build(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableAsync.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableAsync.java new file mode 100644 index 000000000000..0bc699d4f146 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableAsync.java @@ -0,0 +1,119 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; + +public class TableAsync implements AutoCloseable, Closeable { + private final TableBase base; + + public static TableAsync createAndStart( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String tableId, + Permission permission, + Metrics metrics, + ScheduledExecutorService executorService) { + + TableName tableName = + TableName.builder() + .setProjectId(clientInfo.getInstanceName().getProjectId()) + .setInstanceId(clientInfo.getInstanceName().getInstanceId()) + .setTableId(tableId) + .build(); + + OpenTableRequest openReq = + OpenTableRequest.newBuilder() + .setTableName(tableName.toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .setPermission(permission) + .build(); + + TableBase base = + TableBase.createAndStart( + openReq, + VRpcDescriptor.TABLE_SESSION, + VRpcDescriptor.READ_ROW, + VRpcDescriptor.MUTATE_ROW, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + tableId, + metrics, + executorService); + + return new TableAsync(base); + } + + TableAsync(TableBase base) { + this.base = base; + } + + @Override + public void close() { + base.close(); + } + + public SessionPool getSessionPool() { + return base.getSessionPool(); + } + + // TODO: get deadline from compatibility layer + // Currently these are the deadlines from gax: + // ApiCallContext#timeout (attempt timeout) + // ApiCallContext#RetrySettings#totalTimeout + // ApiCallContext#RetrySettings#attemptTimeout + // GrpcApiCallContext#Calloptions#Deadline + // attemptTimeout will be ignored + // {totalTimeout and CallOptions deadline} -> deadline on this call + public CompletableFuture readRow( + SessionReadRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.readRow(req, f, deadline); + return f; + } + + // TODO: get deadline from compatibility layer + public CompletableFuture mutateRow( + SessionMutateRowRequest req, Deadline deadline) { + UnaryResponseFuture f = new UnaryResponseFuture<>(); + base.mutateRow(req, f, deadline); + return f; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableBase.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableBase.java new file mode 100644 index 000000000000..8feef399d625 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableBase.java @@ -0,0 +1,142 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.CancellableVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.RetryingVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolImpl; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.annotations.VisibleForTesting; +import com.google.protobuf.Message; +import io.grpc.CallOptions; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Metadata; +import java.util.concurrent.ScheduledExecutorService; + +class TableBase implements AutoCloseable { + private final SessionPool sessionPool; + private final ScheduledExecutorService backgroundExecutor; + private final Metrics metrics; + private final VRpcDescriptor readRowDescriptor; + private final VRpcDescriptor + mutateRowDescriptor; + + static TableBase createAndStart( + ReqT openReq, + VRpcDescriptor.SessionDescriptor sessionDescriptor, + VRpcDescriptor readRowDescriptor, + VRpcDescriptor mutateRowDescriptor, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + String sessionPoolName, + Metrics metrics, + ScheduledExecutorService executor) { + + SessionPool sessionPool = + new SessionPoolImpl<>( + metrics, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + sessionDescriptor, + sessionPoolName, + executor); + + sessionPool.start(openReq, new Metadata()); + + return new TableBase(sessionPool, readRowDescriptor, mutateRowDescriptor, metrics, executor); + } + + @VisibleForTesting + TableBase( + SessionPool sessionPool, + VRpcDescriptor readRowDescriptor, + VRpcDescriptor mutateRowDescriptor, + Metrics metrics, + ScheduledExecutorService executor) { + this.sessionPool = sessionPool; + this.readRowDescriptor = readRowDescriptor; + this.mutateRowDescriptor = mutateRowDescriptor; + this.metrics = metrics; + this.backgroundExecutor = executor; + } + + @Override + public void close() { + sessionPool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("user closed session") + .build()); + } + + public SessionPool getSessionPool() { + return sessionPool; + } + + public void readRow( + SessionReadRowRequest req, VRpcListener listener, Deadline deadline) { + RetryingVRpc retry = + new RetryingVRpc<>(() -> sessionPool.newCall(readRowDescriptor), backgroundExecutor); + + VRpcTracer tracer = metrics.newTableTracer(sessionPool.getInfo(), readRowDescriptor, deadline); + VRpcCallContext ctx = VRpcCallContext.create(deadline, true, tracer); + + CancellableVRpc cancellableVRpc = + new CancellableVRpc<>(retry, Context.current()); + + cancellableVRpc.start(req, ctx, listener); + } + + public void mutateRow( + SessionMutateRowRequest req, + VRpcListener listener, + Deadline deadline) { + RetryingVRpc retry = + new RetryingVRpc<>(() -> sessionPool.newCall(mutateRowDescriptor), backgroundExecutor); + + boolean idempotent = Util.isIdempotent(req.getMutationsList()); + + VRpcTracer tracer = + metrics.newTableTracer(sessionPool.getInfo(), mutateRowDescriptor, deadline); + VRpcCallContext ctx = VRpcCallContext.create(deadline, idempotent, tracer); + + CancellableVRpc cancellable = + new CancellableVRpc<>(retry, Context.current()); + + cancellable.start(req, ctx, listener); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java index 159c7b0b50ab..7a094f8550f4 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,10 @@ public final String toString() { return String.format("%s/tables/%s", getInstanceName(), getTableId()); } + public static TableName of(String projectId, String instanceId, String tableId) { + return builder().setProjectId(projectId).setInstanceId(instanceId).setTableId(tableId).build(); + } + public static Builder builder() { return new AutoValue_TableName.Builder(); } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/UnaryResponseFuture.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/UnaryResponseFuture.java new file mode 100644 index 000000000000..18ccfd6e09ef --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/UnaryResponseFuture.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.common.base.Preconditions; +import java.util.concurrent.CompletableFuture; +import java.util.logging.Logger; + +public class UnaryResponseFuture extends CompletableFuture implements VRpcListener { + private static final Logger DEFAULT_LOGGER = + Logger.getLogger(UnaryResponseFuture.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + private T msg = null; + private boolean hasMsg = false; + + @Override + public void onMessage(T msg) { + Preconditions.checkState(!hasMsg, "Unary rpc received duplicated message"); + hasMsg = true; + this.msg = msg; + } + + @Override + public void onClose(VRpcResult result) { + if (result.getStatus().isOk()) { + if (!hasMsg) { + completeExceptionally( + new IllegalStateException("Unary rpc completed OK but missing result")); + } else { + complete(msg); + } + } else { + if (!completeExceptionally(VRpcException.create(result))) { + logger.warning("Unary rpc got error after it was resolved: " + result); + } + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Util.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Util.java new file mode 100644 index 000000000000..fba8bd0b8710 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/Util.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.Mutation; +import io.grpc.Metadata; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class Util { + private static final Metadata.Key REQUEST_PARAMS_KEY = + Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER); + private static final Metadata.Key FEATURE_FLAGS_KEY = + Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER); + + public static Metadata composeMetadata( + FeatureFlags featureFlags, Map headerParams) { + Metadata metadata = new Metadata(); + + // Configure FeatureFlags for RLS + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + featureFlags.writeTo(baos); + } catch (IOException e) { + throw new IllegalStateException("ByteArrayOutputStream should never throw an IOException"); + } + String encodedFeatureFlags = + new String(Base64.getUrlEncoder().encode(baos.toByteArray()), StandardCharsets.UTF_8); + metadata.put(FEATURE_FLAGS_KEY, encodedFeatureFlags); + } + + // Configure resource names for RLS + metadata.put( + REQUEST_PARAMS_KEY, + headerParams.entrySet().stream() + .map(e -> String.format("%s=%s", e.getKey(), urlEncode(e.getValue()))) + .collect(Collectors.joining("&"))); + + return metadata; + } + + public static boolean isIdempotent(List mutations) { + for (Mutation mutation : mutations) { + // aggregates are not idempotent + if (mutation.hasAddToCell() || mutation.hasMergeToCell()) { + return false; + } + // mutations with system timestamps are not idempotent + if (mutation.hasSetCell() && mutation.getSetCell().getTimestampMicros() == -1) { + return false; + } + } + return true; + } + + private static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new IllegalStateException("Should never happen", e); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/VRpcException.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/VRpcException.java new file mode 100644 index 000000000000..be212be1ccb2 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/VRpcException.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 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.internal.api; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; + +// TODO: capture caller stack - this will be mostly created by a gRPC response threads, which loses +// the caller stacktrace, which isnt helpful +public class VRpcException extends StatusRuntimeException { + private final VRpcResult result; + + public static VRpcException create(VRpcResult result) { + if (result.getStatus().isOk()) { + return new VRpcException( + Status.INTERNAL.withDescription("Unexpected OK status used for an exception"), result); + } + return new VRpcException(result); + } + + private VRpcException(Status overridenStatus, VRpcResult result) { + super(overridenStatus); + this.result = result; + } + + private VRpcException(VRpcResult result) { + super(result.getStatus()); + this.result = result; + } + + public VRpcResult getResult() { + return result; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPool.java new file mode 100644 index 000000000000..0c041be523f4 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPool.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.CallOptions; +import io.grpc.MethodDescriptor; + +public interface ChannelPool extends AutoCloseable { + + void start(); + + @Override + void close(); + + SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions); + + void updateConfig(ChannelPoolConfiguration config); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImpl.java new file mode 100644 index 000000000000..f2568ce524ed --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImpl.java @@ -0,0 +1,512 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Multiset; +import io.grpc.CallOptions; +import io.grpc.ClientCall; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import io.grpc.Status.Code; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Deque; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +/** + * Proof of concept channel pool that avoids parallel channels to the same afe. The pool is + * dynamically sized based on outstanding streams and tries to limit each channel to at most 10 + * streams. + */ +public class ChannelPoolDpImpl implements ChannelPool { + private static final Logger LOGGER = Logger.getLogger(ChannelPoolDpImpl.class.getName()); + private static final String DEFAULT_LOG_NAME = "pool"; + private static final AtomicInteger INDEX = new AtomicInteger(); + + private final String poolLogId; + + @VisibleForTesting volatile int minGroups; + @VisibleForTesting volatile int maxGroups; + @VisibleForTesting volatile int softMaxPerGroup; + + private final Clock clock; + private final Supplier channelSupplier; + private final ScheduledExecutorService executor; + + private final DebugTagTracer debugTagTracer; + + @GuardedBy("this") + private final List channelGroups; + + @GuardedBy("this") + private final AfeChannelGroup startingGroup; + + @GuardedBy("this") + private int totalStreams = 0; + + // TODO: replace SocketAddress with AfeId + @GuardedBy("this") + private final Multiset sessionsPerAfeId = HashMultiset.create(); + + private ScheduledFuture serviceFuture = null; + + @GuardedBy("this") + private boolean closed = false; + + public ChannelPoolDpImpl( + Supplier channelSupplier, + ChannelPoolConfiguration config, + DebugTagTracer debugTagTracer, + ScheduledExecutorService executor) { + this(channelSupplier, config, DEFAULT_LOG_NAME, debugTagTracer, executor, Clock.systemUTC()); + } + + public ChannelPoolDpImpl( + Supplier channelSupplier, + ChannelPoolConfiguration config, + String logName, + DebugTagTracer debugTagTracer, + ScheduledExecutorService executor) { + this(channelSupplier, config, logName, debugTagTracer, executor, Clock.systemUTC()); + } + + public ChannelPoolDpImpl( + Supplier channelSupplier, + ChannelPoolConfiguration config, + String logName, + DebugTagTracer debugTagTracer, + ScheduledExecutorService executor, + Clock clock) { + this.poolLogId = String.format("%d-%s", INDEX.getAndIncrement(), logName); + this.clock = clock; + this.channelSupplier = channelSupplier; + this.executor = executor; + updateConfig(config); + channelGroups = new ArrayList<>(); + startingGroup = new AfeChannelGroup(null); + this.debugTagTracer = debugTagTracer; + } + + @Override + public void updateConfig(ChannelPoolConfiguration config) { + this.minGroups = config.getMinServerCount(); + this.maxGroups = config.getMaxServerCount(); + this.softMaxPerGroup = config.getPerServerSessionCount(); + } + + @Override + public synchronized void start() { + serviceChannels(); + serviceFuture = executor.scheduleAtFixedRate(this::serviceChannels, 1, 1, TimeUnit.MINUTES); + } + + @Override + public synchronized void close() { + closed = true; + + if (serviceFuture != null) { + serviceFuture.cancel(false); + } + + channelGroups.stream() + .flatMap(g -> g.channels.stream()) + .forEach(channelWrapper -> channelWrapper.channel.shutdown()); + } + + @Override + public synchronized SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + if (closed) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "channel_pool_new_stream_failed"); + return new FailingSessionStream(Status.UNAVAILABLE.withDescription("ChannelPool is closed")); + } + // Find the AFE with the fewest sessions + Optional maybeGroup = + channelGroups.stream() + .filter(g -> g.numStreams < softMaxPerGroup) + .min(Comparator.comparingInt(a -> a.numStreams)); + + // Find the first channel that has capacity + Optional maybeChannel = + maybeGroup.flatMap(g -> g.channels.stream().findFirst()); + + // try to find a channel that has capacity in the least loaded afe + final ChannelWrapper channelWrapper = + maybeChannel.orElseGet( + () -> { + log( + Level.FINE, + "Couldn't find an existing channel with capacity, num outstanding streams across all channel groups: %d, num groups: %d", + channelGroups.stream().mapToInt(g -> g.numStreams).sum(), + channelGroups.size()); + + // If there is no such channel, then try to add a channel that being resolved + // and if no channel is in the process of being added or its already nearing 50% + // utilization + // during initialization, then add a new channel + return startingGroup.channels.stream() + .filter(w -> w.numOutstanding < softMaxPerGroup / 2) + .min(Comparator.comparingInt(w -> w.numOutstanding)) + .map( + (w) -> { + log(Level.FINE, "Using a channel thats already connecting"); + return w; + }) + .orElseGet( + () -> { + log(Level.FINE, "Creating a new channel"); + return addChannel(); + }); + }); + + channelWrapper.numOutstanding++; + channelWrapper.group.numStreams++; + totalStreams++; + + ClientCall innerCall = + channelWrapper.channel.newCall(desc, callOptions); + + return new SessionStreamImpl(innerCall) { + // mark as null so that onClose can tell if onBeforeSessionStart was never called + @Nullable AfeId afeId = null; + + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new ForwardingListener(responseListener) { + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) { + afeId = AfeId.extract(peerInfo); + synchronized (ChannelPoolDpImpl.this) { + rehomeChannel(channelWrapper, afeId); + sessionsPerAfeId.add(afeId); + } + super.onBeforeSessionStart(peerInfo); + } + + @Override + public void onClose(Status status, Metadata trailers) { + synchronized (ChannelPoolDpImpl.this) { + if (afeId != null) { + sessionsPerAfeId.remove(afeId); + } + releaseChannel(channelWrapper, status); + } + super.onClose(status, trailers); + } + }, + headers); + } + }; + } + + @GuardedBy("this") + private ChannelWrapper addChannel() { + debugTagTracer.checkPrecondition( + !closed, "channel_pool_add_channel_failure", "Channel pool is closed"); + log(Level.FINE, "Adding a new channel"); + ChannelWrapper wrapped = new ChannelWrapper(startingGroup, channelSupplier.get(), clock); + startingGroup.channels.addFirst(wrapped); + return wrapped; + } + + @GuardedBy("this") + private void removeGroup(AfeChannelGroup group) { + log(Level.FINE, "Removing group: %s", group.afeId); + group.channels.forEach(c -> c.channel.shutdown()); + channelGroups.remove(group); + // TODO: need to handle a group being added right after it was removed with lingering sessions + } + + @GuardedBy("this") + private AfeChannelGroup rehomeChannel(ChannelWrapper channelWrapper, AfeId afeId) { + AfeChannelGroup origGroup = channelWrapper.group; + + if (Objects.equals(origGroup.afeId, afeId)) { + return origGroup; + } + + log(Level.FINE, "Rehoming channel from: %s to %s", origGroup.afeId, afeId); + + // Re-home the channel + AfeChannelGroup newGroup = + channelGroups.stream() + .filter(g -> Objects.equals(g.afeId, afeId)) + .findAny() + .orElseGet( + () -> { + AfeChannelGroup g = new AfeChannelGroup(afeId); + channelGroups.add(g); + return g; + }); + channelWrapper.group = newGroup; + origGroup.channels.remove(channelWrapper); + if (origGroup.channels.isEmpty()) { + channelGroups.remove(origGroup); + } + origGroup.numStreams -= channelWrapper.numOutstanding; + newGroup.channels.add(channelWrapper); + newGroup.numStreams += channelWrapper.numOutstanding; + + return newGroup; + } + + // Update accounting when a stream is closed and releases its channel + @GuardedBy("this") + private void releaseChannel(ChannelWrapper channelWrapper, Status status) { + totalStreams--; + channelWrapper.group.numStreams--; + channelWrapper.numOutstanding--; + + if (shouldRecycleChannel(status)) { + recycleChannel(channelWrapper); + } + } + + private static boolean shouldRecycleChannel(Status status) { + if (status.getCode() == Code.UNIMPLEMENTED) { + return true; + } + + // TODO: replace this with a flag in the ErrorDetails + if (status.getDescription() != null + && status.getDescription().toLowerCase(Locale.ENGLISH).contains("server is draining")) { + return true; + } + + return false; + } + + @GuardedBy("this") + private void recycleChannel(ChannelWrapper channelWrapper) { + channelWrapper.group.channels.remove(channelWrapper); + channelWrapper.channel.shutdown(); + // Checking for starting group because we don't want to delete the stating group. + if (channelWrapper.group.channels.isEmpty() && channelWrapper.group != startingGroup) { + removeGroup(channelWrapper.group); + } + addChannel(); + } + + @VisibleForTesting + void serviceChannels() { + try { + serviceChannelsSafe(); + } catch (Exception e) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "service_channel_failure"); + log(Level.WARNING, "Failed to service channels", e); + } + } + + /* + - add new group if existing groups are overflowing + - shutdown older channels within a group + */ + private synchronized void serviceChannelsSafe() { + log(Level.FINE, "Servicing channels"); + dumpState(); + + Instant now = Instant.now(clock); + Instant createdAtThreshold = now.minus(Duration.ofMinutes(50)); + + // Thin out the channels in each group, so that each AFEGroup only has 1 channel + for (AfeChannelGroup group : channelGroups) { + if (LOGGER.isLoggable(Level.FINEST) && group.channels.size() > 1) { + log( + Level.FINEST, + "Shutting down %d parallel channels for %s", + group.channels.size() - 1, + group.afeId); + } + while (group.channels.size() > 1) { + // Clean up parallel channels. + // Recent channels added to the end, thus removing the oldest from the beginning. + group.channels.removeFirst().channel.shutdown(); + } + } + + // try to adjust the groups + int desiredGroups = (int) Math.ceil(((float) totalStreams / softMaxPerGroup) * 2); + if (desiredGroups > maxGroups) { + desiredGroups = maxGroups; + } else if (desiredGroups < minGroups) { + desiredGroups = minGroups; + } + + // Right size the groups + if (desiredGroups < channelGroups.size()) { + // Remove extra groups, oldest first + Iterator it = + channelGroups.stream() + .sorted(Comparator.comparing(g -> g.channels.peek().createdAt)) + .limit(channelGroups.size() - desiredGroups) + .iterator(); + + while (it.hasNext()) { + AfeChannelGroup group = it.next(); + log( + Level.FINE, + "Removing %d channel for %s due to lack of concurrency", + group.channels.size(), + group.afeId); + removeGroup(group); + } + } else if (desiredGroups > channelGroups.size() + startingGroup.channels.size()) { + log(Level.FINE, "Adding %d channels", desiredGroups - channelGroups.size()); + for (int i = channelGroups.size(); i < desiredGroups; i++) { + addChannel(); + } + } + + log(Level.FINE, "Done servicing channels"); + dumpState(); + } + + private void log(Level level, String msg, Throwable throwable) { + LOGGER.log(level, String.format("[%s] %s", poolLogId, msg), throwable); + } + + private void log(Level level, String format, Object... args) { + LOGGER.log(level, String.format("[%s] %s", poolLogId, String.format(format, args))); + } + + @GuardedBy("this") + void dumpState() { + if (!LOGGER.isLoggable(Level.FINE)) { + return; + } + + int channels = + channelGroups.stream().mapToInt((AfeChannelGroup chg) -> chg.channels.size()).sum(); + String s = + sessionsPerAfeId.entrySet().stream() + .sorted(Comparator.comparing(e -> e.getElement().toString())) + .map(e -> String.format("%d", e.getCount())) + .collect(Collectors.joining(", ")); + + log( + Level.FINE, + "ChannelPool channelGroups: " + + channelGroups.size() + + ", channels: " + + channels + + ", starting channels: " + + startingGroup.channels.size() + + ", totalStreams: " + + totalStreams + + ", AFEs: " + + sessionsPerAfeId.entrySet().size() + + ", distribution: [" + + s + + "]"); + + if (LOGGER.isLoggable(Level.FINEST)) { + String afeToSessions = + sessionsPerAfeId.entrySet().stream() + .sorted(Comparator.comparing(e -> e.getElement().toString())) + .map(e -> String.format("%s: %d", e.getElement(), e.getCount())) + .collect(Collectors.joining("\n")); + log(Level.FINEST, "ChannelPool session distribution:\n%s", afeToSessions); + } + } + + static class AfeChannelGroup { + private final AfeId afeId; + private final Deque channels; + private int numStreams; + + public AfeChannelGroup(AfeId afeId) { + this.afeId = afeId; + channels = new ArrayDeque<>(); + numStreams = 0; + } + } + + static class ChannelWrapper { + private AfeChannelGroup group; + private final ManagedChannel channel; + private final Instant createdAt; + private int numOutstanding = 0; + + public ChannelWrapper(AfeChannelGroup group, ManagedChannel channel, Clock clock) { + this.group = group; + this.channel = channel; + createdAt = Instant.now(clock); + } + } + + private static class AfeId { + private final long id; + + static AfeId extract(PeerInfo peerInfo) { + return new AfeId(peerInfo.getApplicationFrontendId()); + } + + private AfeId(long id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AfeId)) { + return false; + } + return id == ((AfeId) o).id; + } + + @Override + public int hashCode() { + return com.google.common.base.Objects.hashCode(id); + } + + @Override + public String toString() { + return Long.toString(id); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectPathIpInterceptor.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectPathIpInterceptor.java new file mode 100644 index 000000000000..e22588858eea --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectPathIpInterceptor.java @@ -0,0 +1,89 @@ +/* + * Copyright 2026 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.internal.channels; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Grpc; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.logging.Logger; + +public class DirectPathIpInterceptor implements ClientInterceptor { + private static final Logger LOGGER = Logger.getLogger(DirectPathIpInterceptor.class.getName()); + + private static final String DP_IPV6_PREFIX = "2001:4860:8040"; + private static final String DP_IPV4_PREFIX = "34.126"; + + private static final AtomicInteger nextObjectId = new AtomicInteger(); + private final int myId = nextObjectId.getAndIncrement(); + + private AtomicReference lastIp = new AtomicReference<>(); + private final boolean expectDirectPath; + + public DirectPathIpInterceptor(boolean expectDirectPath) { + this.expectDirectPath = expectDirectPath; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + ClientCall clientCall = channel.newCall(methodDescriptor, callOptions); + return new SimpleForwardingClientCall(clientCall) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onHeaders(Metadata headers) { + SocketAddress socketAddress = + clientCall.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR); + + if (socketAddress != null + && !socketAddress.equals(lastIp.getAndSet(socketAddress))) { + boolean directPathActive = isDirectPath(socketAddress); + if (directPathActive != expectDirectPath) { + LOGGER.warning( + String.format( + "Channel %d, Unexpected DirectPath status: %s, expected: %s. ip: %s", + myId, directPathActive, expectDirectPath, socketAddress)); + } + } + super.onHeaders(headers); + } + }, + headers); + } + }; + } + + private static boolean isDirectPath(SocketAddress remoteAddress) { + InetAddress inetAddress = ((InetSocketAddress) remoteAddress).getAddress(); + String addr = inetAddress.getHostAddress(); + + return addr.startsWith(DP_IPV6_PREFIX) || addr.startsWith(DP_IPV4_PREFIX); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectpathEnforcer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectpathEnforcer.java new file mode 100644 index 000000000000..7aad36e8f824 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/DirectpathEnforcer.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 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.internal.channels; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import io.grpc.alts.AltsContextUtil; + +public class DirectpathEnforcer implements ClientInterceptor { + private final String reason; + + public DirectpathEnforcer(String reason) { + this.reason = reason; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new ForwardingClientCallListener.SimpleForwardingClientCallListener( + responseListener) { + @Override + public void onHeaders(Metadata headers) { + if (!AltsContextUtil.check(getAttributes())) { + // Non-ALTS. Despite configuring a channel for directpath + // on a lower level a fallback may happen. We detect it here + // and bubble up the exception for the channel pool to react. + throw Status.UNAVAILABLE.augmentDescription(reason).asRuntimeException(); + } + super.onHeaders(headers); + } + }, + headers); + } + }; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FailingSessionStream.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FailingSessionStream.java new file mode 100644 index 000000000000..df2ae9ad35c1 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FailingSessionStream.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionRequest; +import io.grpc.Metadata; +import io.grpc.Status; +import javax.annotation.Nullable; + +class FailingSessionStream implements SessionStream { + private final Status status; + + FailingSessionStream(Status status) { + this.status = status; + } + + @Override + public PeerInfo getPeerInfo() { + return DISCONNECTED_PEER_INFO; + } + + @Override + public void start(Listener responseListener, Metadata headers) { + responseListener.onClose(status, new Metadata()); + } + + @Override + public void sendMessage(SessionRequest request) { + // noop + } + + @Override + public void halfClose() { + // noop + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + // noop + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPool.java new file mode 100644 index 000000000000..2ae8772b9744 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPool.java @@ -0,0 +1,212 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener.ChannelFallbackReason; +import com.google.common.base.Preconditions; +import io.grpc.CallOptions; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.time.Duration; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +public class FallbackChannelPool implements ChannelPool { + private FallbackConfiguration config; + private final ChannelPool primary; + private final ChannelPool secondary; + private final PoolFallbackListener poolFallbackListener; + private final ScheduledExecutorService exec; + + @GuardedBy("this") + private ScheduledFuture checkTask; + + private final AtomicReference currentPool; + + private final AtomicInteger successCount = new AtomicInteger(); + private final AtomicInteger failureCount = new AtomicInteger(); + + public FallbackChannelPool( + FallbackConfiguration config, + PoolFallbackListener poolFallbackListener, + ScheduledExecutorService exec) { + Preconditions.checkNotNull(config); + Preconditions.checkNotNull(poolFallbackListener); + Preconditions.checkNotNull(exec); + this.config = config; + this.primary = config.getPrimaryChannelPool(); + this.secondary = config.getFallbackChannelPool(); + currentPool = new AtomicReference(primary); + this.poolFallbackListener = poolFallbackListener; + this.exec = exec; + } + + @Override + public void start() { + scheduleCheckRates(); + primary.start(); + secondary.start(); + } + + @Override + public void updateConfig(ChannelPoolConfiguration newConfig) { + if (!newConfig.hasDirectAccessWithFallback()) { + return; + } + + DirectAccessWithFallback directAccessWithFallback = newConfig.getDirectAccessWithFallback(); + updateConfig( + config.toBuilder() + .setEnabled(true) + .setErrorRate(directAccessWithFallback.getErrorRateThreshold()) + .setCheckInterval( + Duration.ofSeconds(directAccessWithFallback.getCheckInterval().getSeconds())) + .build()); + + // Propagate further. + primary.updateConfig(newConfig); + secondary.updateConfig(newConfig); + } + + // For now only updates error rate, interval, and is enabled. + synchronized void updateConfig(FallbackConfiguration newConfig) { + config = + config.toBuilder() + .setEnabled(newConfig.isEnabled()) + .setCheckInterval(newConfig.getCheckInterval()) + .setErrorRate(newConfig.getErrorRate()) + .build(); + + if (!config.isEnabled()) { + if (currentPool.compareAndSet(secondary, primary)) { + poolFallbackListener.onFallback( + config.getFallbackName(), + config.getPrimaryName(), + ChannelFallbackReason.FALLBACK_DISABLE); + } + } + } + + @Override + public synchronized void close() { + if (checkTask != null) { + checkTask.cancel(false); + } + primary.close(); + secondary.close(); + } + + @Override + public SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + final ChannelPool current = currentPool.get(); + final SessionStream stream = current.newStream(desc, callOptions); + + return new ForwardingSessionStream(stream) { + private boolean ignoreError; + + @Override + public void start(Listener responseListener, Metadata headers) { + try { + super.start( + new SessionStream.ForwardingListener(responseListener) { + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) { + if (current == primary) { + // Count successful session establishment as success. + successCount.incrementAndGet(); + // peerInfo received successfully, session is established, + // this is a successful start, thus ignoring any following errors. + ignoreError = true; + } + super.onBeforeSessionStart(peerInfo); + } + + @Override + public void onClose(Status status, Metadata trailers) { + // Already using fallback. + if (current != primary) { + super.onClose(status, trailers); + return; + } + + if (!status.isOk() && !ignoreError) { + failureCount.incrementAndGet(); + } + super.onClose(status, trailers); + } + }, + headers); + } catch (Exception e) { + if (current == primary) { + // Any exception on newStream start is a failure. + failureCount.incrementAndGet(); + } + throw e; + } + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + // Force closing the session, thus ignoring the error caused by that. + ignoreError = true; + super.forceClose(message, cause); + } + }; + } + + private synchronized void scheduleCheckRates() { + checkTask = + exec.schedule( + this::checkRatesAndReschedule, + config.getCheckInterval().toMillis(), + TimeUnit.MILLISECONDS); + } + + private void checkRatesAndReschedule() { + checkRates(); + scheduleCheckRates(); + } + + private synchronized void checkRates() { + int successes = successCount.getAndSet(0); + int failures = failureCount.getAndSet(0); + int total = successes + failures; + + if (!config.isEnabled()) { + return; + } + + if (total > 0 && ((double) failures) / total >= config.getErrorRate()) { + if (currentPool.compareAndSet(primary, secondary)) { + poolFallbackListener.onFallback( + config.getPrimaryName(), config.getFallbackName(), ChannelFallbackReason.ERROR_RATE); + } + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackConfiguration.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackConfiguration.java new file mode 100644 index 000000000000..058dfdcaeb7a --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackConfiguration.java @@ -0,0 +1,69 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.auto.value.AutoValue; +import java.time.Duration; + +@AutoValue +public abstract class FallbackConfiguration { + public abstract boolean isEnabled(); + + public abstract double getErrorRate(); + + public abstract Duration getCheckInterval(); + + public abstract String getPrimaryName(); + + public abstract String getFallbackName(); + + public abstract ChannelPool getPrimaryChannelPool(); + + public abstract ChannelPool getFallbackChannelPool(); + + public abstract Builder toBuilder(); + + public static Builder builder() { + return new AutoValue_FallbackConfiguration.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setEnabled(boolean enabled); + + public abstract Builder setErrorRate(double errorRate); + + public abstract Builder setCheckInterval(Duration checkInterval); + + protected abstract Builder setPrimaryName(String primaryName); + + protected abstract Builder setFallbackName(String fallbackName); + + protected abstract Builder setPrimaryChannelPool(ChannelPool primaryChannelPool); + + protected abstract Builder setFallbackChannelPool(ChannelPool fallbackChannelPool); + + public Builder setPrimary(String name, ChannelPool pool) { + return setPrimaryName(name).setPrimaryChannelPool(pool); + } + + public Builder setFallback(String name, ChannelPool pool) { + return setFallbackName(name).setFallbackChannelPool(pool); + } + + public abstract FallbackConfiguration build(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ForwardingSessionStream.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ForwardingSessionStream.java new file mode 100644 index 000000000000..54652c044ee5 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ForwardingSessionStream.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionRequest; +import io.grpc.Metadata; +import javax.annotation.Nullable; + +public class ForwardingSessionStream implements SessionStream { + private final SessionStream delegate; + + public ForwardingSessionStream(SessionStream delegate) { + this.delegate = delegate; + } + + @Override + public PeerInfo getPeerInfo() { + return delegate.getPeerInfo(); + } + + @Override + public void start(Listener responseListener, Metadata headers) { + delegate.start(responseListener, headers); + } + + @Override + public void sendMessage(SessionRequest request) { + delegate.sendMessage(request); + } + + @Override + public void halfClose() { + delegate.halfClose(); + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + delegate.forceClose(message, cause); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStream.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStream.java new file mode 100644 index 000000000000..ebbc39af7f2c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStream.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.Metadata; +import io.grpc.Status; +import javax.annotation.Nullable; + +public interface SessionStream { + public static final PeerInfo DISCONNECTED_PEER_INFO = + PeerInfo.newBuilder().setTransportType(TransportType.TRANSPORT_TYPE_SESSION_UNKNOWN).build(); + + public PeerInfo getPeerInfo(); + + public void start(Listener responseListener, Metadata headers); + + public void sendMessage(SessionRequest request); + + public void halfClose(); + + public void forceClose(@Nullable String message, @Nullable Throwable cause); + + public interface Listener { + void onBeforeSessionStart(PeerInfo peerInfo); + + void onMessage(SessionResponse msg); + + void onClose(Status status, Metadata trailers); + } + + public static class ForwardingListener implements Listener { + private final Listener delegate; + + public ForwardingListener(Listener delegate) { + this.delegate = delegate; + } + + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) { + delegate.onBeforeSessionStart(peerInfo); + } + + @Override + public void onMessage(SessionResponse msg) { + delegate.onMessage(msg); + } + + @Override + public void onClose(Status status, Metadata trailers) { + delegate.onClose(status, trailers); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStreamImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStreamImpl.java new file mode 100644 index 000000000000..fa46914df03b --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SessionStreamImpl.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import io.grpc.ClientCall; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.alts.AltsContextUtil; +import java.util.Base64; +import javax.annotation.Nullable; + +public class SessionStreamImpl implements SessionStream { + private final ClientCall call; + private volatile PeerInfo peerInfo = DISCONNECTED_PEER_INFO; + + @VisibleForTesting + static final Metadata.Key PEER_INFO_KEY = + Metadata.Key.of("bigtable-peer-info", Metadata.ASCII_STRING_MARSHALLER); + + public SessionStreamImpl(ClientCall call) { + this.call = call; + } + + @Override + public PeerInfo getPeerInfo() { + return peerInfo; + } + + @Override + public void start(Listener responseListener, Metadata headers) { + call.start( + new ClientCall.Listener() { + @Override + public void onHeaders(Metadata headers) { + String encodedStr = headers.get(PEER_INFO_KEY); + Preconditions.checkArgument( + !Strings.isNullOrEmpty(encodedStr), + "Session open response headers missing %s", + PEER_INFO_KEY.name()); + + PeerInfo newPeerInfo; + + try { + byte[] decoded = Base64.getUrlDecoder().decode(encodedStr); + newPeerInfo = PeerInfo.parseFrom(decoded); + } catch (Exception e) { + throw new IllegalArgumentException( + "Failed to parse " + + PEER_INFO_KEY.name() + + " from the response header value: " + + encodedStr); + } + // TODO: remove these fallbacks once PeerInfo is properly populated on the server + if (newPeerInfo.getTransportType() == TransportType.TRANSPORT_TYPE_UNKNOWN) { + if (AltsContextUtil.check(call.getAttributes())) { + newPeerInfo = + newPeerInfo.toBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .build(); + } else { + newPeerInfo = + newPeerInfo.toBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_UNKNOWN) + .build(); + } + } + SessionStreamImpl.this.peerInfo = newPeerInfo; + responseListener.onBeforeSessionStart(peerInfo); + super.onHeaders(headers); + } + + @Override + public void onMessage(SessionResponse message) { + responseListener.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + responseListener.onClose(status, trailers); + } + }, + headers); + call.request(Integer.MAX_VALUE); + } + + @Override + public void sendMessage(SessionRequest request) { + call.sendMessage(request); + } + + @Override + public void halfClose() { + call.halfClose(); + } + + @Override + public void forceClose(@Nullable String message, @Nullable Throwable cause) { + call.cancel("Force closed: " + message, cause); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SingleChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SingleChannelPool.java new file mode 100644 index 000000000000..6d40b58d53d4 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SingleChannelPool.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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.internal.channels; + +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.CallOptions; +import io.grpc.ManagedChannel; +import io.grpc.MethodDescriptor; +import java.util.function.Supplier; + +public class SingleChannelPool implements ChannelPool { + private final Supplier channelSupplier; + private ManagedChannel channel; + + public SingleChannelPool(Supplier channelSupplier) { + this.channelSupplier = channelSupplier; + } + + @Override + public void start() { + channel = channelSupplier.get(); + } + + @Override + public void close() { + channel.shutdown(); + } + + @Override + public SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + return new SessionStreamImpl(channel.newCall(desc, callOptions)); + } + + @Override + public void updateConfig(ChannelPoolConfiguration config) { + // No-op. + return; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SwitchingChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SwitchingChannelPool.java new file mode 100644 index 000000000000..428a0080d8dc --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/SwitchingChannelPool.java @@ -0,0 +1,213 @@ +/* + * Copyright 2026 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.internal.channels; + +import static com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util.transportTypeToString; + +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager.ListenerHandle; +import io.grpc.CallOptions; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.MethodDescriptor; +import java.time.Duration; +import java.util.concurrent.ScheduledExecutorService; +import java.util.function.Supplier; +import javax.annotation.concurrent.GuardedBy; + +/** + * SwitchingChannelPool reads channel pool configuration from configManager on initialization, + * creates underlying channel pool according to the configuration, and subscribes to configuration + * updates. When update happens, it propagates updated configuration to the underlying channel pool + * or creates a different channel pool if channel pool mode has changed. + */ +public class SwitchingChannelPool implements ChannelPool { + @GuardedBy("this") + private ChannelPool delegate; + + private ChannelPoolConfiguration currentConfiguration; + + private final boolean fallbackAvailable; + private final ListenerHandle configListener; + + @GuardedBy("this") + private boolean isClosed; + + private final ChannelProvider channelProvider; + private final Metrics metrics; + private final ScheduledExecutorService backgroundExecutor; + + public SwitchingChannelPool( + ChannelProvider channelProvider, + ClientConfigurationManager configManager, + Metrics metrics, + ScheduledExecutorService backgroundExecutor) { + this.channelProvider = channelProvider; + this.metrics = metrics; + this.backgroundExecutor = backgroundExecutor; + + currentConfiguration = + configManager.getClientConfiguration().getSessionConfiguration().getChannelConfiguration(); + + if (channelProvider.getFallback().isPresent()) { + fallbackAvailable = true; + delegate = createChannelPoolForCurrentMode(); + } else { + // Depending on whether DirectAccess is avaialbe, the channelProvider + // is either a DirectAccess with fallback to Cloudpath + // or a basic Cloudpath. + // If it's a basic cloudpath we can't do any fallback, + // and we can't do directaccess without fallback. + // Essentially, fallback configuration is not applicable here. + fallbackAvailable = false; + delegate = newChannelPoolFromProvider(channelProvider); + } + + // Subscribe to config changes. + configListener = + configManager.addListener( + cfg -> cfg.getSessionConfiguration().getChannelConfiguration(), this::updateConfig); + } + + @Override + public synchronized void updateConfig(ChannelPoolConfiguration newConfig) { + if (isClosed) { + return; + } + + if (fallbackAvailable && currentConfiguration.getModeCase() != newConfig.getModeCase()) { + // Mode has changed and we can change modes. + currentConfiguration = newConfig; + ChannelPool cp = createChannelPoolForCurrentMode(); + replaceChannelPool(cp); + return; + } + + currentConfiguration = newConfig; + delegate.updateConfig(currentConfiguration); + } + + private ChannelPool createChannelPoolForCurrentMode() { + switch (currentConfiguration.getModeCase()) { + default: + case MODE_NOT_SET: + case CLOUD_PATH_ONLY: + return newChannelPoolFromProvider(channelProvider.getFallback().get()); + case DIRECT_ACCESS_ONLY: + return newChannelPoolFromProvider(channelProvider); + case DIRECT_ACCESS_WITH_FALLBACK: + ChannelPool primaryChannelPool = + newChannelPoolFromProvider( + channelProvider, + "primary", + new DirectpathEnforcer( + "Non-directpath connections are not allowed in the directpath channel " + + "pool when a fallback channel pool is available.")); + ChannelPool fallbackChannelPool = + newChannelPoolFromProvider(channelProvider.getFallback().get(), "fallback"); + FallbackConfiguration fallbackConfiguration = + FallbackConfiguration.builder() + .setPrimary( + transportTypeToString(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS), + primaryChannelPool) + .setFallback( + transportTypeToString(TransportType.TRANSPORT_TYPE_SESSION_CLOUD_PATH), + fallbackChannelPool) + .setEnabled(true) + .setCheckInterval( + Duration.ofSeconds( + currentConfiguration + .getDirectAccessWithFallback() + .getCheckInterval() + .getSeconds())) + .setErrorRate( + currentConfiguration.getDirectAccessWithFallback().getErrorRateThreshold()) + .build(); + return new FallbackChannelPool( + fallbackConfiguration, metrics.getPoolFallbackListener(), backgroundExecutor); + } + } + + private synchronized void replaceChannelPool(ChannelPool newChannelPool) { + newChannelPool.start(); + ChannelPool prev = delegate; + delegate = newChannelPool; + prev.close(); + } + + @Override + public synchronized void start() { + delegate.start(); + } + + @Override + public synchronized void close() { + if (isClosed) { + return; + } + + configListener.close(); + delegate.close(); + isClosed = true; + } + + @Override + public synchronized SessionStream newStream( + MethodDescriptor desc, CallOptions callOptions) { + return delegate.newStream(desc, callOptions); + } + + private ChannelPool newChannelPoolFromProvider( + ChannelProvider channelProvider, ClientInterceptor... interceptors) { + return newChannelPoolFromProvider(channelProvider, null, interceptors); + } + + private ChannelPool newChannelPoolFromProvider( + ChannelProvider channelProvider, String logName, ClientInterceptor... interceptors) { + if (channelProvider.isSingleEndpoint()) { + return new SingleChannelPool( + channelBuilderToSupplier(channelProvider.newChannelBuilder(), interceptors)); + } + + if (logName != null) { + return new ChannelPoolDpImpl( + channelBuilderToSupplier(channelProvider.newChannelBuilder(), interceptors), + currentConfiguration, + logName, + metrics.getDebugTagTracer(), + backgroundExecutor); + } + + return new ChannelPoolDpImpl( + channelBuilderToSupplier(channelProvider.newChannelBuilder(), interceptors), + currentConfiguration, + metrics.getDebugTagTracer(), + backgroundExecutor); + } + + private Supplier channelBuilderToSupplier( + ManagedChannelBuilder channelBuilder, ClientInterceptor... interceptors) { + return () -> channelBuilder.intercept(interceptors).build(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/DisabledShim.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/DisabledShim.java new file mode 100644 index 000000000000..b4d3cc305cf4 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/DisabledShim.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 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.internal.compat; + +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowMutation; + +public class DisabledShim implements Shim { + + @Override + public void close() {} + + @Override + public UnaryCallable decorateReadRow( + UnaryCallable classic, + RowAdapter rowAdapter, + UnaryCallSettings settings) { + return classic; + } + + @Override + public UnaryCallable decorateMutateRow( + UnaryCallable classic, UnaryCallSettings settings) { + return classic; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapter.java new file mode 100644 index 000000000000..4db124936902 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapter.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 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.internal.compat; + +import com.google.api.core.ApiFuture; +import io.grpc.Context.CancellableContext; +import java.util.concurrent.CancellationException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import javax.annotation.Nonnull; + +public class FutureAdapter implements ApiFuture { + private final CompletableFuture inner; + private final CancellableContext ambientCtx; + + public FutureAdapter(CompletableFuture inner, CancellableContext ambientCtx) { + this.inner = inner; + this.ambientCtx = ambientCtx; + + CompletableFuture ignored = inner.whenComplete((ignored1, ignored2) -> ambientCtx.close()); + } + + @Override + public void addListener(Runnable listener, Executor executor) { + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = inner.whenCompleteAsync((v, t) -> listener.run(), executor); + } + + @Override + public boolean cancel(boolean mayInterruptIfRunning) { + boolean wasCancelled = inner.cancel(mayInterruptIfRunning); + ambientCtx.cancel(new CancellationException("Operation Future was cancelled by the end user")); + return wasCancelled; + } + + @Override + public boolean isCancelled() { + return inner.isCancelled(); + } + + @Override + public boolean isDone() { + return inner.isDone(); + } + + @Override + public V get() throws InterruptedException, ExecutionException { + return inner.get(); + } + + @Override + public V get(long timeout, @Nonnull TimeUnit unit) + throws InterruptedException, ExecutionException, TimeoutException { + return inner.get(timeout, unit); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxBasicChannelProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxBasicChannelProvider.java new file mode 100644 index 000000000000..26d7857aafa8 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxBasicChannelProvider.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026 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.internal.compat; + +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.auth.Credentials; +import com.google.bigtable.v2.FeatureFlags; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import io.grpc.CallCredentials; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannelBuilder; +import io.grpc.MethodDescriptor; +import io.grpc.auth.MoreCallCredentials; +import java.io.IOException; +import java.util.Optional; +import javax.annotation.Nullable; + +public class GaxBasicChannelProvider implements ChannelProvider { + private final InstantiatingGrpcChannelProvider inner; + private final @Nullable CallCredentials credentials; + + public GaxBasicChannelProvider( + InstantiatingGrpcChannelProvider inner, @Nullable Credentials credentials) { + this.inner = inner.toBuilder().setAttemptDirectPath(false).build(); + this.credentials = Optional.ofNullable(credentials).map(MoreCallCredentials::from).orElse(null); + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder() + .setTrafficDirectorEnabled(false) + .setDirectAccessRequested(false) + .build(); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + try { + ManagedChannelBuilder builder = inner.createChannelBuilder(); + if (credentials != null) { + builder.intercept(new CredInterceptor(credentials)); + } + return builder; + } catch (IOException e) { + throw new RuntimeException("Gax channel provider failed to provide a channel builder", e); + } + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + private static class CredInterceptor implements ClientInterceptor { + private final CallCredentials callCredentials; + + private CredInterceptor(CallCredentials callCredentials) { + this.callCredentials = callCredentials; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + return next.newCall(method, callOptions.withCallCredentials(callCredentials)); + } + } + + @Override + public Optional getFallback() { + return Optional.empty(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxDirectAccessChannelProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxDirectAccessChannelProvider.java new file mode 100644 index 000000000000..bfc4dfd7bfd2 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/GaxDirectAccessChannelProvider.java @@ -0,0 +1,99 @@ +/* + * Copyright 2026 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.internal.compat; + +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.auth.Credentials; +import com.google.bigtable.v2.FeatureFlags; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.util.Optional; +import javax.annotation.Nullable; + +public class GaxDirectAccessChannelProvider implements ChannelProvider { + private final InstantiatingGrpcChannelProvider inner; + private final Optional fallback; + + public static ChannelProvider create( + InstantiatingGrpcChannelProvider outer, @Nullable Credentials credentials) { + InstantiatingGrpcChannelProvider directAccessProvider = + outer.toBuilder().setAttemptDirectPath(true).setAttemptDirectPathXds().build(); + + InstantiatingGrpcChannelProvider cloudPathProvider = + outer.toBuilder().setAttemptDirectPath(false).build(); + + if (directAccessProvider.canUseDirectPath()) { + return new GaxDirectAccessChannelProvider( + directAccessProvider, credentials, Optional.empty()); + } else { + return new GaxBasicChannelProvider(cloudPathProvider, credentials); + } + } + + public static ChannelProvider createWithFallback( + InstantiatingGrpcChannelProvider outer, @Nullable Credentials credentials) { + InstantiatingGrpcChannelProvider directAccessProvider = + outer.toBuilder().setAttemptDirectPath(true).setAttemptDirectPathXds().build(); + + InstantiatingGrpcChannelProvider cloudPathProvider = + outer.toBuilder().setAttemptDirectPath(false).build(); + + if (directAccessProvider.canUseDirectPath()) { + return new GaxDirectAccessChannelProvider( + directAccessProvider, + credentials, + Optional.of(new GaxBasicChannelProvider(cloudPathProvider, credentials))); + } else { + return new GaxBasicChannelProvider(cloudPathProvider, credentials); + } + } + + private GaxDirectAccessChannelProvider( + InstantiatingGrpcChannelProvider directAccessProvider, + @SuppressWarnings("unused") @Nullable Credentials credentials, + Optional fallback) { + this.inner = directAccessProvider; + this.fallback = fallback; + } + + @Override + public FeatureFlags updateFeatureFlags(FeatureFlags featureFlags) { + return featureFlags.toBuilder() + .setTrafficDirectorEnabled(true) + .setDirectAccessRequested(true) + .build(); + } + + @Override + public ManagedChannelBuilder newChannelBuilder() { + try { + return inner.createChannelBuilder(); + } catch (IOException e) { + throw new RuntimeException("Gax channel provider failed to provide a channel builder", e); + } + } + + @Override + public boolean isSingleEndpoint() { + return false; + } + + @Override + public Optional getFallback() { + return fallback; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Shim.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Shim.java new file mode 100644 index 000000000000..b15e4003af34 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Shim.java @@ -0,0 +1,35 @@ +/* + * Copyright 2026 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.internal.compat; + +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowMutation; + +public interface Shim { + + void close(); + + UnaryCallable decorateReadRow( + UnaryCallable classic, + RowAdapter rowAdapter, + UnaryCallSettings settings); + + UnaryCallable decorateMutateRow( + UnaryCallable classic, UnaryCallSettings settings); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImpl.java new file mode 100644 index 000000000000..353973dc8e58 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ShimImpl.java @@ -0,0 +1,276 @@ +/* + * Copyright 2026 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.internal.compat; + +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.BigtableGrpc.BigtableBlockingV2Stub; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ConfiguredChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.Client; +import com.google.cloud.bigtable.data.v2.internal.api.Client.Resource; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.DivertingUnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.MutateRowShim; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.ReadRowShim; +import com.google.cloud.bigtable.data.v2.internal.compat.ops.ReadRowShimInner; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.dp.DirectAccessInvestigator; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.stub.MetadataExtractorInterceptor; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.stub.MetadataUtils; +import java.io.IOException; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * Implementation of a shim to fork off traffic to session based apis. It acts as a factory for + * callable decorators. + */ +public class ShimImpl implements Shim { + private static final Logger logger = Logger.getLogger(ShimImpl.class.getName()); + + // TODO: this should be a client config + public static final int MAX_CONSECUTIVE_UNIMPLEMENTED_FAILURES = 30; + private static final Duration DA_CHECK_TIMEOUT = Duration.ofSeconds(5); + + private final ClientConfigurationManager configManager; + private final Client client; + + private final ReadRowShimInner readRowShimInner; + private final MutateRowShim mutateRowShim; + + public static Shim create( + ClientInfo clientInfo, + @Nullable Credentials callCreds, + Metrics metrics, + ScheduledExecutorService bgExecutor, + StubSettings stubSettings) + throws IOException { + + TransportChannelProvider transportProvider = stubSettings.getTransportChannelProvider(); + if (!(transportProvider instanceof InstantiatingGrpcChannelProvider)) { + return new DisabledShim(); + } + + transportProvider = + ((InstantiatingGrpcChannelProvider) transportProvider) + .toBuilder() + .setHeaderProvider(ImmutableMap::of) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setAttemptDirectPath(true) + .setAttemptDirectPathXds() + .build(); + + if (transportProvider.needsEndpoint()) { + transportProvider = transportProvider.withEndpoint(stubSettings.getEndpoint()); + } + if (callCreds != null && transportProvider.needsCredentials()) { + transportProvider = transportProvider.withCredentials(callCreds); + } + if (transportProvider.needsBackgroundExecutor()) { + transportProvider = transportProvider.withBackgroundExecutor(bgExecutor); + } + if (transportProvider.needsMtlsEndpoint() + && !Strings.isNullOrEmpty(stubSettings.getMtlsEndpoint())) { + transportProvider = transportProvider.withMtlsEndpoint(stubSettings.getMtlsEndpoint()); + } + + // Channel provider for the client. DirectAccess with fallback by default. + ChannelProvider clientChannelProvider = + configureChannelProvider( + GaxDirectAccessChannelProvider.createWithFallback( + (InstantiatingGrpcChannelProvider) transportProvider, callCreds), + metrics); + + if (!checkDirectAccessAvailable( + Client.BASE_FEATURE_FLAGS, clientInfo, clientChannelProvider, metrics, bgExecutor)) { + // Directpath failed, revert to basic channel provider for the client. + clientChannelProvider = + configureChannelProvider( + new GaxBasicChannelProvider( + (InstantiatingGrpcChannelProvider) transportProvider, callCreds), + metrics); + } + + // ChannelProvider for configuration manager. + ChannelProvider configChannelProvider = + configureChannelProvider( + new GaxBasicChannelProvider( + (InstantiatingGrpcChannelProvider) transportProvider, callCreds), + metrics); + + ClientConfigurationManager configManager = + new ClientConfigurationManager( + configChannelProvider.updateFeatureFlags(Client.BASE_FEATURE_FLAGS), + clientInfo, + configChannelProvider, + metrics.getDebugTagTracer(), + bgExecutor); + + try { + configManager.start().get(); + metrics.getDebugTagTracer().setClientConfigurationManager(configManager); + } catch (Exception e) { + logger.log(Level.WARNING, "Failed to fetch initial client configuration", e); + configManager.close(); + return new DisabledShim(); + } + + FeatureFlags featureFlags = Client.BASE_FEATURE_FLAGS; + + if (configManager.areSessionsRequired()) { + featureFlags = featureFlags.toBuilder().setSessionsRequired(true).build(); + } + + Client client = + new Client( + clientChannelProvider.updateFeatureFlags(featureFlags), + clientInfo, + clientChannelProvider, + Resource.createShared(metrics), + Resource.createShared(configManager), + Resource.createShared(bgExecutor)); + + return new ShimImpl(configManager, client); + } + + public ShimImpl(ClientConfigurationManager configManager, Client client) { + this.configManager = configManager; + this.client = client; + + this.readRowShimInner = new ReadRowShimInner(client); + this.mutateRowShim = new MutateRowShim(client); + } + + private static ChannelProvider configureChannelProvider( + ChannelProvider channelProvider, Metrics metrics) { + return new ConfiguredChannelProvider( + channelProvider, + channelBuilder -> + metrics + .configureGrpcChannel(channelBuilder) + .keepAliveTime(Client.KEEPALIVE_TIME_MS, TimeUnit.MILLISECONDS) + .keepAliveTimeout(Client.KEEPALIVE_TIMEOUT_MS, TimeUnit.MILLISECONDS) + // TODO: consider localizing this for large reads + .maxInboundMessageSize(256 * 1024 * 1024)); + } + + private static boolean checkDirectAccessAvailable( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + Metrics metrics, + ScheduledExecutorService bgExecutor) { + ManagedChannel channel = channelProvider.newChannelBuilder().build(); + DirectPathCompatibleTracer tracer = metrics.getDirectPathCompatibleTracer(); + + Metadata metadata = + com.google.cloud.bigtable.data.v2.internal.api.Util.composeMetadata( + channelProvider.updateFeatureFlags(featureFlags), + ImmutableMap.of( + "instance_name", clientInfo.getInstanceName().toString(), + "app_profile_id", clientInfo.getAppProfileId())); + ClientInterceptor attachMetadata = MetadataUtils.newAttachHeadersInterceptor(metadata); + MetadataExtractorInterceptor metaInterceptor = new MetadataExtractorInterceptor(); + + BigtableBlockingV2Stub stub = + BigtableGrpc.newBlockingV2Stub(channel).withInterceptors(attachMetadata, metaInterceptor); + + try { + stub.withDeadlineAfter(DA_CHECK_TIMEOUT) + .getClientConfiguration( + GetClientConfigurationRequest.newBuilder() + .setInstanceName(clientInfo.getInstanceName().toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .build()); + } catch (Exception e) { + logger.log(Level.FINE, "DirectAccess check RPC failed.", e); + // Spin up investigation. + bgExecutor.execute(() -> DirectAccessInvestigator.investigateAndReport(tracer, e)); + return false; + } finally { + channel.shutdownNow(); + } + + TransportType tt = + Optional.ofNullable(metaInterceptor.getSidebandData().getPeerInfo()) + .map(PeerInfo::getTransportType) + .orElse(TransportType.TRANSPORT_TYPE_UNKNOWN); + + boolean result = + tt == TransportType.TRANSPORT_TYPE_DIRECT_ACCESS + || tt == TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS; + + if (result) { + tracer.recordSuccess(metaInterceptor.getSidebandData().getIpProtocol()); + } else { + // Spin up investigation. + bgExecutor.execute(() -> DirectAccessInvestigator.investigateAndReport(tracer, null)); + } + + return result; + } + + @Override + public void close() { + client.close(); + configManager.close(); + } + + @Override + public UnaryCallable decorateReadRow( + UnaryCallable classic, + RowAdapter rowAdapter, + UnaryCallSettings settings) { + return new DivertingUnaryCallable<>( + configManager, + classic, + new ReadRowShim<>(readRowShimInner, rowAdapter), + Util.extractTimeout(settings)); + } + + @Override + public UnaryCallable decorateMutateRow( + UnaryCallable classic, UnaryCallSettings settings) { + return new DivertingUnaryCallable<>( + configManager, classic, mutateRowShim, Util.extractTimeout(settings)); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Util.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Util.java new file mode 100644 index 000000000000..42fa0b9b1d04 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/Util.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 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.internal.compat; + +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.cache.RemovalListener; +import io.grpc.Context; +import io.grpc.Deadline; +import java.io.Closeable; +import java.io.IOException; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import javax.annotation.Nonnull; + +public class Util { + public static LoadingCache createSessionMap( + Function factory) { + return CacheBuilder.newBuilder() + .expireAfterAccess(Duration.ofMinutes(5)) + .removalListener( + (RemovalListener) + notification -> { + try { + @SuppressWarnings("DataFlowIssue") + @Nonnull + V value = notification.getValue(); + //noinspection DataFlowIssue + value.close(); + } catch (IOException e) { + // TODO log + } + }) + .build( + new CacheLoader() { + @Override + @Nonnull + public V load(@Nonnull K key) { + return factory.apply(key); + } + }); + } + + public static Duration extractTimeout(UnaryCallSettings settings) { + return settings.getRetrySettings().getTotalTimeoutDuration(); + } + + public static Deadline extractDeadline(GrpcCallContext callContext, Duration defaultDeadline) { + // NOTE: ignoring callContext.timeout because its an attempt timeout + Optional ambientDeadline = Optional.ofNullable(Context.current().getDeadline()); + Optional retryTotalTimeout = + Optional.ofNullable(callContext) + .flatMap(ctx -> Optional.ofNullable(ctx.getRetrySettings())) + .map(RetrySettings::getTotalTimeoutDuration); + Optional grpcCallDeadline = + Optional.ofNullable(callContext) + .flatMap(ctx -> Optional.ofNullable(ctx.getCallOptions())) + .flatMap(ctx -> Optional.ofNullable(ctx.getDeadline())); + + Deadline effectiveDeadline = null; + if (ambientDeadline.isPresent()) { + effectiveDeadline = ambientDeadline.get(); + } + if (grpcCallDeadline.isPresent()) { + if (effectiveDeadline == null || grpcCallDeadline.get().isBefore(effectiveDeadline)) { + effectiveDeadline = grpcCallDeadline.get(); + } + } + if (retryTotalTimeout.isPresent()) { + Deadline retryDeadline = + Deadline.after(retryTotalTimeout.get().toMillis(), TimeUnit.MILLISECONDS); + if (effectiveDeadline == null || retryDeadline.isBefore(effectiveDeadline)) { + effectiveDeadline = retryDeadline; + } + } + if (effectiveDeadline == null) { + effectiveDeadline = Deadline.after(defaultDeadline.toMillis(), TimeUnit.MILLISECONDS); + } + return effectiveDeadline; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/DivertingUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/DivertingUnaryCallable.java new file mode 100644 index 000000000000..b7c7f815f941 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/DivertingUnaryCallable.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 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.internal.compat.ops; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigtable.data.v2.internal.compat.FutureAdapter; +import com.google.cloud.bigtable.data.v2.internal.compat.Util; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.base.Throwables; +import io.grpc.Context; +import io.grpc.Context.CancellableContext; +import io.grpc.Deadline; +import io.grpc.Status; +import io.grpc.StatusException; +import io.grpc.StatusRuntimeException; +import java.time.Duration; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ThreadLocalRandom; + +/** A callable to fork traffic between classic and session based operations. */ +public class DivertingUnaryCallable extends UnaryCallable { + private final ClientConfigurationManager configurationManager; + + private final UnaryCallable classic; + private final UnaryShim experimental; + + private final Duration defaultTimeout; + + public DivertingUnaryCallable( + ClientConfigurationManager configurationManager, + UnaryCallable classic, + UnaryShim experimental, + Duration defaultTimeout) { + this.configurationManager = configurationManager; + this.classic = classic; + this.experimental = experimental; + this.defaultTimeout = defaultTimeout; + } + + @Override + public ApiFuture futureCall(ReqT request, ApiCallContext context) { + if (!useExperimental(request)) { + return classic.futureCall(request, context); + } + + Deadline deadline = Util.extractDeadline((GrpcCallContext) context, defaultTimeout); + + // Java8 futures dont chain cancellations + // ApiFutures do, so we pipe cancellation via the ambient Context + // futureCall is responsible for attaching/detaching + // FutureAdapter is responsible for cleaning up the context + CancellableContext ambientCtx = Context.current().withCancellation(); + + CompletableFuture f; + + try { + f = ambientCtx.call(() -> experimental.call(request, deadline)); + } catch (Throwable e) { + ambientCtx.close(); + + Throwables.throwIfUnchecked(e); + throw new RuntimeException(e); + } + + f = + f.handle( + (r, e) -> { + if (e != null) { + throw translateException(e); + } + return r; + }); + + return new FutureAdapter<>(f, ambientCtx); + } + + private boolean useExperimental(ReqT req) { + if (!experimental.supports(req)) { + return false; + } + + float ratio = + configurationManager.getClientConfiguration().getSessionConfiguration().getSessionLoad(); + if (ratio == 0) { + return false; + } + if (ratio != 1.0 && ThreadLocalRandom.current().nextFloat() > ratio) { + return false; + } + return true; + } + + ApiException translateException(Throwable e) { + Status.Code code = Status.Code.UNKNOWN; + + if (e instanceof StatusRuntimeException) { + code = ((StatusRuntimeException) e).getStatus().getCode(); + } + if (e instanceof StatusException) { + code = ((StatusException) e).getStatus().getCode(); + } + + return ApiExceptionFactory.createException(e.getMessage(), e, GrpcStatusCode.of(code), false); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/MutateRowShim.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/MutateRowShim.java new file mode 100644 index 000000000000..9102714457ae --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/MutateRowShim.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 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.internal.compat.ops; + +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.cloud.bigtable.data.v2.internal.api.AuthorizedViewAsync; +import com.google.cloud.bigtable.data.v2.internal.api.Client; +import com.google.cloud.bigtable.data.v2.internal.api.TableAsync; +import com.google.cloud.bigtable.data.v2.internal.compat.ShimImpl; +import com.google.cloud.bigtable.data.v2.internal.compat.Util; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.common.cache.LoadingCache; +import io.grpc.Deadline; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; + +public class MutateRowShim implements UnaryShim { + + private final LoadingCache tables; + private final LoadingCache authViews; + + public MutateRowShim(Client client) { + tables = + Util.createSessionMap( + k -> client.openTableAsync(k.getTableId(), Permission.PERMISSION_WRITE)); + authViews = + Util.createSessionMap( + k -> + client.openAuthorizedViewAsync( + k.getTableId(), + k.getAuthorizedViewId(), + OpenAuthorizedViewRequest.Permission.PERMISSION_WRITE)); + } + + @Override + public void close() throws IOException { + tables.invalidateAll(); + authViews.invalidateAll(); + } + + @Override + public boolean supports(RowMutation request) { + TargetId targetId = request.getTargetId(); + SessionPool pool; + // TODO: avoid double lookup + if (targetId instanceof TableId) { + pool = tables.getUnchecked((TableId) targetId).getSessionPool(); + } else if (targetId instanceof AuthorizedViewId) { + pool = authViews.getUnchecked((AuthorizedViewId) targetId).getSessionPool(); + } else { + return false; + } + // Currently this will only fallback in case RLS is misconfigured. If the AFE + // pool is unavailable, it'll be controlled by ClientConfiguration. + return pool.getConsecutiveUnimplementedFailures() + < ShimImpl.MAX_CONSECUTIVE_UNIMPLEMENTED_FAILURES + || pool.hasSession(); + } + + @Override + public CompletableFuture call(RowMutation request, Deadline deadline) { + TargetId targetId = request.getTargetId(); + + SessionMutateRowRequest innerReq = request.toSessionProto(); + + if (targetId instanceof TableId) { + return tables + .getUnchecked((TableId) targetId) + .mutateRow(innerReq, deadline) + .thenApply(r -> null); + } + if (targetId instanceof AuthorizedViewId) { + return authViews + .getUnchecked((AuthorizedViewId) targetId) + .mutateRow(innerReq, deadline) + .thenApply(r -> null); + } + + CompletableFuture f = new CompletableFuture<>(); + f.completeExceptionally( + new UnsupportedOperationException("Unsupported targetId type: " + targetId)); + return f; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShim.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShim.java new file mode 100644 index 000000000000..68d9b9443c83 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShim.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 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.internal.compat.ops; + +import com.google.bigtable.v2.Cell; +import com.google.bigtable.v2.Column; +import com.google.bigtable.v2.Family; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.models.RowAdapter; +import com.google.cloud.bigtable.data.v2.models.RowAdapter.RowBuilder; +import io.grpc.Deadline; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; + +/** + * Stateless wrapper around {@link ReadRowShimInner}. It primary purpose is to pair a {@link + * RowAdapter} with a stateful {@link ReadRowShimInner}. + */ +public class ReadRowShim implements UnaryShim { + private static final RowAdapter DEFAULT_ADAPTER = new DefaultRowAdapter(); + + private final ReadRowShimInner inner; + private final RowAdapter adapter; + + public static ReadRowShim createDefault(ReadRowShimInner inner) { + return new ReadRowShim<>(inner, DEFAULT_ADAPTER); + } + + public ReadRowShim(ReadRowShimInner inner, RowAdapter adapter) { + this.inner = inner; + this.adapter = adapter; + } + + @Override + public boolean supports(Query request) { + return inner.supports(request); + } + + @Override + public CompletableFuture call(Query request, Deadline deadline) { + CompletableFuture f = inner.call(request, deadline); + return f.thenApply(r -> buildRow(adapter.createRowBuilder(), r)); + } + + @Override + public void close() throws IOException { + inner.close(); + } + + private static T buildRow(RowBuilder adapter, SessionReadRowResponse input) { + if (!input.hasRow()) { + return null; + } + com.google.bigtable.v2.Row protoRow = input.getRow(); + + adapter.startRow(protoRow.getKey()); + + for (Family family : protoRow.getFamiliesList()) { + for (Column column : family.getColumnsList()) { + for (Cell cell : column.getCellsList()) { + adapter.startCell( + family.getName(), + column.getQualifier(), + cell.getTimestampMicros(), + cell.getLabelsList(), + 0); + adapter.cellValue(cell.getValue()); + adapter.finishCell(); + } + } + } + return adapter.finishRow(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShimInner.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShimInner.java new file mode 100644 index 000000000000..9dc134bd2392 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/ReadRowShimInner.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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.internal.compat.ops; + +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenTableRequest.Permission; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.cloud.bigtable.data.v2.internal.api.AuthorizedViewAsync; +import com.google.cloud.bigtable.data.v2.internal.api.Client; +import com.google.cloud.bigtable.data.v2.internal.api.MaterializedViewAsync; +import com.google.cloud.bigtable.data.v2.internal.api.TableAsync; +import com.google.cloud.bigtable.data.v2.internal.compat.ShimImpl; +import com.google.cloud.bigtable.data.v2.internal.compat.Util; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.MaterializedViewId; +import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.common.cache.LoadingCache; +import io.grpc.Deadline; +import java.util.concurrent.CompletableFuture; + +public class ReadRowShimInner implements UnaryShim { + private final LoadingCache tables; + private final LoadingCache authViews; + private final LoadingCache matViews; + + public ReadRowShimInner(Client client) { + tables = + Util.createSessionMap( + k -> client.openTableAsync(k.getTableId(), Permission.PERMISSION_READ)); + authViews = + Util.createSessionMap( + k -> + client.openAuthorizedViewAsync( + k.getTableId(), + k.getAuthorizedViewId(), + OpenAuthorizedViewRequest.Permission.PERMISSION_READ)); + matViews = + Util.createSessionMap( + k -> + client.openMaterializedViewAsync( + k.getMaterializedViewId(), + OpenMaterializedViewRequest.Permission.PERMISSION_READ)); + } + + @Override + public void close() { + tables.invalidateAll(); + authViews.invalidateAll(); + matViews.invalidateAll(); + } + + @Override + public boolean supports(Query request) { + TargetId targetId = request.getTargetId(); + SessionPool pool; + // TODO avoid double lookup + if (targetId instanceof TableId) { + pool = tables.getUnchecked((TableId) targetId).getSessionPool(); + } else if (targetId instanceof AuthorizedViewId) { + pool = authViews.getUnchecked((AuthorizedViewId) targetId).getSessionPool(); + } else if (targetId instanceof MaterializedViewId) { + pool = matViews.getUnchecked((MaterializedViewId) targetId).getSessionPool(); + } else { + return false; + } + // Currently this will only fallback in case RLS is misconfigured. If the AFE + // pool is unavailable, it'll be controlled by ClientConfiguration. + return pool.getConsecutiveUnimplementedFailures() + < ShimImpl.MAX_CONSECUTIVE_UNIMPLEMENTED_FAILURES + || pool.hasSession(); + } + + @Override + public CompletableFuture call(Query query, Deadline deadline) { + TargetId targetId = query.getTargetId(); + + SessionReadRowRequest innerReq = query.toSessionPointProto(); + + if (targetId instanceof TableId) { + return tables.getUnchecked((TableId) targetId).readRow(innerReq, deadline); + } + if (targetId instanceof AuthorizedViewId) { + return authViews.getUnchecked((AuthorizedViewId) targetId).readRow(innerReq, deadline); + } + if (targetId instanceof MaterializedViewId) { + return matViews.getUnchecked((MaterializedViewId) targetId).readRow(innerReq, deadline); + } + + CompletableFuture f = new CompletableFuture<>(); + f.completeExceptionally( + new UnsupportedOperationException("Unsupported targetId type: " + targetId)); + return f; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/UnaryShim.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/UnaryShim.java new file mode 100644 index 000000000000..864e765b2c50 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/compat/ops/UnaryShim.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026 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.internal.compat.ops; + +import io.grpc.Deadline; +import java.io.Closeable; +import java.util.concurrent.CompletableFuture; + +/** + * Wrapper interface for session operations. It will own a set of {@link + * com.google.cloud.bigtable.data.v2.internal.session.SessionPool}s and wil dispatch vRPCs. It's + * responsible for creating these {@link + * com.google.cloud.bigtable.data.v2.internal.session.SessionPool}s on the fly and garbage + * collecting them when they are no longer used. Each logical operation will implement this + * interface. + */ +public interface UnaryShim extends Closeable { + CompletableFuture call(ReqT request, Deadline deadline); + + default boolean supports(ReqT request) { + return true; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java index 9c0a70d30c33..c37259b022c1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,15 @@ import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientBatchWriteFlowControlFactor; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientBatchWriteFlowControlTargetQps; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientChannelPoolFallbackCount; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientChannelPoolOutstandingRpcs; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientDebugTagCount; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientDpCompatGuage; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientPerConnectionErrorCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionDuration; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionOpenLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionUptime; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientTransportLatency; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.GrpcMetric; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.MetricWrapper; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.PacemakerDelay; @@ -29,7 +35,6 @@ import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency2; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableClientBlockingLatency; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableConnectivityErrorCount; -import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableDebugTagCount; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableFirstResponseLatency; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableOperationLatency; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRemainingDeadline; @@ -71,9 +76,17 @@ public class MetricRegistry { final ClientBatchWriteFlowControlFactor batchWriteFlowControlFactorMetric; final ClientBatchWriteFlowControlTargetQps batchWriteFlowControlTargetQpsMetric; - final TableDebugTagCount debugTagCountMetric; + final ClientTransportLatency transportLatencyMetric; + + final ClientSessionUptime sessionUptimeMetric; + final ClientSessionDuration sessionDurationMetric; + final ClientSessionOpenLatency sessionOpenLatencyMetric; + + final ClientDebugTagCount debugTagCountMetric; final PacemakerDelay pacemakerDelayMetric; + final ClientChannelPoolFallbackCount channelFallbackCountMetric; + private final Map> metrics = new HashMap<>(); private final List grpcMetricNames = new ArrayList<>(); @@ -94,9 +107,16 @@ public MetricRegistry() { batchWriteFlowControlFactorMetric = register(new ClientBatchWriteFlowControlFactor()); batchWriteFlowControlTargetQpsMetric = register(new ClientBatchWriteFlowControlTargetQps()); - debugTagCountMetric = register(new TableDebugTagCount()); + sessionUptimeMetric = register(new ClientSessionUptime()); + sessionDurationMetric = register(new ClientSessionDuration()); + sessionOpenLatencyMetric = register(new ClientSessionOpenLatency()); + transportLatencyMetric = register(new ClientTransportLatency()); + + debugTagCountMetric = register(new ClientDebugTagCount()); pacemakerDelayMetric = register(new PacemakerDelay()); + channelFallbackCountMetric = register(new ClientChannelPoolFallbackCount()); + // From // https://github.com/grpc/grpc-java/blob/31fdb6c2268b4b1c8ba6c995ee46c58e84a831aa/rls/src/main/java/io/grpc/rls/CachingRlsLbClient.java#L138-L165 registerGrpcMetric( @@ -169,8 +189,12 @@ public MetricWrapper getMetric(String name) { return metrics.get(name); } - public RecorderRegistry newRecorderRegistry(MeterProvider meterProvider) { - return new RecorderRegistry(meterProvider.get(METER_NAME)); + public RecorderRegistry newInternalRecorderRegistry(MeterProvider meterProvider) { + return new RecorderRegistry(meterProvider.get(METER_NAME), false); + } + + public RecorderRegistry newUserRecorderRegistry(MeterProvider meterProvider) { + return new RecorderRegistry(meterProvider.get(METER_NAME), true); } public class RecorderRegistry { @@ -190,29 +214,52 @@ public class RecorderRegistry { public final ClientBatchWriteFlowControlTargetQps.Recorder batchWriteFlowControlTargetQps; public final ClientBatchWriteFlowControlFactor.Recorder batchWriteFlowControlFactor; - public final TableDebugTagCount.Recorder debugTagCount; + public final ClientTransportLatency.Recorder transportLatency; + + public final ClientSessionUptime.Recorder sessionUptime; + public final ClientSessionDuration.Recorder sessionDuration; + public final ClientSessionOpenLatency.Recorder sessionOpenLatency; + + public final ClientDebugTagCount.Recorder debugTagCount; public final PacemakerDelay.Recorder pacemakerDelay; - private RecorderRegistry(Meter meter) { + public final ClientChannelPoolFallbackCount.Recorder channelFallbackCount; + + private RecorderRegistry(Meter meter, boolean disableInternalMetrics) { + // Public metrics operationLatency = operationLatencyMetric.newRecorder(meter); attemptLatency = attemptLatencyMetric.newRecorder(meter); - attemptLatency2 = attemptLatency2Metric.newRecorder(meter); retryCount = retryCountMetric.newRecorder(meter); firstResponseLantency = firstResponseLantencyMetric.newRecorder(meter); serverLatency = serverLatencyMetric.newRecorder(meter); - channelPoolOutstandingRpcs = channelPoolOutstandingRpcsMetric.newRecorder(meter); connectivityErrorCount = connectivityErrorCountMetric.newRecorder(meter); - dpCompatGuage = dpCompatGuageMetric.newRecorder(meter); applicationBlockingLatency = applicationBlockingLatencyMetric.newRecorder(meter); clientBlockingLatency = clientBlockingLatencyMetric.newRecorder(meter); + + // Internal Metrics - only recorded by internalOtel, when configuring userOtel instances, + // internal metrics get registered on a noop provider + if (disableInternalMetrics) { + meter = MeterProvider.noop().get(METER_NAME); + } + attemptLatency2 = attemptLatency2Metric.newRecorder(meter); + channelPoolOutstandingRpcs = channelPoolOutstandingRpcsMetric.newRecorder(meter); + dpCompatGuage = dpCompatGuageMetric.newRecorder(meter); perConnectionErrorCount = perConnectionErrorCountMetric.newRecorder(meter); remainingDeadline = remainingDeadlineMetric.newRecorder(meter); batchWriteFlowControlTargetQps = batchWriteFlowControlTargetQpsMetric.newRecorder(meter); batchWriteFlowControlFactor = batchWriteFlowControlFactorMetric.newRecorder(meter); + transportLatency = transportLatencyMetric.newRecorder(meter); + + sessionUptime = sessionUptimeMetric.newRecorder(meter); + sessionDuration = sessionDurationMetric.newRecorder(meter); + sessionOpenLatency = sessionOpenLatencyMetric.newRecorder(meter); + debugTagCount = debugTagCountMetric.newRecorder(meter); pacemakerDelay = pacemakerDelayMetric.newRecorder(meter); + + channelFallbackCount = channelFallbackCountMetric.newRecorder(meter); } } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java index 6e30d3dd2ba6..8f736a5da824 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java @@ -18,22 +18,37 @@ import com.google.api.gax.tracing.ApiTracerFactory; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.tracers.ChannelPoolMetricsTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import io.grpc.Deadline; import io.grpc.ManagedChannelBuilder; import java.io.Closeable; import java.io.IOException; import javax.annotation.Nullable; public interface Metrics extends Closeable { - ApiTracerFactory createTracerFactory(ClientInfo clientInfo) throws IOException; - - > T configureGrpcChannel(T channelBuilder); - @Nullable ChannelPoolMetricsTracer getChannelPoolMetricsTracer(); DirectPathCompatibleTracer getDirectPathCompatibleTracer(); + VRpcTracer newTableTracer(SessionPoolInfo poolInfo, VRpcDescriptor descriptor, Deadline deadline); + + SessionTracer newSessionTracer(SessionPoolInfo poolInfo); + + PoolFallbackListener getPoolFallbackListener(); + + ApiTracerFactory createTracerFactory(ClientInfo clientInfo) throws IOException; + + > T configureGrpcChannel(T channelBuilder); + + DebugTagTracer getDebugTagTracer(); + void start(); @Override diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java index c7a68f8eea48..3595f67d885d 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java @@ -17,11 +17,16 @@ import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.ApiTracerFactory.OperationType; import com.google.api.gax.tracing.OpencensusTracerFactory; +import com.google.api.gax.tracing.SpanName; import com.google.auth.Credentials; import com.google.cloud.bigtable.Version; import com.google.cloud.bigtable.data.v2.BigtableDataSettings; import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics.NoopPoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics.NoopSessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics.NoopVrpcTracer; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.exporter.BigtableCloudMonitoringExporter; @@ -31,14 +36,28 @@ import com.google.cloud.bigtable.data.v2.internal.csm.tracers.BuiltinMetricsTracerFactory; import com.google.cloud.bigtable.data.v2.internal.csm.tracers.ChannelPoolMetricsTracer; import com.google.cloud.bigtable.data.v2.internal.csm.tracers.CompositeTracerFactory; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.CompositeVRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracerImpl; import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracerImpl; import com.google.cloud.bigtable.data.v2.internal.csm.tracers.Pacemaker; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListenerImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracerImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.UserApiVRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracerImpl; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import io.grpc.Deadline; import io.grpc.ManagedChannelBuilder; import io.grpc.opentelemetry.GrpcOpenTelemetry; import io.opencensus.stats.StatsRecorder; @@ -55,15 +74,14 @@ import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; public class MetricsImpl implements Metrics, Closeable { - private final MetricRegistry metricRegistry; - private final ApiTracerFactory userTracerFactory; private final @Nullable OpenTelemetrySdk internalOtel; private final @Nullable MetricRegistry.RecorderRegistry internalRecorder; - private final @Nullable OpenTelemetry userOtel; private final @Nullable MetricRegistry.RecorderRegistry userRecorder; private final ScheduledExecutorService executor; private final Tagger ocTagger; @@ -72,7 +90,14 @@ public class MetricsImpl implements Metrics, Closeable { @Nullable private final GrpcOpenTelemetry grpcOtel; @Nullable private final ChannelPoolMetricsTracer channelPoolMetricsTracer; private final DirectPathCompatibleTracer directPathCompatibleTracer; + private final DebugTagTracer debugTagTracer; @Nullable private final Pacemaker pacemaker; + private final PoolFallbackListener poolFallbackListener; + private final Object sessionLock = new Object(); + + @GuardedBy("sessionLock") + private final List sessionTracers = new ArrayList<>(); + private final List> tasks = new ArrayList<>(); public MetricsImpl( @@ -84,11 +109,9 @@ public MetricsImpl( Tagger ocTagger, StatsRecorder ocRecorder, ScheduledExecutorService executor) { - this.metricRegistry = metricRegistry; this.userTracerFactory = Preconditions.checkNotNull(userTracerFactory); this.internalOtel = internalOtel; - this.userOtel = userOtel; this.ocTagger = ocTagger; this.ocRecorder = ocRecorder; @@ -96,11 +119,15 @@ public MetricsImpl( this.executor = executor; if (internalOtel != null) { - this.internalRecorder = metricRegistry.newRecorderRegistry(internalOtel.getMeterProvider()); + this.internalRecorder = + metricRegistry.newInternalRecorderRegistry(internalOtel.getMeterProvider()); this.pacemaker = new Pacemaker(internalRecorder, clientInfo, "background"); this.channelPoolMetricsTracer = new ChannelPoolMetricsTracer(internalRecorder, clientInfo); this.directPathCompatibleTracer = new DirectPathCompatibleTracerImpl(clientInfo, internalRecorder); + this.debugTagTracer = new DebugTagTracerImpl(clientInfo, internalRecorder); + // Session based channel pool tracer + this.poolFallbackListener = new PoolFallbackListenerImpl(internalRecorder, clientInfo); this.grpcOtel = GrpcOpenTelemetry.newBuilder() .sdk(internalOtel) @@ -117,10 +144,12 @@ public MetricsImpl( this.pacemaker = null; this.channelPoolMetricsTracer = null; this.directPathCompatibleTracer = NoopMetricsProvider.NoopDirectPathCompatibleTracer.INSTANCE; + this.debugTagTracer = NoopMetrics.NoopDebugTracer.INSTANCE; + this.poolFallbackListener = new NoopPoolFallbackListener(); } if (userOtel != null) { - this.userRecorder = metricRegistry.newRecorderRegistry(userOtel.getMeterProvider()); + this.userRecorder = metricRegistry.newUserRecorderRegistry(userOtel.getMeterProvider()); } else { this.userRecorder = null; } @@ -144,6 +173,10 @@ public void start() { if (pacemaker != null) { tasks.add(pacemaker.start(executor)); } + if (internalOtel != null) { + tasks.add( + executor.scheduleAtFixedRate(this::recordAsyncSessionMetrics, 1, 1, TimeUnit.MINUTES)); + } } @Override @@ -155,6 +188,58 @@ public > T configureGrpcChannel(T channelBuil return channelBuilder; } + @Override + public VRpcTracer newTableTracer( + SessionPoolInfo poolInfo, VRpcDescriptor descriptor, Deadline deadline) { + if (internalRecorder == null) { + return new NoopVrpcTracer(); + } + ImmutableList.Builder builder = ImmutableList.builder(); + builder.add( + new VRpcTracerImpl(internalRecorder, poolInfo, descriptor.getMethodInfo(), deadline)); + if (userRecorder != null) { + builder.add(new VRpcTracerImpl(userRecorder, poolInfo, descriptor.getMethodInfo(), deadline)); + } + if (userTracerFactory != null) { + List nameStrings = Splitter.on('.').splitToList(descriptor.getMethodInfo().getName()); + builder.add( + new UserApiVRpcTracer( + userTracerFactory.newTracer( + null, + SpanName.of(nameStrings.get(0), nameStrings.get(1)), + descriptor.getMethodInfo().getStreaming() + ? OperationType.ServerStreaming + : OperationType.Unary), + poolInfo, + descriptor)); + } + return new CompositeVRpcTracer(builder.build()); + } + + @Override + public SessionTracer newSessionTracer(SessionPoolInfo poolInfo) { + if (internalRecorder == null) { + return new NoopSessionTracer(); + } + + SessionTracerImpl tracer = new SessionTracerImpl(internalRecorder, poolInfo); + synchronized (sessionLock) { + sessionTracers.add(tracer); + } + return tracer; + } + + private void recordAsyncSessionMetrics() { + synchronized (sessionLock) { + sessionTracers.removeIf(tracer -> !tracer.recordAsyncMetrics()); + } + } + + @Override + public PoolFallbackListener getPoolFallbackListener() { + return poolFallbackListener; + } + @Override public ApiTracerFactory createTracerFactory(ClientInfo clientInfo) { ImmutableList.Builder tracerFactories = ImmutableList.builder(); @@ -184,6 +269,11 @@ public DirectPathCompatibleTracer getDirectPathCompatibleTracer() { return directPathCompatibleTracer; } + @Override + public DebugTagTracer getDebugTagTracer() { + return debugTagTracer; + } + public static OpenTelemetrySdk createBuiltinOtel( MetricRegistry metricRegistry, ClientInfo clientInfo, diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/NoopMetrics.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/NoopMetrics.java new file mode 100644 index 000000000000..4990987ea3bc --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/NoopMetrics.java @@ -0,0 +1,154 @@ +/* + * Copyright 2026 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.internal.csm; + +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.ChannelPoolMetricsTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.CompositeTracerFactory; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DirectPathCompatibleTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider.NoopDirectPathCompatibleTracer; +import com.google.common.collect.ImmutableList; +import io.grpc.Deadline; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Status; +import java.io.IOException; +import java.time.Duration; +import javax.annotation.Nullable; + +public class NoopMetrics implements Metrics { + + @Override + public void start() {} + + @Override + public void close() {} + + @Override + public VRpcTracer newTableTracer( + SessionPoolInfo poolInfo, VRpcDescriptor descriptor, Deadline deadline) { + return NoopVrpcTracer.INSTANCE; + } + + @Override + public SessionTracer newSessionTracer(SessionPoolInfo poolInfo) { + return new NoopSessionTracer(); + } + + @Override + public DirectPathCompatibleTracer getDirectPathCompatibleTracer() { + return NoopDirectPathCompatibleTracer.INSTANCE; + } + + @Override + public DebugTagTracer getDebugTagTracer() { + return NoopDebugTracer.INSTANCE; + } + + @Override + public PoolFallbackListener getPoolFallbackListener() { + return new NoopPoolFallbackListener(); + } + + @Nullable + @Override + public ChannelPoolMetricsTracer getChannelPoolMetricsTracer() { + return null; + } + + @Override + public ApiTracerFactory createTracerFactory(ClientInfo clientInfo) throws IOException { + return new CompositeTracerFactory(ImmutableList.of()); + } + + @Override + public > T configureGrpcChannel(T channelBuilder) { + return channelBuilder; + } + + public static class NoopVrpcTracer implements VRpcTracer { + + public static final NoopVrpcTracer INSTANCE = new NoopVrpcTracer(); + + @Override + public void onOperationStart() {} + + @Override + public void onAttemptStart(Object request) {} + + @Override + public void onRequestSent(PeerInfo peerInfo) {} + + @Override + public void onResponseReceived() {} + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) {} + + @Override + public void onAttemptFinish(VRpc.VRpcResult result) {} + + @Override + public void onOperationFinish(VRpc.VRpcResult result) {} + } + + public static class NoopSessionTracer implements SessionTracer { + + @Override + public void onStart() {} + + @Override + public void onOpen(PeerInfo peerInfo) {} + + @Override + public void onVRpcClose(Status.Code code) {} + + @Override + public void onClose( + PeerInfo peerInfo, CloseSessionRequest.CloseSessionReason reason, Status status) {} + + @Override + public boolean recordAsyncMetrics() { + return false; + } + } + + public static class NoopPoolFallbackListener implements PoolFallbackListener { + @Override + public void onFallback(String from, String to, ChannelFallbackReason reason) {} + } + + public static class NoopDebugTracer extends DebugTagTracer { + public static final NoopDebugTracer INSTANCE = new NoopDebugTracer(); + + @Override + public void record(TelemetryConfiguration.Level level, String tag) {} + + @Override + public void setClientConfigurationManager(ClientConfigurationManager manager) {} + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java index 7122cb40c784..b1d90f593cd1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java index b7afb73ee9e3..e45ea2607f5b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java index 4312392afa40..59b76077f2aa 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java index 91cfab1301ff..ade147caea69 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.api.gax.rpc.ApiException; import com.google.bigtable.v2.AuthorizedViewName; import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.ClusterInformation; import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; import com.google.bigtable.v2.MaterializedViewName; import com.google.bigtable.v2.MutateRowRequest; @@ -29,7 +30,6 @@ import com.google.bigtable.v2.ReadChangeStreamRequest; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadRowsRequest; -import com.google.bigtable.v2.ResponseParams; import com.google.bigtable.v2.SampleRowKeysRequest; import com.google.bigtable.v2.TableName; import com.google.common.annotations.VisibleForTesting; @@ -58,6 +58,12 @@ public String getValue() { static final String TRANSPORT_TYPE_PREFIX = "TRANSPORT_TYPE_"; + public static String formatTransportRegion(@Nullable PeerInfo peerInfo) { + return Optional.ofNullable(peerInfo).map(PeerInfo::getApplicationFrontendRegion).orElse(""); + } + + @SuppressWarnings("deprecation") + // TODO: server is still sending back zone instead of region. Update this after server is updated public static String formatTransportZone(@Nullable PeerInfo peerInfo) { return Optional.ofNullable(peerInfo).map(PeerInfo::getApplicationFrontendZone).orElse(""); } @@ -118,16 +124,16 @@ static String transportTypeToStringWithoutFallback(TransportType transportType) } } - public static String formatClusterIdMetricLabel(@Nullable ResponseParams clusterInfo) { + public static String formatClusterIdMetricLabel(@Nullable ClusterInformation clusterInfo) { return Optional.ofNullable(clusterInfo) - .map(ResponseParams::getClusterId) + .map(ClusterInformation::getClusterId) .filter(s -> !s.isEmpty()) .orElse(""); } - public static String formatZoneIdMetricLabel(@Nullable ResponseParams clusterInfo) { + public static String formatZoneIdMetricLabel(@Nullable ClusterInformation clusterInfo) { return Optional.ofNullable(clusterInfo) - .map(ResponseParams::getZoneId) + .map(ClusterInformation::getZoneId) .filter(s -> !s.isEmpty()) .orElse("global"); } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java index 1ccd3f00e947..635cd6d2717f 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java index 601e19dc66d7..cbb9cd37012b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolFallbackCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolFallbackCount.java new file mode 100644 index 000000000000..1a5a5b312230 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolFallbackCount.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 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.internal.csm.metrics; + +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.PoolFallbackListener.ChannelFallbackReason; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.Meter; + +public class ClientChannelPoolFallbackCount extends MetricWrapper { + + private static final String NAME = + "bigtable.googleapis.com/internal/client/channel_fallback_count"; + private static final AttributeKey FROM_KEY = AttributeKey.stringKey("from"); + private static final AttributeKey TO_KEY = AttributeKey.stringKey("to"); + private static final AttributeKey REASON_KEY = AttributeKey.stringKey("reason"); + + public ClientChannelPoolFallbackCount() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongCounter instrument; + + private Recorder(Meter meter) { + instrument = + meter + .counterBuilder(NAME) + .setDescription("Number of fallback occurrences.") + .setUnit(Units.COUNT) + .build(); + } + + public void record( + ClientInfo clientInfo, long count, String from, String to, ChannelFallbackReason reason) { + Attributes attrs = + getSchema() + .createResourceAttrs(clientInfo) + .put(FROM_KEY, from) + .put(TO_KEY, to) + .put(REASON_KEY, reason.name()) + .build(); + instrument.add(count, attrs); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableDebugTagCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDebugTagCount.java similarity index 65% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableDebugTagCount.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDebugTagCount.java index 5d9dbc8536a5..3abdc751c2ca 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableDebugTagCount.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDebugTagCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,32 +16,19 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; -import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; -import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema; -import com.google.common.collect.ImmutableMap; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.metrics.LongCounter; import io.opentelemetry.api.metrics.Meter; -import javax.annotation.Nullable; -public class TableDebugTagCount extends MetricWrapper { +public class ClientDebugTagCount extends MetricWrapper { private static final String NAME = "bigtable.googleapis.com/internal/client/debug_tags"; - public TableDebugTagCount() { - super(TableSchema.INSTANCE, NAME); - } - - @Override - public ImmutableMap extractMetricLabels( - Attributes metricAttrs, EnvInfo envInfo, ClientInfo clientInfo) { - return ImmutableMap.builder() - .putAll(super.extractMetricLabels(metricAttrs, envInfo, clientInfo)) - .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) - .build(); + public ClientDebugTagCount() { + super(ClientSchema.INSTANCE, NAME); } public Recorder newRecorder(Meter meter) { @@ -60,15 +47,10 @@ private Recorder(Meter meter) { .build(); } - public void record( - ClientInfo clientInfo, - String tableId, - String tag, - @Nullable ResponseParams clusterInfo, - long amount) { + public void record(ClientInfo clientInfo, String tag, long amount) { Attributes attributes = getSchema() - .createResourceAttrs(clientInfo, tableId, clusterInfo) + .createResourceAttrs(clientInfo) // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter .put(MetricLabels.CLIENT_NAME, clientInfo.getClientName()) .put(MetricLabels.DEBUG_TAG_KEY, tag) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java index ff7dd36cbecf..6637795e2309 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionDuration.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionDuration.java new file mode 100644 index 000000000000..0a51ad16d315 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionDuration.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 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.internal.csm.metrics; + +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.collect.ImmutableSortedSet; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +public class ClientSessionDuration extends MetricWrapper { + private static final String NAME = "bigtable.googleapis.com/internal/client/session/durations"; + + public static final List BUCKETS_MS = + ImmutableSortedSet.naturalOrder() + .add(0L) + .addAll(Buckets.generateGeometricSeq(1, TimeUnit.MINUTES.toMillis(20))) + .build() + .asList(); + + public enum SessionCloseVRpcState { + None("none", false, false), + SomeOk("some_ok", true, true), + AllOk("all_ok", true, false), + AllError("all_error", false, true); + + private final String label; + private final boolean hasOk; + private final boolean hasError; + + SessionCloseVRpcState(String label, boolean hasOk, boolean hasError) { + this.label = label; + this.hasOk = hasOk; + this.hasError = hasError; + } + + public static SessionCloseVRpcState find(boolean hasOk, boolean hasError) { + for (SessionCloseVRpcState v : SessionCloseVRpcState.values()) { + if (v.hasOk == hasOk && v.hasError == hasError) { + return v; + } + } + throw new IllegalStateException( + String.format( + "Failed to find SessionCloseVRpcState variant for hasOk: %b, hasError: %b", + hasOk, hasError)); + } + } + + public ClientSessionDuration() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("Client observed latency for establishing a new session") + .setUnit(Units.MILLISECOND) + .ofLongs() + .setExplicitBucketBoundariesAdvice(BUCKETS_MS) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, + @Nullable PeerInfo peerInfo, + Status.Code code, + CloseSessionReason closeReason, + SessionCloseVRpcState vrpcState, + boolean isReady, + Duration latency) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + // metric specific + .put(MetricLabels.SESSION_READY_KEY, isReady) + .put(MetricLabels.STATUS_KEY, code.name()) // gRPC stream status + .put(MetricLabels.REASON_KEY, closeReason.name()) + .put(MetricLabels.VRPCS_KEY, vrpcState.label) + .build(); + + instrument.record((long) toMillis(latency), attributes); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionOpenLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionOpenLatency.java new file mode 100644 index 000000000000..a8fc77e4cb20 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionOpenLatency.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 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.internal.csm.metrics; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.collect.ImmutableSortedSet; +import io.grpc.Status; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +public class ClientSessionOpenLatency extends MetricWrapper { + private static final String NAME = + "bigtable.googleapis.com/internal/client/session/open_latencies"; + + public static final List BUCKETS_MS = + ImmutableSortedSet.naturalOrder() + .addAll(Buckets.generateLinearSeq(0, 3, 0.1)) + .addAll(Buckets.generateLinearSeq(3, 9, 1)) + .addAll( + Buckets.generateGeometricSeq(10, TimeUnit.MINUTES.toMillis(5)).stream() + .map(Long::doubleValue) + .collect(Collectors.toList())) + .build() + .asList(); + + public ClientSessionOpenLatency() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("Client observed latency for establishing a new session") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(BUCKETS_MS) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, @Nullable PeerInfo peerInfo, Status.Code code, Duration latency) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + // metric specific + .put(MetricLabels.STATUS_KEY, code.name()) + .build(); + + instrument.record(toMillis(latency), attributes); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionUptime.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionUptime.java new file mode 100644 index 000000000000..1a0acb1bf879 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientSessionUptime.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 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.internal.csm.metrics; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.collect.ImmutableSortedSet; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +public class ClientSessionUptime extends MetricWrapper { + private static final String NAME = "bigtable.googleapis.com/internal/client/session/uptime"; + + public static final List BUCKETS_MS = + ImmutableSortedSet.naturalOrder() + .add(0L) + .addAll(Buckets.generateGeometricSeq(1, TimeUnit.MINUTES.toMillis(20))) + .build() + .asList(); + + public ClientSessionUptime() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final LongHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("A distribution age of all active sessions") + .setUnit(Units.MILLISECOND) + .ofLongs() + .setExplicitBucketBoundariesAdvice(BUCKETS_MS) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, @Nullable PeerInfo peerInfo, boolean isReady, Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + .put(MetricLabels.SESSION_READY_KEY, isReady) + .build(); + + instrument.record((long) toMillis(duration), attributes); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientTransportLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientTransportLatency.java new file mode 100644 index 000000000000..9ff2d25000d5 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientTransportLatency.java @@ -0,0 +1,75 @@ +/* + * Copyright 2026 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.internal.csm.metrics; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Buckets; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.MetricLabels; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.Constants.Units; +import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import javax.annotation.Nullable; + +public class ClientTransportLatency extends MetricWrapper { + public static final String NAME = "bigtable.googleapis.com/internal/client/transport_latencies"; + + public ClientTransportLatency() { + super(ClientSchema.INSTANCE, NAME); + } + + public Recorder newRecorder(Meter meter) { + return new Recorder(meter); + } + + public class Recorder { + private final DoubleHistogram instrument; + + private Recorder(Meter meter) { + instrument = + meter + .histogramBuilder(NAME) + .setDescription("The latency measured from e2e latencies minus node latencies.") + .setUnit(Units.MILLISECOND) + .setExplicitBucketBoundariesAdvice(Buckets.AGGREGATION_WITH_MILLIS_HISTOGRAM) + .build(); + } + + public void record( + SessionPoolInfo poolInfo, + @Nullable PeerInfo peerInfo, + MethodInfo methodInfo, + Duration duration) { + Attributes attributes = + getSchema() + .createResourceAttrs(poolInfo.getClientInfo()) + // Shared session labels + .put(MetricLabels.SESSION_TYPE_KEY, poolInfo.getTypeLabel()) + .put(MetricLabels.SESSION_NAME, poolInfo.getName()) + .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) + .put(MetricLabels.AFE_LOCATION_KEY, Util.formatTransportSubzone(peerInfo)) + .put(MetricLabels.METHOD_KEY, methodInfo.getName()) + .build(); + + instrument.record(toMillis(duration), attributes); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java index 3478fd2e42f0..010dbfc3df85 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,6 +61,14 @@ private MetricLabels() {} static final AttributeKey DP_IP_PREFERENCE_KEY = AttributeKey.stringKey("ip_preference"); + static final AttributeKey SESSION_TYPE_KEY = AttributeKey.stringKey("session_type"); + static final AttributeKey SESSION_NAME = AttributeKey.stringKey("session_name"); + static final AttributeKey AFE_LOCATION_KEY = AttributeKey.stringKey("afe_location"); + + static final AttributeKey REASON_KEY = AttributeKey.stringKey("closing_reason"); + static final AttributeKey VRPCS_KEY = AttributeKey.stringKey("vrpcs"); + static final AttributeKey SESSION_READY_KEY = AttributeKey.booleanKey("ready"); + public static final AttributeKey STATUS_KEY = AttributeKey.stringKey("status"); static final AttributeKey EXECUTOR_KEY = AttributeKey.stringKey("executor"); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java index e4ddc1216536..517ab454e806 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java index a6c882d820e7..3947d3e680d4 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java index 9fd5561d0f24..464a4138d134 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -69,7 +69,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Duration duration) { Attributes attributes = getSchema() diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java index e792cb8eb8d7..fa7666c740e2 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -68,7 +68,7 @@ private Recorder(Meter meter) { public void record( ClientInfo clientInfo, String tableId, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, MethodInfo methodInfo, Status.Code code, Duration latency) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java index ca895e0e1bc6..090e386eec70 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ */ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; +import com.google.bigtable.v2.ClusterInformation; import com.google.bigtable.v2.PeerInfo; -import com.google.bigtable.v2.ResponseParams; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -70,7 +70,7 @@ public void record( ClientInfo clientInfo, String tableId, @Nullable PeerInfo peerInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, MethodInfo methodInfo, Status.Code code, Duration latency) { @@ -80,7 +80,7 @@ public void record( .createResourceAttrs(clientInfo, tableId, clusterInfo) .put(MetricLabels.TRANSPORT_TYPE, Util.formatTransportType(peerInfo)) .put(MetricLabels.STATUS_KEY, code.name()) - .put(MetricLabels.TRANSPORT_REGION, "") + .put(MetricLabels.TRANSPORT_REGION, Util.formatTransportRegion(peerInfo)) // To maintain backwards compat CLIENT_UID is set using sideband data in the exporter .put(MetricLabels.TRANSPORT_ZONE, Util.formatTransportZone(peerInfo)) .put(MetricLabels.TRANSPORT_SUBZONE, Util.formatTransportSubzone(peerInfo)) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java index 7fc46c5559d6..74ec711c2fb5 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -70,7 +70,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Duration duration) { Attributes attributes = getSchema() diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java index 3f99f90248e5..228b2c88b0e1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -69,7 +69,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Status.Code code, long count) { Attributes attributes = diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java index 6ad09e7798f9..2c64b53cf40c 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -73,7 +73,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Status.Code code, Duration duration) { Attributes attributes = diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java index 781501100fd4..b66f1e2b37cf 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -71,7 +71,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Status.Code code, Duration duration) { Attributes attributes = diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java index 314f9874c8b9..1d5d0819129e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -30,6 +30,7 @@ import io.opentelemetry.api.metrics.DoubleHistogram; import io.opentelemetry.api.metrics.Meter; import java.time.Duration; +import javax.annotation.Nullable; public class TableRemainingDeadline extends MetricWrapper { public static final String NAME = "bigtable.googleapis.com/internal/client/remaining_deadline"; @@ -71,7 +72,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Status.Code code, Duration duration) { Attributes attributes = diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java index 205bf8396284..eb6e394afb44 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -66,7 +66,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Status.Code code, long amount) { Attributes attributes = diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java index cafc0c245e6c..6535def001aa 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.metrics; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -71,7 +71,7 @@ public void record( ClientInfo clientInfo, String tableId, MethodInfo methodInfo, - @Nullable ResponseParams clusterInfo, + @Nullable ClusterInformation clusterInfo, Status.Code code, Duration duration) { Attributes attributes = diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/package-info.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/package-info.java new file mode 100644 index 000000000000..86fc15faea42 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/package-info.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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. + */ + +/** + * Clientside metrics apis + * + *

Bigtable clientside metrics are implemented using Opentelemetry. However unlike most libraries + * that use Opentelemetry, the Bigtable client bundles its own exporter that is on by default. The + * metrics collected are exported to Cloud Monitoring. + * + *

There are 3 types of metrics that are collected: + * + *

    + *
  • Table based metrics - these metrics are meant to be the clientside counterpart of the + * serverside bigtable_table metrics. The are tied to Table-bound RPCs. + *
  • Client based metrics - these metrics are internal and used to monitor the e2e health of the + * client. They are tied to the bigtable_client resource. + *
  • Client based gRPC metrics - these are metrics collected by the underlying gRPC library and + * are exported using the bigtable_client resource + *
+ * + *

The client will attach relevant attributes to the measurement when it is being recorded. There + * are 2 types of attributes: resource and metric. Some of the table based resource attributes are + * dynamic and are extracted from an RPC response. To facilitate this, the resource attributes will + * be sent into Opentelemetry as metric attributes and then during export, the attributes will be + * split between the monitored resource and metric labels. + * + *

Client based metrics use a schema that's mostly static, however some of the attributes are + * slow to resolve. The resolution of those attributes will be deferred until the export phase in + * the Exporter. While the non-expensive ones will be sent as metric attributes same as table based + * metrics + * + *

Client based gRPC metrics are recorded by gRPC and don't have access to the any Bigtable + * attributes. All of the Bigtable attributes will be filled in by the Exporter. + * + *

To make this manageable, attributes from different sources are encapsulated by POJOs and are + * plumbed to the RpcTracer and the Exporter. The metrics themselves are wrapped in typesafe + * classes. Each metric has its own class which will have a metric specific record method. In + * addition the metric classes will extend a schema specific class (ie AbstractClientMetric). The + * schema specific class will serve 2 use cases: + * + *

    + *
  • During the record phase, createResourceAttrs method, will ensure all of the resource + * attributes are captured as metric attributes. + *
  • During the export phase, createMonitoredResource and createMetricLabels methods are used to + * extract a MonitoredResource and Metric labels. + *
+ */ +package com.google.cloud.bigtable.data.v2.internal.csm; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java index 0a5b3adeb2cb..69a450977b73 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java index a5d621acbc2b..3458ce606450 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java index e333837d7ab1..8a655cfd7686 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package com.google.cloud.bigtable.data.v2.internal.csm.schema; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.ClusterInformation; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; @@ -54,7 +54,7 @@ public ProjectName extractProjectName(Attributes attrs, EnvInfo envInfo, ClientI } public AttributesBuilder createResourceAttrs( - ClientInfo clientInfo, String tableId, @Nullable ResponseParams clusterInfo) { + ClientInfo clientInfo, String tableId, @Nullable ClusterInformation clusterInfo) { return Attributes.builder() .put(BIGTABLE_PROJECT_ID_KEY, clientInfo.getInstanceName().getProjectId()) .put(INSTANCE_ID_KEY, clientInfo.getInstanceName().getInstanceId()) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java index d2fa015cf354..305ec53315e6 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java @@ -20,7 +20,7 @@ import com.google.api.core.ObsoleteApi; import com.google.api.gax.retrying.ServerStreamingAttemptException; -import com.google.bigtable.v2.ResponseParams; +import com.google.bigtable.v2.PeerInfo; import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; @@ -296,19 +296,14 @@ private void recordOperationCompletion(@Nullable Throwable throwable) { // graph will be less confusing if (attemptCount > 1) { recorder.retryCount.record( - clientInfo, - tableId, - methodInfo, - sidebandData.getResponseParams(), - code, - attemptCount - 1); + clientInfo, tableId, methodInfo, sidebandData.getClusterInfo(), code, attemptCount - 1); } recorder.operationLatency.record( clientInfo, tableId, methodInfo, - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), code, Duration.ofNanos(operationLatencyNano)); @@ -318,7 +313,7 @@ private void recordOperationCompletion(@Nullable Throwable throwable) { clientInfo, tableId, methodInfo, - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), Duration.ofNanos(applicationLatencyNano)); if (methodInfo.equals(READ_ROWS)) { @@ -326,7 +321,7 @@ private void recordOperationCompletion(@Nullable Throwable throwable) { clientInfo, tableId, methodInfo, - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), code, firstResponsePerOpTimer.elapsed()); } @@ -360,13 +355,13 @@ private void recordAttemptCompletion(@Nullable Throwable throwable) { clientInfo, tableId, methodInfo, - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), Duration.ofNanos(totalClientBlockingTime.get())); recorder.attemptLatency.record( clientInfo, tableId, - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), methodInfo, code, attemptTimer.elapsed()); @@ -375,7 +370,7 @@ private void recordAttemptCompletion(@Nullable Throwable throwable) { clientInfo, tableId, sidebandData.getPeerInfo(), - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), methodInfo, code, attemptTimer.elapsed()); @@ -387,7 +382,7 @@ private void recordAttemptCompletion(@Nullable Throwable throwable) { clientInfo, tableId, methodInfo, - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), code, Comparators.max(remainingDeadlineAtAttemptStart, Duration.ZERO)); } @@ -397,7 +392,7 @@ private void recordAttemptCompletion(@Nullable Throwable throwable) { clientInfo, tableId, methodInfo, - sidebandData.getResponseParams(), + sidebandData.getClusterInfo(), code, sidebandData.getGfeTiming()); } @@ -409,18 +404,18 @@ private void recordAttemptCompletion(@Nullable Throwable throwable) { seenServer = seenServer - || Optional.ofNullable(sidebandData.getResponseParams()) - .map(rp -> !ResponseParams.getDefaultInstance().equals(rp)) + || Optional.ofNullable(sidebandData.getPeerInfo()) + .map(rp -> !PeerInfo.getDefaultInstance().equals(rp)) .orElse(false); seenServer = seenServer || (sidebandData.getGfeTiming() != null); if (seenServer) { recorder.connectivityErrorCount.record( - clientInfo, tableId, methodInfo, sidebandData.getResponseParams(), code, 0); + clientInfo, tableId, methodInfo, sidebandData.getClusterInfo(), code, 0); } else { recorder.connectivityErrorCount.record( - clientInfo, tableId, methodInfo, sidebandData.getResponseParams(), code, 1); + clientInfo, tableId, methodInfo, sidebandData.getClusterInfo(), code, 1); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java index ec132e4dad64..2d53d119c1f3 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracer.java new file mode 100644 index 000000000000..473c8c56811c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracer.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import java.time.Duration; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class CompositeVRpcTracer implements VRpcTracer { + + private static final Logger logger = Logger.getLogger(CompositeVRpcTracer.class.getName()); + + private final List children; + + public CompositeVRpcTracer(List children) { + this.children = children; + } + + @Override + public void onOperationStart() { + children.forEach( + c -> { + try { + c.onOperationStart(); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log operation start on tracer {0}", + c.getClass().getName()); + } + }); + } + + @Override + public void onAttemptStart(Object req) { + children.forEach( + c -> { + try { + c.onAttemptStart(req); + } catch (Throwable e) { + logger.log( + Level.WARNING, "Failed to log attempt start on tracer {0}", c.getClass().getName()); + } + }); + } + + @Override + public void onRequestSent(PeerInfo peerInfo) { + children.forEach( + c -> { + try { + c.onRequestSent(peerInfo); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log request sent on tracer {0} for peer {1}", + new Object[] {c.getClass().getName(), peerInfo}); + } + }); + } + + @Override + public void onResponseReceived() { + children.forEach( + c -> { + try { + c.onResponseReceived(); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log response received on tracer {0}", + c.getClass().getName()); + } + }); + } + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) { + children.forEach( + c -> { + try { + c.recordApplicationBlockingLatencies(elapsed); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log application latencies on tracer {0} with duration {1}", + new Object[] {c.getClass().getName(), elapsed}); + } + }); + } + + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + children.forEach( + c -> { + try { + c.onAttemptFinish(result); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log attempt finish on tracer {0} with result {1}", + new Object[] {c.getClass().getName(), result}); + } + }); + } + + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + children.forEach( + c -> { + try { + c.onOperationFinish(result); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to log operation finish on tracer {0} with result {1}", + new Object[] {c.getClass().getName(), result}); + } + }); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracer.java new file mode 100644 index 000000000000..e841f8b9bb8b --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracer.java @@ -0,0 +1,34 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; + +public abstract class DebugTagTracer { + + public abstract void record(TelemetryConfiguration.Level level, String tag); + + public abstract void setClientConfigurationManager(ClientConfigurationManager manager); + + public final void checkPrecondition( + boolean expression, String tag, String errorMessage, Object... args) { + if (!expression) { + record(TelemetryConfiguration.Level.ERROR, tag); + throw new IllegalStateException(String.format(errorMessage, args)); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracerImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracerImpl.java new file mode 100644 index 000000000000..4ba0f28ef5b8 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DebugTagTracerImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import java.util.Optional; + +public class DebugTagTracerImpl extends DebugTagTracer { + + private final MetricRegistry.RecorderRegistry registry; + private final ClientInfo clientInfo; + + private Optional manager = Optional.empty(); + + public DebugTagTracerImpl(ClientInfo clientInfo, MetricRegistry.RecorderRegistry registry) { + this.clientInfo = clientInfo; + this.registry = registry; + } + + public void setClientConfigurationManager(ClientConfigurationManager manager) { + this.manager = Optional.of(manager); + } + + @Override + public void record(TelemetryConfiguration.Level level, String tag) { + if (shouldRecord(level)) { + registry.debugTagCount.record(clientInfo, tag, 1); + } + } + + private boolean shouldRecord(TelemetryConfiguration.Level level) { + TelemetryConfiguration.Level currentLevel = + manager + .map(m -> m.getClientConfiguration().getTelemetryConfiguration().getDebugTagLevel()) + .orElse(TelemetryConfiguration.Level.WARN); + return level.getNumber() >= currentLevel.getNumber(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListener.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListener.java new file mode 100644 index 000000000000..cb808b094ce8 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListener.java @@ -0,0 +1,25 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +public interface PoolFallbackListener { + public enum ChannelFallbackReason { + ERROR_RATE, + FALLBACK_DISABLE + }; + + void onFallback(String from, String to, ChannelFallbackReason reason); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListenerImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListenerImpl.java new file mode 100644 index 000000000000..154c3f8a3f65 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/PoolFallbackListenerImpl.java @@ -0,0 +1,34 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; + +public class PoolFallbackListenerImpl implements PoolFallbackListener { + private final RecorderRegistry registry; + private final ClientInfo clientInfo; + + public PoolFallbackListenerImpl(RecorderRegistry registry, ClientInfo clientInfo) { + this.registry = registry; + this.clientInfo = clientInfo; + } + + @Override + public void onFallback(String from, String to, ChannelFallbackReason reason) { + registry.channelFallbackCount.record(clientInfo, 1, from, to, reason); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracer.java new file mode 100644 index 000000000000..a9048490d769 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.PeerInfo; +import io.grpc.Status; + +public interface SessionTracer { + + void onStart(); + + void onOpen(PeerInfo peerInfo); + + void onVRpcClose(Status.Code code); + + void onClose(PeerInfo peerInfo, CloseSessionReason reason, Status status); + + /** + * Record any metrics outside of the normal flow (ie periodically recording how long a session has + * been open). + * + * @return false if this tracker is done and will not have anymore metrics to record. + */ + boolean recordAsyncMetrics(); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracerImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracerImpl.java new file mode 100644 index 000000000000..add572f28b7e --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/SessionTracerImpl.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionDuration.SessionCloseVRpcState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.base.Stopwatch; +import io.grpc.Status; +import io.grpc.Status.Code; + +public class SessionTracerImpl implements SessionTracer { + private final RecorderRegistry metricRegistry; + private final SessionPoolInfo poolInfo; + + private final Stopwatch uptime = Stopwatch.createUnstarted(); + + private enum State { + New, + Ready, + Closed + } + + private volatile State state = State.New; + private volatile boolean hasOkRpcs = false; + private volatile boolean hasErrorRpcs = false; + private volatile PeerInfo lastPeerInfo = SessionStream.DISCONNECTED_PEER_INFO; + + public SessionTracerImpl(RecorderRegistry metricRegistry, SessionPoolInfo sessionInfo) { + this.metricRegistry = metricRegistry; + this.poolInfo = sessionInfo; + } + + @Override + public void onStart() { + uptime.start(); + } + + @Override + public void onOpen(PeerInfo peerInfo) { + state = State.Ready; + lastPeerInfo = peerInfo; + + metricRegistry.sessionOpenLatency.record(poolInfo, peerInfo, Status.Code.OK, uptime.elapsed()); + } + + @Override + public void onVRpcClose(Status.Code code) { + if (code == Code.OK) { + hasOkRpcs = true; + } else { + hasErrorRpcs = true; + } + } + + @Override + public void onClose(PeerInfo peerInfo, CloseSessionReason reason, Status status) { + lastPeerInfo = peerInfo; + + if (state == State.New) { + metricRegistry.sessionOpenLatency.record( + poolInfo, peerInfo, status.getCode(), uptime.elapsed()); + } + + metricRegistry.sessionDuration.record( + poolInfo, + peerInfo, + status.getCode(), + reason, + SessionCloseVRpcState.find(hasOkRpcs, hasErrorRpcs), + state == State.Ready, + uptime.elapsed()); + + state = State.Closed; + } + + @Override + public boolean recordAsyncMetrics() { + if (state == State.Closed) { + return false; + } + metricRegistry.sessionUptime.record( + poolInfo, lastPeerInfo, state == State.Ready, uptime.elapsed()); + return true; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/UserApiVRpcTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/UserApiVRpcTracer.java new file mode 100644 index 000000000000..e794036d5aa0 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/UserApiVRpcTracer.java @@ -0,0 +1,89 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.api.gax.tracing.ApiTracer; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import java.time.Duration; +import java.util.concurrent.atomic.AtomicInteger; + +/* A VRpc tracer that wraps the legacy gax ApiTracer */ +public class UserApiVRpcTracer implements VRpcTracer { + + private final ApiTracer delegate; + private final AtomicInteger counter = new AtomicInteger(0); + private final TableName tableName; + private final String appProfileId; + private final VRpcDescriptor descriptor; + + public UserApiVRpcTracer( + ApiTracer apiTracer, SessionPoolInfo poolInfo, VRpcDescriptor descriptor) { + this.delegate = apiTracer; + this.tableName = + TableName.newBuilder() + .setProject(poolInfo.getClientInfo().getInstanceName().getProjectId()) + .setInstance(poolInfo.getClientInfo().getInstanceName().getInstanceId()) + .setTable(poolInfo.getName()) + .build(); + this.appProfileId = poolInfo.getClientInfo().getAppProfileId(); + this.descriptor = descriptor; + } + + @Override + public void onOperationStart() {} + + @Override + public void onAttemptStart(Object req) { + delegate.attemptStarted( + descriptor.toLegacyProto(tableName.toString(), appProfileId, req), + counter.getAndIncrement()); + } + + @Override + public void onRequestSent(PeerInfo peerInfo) { + delegate.requestSent(); + } + + @Override + public void onResponseReceived() { + delegate.responseReceived(); + } + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) {} + + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + if (result.getStatus().isOk()) { + delegate.attemptSucceeded(); + } else { + delegate.attemptFailedDuration(result.getStatus().asException(), Duration.ZERO); + } + } + + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + if (result.getStatus().isOk()) { + delegate.operationSucceeded(); + } else { + delegate.operationFailed(result.getStatus().asException()); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracer.java new file mode 100644 index 000000000000..924bdd4d6006 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracer.java @@ -0,0 +1,38 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import java.time.Duration; + +public interface VRpcTracer { + + void onOperationStart(); + + void onAttemptStart(Object request); + + void onRequestSent(PeerInfo peerInfo); + + void onResponseReceived(); + + void recordApplicationBlockingLatencies(Duration elapsed); + + void onAttemptFinish(VRpcResult result); + + void onOperationFinish(VRpcResult result); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerImpl.java new file mode 100644 index 000000000000..857be73d3904 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerImpl.java @@ -0,0 +1,215 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult.State; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.common.base.Stopwatch; +import io.grpc.Deadline; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +/** + * + * + *
+ * The following events happen in an operation:
+ * operation
+ *   attempt start
+ *     attempt waiting for session / channel
+ *     rpc sent from client
+ *     rpc waiting for grpc buffer to be ready
+ *     receive response from server and calls back app's listener
+ *   attempt finish
+ *   retry wait
+ *   attempt start again
+ *   ...
+ *   attempt finish
+ * operation finish
+ * 
+ */ +public class VRpcTracerImpl implements VRpcTracer { + private static final ClusterInformation UNKNOWN_CLUSTER = + ClusterInformation.newBuilder().setZoneId("global").setClusterId("").build(); + + private final RecorderRegistry metricRegistry; + private final SessionPoolInfo poolInfo; + private final MethodInfo methodInfo; + private final Deadline originalDeadline; + + private final Stopwatch attemptTimer = Stopwatch.createStarted(); // per attempt + private final Stopwatch operationTimer = Stopwatch.createStarted(); // per operation + private final Stopwatch clientBlockingTimer = Stopwatch.createStarted(); // per attempt + private final Stopwatch firstResponsePerOpTimer = Stopwatch.createStarted(); // per operation + private Duration applicationBlockingLatency = Duration.ZERO; // per operation + private long remainingDeadline; // per attempt + + private final Stopwatch applicationBlockingTimer = Stopwatch.createUnstarted(); + private ClusterInformation lastClusterInfo; + private PeerInfo lastPeerInfo = SessionStream.DISCONNECTED_PEER_INFO; + + private int numAttempts = 0; + + public VRpcTracerImpl( + RecorderRegistry metricRegistry, + SessionPoolInfo poolInfo, + MethodInfo methodInfo, + Deadline deadline) { + this.metricRegistry = metricRegistry; + this.poolInfo = poolInfo; + this.methodInfo = methodInfo; + this.originalDeadline = deadline; + this.lastClusterInfo = UNKNOWN_CLUSTER; + } + + @Override + public void onOperationStart() {} + + @Override + public void onAttemptStart(Object req) { + if (!attemptTimer.isRunning()) { + attemptTimer.reset().start(); + } + if (!clientBlockingTimer.isRunning()) { + clientBlockingTimer.reset().start(); + } + remainingDeadline = originalDeadline.timeRemaining(TimeUnit.MILLISECONDS); + numAttempts++; + } + + @Override + public void onRequestSent(PeerInfo peerInfo) { + this.lastPeerInfo = peerInfo; + if (clientBlockingTimer.isRunning()) { + clientBlockingTimer.stop(); + } + } + + @Override + public void onResponseReceived() { + if (firstResponsePerOpTimer.isRunning()) { + firstResponsePerOpTimer.stop(); + } + if (!applicationBlockingTimer.isRunning()) { + applicationBlockingTimer.reset().start(); + } + } + + @Override + public void recordApplicationBlockingLatencies(Duration elapsed) { + applicationBlockingLatency = applicationBlockingLatency.plus(elapsed); + } + + @Override + public void onAttemptFinish(VRpcResult result) { + attemptTimer.stop(); + + @SuppressWarnings("AssignmentExpression") + ClusterInformation clusterInfo = + lastClusterInfo = Optional.ofNullable(result.getClusterInfo()).orElse(UNKNOWN_CLUSTER); + + metricRegistry.attemptLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + clusterInfo, + methodInfo, + result.getStatus().getCode(), + attemptTimer.elapsed()); + + metricRegistry.attemptLatency2.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + lastPeerInfo, + clusterInfo, + methodInfo, + result.getStatus().getCode(), + attemptTimer.elapsed()); + + // TODO: what should be server latency? + // metricRegistry.serverLatency.record( + // poolInfo, methodInfo, clusterInfo, result.getStatus(), result.getServerLatency()); + + // If the result state is not SERVER_RESULT that means the vrpc failed before + // reaching the AFE and we increment the connectivity error counter. + metricRegistry.connectivityErrorCount.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + clusterInfo, + result.getStatus().getCode(), + (result.getState() != State.SERVER_RESULT) ? 1 : 0); + + metricRegistry.clientBlockingLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + clusterInfo, + clientBlockingTimer.elapsed()); + + metricRegistry.remainingDeadline.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + clusterInfo, + result.getStatus().getCode(), + Duration.ofMillis(remainingDeadline)); + + metricRegistry.transportLatency.record( + poolInfo, + lastPeerInfo, + methodInfo, + attemptTimer.elapsed().minus(result.getBackendLatency())); + } + + @Override + public void onOperationFinish(VRpcResult result) { + metricRegistry.operationLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + result.getStatus().getCode(), + operationTimer.elapsed()); + metricRegistry.applicationBlockingLatency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + applicationBlockingLatency); + metricRegistry.firstResponseLantency.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + result.getStatus().getCode(), + firstResponsePerOpTimer.elapsed()); + metricRegistry.retryCount.record( + poolInfo.getClientInfo(), + poolInfo.getName(), + methodInfo, + lastClusterInfo, + result.getStatus().getCode(), + numAttempts - 1); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/CancellableVRpc.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/CancellableVRpc.java new file mode 100644 index 000000000000..ded284e1979c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/CancellableVRpc.java @@ -0,0 +1,74 @@ +/* + * Copyright 2026 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.internal.middleware; + +import com.google.common.util.concurrent.MoreExecutors; +import io.grpc.Context; +import io.grpc.Deadline; +import java.util.Optional; +import java.util.concurrent.TimeoutException; + +/** + * A {@link VRpc} decorator that propagates gRPC {@link Context} cancellation to the underlying + * VRpc. + */ +public class CancellableVRpc extends ForwardingVRpc { + private final Context context; + private final Context.CancellationListener cancellationListener; + + public CancellableVRpc(VRpc delegate, Context context) { + super(delegate); + this.context = context; + this.cancellationListener = + (c) -> { + boolean deadlineExceeded = + Optional.ofNullable(c.getDeadline()).map(Deadline::isExpired).orElse(false); + deadlineExceeded = deadlineExceeded && c.cancellationCause() instanceof TimeoutException; + // Let VRpc machinery handle deadline exceeded + if (!deadlineExceeded) { + delegate.cancel("gRPC context cancelled", c.cancellationCause()); + } + }; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + context.addListener(cancellationListener, MoreExecutors.directExecutor()); + super.start( + req, ctx, new CancellationCleanupListener<>(listener, context, cancellationListener)); + } + + private static class CancellationCleanupListener extends ForwardListener { + private final Context context; + private final Context.CancellationListener cancellationListener; + + private CancellationCleanupListener( + VRpcListener delegate, + Context context, + Context.CancellationListener cancellationListener) { + super(delegate); + this.context = context; + this.cancellationListener = cancellationListener; + } + + @Override + public void onClose(VRpcResult result) { + context.removeListener(cancellationListener); + super.onClose(result); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpc.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpc.java new file mode 100644 index 000000000000..05173e6a9ef9 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpc.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 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.internal.middleware; + +import javax.annotation.Nullable; + +/** Simple helper to delegate all calls to another {@link VRpc}. */ +public class ForwardingVRpc implements VRpc { + private final VRpc delegate; + + public ForwardingVRpc(VRpc delegate) { + this.delegate = delegate; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + delegate.start(req, ctx, listener); + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + delegate.cancel(message, cause); + } + + @Override + public void requestNext() { + delegate.requestNext(); + } + + public static class ForwardListener implements VRpc.VRpcListener { + private final VRpc.VRpcListener delegate; + + public ForwardListener(VRpcListener delegate) { + this.delegate = delegate; + } + + @Override + public void onMessage(RespT msg) { + delegate.onMessage(msg); + } + + @Override + public void onClose(VRpcResult result) { + delegate.onClose(result); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpc.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpc.java new file mode 100644 index 000000000000..9c36f6fcfec1 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpc.java @@ -0,0 +1,338 @@ +/* + * Copyright 2026 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.internal.middleware; + +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.common.base.Stopwatch; +import com.google.protobuf.Duration; +import com.google.protobuf.util.Durations; +import com.google.rpc.RetryInfo; +import io.grpc.Context; +import io.grpc.Status; +import io.grpc.SynchronizationContext; +import java.util.Optional; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +public class RetryingVRpc implements VRpc { + + private static final Logger LOG = Logger.getLogger(RetryingVRpc.class.getName()); + + private final Context grpcContext; + private final io.opentelemetry.context.Context otelContext; + + private final Supplier> attemptFactory; + private ReqT request; + private VRpcListener listener; + private VRpcCallContext context; + private VRpcTracer tracer; + + private final ScheduledExecutorService executor; + private final SynchronizationContext syncContext; + + // current state and all the flags don't need to be volatile because they're only updated within + // the sync context. + private State currentState; + private boolean started; + // Breaks the loop if uncaught exception happens during sync context execution. + private boolean isCancelling; + + public RetryingVRpc(Supplier> supplier, ScheduledExecutorService executor) { + this.attemptFactory = supplier; + + grpcContext = Context.current(); + otelContext = io.opentelemetry.context.Context.current(); + + this.executor = otelContext.wrap(executor); + this.syncContext = + new SynchronizationContext( + (t, e) -> { + this.cancel( + "Unexpected error while notifying the caller of RetryingVRpc. Trying to cancel vRpc to ensure consistent state", + e); + }); + + started = false; + isCancelling = false; + this.currentState = new Idle(); + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + syncContext.execute( + () -> { + if (started) { + listener.onClose( + VRpcResult.createRejectedError( + Status.FAILED_PRECONDITION.withDescription("operation is already started"))); + return; + } + started = true; + + this.request = req; + this.listener = listener; + this.context = ctx; + this.tracer = context.getTracer(); + + tracer.onOperationStart(); + currentState.onStart(); + }); + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + syncContext.execute( + () -> { + if (currentState.isDone() || isCancelling) { + LOG.fine("Ignoring cancel because the vRPC is already cancelled or done."); + return; + } + // Prevents infinite loop if there's any error thrown during this phase. + isCancelling = true; + Throwable finalCause = cause; + try { + currentState.onCancel(message, cause); + } catch (Throwable t) { + if (finalCause != null) { + finalCause.addSuppressed(t); + } else { + finalCause = t; + } + } + onStateChange( + new Done( + VRpcResult.createRejectedError( + Status.CANCELLED.withDescription(message).withCause(finalCause)))); + }); + } + + @Override + public void requestNext() { + throw new UnsupportedOperationException("request next is not supported in unary"); + } + + void onStateChange(State state) { + syncContext.throwIfNotInThisSynchronizationContext(); + if (currentState.isDone()) { + return; + } + this.currentState = state; + currentState.onStart(); + } + + abstract static class State { + public abstract void onStart(); + + public void onCancel(String reason, Throwable throwable) {} + + public boolean isDone() { + return false; + } + } + + class Idle extends State { + + @Override + public void onStart() { + // initial request and retries will all start in idle state. + // TODO: When stream is supported we only transition to active state when + // caller is requesting more. And this should be part of the attempt time and app blocking + // time. + Active active = new Active(); + onStateChange(active); + } + } + + class Active extends State { + + private VRpc attempt; + + @Override + public void onStart() { + attempt = attemptFactory.get(); + tracer.onAttemptStart(request); + attempt.start( + request, + context, + new VRpcListener() { + @Override + public void onMessage(RespT msg) { + syncContext.execute( + () -> { + if (currentState != Active.this) { + LOG.log( + Level.FINE, + "Discarding response {0} because the attempt is no longer active.", + msg); + return; + } + tracer.onResponseReceived(); + Stopwatch appTimer = Stopwatch.createStarted(); + try { + listener.onMessage(msg); + } finally { + tracer.recordApplicationBlockingLatencies(appTimer.elapsed()); + } + }); + } + + @Override + public void onClose(VRpcResult result) { + syncContext.execute( + () -> { + tracer.onAttemptFinish(result); + if (currentState != Active.this) { + LOG.log( + Level.FINE, + "Discarding server close with result {0} because the the attempt is no longer active.", + result); + return; + } + if (shouldRetry(result)) { + context = context.createForNextAttempt(); + Duration retryDelay = + Optional.ofNullable(result.getRetryInfo()) + .map(RetryInfo::getRetryDelay) + .orElse(Durations.ZERO); + if (Durations.compare(retryDelay, Durations.ZERO) > 0) { + Scheduled scheduled = new Scheduled(retryDelay); + onStateChange(scheduled); + } else { + onStateChange(new Idle()); + } + return; + } + + onStateChange(new Done(result)); + }); + } + }); + } + + @Override + public void onCancel(String reason, Throwable throwable) { + // attempt could be null if attemptFactory.get() throws an exception. In which case sync + // context uncaught exception handler will be called, which calls cancel on the current + // state before transition into done state. + if (attempt != null) { + attempt.cancel(reason, throwable); + } + } + + boolean shouldRetry(VRpcResult result) { + // If the error has RetryInfo, it means it comes from the server and should + // be retried. + if (!result.getStatus().isOk() + && result.getRetryInfo() != null + && result.getRetryInfo().hasRetryDelay()) { + long retryDelay = Durations.toMillis(result.getRetryInfo().getRetryDelay()); + // only schedule retry if there's still a chance for the request to succeed + return context.getOperationInfo().getDeadline().timeRemaining(TimeUnit.MILLISECONDS) + - retryDelay + > 1; + } + // Do not retry result that is explicitly rejected + if (result.getRejected()) { + return false; + } + // If the error didn't leave the client or failed in transport and is idempotent, we + // can retry up to 3 times. + boolean isRetryable = + (result.getState() == VRpcResult.State.UNCOMMITED) + || (context.getOperationInfo().isIdempotent() + && result.getState() == VRpcResult.State.TRANSPORT_FAILURE); + if (isRetryable && context.getOperationInfo().getAttemptNumber() < 3) { + return true; + } + return false; + } + } + + class Scheduled extends State { + private final Duration retryDelay; + private SynchronizationContext.ScheduledHandle future; + + Scheduled(Duration retryDelay) { + this.retryDelay = retryDelay; + } + + @Override + public void onStart() { + try { + future = + syncContext.schedule( + () -> grpcContext.wrap(() -> onStateChange(new Idle())).run(), + Durations.toMillis(retryDelay), + TimeUnit.MILLISECONDS, + executor); + } catch (RejectedExecutionException e) { + onStateChange( + new Done( + VRpcResult.createRejectedError( + Status.CANCELLED + .withDescription( + "Executor shutting down, can't schedule operation for retry.") + .withCause(e)))); + } + } + + @Override + public void onCancel(String reason, Throwable throwable) { + // future can be null if schedule throws an exception that's not RejectedExecutionException. + // In which case sync context uncaught exception handler will be called, which calls cancel on + // the current + // state before transition into done state. + if (future != null && future.isPending()) { + future.cancel(); + } + } + } + + class Done extends State { + + private final VRpcResult result; + + Done(VRpcResult result) { + this.result = result; + } + + @Override + public void onStart() { + if (!started) { + LOG.fine("operation is not started yet."); + return; + } + Stopwatch appTimer = Stopwatch.createStarted(); + try { + listener.onClose(result); + } finally { + tracer.recordApplicationBlockingLatencies(appTimer.elapsed()); + tracer.onOperationFinish(result); + } + } + + @Override + public boolean isDone() { + return true; + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpc.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpc.java new file mode 100644 index 000000000000..a29a51fd72c6 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpc.java @@ -0,0 +1,328 @@ +/* + * Copyright 2026 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.internal.middleware; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Ticker; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.Any; +import com.google.rpc.RetryInfo; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.protobuf.StatusProto; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * Internal Bigtable representation of an RPC. + * + *

The primary intent is to model the RPC as a chain of composable middleware. This abstraction + * models Unary and ServerStreaming style RPCs by generalizing them as ServerStreaming. + */ +public interface VRpc { + + /** + * Start the RPC and send the request message. + * + *

This must be called before any other method on this object. The {@code listener} will be + * notified of the results. Please note, that the first response of the response stream will be + * delivered by default. + */ + void start(ReqT req, VRpcCallContext ctx, VRpcListener listener); + + /** Cancel a started RPC. This will be done by best effort. */ + void cancel(@Nullable String message, @Nullable Throwable cause); + + /** + * TBD - server streaming rpcs. This will be used to request more data. Unlike gRPC's request(n), + * starting a call will implicitly request the first message. + */ + void requestNext(); + + /** + * Bigtable specific version of ClientCall.Listener - simplified to only cater to client unary + * RPCs. Methods on this class are guaranteed to be called sequentially. + */ + interface VRpcListener { + + /** Called when the next response message is the received. */ + void onMessage(RespT msg); + + /** Called when the vRPC completes. */ + void onClose(VRpcResult result); + } + + /** vRPC side band data. */ + // TODO: set grpc deadline on callOptions or context + @AutoValue + abstract class VRpcCallContext { + + private static final Logger logger = Logger.getLogger(VRpcCallContext.class.getName()); + + /** Retry related metadata. */ + public abstract OperationInfo getOperationInfo(); + + /** The TraceId of the caller. */ + public abstract String getTraceParent(); + + public abstract VRpcTracer getTracer(); + + // TODO: csm + // Clientside metrics instrument + // public abstract BigtableTracer getTracer(); + + public static VRpcCallContext create( + Deadline deadline, boolean isIdempotent, VRpcTracer tracer) { + + Deadline grpcContextDeadline = Context.current().getDeadline(); + + Duration operationTimeout; + if (grpcContextDeadline != null && grpcContextDeadline.isBefore(deadline)) { + logger.log( + Level.FINE, + "grpc Context deadline {} is shorter than VrpcCallContext deadline {}", + new Object[] {grpcContextDeadline, deadline}); + operationTimeout = + Duration.ofNanos(grpcContextDeadline.timeRemaining(TimeUnit.NANOSECONDS)); + } else { + operationTimeout = Duration.ofNanos(deadline.timeRemaining(TimeUnit.NANOSECONDS)); + } + + return new AutoValue_VRpc_VRpcCallContext( + OperationInfo.create(operationTimeout, isIdempotent), "TODO", tracer); + } + + public VRpcCallContext createForNextAttempt() { + return new AutoValue_VRpc_VRpcCallContext( + getOperationInfo().createForNextAttempt(), getTraceParent(), getTracer()); + } + } + + /** Sideband data required for retries and/or hedging. */ + @AutoValue + abstract class OperationInfo { + /** + * Monotonically increasing number of retry attempt per operation. Starts with 0 for the + * original attempt. + */ + public abstract int getAttemptNumber(); + + /** + * When the caller started the operation (ie. when the first attempt was sent). This is the + * machine time. + */ + abstract long getOperationStartTickNs(); + + /** + * Original timeout of the operation (OperationStart + OperationTimeout = original deadline). + */ + public abstract Duration getOperationTimeout(); + + /** If it's safe to retry the vRPC after its been commited. */ + public abstract boolean isIdempotent(); + + abstract Ticker getTicker(); + + public Deadline getDeadline() { + return Deadline.after( + getOperationTimeout().toNanos() + getOperationStartTickNs() - getTicker().read(), + TimeUnit.NANOSECONDS); + } + + /** Create a new copy of the {@link OperationInfo} for the next retry/heding attempt. */ + public OperationInfo createForNextAttempt() { + return new AutoValue_VRpc_OperationInfo( + getAttemptNumber() + 1, + getOperationStartTickNs(), + getOperationTimeout(), + isIdempotent(), + getTicker()); + } + + /** Create new {@link OperationInfo} for the first attempt. */ + public static OperationInfo create(Duration operationTimeout, boolean isIdempotent) { + return create(Ticker.systemTicker(), operationTimeout, isIdempotent); + } + + @VisibleForTesting + static OperationInfo create(Ticker ticker, Duration operationTimeout, boolean isIdempotent) { + return new AutoValue_VRpc_OperationInfo( + 0, ticker.read(), operationTimeout, isIdempotent, ticker); + } + } + + /** Represents the final state of a vRPC. */ + @AutoValue + abstract class VRpcResult { + /** + * Describes how far the vRPC progressed prior to failure: + * + *

+ *
{@code UNCOMMITED} + *
The vRPC never left the client + *
{@code TRANSPORT_FAILURE} + *
The vRPC failed due to transport + *
{@code SERVER_RESULT} + *
The vRPC result was explicitly communicated by the server + *
{@code USER_FAILURE} + *
The vRPC failed due to errors in users callback + *
+ */ + public enum State { + UNCOMMITED, + TRANSPORT_FAILURE, + SERVER_RESULT, + USER_FAILURE + } + + /** + * How far the vRPC progressed before reaching terminal state. + * + * @see State + */ + public abstract State getState(); + + public abstract Status getStatus(); + + /** The status details. */ + @Nullable + protected abstract List getDetails(); + + /** + * Side channel metadata for client side metrics - describes the cluster that handled the + * request. + */ + @Nullable + public abstract ClusterInformation getClusterInfo(); + + /** Latency returned in SessionRequestStats. */ + public abstract Duration getBackendLatency(); + + /** Server directed retries. */ + // Server directed retries + @Nullable + public abstract RetryInfo getRetryInfo(); + + /** If the vrpc should be rejected for retry. */ + public abstract boolean getRejected(); + + public static VRpcResult createUncommitedError(Status status) { + return new AutoValue_VRpc_VRpcResult( + State.UNCOMMITED, status, ImmutableList.of(), null, Duration.ZERO, null, false); + } + + public static VRpcResult createRejectedError(Status status) { + return new AutoValue_VRpc_VRpcResult( + State.UNCOMMITED, status, ImmutableList.of(), null, Duration.ZERO, null, true); + } + + /** + * vRPC failed because the underlying transport failed. We don't know if the vRPC made it to the + * nodes, so we must assume complete uncertainty. + */ + public static VRpcResult createRemoteTransportError(Status transportStatus, Metadata trailers) { + Status status = Status.UNAVAILABLE.withDescription("vRPC failed due to transport error"); + + if (transportStatus.getCause() != null) { + status = status.withCause(transportStatus.getCause()); + } else { + status = + status.augmentDescription( + String.format( + "Transport error: %s: %s", + transportStatus.getCode(), transportStatus.getDescription())); + } + + List details = + StatusProto.fromStatusAndTrailers(transportStatus, trailers).getDetailsList(); + + return new AutoValue_VRpc_VRpcResult( + // TODO: need clusterInfo + State.TRANSPORT_FAILURE, status, details, null, Duration.ZERO, null, false); + } + + /** + * vRPC failed because the underlying transport failed. We don't know if the the vRPC made it to + * the nodes, so we must assume complete uncertainty. + */ + public static VRpcResult createLocalTransportError(Status status) { + return new AutoValue_VRpc_VRpcResult( + State.TRANSPORT_FAILURE, status, null, null, Duration.ZERO, null, false); + } + + public static VRpcResult createUserError(Throwable throwable) { + return new AutoValue_VRpc_VRpcResult( + State.USER_FAILURE, + Status.CANCELLED + .withCause(throwable) + .withDescription("Cancelling RPC due to exception thrown by user callback"), + ImmutableList.of(), + null, + Duration.ZERO, + // TODO: use server retry delay if available + null, + true); + } + + /** Wrap an OK from the server. */ + public static VRpcResult createServerOk(VirtualRpcResponse r) { + return new AutoValue_VRpc_VRpcResult( + State.SERVER_RESULT, + Status.OK, + ImmutableList.of(), + normalizeClusterInfo(r.getClusterInfo()), + Duration.ofSeconds( + r.getStats().getBackendLatency().getSeconds(), + r.getStats().getBackendLatency().getNanos()), + null, + false); + } + + /** Wrap the error response from the server. */ + public static VRpcResult createServerError(ErrorResponse r) { + Status grpcStatus = + Status.fromCodeValue(r.getStatus().getCode()).withDescription(r.getStatus().getMessage()); + return new AutoValue_VRpc_VRpcResult( + State.SERVER_RESULT, + grpcStatus, + r.getStatus().getDetailsList(), + normalizeClusterInfo(r.getClusterInfo()), + Duration.ZERO, + r.getRetryInfo(), + false); + } + + @Nullable + private static ClusterInformation normalizeClusterInfo(ClusterInformation clusterInformation) { + if (ClusterInformation.getDefaultInstance().equals(clusterInformation)) { + return null; + } + return clusterInformation; + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/DynamicPicker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/DynamicPicker.java new file mode 100644 index 000000000000..664f8e64657a --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/DynamicPicker.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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 + * + * http://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.internal.session; + +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * A Picker that delegates to a concrete Picker implementation based on the current configuration. + */ +class DynamicPicker extends Picker { + private static final Logger LOGGER = Logger.getLogger(DynamicPicker.class.getName()); + private final SessionList sessions; + + private volatile Picker delegate; + private LoadBalancingOptions.LoadBalancingStrategyCase currentStrategy; + + public DynamicPicker( + SessionList sessions, LoadBalancingOptions.LoadBalancingStrategyCase initialStrategy) { + this.sessions = sessions; + this.currentStrategy = initialStrategy; + this.delegate = createPicker(initialStrategy); + } + + @Override + public Optional pickSession() { + return delegate.pickSession(); + } + + public void updateConfig(SessionClientConfiguration.SessionPoolConfiguration config) { + LoadBalancingOptions.LoadBalancingStrategyCase newStrategy = + config.getLoadBalancingOptions().getLoadBalancingStrategyCase(); + if (newStrategy != currentStrategy) { + delegate = createPicker(newStrategy); + currentStrategy = newStrategy; + } + } + + private Picker createPicker(LoadBalancingOptions.LoadBalancingStrategyCase strategy) { + switch (strategy) { + case RANDOM: + return new SimplePicker(sessions); + case LEAST_IN_FLIGHT: + return new LeastInFlightPicker(sessions); + default: + LOGGER.log( + Level.FINE, "got load balancing strategy {0} which was not implemented", strategy); + // TODO: implement PeakEwma + return new LeastInFlightPicker(sessions); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastInFlightPicker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastInFlightPicker.java new file mode 100644 index 000000000000..8a3e195b1fdb --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/LeastInFlightPicker.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.AfeHandle; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ThreadLocalRandom; + +/** Pick the AFE with the fewest in-flight requests. Experimental for now. */ +class LeastInFlightPicker extends Picker { + private final SessionList sessionList; + + public LeastInFlightPicker(SessionList sessionList) { + this.sessionList = sessionList; + } + + @Override + Optional pickSession() { + List readyAfes = sessionList.getAfesWithReadySessions(); + int size = readyAfes.size(); + + if (size == 0) { + return Optional.empty(); + } + + ThreadLocalRandom random = ThreadLocalRandom.current(); + AfeHandle selected = readyAfes.get(random.nextInt(size)); + + // If we have options, pick a second candidate and keep the better one + if (size > 1) { + AfeHandle candidate2 = readyAfes.get(random.nextInt(size)); + if (candidate2.getNumOutstanding() < selected.getNumOutstanding()) { + selected = candidate2; + } + } + + return sessionList.checkoutSession(selected); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Picker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Picker.java new file mode 100644 index 000000000000..ce4bc5a68c98 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Picker.java @@ -0,0 +1,24 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.Optional; + +abstract class Picker { + abstract Optional pickSession(); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizer.java new file mode 100644 index 000000000000..01a83a661486 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizer.java @@ -0,0 +1,108 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.PoolStats; +import com.google.rpc.Status; +import javax.annotation.CheckReturnValue; + +class PoolSizer { + + // Fraction of idle sessions to keep in order to manage an increase in requests-in-flight. For + // example, a headroom of 50% will keep enough sessions to deal with a 50% increase in QPS or a + // 50% increase in latency (since that also increases requests-in-flight). + private volatile float idlesSessionHeadRoom; + private volatile int minIdleSessions; + private volatile int maxIdleSessions; + + private final PoolStats stats; + private final Sized pendingRpcs; + + // This resolves cold start overprovisioning issue. + // Session creation sometimes involves creating new connection and warming the backend. + // So it takes time, but accumulated vRPCs may be processed rather quickly as simple + // point reads are expected to complete within 1-4ms. + // We assume that it is okay to collect 10 pending calls per starting session so that after + // the session is ready it takes 10-40ms to process all pending calls. + private volatile int pendingVRpcsPerSession; + + interface Sized { + int getSize(); + } + + PoolSizer( + PoolStats stats, + Sized pendingRpcs, + SessionClientConfiguration.SessionPoolConfiguration poolConfig) { + this.stats = stats; + this.pendingRpcs = pendingRpcs; + + this.idlesSessionHeadRoom = poolConfig.getHeadroom(); + this.minIdleSessions = poolConfig.getMinSessionCount(); + this.maxIdleSessions = poolConfig.getMaxSessionCount(); + this.pendingVRpcsPerSession = poolConfig.getNewSessionQueueLength(); + } + + void updateConfig(SessionClientConfiguration.SessionPoolConfiguration poolConfiguration) { + this.idlesSessionHeadRoom = poolConfiguration.getHeadroom(); + this.minIdleSessions = poolConfiguration.getMinSessionCount(); + this.maxIdleSessions = poolConfiguration.getMaxSessionCount(); + this.pendingVRpcsPerSession = poolConfiguration.getNewSessionQueueLength(); + } + + public int getScaleDelta() { + // Assume each session handles 1 RPC at a time. This should be revisited if sessions get + // support for multiplexing. + int effectivePending = (int) Math.ceil((float) pendingRpcs.getSize() / pendingVRpcsPerSession); + int sessionsInUse = effectivePending + stats.getInUseCount(); + int unboundedDesiredIdleSessions = (int) Math.ceil(sessionsInUse * idlesSessionHeadRoom); + int desiredIdleSessions = + Math.max(Math.min(unboundedDesiredIdleSessions, maxIdleSessions), minIdleSessions); + + int desiredCapacity = sessionsInUse + desiredIdleSessions; + int eventualCapacity = stats.getExpectedCapacity(); + int immediateCapacity = eventualCapacity - stats.getStartingCount(); + + if (desiredCapacity < immediateCapacity) { + return desiredCapacity - immediateCapacity; + } else if (desiredCapacity > eventualCapacity) { + return desiredCapacity - eventualCapacity; + } else { + return 0; + } + } + + /** Returns true if the session should be replaced */ + @CheckReturnValue + public boolean handleGoAway(GoAwayResponse msg) { + return getScaleDelta() >= 0; + } + + /** Returns true if the closed session should be replaced */ + @CheckReturnValue + boolean handleSessionClose(Status statusProto) { + return getScaleDelta() >= 0; + } + + /** Returns true if a new session should be added. */ + @CheckReturnValue + boolean handleNewCall() { + return getScaleDelta() > 0; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Session.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Session.java new file mode 100644 index 000000000000..35f8f98bc571 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/Session.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.protobuf.Message; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Instant; + +/** + * A Bigtable abstraction over a bidirectional {@link io.grpc.ClientCall} to treat it as a stateful + * vRPC transport. + */ +public interface Session { + /** State transitions of Session, will happen in defined order */ + enum SessionState { + NEW(0), + STARTING(1), + READY(2), + CLOSING(3), + WAIT_SERVER_CLOSE(4), + CLOSED(5); + + final int phase; + + SessionState(int phase) { + this.phase = phase; + } + } + + @AutoValue + abstract class OpenParams { + abstract Metadata metadata(); + + abstract OpenSessionRequest request(); + + static OpenParams create(Metadata metadata, OpenSessionRequest request) { + return new AutoValue_Session_OpenParams(metadata, request); + } + + OpenParams withResetConsecutiveAttempt() { + return new AutoValue_Session_OpenParams( + metadata(), request().toBuilder().setConsecutiveFailedConnectionAttempts(0).build()); + } + + OpenParams withIncrementedAttempts() { + return new AutoValue_Session_OpenParams( + metadata(), + request().toBuilder() + .setConsecutiveFailedConnectionAttempts( + request().getConsecutiveFailedConnectionAttempts() + 1) + .build()); + } + } + + SessionState getState(); + + Instant getLastStateChange(); + + OpenParams getOpenParams(); + + boolean isOpenParamsUpdated(); + + PeerInfo getPeerInfo(); + + String getLogName(); + + Instant getNextHeartbeat(); + + /** + * Start the session by sending the opening message. + * + *

This must be the first method called on the {@link Session}. It will try setup a session + * using the req (for the server) and headers (for rls). + */ + void start(OpenSessionRequest req, Metadata headers, Listener sessionListener); + + /** + * Caller instructed close of the Session. Will immediately close the session and abort all + * outstanding vRPCs. + */ + void close(CloseSessionRequest req); + + /** Force close a session. */ + void forceClose(CloseSessionRequest reason); + + /** + * Start a new vRPC. This method can only be called after {@link + * Listener#onReady(OpenSessionResponse)} has been notified. + */ + VRpc newCall( + VRpcDescriptor descriptor) throws IllegalStateException; + + /** Callback for Session lifecycyle transitions. Methods are called sequentially. */ + interface Listener { + + void onReady(OpenSessionResponse msg); + + void onGoAway(GoAwayResponse msg); + + void onClose(SessionState prevState, Status status, Metadata trailers); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudget.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudget.java new file mode 100644 index 000000000000..bfa8dd2213a9 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudget.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.common.annotations.VisibleForTesting; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.concurrent.NotThreadSafe; + +@NotThreadSafe +class SessionCreationBudget { + private static final Logger DEFAULT_LOGGER = + Logger.getLogger(SessionCreationBudget.class.getName()); + + // TODO: add a metric for session can't be created because there's no budget + private volatile int maxConcurrentRequest; + private volatile Duration penalty; + private final Clock clock; + + private int concurrentRequests = 0; + + // Whenever a session creation failed, add the time to the list + private final List delayedCreationTokens = new ArrayList<>(); + + static SessionCreationBudget create(int max, Duration penalty) { + return new SessionCreationBudget(max, penalty, Clock.systemUTC()); + } + + @VisibleForTesting + SessionCreationBudget(int max, Duration penalty, Clock clock) { + this.maxConcurrentRequest = max; + this.penalty = penalty; + this.clock = clock; + } + + Instant getNextAvailableBudget() { + if (concurrentRequests < maxConcurrentRequest) { + return Instant.now(); + } + + if (delayedCreationTokens.isEmpty()) { + return Instant.now(); + } + + return delayedCreationTokens.get(0); + } + + boolean tryReserveSession() { + sanityCheck(); + + if (concurrentRequests == maxConcurrentRequest) { + drainCreationFailures(); + } + + if (concurrentRequests == maxConcurrentRequest) { + return false; + } + + concurrentRequests++; + return true; + } + + void onSessionCreationFailure() { + delayedCreationTokens.add(Instant.now(clock).plus(penalty)); + } + + void onSessionCreationSuccess() { + concurrentRequests--; + } + + private void drainCreationFailures() { + Instant now = Instant.now(clock); + Iterator iter = delayedCreationTokens.listIterator(); + while (iter.hasNext()) { + if (iter.next().isBefore(now)) { + concurrentRequests--; + iter.remove(); + } else { + // The list should be roughly sorted. Exit early when we encounter + // something expires later. + break; + } + } + } + + private void sanityCheck() { + // This could happen if the budget is updated + if (concurrentRequests < 0) { + DEFAULT_LOGGER.log( + Level.FINE, + "concurrent request can't be negative: {0}. Resetting it to 0.", + concurrentRequests); + concurrentRequests = 0; + } + if (concurrentRequests > maxConcurrentRequest) { + DEFAULT_LOGGER.log( + Level.FINE, + "Concurrent requests out of range: {0}. Resetting it to max.", + concurrentRequests); + concurrentRequests = maxConcurrentRequest; + } + } + + public int getMaxConcurrentRequest() { + return maxConcurrentRequest; + } + + void updateConfig(SessionClientConfiguration.SessionPoolConfiguration config) { + int oldBudget = this.maxConcurrentRequest; + this.maxConcurrentRequest = config.getNewSessionCreationBudget(); + this.penalty = SessionUtil.toJavaDuration(config.getNewSessionCreationPenalty()); + DEFAULT_LOGGER.log( + Level.FINE, + "updated session creation budget from {0} to {1}.", + new Object[] {oldBudget, config.getNewSessionCreationBudget()}); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionFactory.java new file mode 100644 index 000000000000..20246775b6cb --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionFactory.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import io.grpc.CallOptions; +import io.grpc.MethodDescriptor; + +/** Wrapper around a channel to centralize per call session customizations. */ +public final class SessionFactory { + private final ChannelPool channelPool; + private final MethodDescriptor methodDescriptor; + private final CallOptions callOptions; + + public SessionFactory( + ChannelPool channelPool, + MethodDescriptor methodDescriptor, + CallOptions callOptions) { + this.channelPool = channelPool; + this.methodDescriptor = methodDescriptor; + this.callOptions = callOptions; + } + + public SessionStream createNew() { + return channelPool.newStream(methodDescriptor, callOptions); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImpl.java new file mode 100644 index 000000000000..9cd58da876d2 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImpl.java @@ -0,0 +1,689 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.HeartbeatResponse; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionParametersResponse; +import com.google.bigtable.v2.SessionRefreshConfig; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.bigtable.v2.VirtualRpcRequest; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.SessionTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcImpl.VRpcSessionApi; +import com.google.common.annotations.VisibleForTesting; +import com.google.protobuf.Message; +import com.google.protobuf.TextFormat; +import com.google.protobuf.util.Durations; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.Locale; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +/** Wraps a Bidi ClientCall and layers session semantics on top. */ +@VisibleForTesting +public class SessionImpl implements Session, VRpcSessionApi { + private static final Logger DEFAULT_LOGGER = Logger.getLogger(SessionImpl.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + private static final SessionParametersResponse DEFAULT_SESSION_PARAMS = + SessionParametersResponse.newBuilder().setKeepAlive(Durations.fromMillis(100)).build(); + + static final Duration HEARTBEAT_CHECK_INTERVAL = + Duration.ofMillis(Durations.toMillis(DEFAULT_SESSION_PARAMS.getKeepAlive())); + + @VisibleForTesting + // A time in the future to skip heartbeat checks when there's no active vRPCs on the session + static final Duration FUTURE_TIME = Duration.ofMinutes(30); + + /* + * This lock should be mostly uncontended - all access should be naturally interleaved. Contention + * can only really happen when an unsolicited gRPC control message (ie GOAWAY) arrives at the same + * time as newCall or cancel. + * TODO: Contention will increase when multiplexing is implemented. + */ + private final Object lock = new Object(); + + private final Clock clock; + + private final SessionTracer tracer; + private final DebugTagTracer debugTagTracer; + + private final SessionInfo info; + + @GuardedBy("lock") + private final SessionStream stream; + + @GuardedBy("lock") + private SessionState state = SessionState.NEW; + + @GuardedBy("lock") + private Instant lastStateChangedAt; + + private Listener sessionListener; + + private volatile OpenParams openParams; + + private volatile boolean openParamsUpdated; + + @Nullable private CloseSessionRequest closeReason = null; + + @GuardedBy("lock") + private long nextRpcId = 1; + + // TODO: replace with a map when implementing multiplexing + @GuardedBy("lock") + private VRpcImpl currentRpc = null; + + @GuardedBy("lock") + private VRpcResult currentCancel = null; + + private SessionParametersResponse sessionParameters = DEFAULT_SESSION_PARAMS; + private Duration heartbeatInterval = + Duration.ofMillis(Durations.toMillis(sessionParameters.getKeepAlive())); + + private volatile Instant nextHeartbeat; + + public SessionImpl( + Metrics metrics, SessionPoolInfo poolInfo, long sessionNum, SessionStream stream) { + this(metrics, Clock.systemUTC(), poolInfo, sessionNum, stream); + } + + SessionImpl( + Metrics metrics, + Clock clock, + SessionPoolInfo poolInfo, + long sessionNum, + SessionStream stream) { + this.clock = clock; + this.info = SessionInfo.create(poolInfo, sessionNum); + this.stream = stream; + this.tracer = metrics.newSessionTracer(poolInfo); + this.debugTagTracer = metrics.getDebugTagTracer(); + this.nextHeartbeat = clock.instant().plus(FUTURE_TIME); + this.openParamsUpdated = false; + } + + @Override + public SessionState getState() { + synchronized (lock) { + return state; + } + } + + @Override + public Instant getLastStateChange() { + synchronized (lock) { + return lastStateChangedAt; + } + } + + @Override + public OpenParams getOpenParams() { + return openParams; + } + + @Override + public boolean isOpenParamsUpdated() { + return openParamsUpdated; + } + + @Override + public Instant getNextHeartbeat() { + return nextHeartbeat; + } + + @Override + public PeerInfo getPeerInfo() { + // This lock might not be necessary, its populated once on a gRPC callback which should + // establish a happens before relationship. However access to the underlying stream is guarded + // with errorprone, so sync block is required to get around the lint. + // TODO: consider removing the sync block + synchronized (lock) { + return stream.getPeerInfo(); + } + } + + @Override + public String getLogName() { + return info.getLogName(); + } + + @Override + public void forceClose(CloseSessionRequest closeReason) { + synchronized (lock) { + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_force_close_wrong_state", + "Tried to forceClose an unstarted session %s in state %s", + info.getLogName(), + state); + + if (state == SessionState.CLOSED) { + return; + } + + updateState(SessionState.WAIT_SERVER_CLOSE); + this.closeReason = closeReason; + + // Not sending the CloseSessionRequest because cancel() will just drop it + stream.forceClose(closeReason.getDescription(), null); + // Listeners will be notified by dispatchStreamClosed + } + } + + @Override + public void start(OpenSessionRequest req, Metadata headers, Listener sessionListener) { + synchronized (lock) { + debugTagTracer.checkPrecondition( + state == SessionState.NEW, + "session_start_wrong_state", + "Tried to start a started session, current state: %s", + state); + + logger.fine(String.format("Starting session %s", info.getLogName())); + tracer.onStart(); + + updateState(SessionState.STARTING); + openParams = OpenParams.create(headers, req); + this.sessionListener = sessionListener; + + SessionRequest wrappedReq = SessionRequest.newBuilder().setOpenSession(req).build(); + stream.start( + new SessionStream.Listener() { + @Override + public void onBeforeSessionStart(PeerInfo peerInfo) {} + + @Override + public void onMessage(SessionResponse message) { + dispatchResponseMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + dispatchStreamClosed(status, trailers); + } + }, + headers); + + stream.sendMessage(wrappedReq); + } + } + + @Override + public void close(CloseSessionRequest req) { + logger.fine(String.format("Closing session %s for reason: %s", info.getLogName(), req)); + + synchronized (lock) { + // Throw an exception because this is a bug and we dont have a listener + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_close_wrong_state", + "Session error: Caller tried to close session %s before starting it with the reason: %s", + info.getLogName(), + req); + + // Multiple close is a no-op + if (state.phase >= SessionState.CLOSING.phase) { + logger.fine( + String.format( + "Session error: Caller tried to close a session %s that is %s for reason: %s", + info.getLogName(), state, req)); + return; + } + + closeReason = req; + updateState(SessionState.CLOSING); + + if (currentRpc == null) { + startGracefulClose(); + } + } + } + + /** Wraps the flow of closing a session. */ + @GuardedBy("lock") + private void startGracefulClose() { + debugTagTracer.checkPrecondition( + state == SessionState.CLOSING, + "session_graceful_close_wrong_state", + "Session error: %s tried to actuate session closing when not in the correct state. State: %s", + info.getLogName(), + state); + + // TODO: send metrics + updateState(SessionState.WAIT_SERVER_CLOSE); + + // Should never happen + if (closeReason == null) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_close_no_reason"); + logger.log( + Level.WARNING, + String.format("%s graceful shutdown started without a reason", info.getLogName()), + new IllegalStateException("Tried to close a session without a reason")); + // Synthesize a reason so that we let the server know of the problem instead + closeReason = + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_ERROR) + .setDescription("Started graceful shutdown close without a reason set") + .build(); + } + stream.sendMessage(SessionRequest.newBuilder().setCloseSession(closeReason).build()); + // TODO: remove this after the server is updated + stream.halfClose(); + } + + @Override + public + VRpc newCall(VRpcDescriptor descriptor) { + debugTagTracer.checkPrecondition( + descriptor.getSessionDescriptor().getType() == info.getPoolInfo().getType(), + "session_new_call_wrong_type", + "wrong VRpc descriptor type"); + + synchronized (lock) { + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_new_call_wrong_state", + "Session error: newCall called before start"); + + long rpcId = nextRpcId; + nextRpcId = Math.incrementExact(nextRpcId); + return new VRpcImpl<>(this, descriptor, rpcId, stream.getPeerInfo()); + } + } + + @Override + public Status startRpc(VRpcImpl rpc, VirtualRpcRequest payload) { + // start monitoring for heartbeat when the vrpc is started + this.nextHeartbeat = clock.instant().plus(heartbeatInterval); + + synchronized (lock) { + if (currentRpc != null) { + return Status.INTERNAL.withDescription( + "Session error: RPC multiplexing is not yet supported"); + } + if (state != SessionState.READY) { + return Status.INTERNAL.withDescription( + "Session error: Session was not ready, state = " + state); + } + + this.currentRpc = rpc; + stream.sendMessage(SessionRequest.newBuilder().setVirtualRpc(payload).build()); + return Status.OK; + } + } + + @Override + public void cancelRpc(long rpcId, @Nullable String message, @Nullable Throwable cause) { + synchronized (lock) { + if (currentRpc != null && rpcId == currentRpc.rpcId) { + currentCancel = + VRpcResult.createRejectedError( + Status.CANCELLED.withDescription(message).withCause(cause)); + } + // do nothing if the rpc is already finished + } + } + + // region SessionStream event handlers + private void dispatchResponseMessage(SessionResponse message) { + switch (message.getPayloadCase()) { + case OPEN_SESSION: + handleOpenSessionResponse(message.getOpenSession()); + break; + case SESSION_PARAMETERS: + handleSessionParamsResponse(message.getSessionParameters()); + break; + case GO_AWAY: + handleGoAwayResponse(message.getGoAway()); + break; + case VIRTUAL_RPC: + handleVRpcResponse(message.getVirtualRpc()); + break; + case HEARTBEAT: + handleHeartBeatResponse(message.getHeartbeat()); + break; + case SESSION_REFRESH_CONFIG: + handleSessionRefreshConfigResponse(message.getSessionRefreshConfig()); + break; + case ERROR: + handleVRpcErrorResponse(message.getError()); + break; + case PAYLOAD_NOT_SET: + default: + handleUnknownResponseMessage(message); + } + } + + private void handleOpenSessionResponse(OpenSessionResponse openSession) { + logger.fine(String.format("%s Session is ready", info.getLogName())); + + PeerInfo localPeerInfo; + + synchronized (lock) { + debugTagTracer.checkPrecondition( + state != SessionState.NEW, + "session_open_wrong_state", + "Got session open response before session started"); + debugTagTracer.checkPrecondition( + state != SessionState.CLOSED, + "session_open_wrong_state", + "Got session open response after session was closed"); + + if (state != SessionState.STARTING) { + logger.fine(String.format("Stream was already %s when session open was received", state)); + return; + } + localPeerInfo = stream.getPeerInfo(); + updateState(SessionState.READY); + } + tracer.onOpen(localPeerInfo); + sessionListener.onReady(openSession); + } + + private void handleSessionParamsResponse(SessionParametersResponse resp) { + synchronized (lock) { + if (state.phase >= SessionState.CLOSING.phase) { + logger.fine( + String.format("Stream was already %s when session params were received", state)); + return; + } + + if (!sessionParameters.equals(resp)) { + this.sessionParameters = resp; + this.heartbeatInterval = + Duration.ofMillis(Durations.toMillis(sessionParameters.getKeepAlive())); + logger.log( + Level.CONFIG, + () -> + String.format( + "%s session params changed: %s", + info.getLogName(), + TextFormat.printer().emittingSingleLine(true).printToString(resp))); + } + } + } + + private void handleVRpcResponse(VirtualRpcResponse vrpc) { + // TODO: when stream is supported this should be updated to the next expected time instead of + // session life time + this.nextHeartbeat = clock.instant().plus(FUTURE_TIME); + VRpcImpl localRpc; + VRpcResult localCancel; + + boolean needsClose; + + synchronized (lock) { + if (state.phase > SessionState.CLOSING.phase) { + debugTagTracer.record( + TelemetryConfiguration.Level.WARN, "session_closed_discard_vrpc_response"); + logger.warning( + String.format( + "%s Discarding vRPC error because session is past the CLOSING phase with the reason: %s", + info.getLogName(), closeReason)); + return; + } + + debugTagTracer.checkPrecondition( + state == SessionState.READY || state == SessionState.CLOSING, + "session_vrpc_response_wrong_state", + "Unexpected vRPC response when session is %s", + state); + debugTagTracer.checkPrecondition( + currentRpc != null, "session_vrpc_null", "Got vRPC response but current vRPC is unset"); + debugTagTracer.checkPrecondition( + currentRpc.rpcId == vrpc.getRpcId(), + "session_vrpc_id_mismatch", + "Got vRPC response for the wrong vRPC: expect: %s, actual: %s", + currentRpc.rpcId, + vrpc.getRpcId()); + + // reset state of the current rpc + localCancel = currentCancel; + currentCancel = null; + localRpc = currentRpc; + // TODO: handle multiplexing + currentRpc = null; + needsClose = (state == SessionState.CLOSING); + } + + if (localCancel != null) { + tracer.onVRpcClose(localCancel.getStatus().getCode()); + localRpc.handleError(localCancel); + } else { + tracer.onVRpcClose(Status.OK.getCode()); + localRpc.handleResponse(vrpc); + } + if (needsClose) { + synchronized (lock) { + if (state == SessionState.CLOSING) { + startGracefulClose(); + } + } + } + } + + private void handleHeartBeatResponse(HeartbeatResponse ignored) { + this.nextHeartbeat = clock.instant().plus(heartbeatInterval); + } + + private void handleSessionRefreshConfigResponse(SessionRefreshConfig config) { + synchronized (lock) { + Metadata grpcMetadata = new Metadata(); + config + .getMetadataList() + .forEach( + entry -> + grpcMetadata.put( + Metadata.Key.of(entry.getKey(), Metadata.ASCII_STRING_MARSHALLER), + entry.getValue().toStringUtf8())); + openParams = OpenParams.create(grpcMetadata, config.getOptimizedOpenRequest()); + openParamsUpdated = true; + } + } + + private void handleVRpcErrorResponse(ErrorResponse error) { + // Skips the heartbeat check when there's no active vrpc on the session + this.nextHeartbeat = clock.instant().plus(FUTURE_TIME); + + VRpcImpl localRpc; + boolean needsClose; + VRpcResult localCancel; + + synchronized (lock) { + if (state.phase > SessionState.CLOSING.phase) { + debugTagTracer.record( + TelemetryConfiguration.Level.WARN, "session_closed_discard_vrpc_response"); + logger.warning( + String.format( + "%s Discarding vRPC error because session is past the CLOSING phase with the reason: %s, error was: %s", + info.getLogName(), closeReason, error)); + return; + } + + debugTagTracer.checkPrecondition( + state == SessionState.READY || state == SessionState.CLOSING, + "session_vrpc_response_wrong_state", + "Unexpected vRPC response when session is %s", + state); + + debugTagTracer.checkPrecondition( + currentRpc != null, "session_vrpc_null", "Got vRPC response but current vRPC is unset"); + debugTagTracer.checkPrecondition( + currentRpc.rpcId == error.getRpcId(), + "session_vrpc_id_mismatch", + "Got vRPC response for the wrong vRPC: expect: %s, actual: %s", + currentRpc.rpcId, + error.getRpcId()); + + // reset the state of the current rpc + localCancel = currentCancel; + currentCancel = null; + localRpc = currentRpc; + currentRpc = null; + needsClose = (state == SessionState.CLOSING); + } + + if (localCancel != null) { + tracer.onVRpcClose(localCancel.getStatus().getCode()); + localRpc.handleError(localCancel); + } else { + tracer.onVRpcClose(Status.fromCodeValue(error.getStatus().getCode()).getCode()); + localRpc.handleError(VRpcResult.createServerError(error)); + } + if (needsClose) { + synchronized (lock) { + if (state == SessionState.CLOSING) { + startGracefulClose(); + } + } + } + } + + private void handleGoAwayResponse(GoAwayResponse goAwayResponse) { + synchronized (lock) { + if (state.phase >= SessionState.CLOSING.phase) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_go_away_ignored"); + logger.warning( + String.format( + "Session error: %s Ignoring goaway because session is %s", + info.getLogName(), state)); + return; + } + + debugTagTracer.checkPrecondition( + state.phase >= SessionState.STARTING.phase, + "session_go_away_wrong_state", + "Unexpected goaway when session is %s", + state); + + updateState(SessionState.CLOSING); + closeReason = + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_GOAWAY) + .setDescription( + "Server sent GO_AWAY_" + goAwayResponse.getReason().toUpperCase(Locale.ENGLISH)) + .build(); + if (currentRpc == null) { + startGracefulClose(); + } + } + sessionListener.onGoAway(goAwayResponse); + } + + private void handleUnknownResponseMessage(SessionResponse message) { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_unknown_response"); + logger.warning(String.format("%s Unknown control message: %s", info.getLogName(), message)); + } + + private void dispatchStreamClosed(Status status, Metadata trailers) { + SessionState prevState; + VRpcImpl localVRpc; + + PeerInfo localPeerInfo; + synchronized (lock) { + prevState = state; + + if (!status.isOk()) { + String augmentedDescription = + Optional.ofNullable(status.getDescription()).map(d -> d + ". ").orElse("") + + "PeerInfo: " + + formatPeerInfo(getPeerInfo()); + + status = status.withDescription(augmentedDescription); + } + + if (state == SessionState.WAIT_SERVER_CLOSE) { + logger.fine(String.format("%s closed normally with status %s", info.getLogName(), status)); + } else { + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "session_abnormal_close"); + // Unexpected path + String msg = + String.format( + "Session error: %s session closed unexpectedly in state %s. Status: %s", + info.getLogName(), state, status); + logger.warning(msg); + + if (state == SessionState.CLOSED) { + return; + } + + closeReason = + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_ERROR) + .setDescription("Unexpected session close with status: " + status.getCode()) + .build(); + } + + localVRpc = currentRpc; + localPeerInfo = stream.getPeerInfo(); + currentRpc = null; + updateState(SessionState.CLOSED); + } + + if (localVRpc != null) { + try { + localVRpc.handleSessionClose(VRpcResult.createRemoteTransportError(status, trailers)); + } catch (Throwable t) { + logger.log( + Level.WARNING, + String.format( + "Session error: %s Unhandled exception while notifying vRpc of session closure status %s", + info.getLogName(), status), + t); + } + tracer.onVRpcClose(Status.UNAVAILABLE.getCode()); + } + tracer.onClose(localPeerInfo, closeReason.getReason(), status); + sessionListener.onClose(prevState, status, trailers); + } + + @GuardedBy("lock") + private void updateState(SessionState newState) { + this.state = newState; + this.lastStateChangedAt = clock.instant(); + } + + private static String formatPeerInfo(PeerInfo peerInfo) { + if (peerInfo == null) { + return "null"; + } + return TextFormat.printer().emittingSingleLine(true).printToString(peerInfo); + } + // endregion +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionInfo.java new file mode 100644 index 000000000000..a3c4bf1d7397 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionInfo.java @@ -0,0 +1,33 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.auto.value.AutoValue; + +@AutoValue +public abstract class SessionInfo { + public abstract SessionPoolInfo getPoolInfo(); + + public abstract String getLogName(); + + public abstract boolean isReady(); + + static SessionInfo create(SessionPoolInfo poolInfo, long sessionNum) { + String logName = String.format("%s-%d", poolInfo.getLogName(), sessionNum); + return new AutoValue_SessionInfo(poolInfo, logName, false); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionList.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionList.java new file mode 100644 index 000000000000..0cc06e258ad4 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionList.java @@ -0,0 +1,449 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_MISSED_HEARTBEAT; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.common.annotations.VisibleForTesting; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.concurrent.NotThreadSafe; + +/** + * A data structure to track sessions through their lifecycle transitions. + * + *

Each session will be wrapped in a SessionHandle to track per Session state. + * + *

This class is not thread safe and requires external synchronization. + */ +@NotThreadSafe +class SessionList { + private static final Logger LOG = Logger.getLogger(SessionList.class.getName()); + + static final Duration SESSION_LIST_PRUNE_INTERVAL = Duration.ofMinutes(10); + + // List of afes that have sessions that are ready now. + private final List afesWithReadySessions = new ArrayList<>(); + // A map of all recently used Afes with possibly empty sessions + private final Map afeHandles = new HashMap<>(); + // All the sessions being tracked by this SessionList including: + // - ones that are in use + // - starting sessions + // - closing sessions + private final Set allSessions = new HashSet<>(); + private final Set inUseSessions = new HashSet<>(); + + private final CloseSessionRequest missedHeartbeatCloseRequest = + CloseSessionRequest.newBuilder() + .setReason(CLOSE_SESSION_REASON_MISSED_HEARTBEAT) + .setDescription("missed heartbeat") + .build(); + + // pool level statistics across all the afes + private final PoolStats poolStats = new PoolStats(); + + /** Entrypoint for a session's lifecycle */ + SessionHandle newHandle(Session session) { + SessionHandle h = new SessionHandle(session); + allSessions.add(h); + poolStats.startingCount++; + poolStats.expectedCapacity++; + return h; + } + + /** Get {@link PoolStats} */ + PoolStats getStats() { + return poolStats; + } + + Set getAllSessions() { + return allSessions; + } + + List getAfesWithReadySessions() { + return Collections.unmodifiableList(afesWithReadySessions); + } + + /** + * Gets the next ready session from the afe. This will be called when a vrpc is about to be + * started, it is called by the {@link Picker}. + */ + public Optional checkoutSession(AfeHandle afeHandle) { + Optional maybeHandle = Optional.ofNullable(afeHandle.sessions.poll()); + + maybeHandle.ifPresent( + handle -> { + poolStats.readyCount--; + poolStats.inUseCount++; + + if (handle.afe.get().sessions.isEmpty()) { + afesWithReadySessions.remove(afeHandle); + } + }); + + return maybeHandle; + } + + /** Closes all the sessions with this reason. */ + void close(CloseSessionRequest req) { + // Notify all sessions to close and have the callbacks clean up the rest of the state + for (SessionHandle s : allSessions) { + s.getSession().close(req); + } + } + + void prune() { + Instant now = Instant.now(); + Instant horizon = now.minus(SESSION_LIST_PRUNE_INTERVAL); + + Iterator> it = afeHandles.entrySet().iterator(); + while (it.hasNext()) { + Entry e = it.next(); + AfeHandle handle = e.getValue(); + if (handle.refCount > 0) { + continue; + } + if (handle.lastConnected.isBefore(horizon)) { + continue; + } + it.remove(); + } + } + + void checkHeartbeat(Clock clock) { + Instant now = clock.instant(); + inUseSessions.forEach( + handle -> { + if (now.isAfter(handle.getSession().getNextHeartbeat())) { + LOG.log( + Level.WARNING, + "Missed heartbeat for {0}, forcing session close", + handle.getSession().getLogName()); + handle.getSession().forceClose(missedHeartbeatCloseRequest); + } + }); + } + + @NotThreadSafe + class SessionHandle { + private final Session session; + private boolean inExpectedCount = true; + + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") + private Optional afe = Optional.empty(); + + SessionHandle(Session session) { + this.session = session; + } + + Session getSession() { + return session; + } + + /** First transition in the happy path - server acknowledged the session */ + void onSessionStarted() { + PeerInfo peerInfo = session.getPeerInfo(); + + AfeHandle afeHandle = + afeHandles.computeIfAbsent(AfeId.extract(peerInfo), (ignored) -> new AfeHandle()); + this.afe = Optional.of(afeHandle); + afeHandle.sessions.add(this); + afeHandle.refCount++; + afeHandle.lastConnected = Instant.now(); + if (afeHandle.sessions.size() == 1) { + afesWithReadySessions.add(afeHandle); + } + + poolStats.startingCount--; + poolStats.readyCount++; + } + + void onVRpcStarted() { + // Pool stats and AFE list are updated in SessionList#checkoutSession + inUseSessions.add(this); + } + + /** + * The session is returned to the pool after use. This undoes what SessionList#checkoutSession + */ + void onVRpcFinish(Duration elapsed, VRpcResult result) { + // Guaranteed to be set - vrpc can only start after the session is ready + AfeHandle afeHandle = this.afe.get(); + + poolStats.inUseCount--; + inUseSessions.remove(this); + + if (result.getStatus().isOk()) { + afeHandle.updateLatency(elapsed, result.getBackendLatency()); + } + + if (session.getState() == SessionState.READY) { + poolStats.readyCount++; + afeHandle.sessions.add(this); + afeHandle.lastConnected = Instant.now(); + + // If this is the first session returned to the pool, transition the afe to ready list + if (afeHandle.sessions.size() == 1) { + afesWithReadySessions.add(afeHandle); + } + } + } + + /** + * Server started graceful refresh. The session is still available, but a replacement is being + * searched for. + */ + void onSessionClosing() { + // The session could get a goaway before it started, which means it has not been + // associated with an afe. + // Also the session could get a goaway when its either idle or in use. + boolean wasReady = false; + + // if afe is not present, the session has not started, so skip this + if (afe.isPresent()) { + wasReady = afe.get().sessions.remove(this); + + if (afe.get().sessions.isEmpty()) { + afesWithReadySessions.remove(afe.get()); + } + } + + if (wasReady) { + poolStats.readyCount--; + } + // eagerly decrement expected count and make sure to avoid double counting in onSessionClosed + poolStats.expectedCapacity--; + inExpectedCount = false; + } + + void onSessionClosed(SessionState prevState) { + if (inExpectedCount) { + poolStats.expectedCapacity--; + inExpectedCount = false; + } + // only update counts after the session started and has an afe associated + afe.ifPresent(afeHandle -> afeHandle.refCount--); + + // NOTE: don't need to update vRpc counters, onVRpcFinish will have been invoked already + switch (prevState) { + case NEW: + throw new IllegalStateException("NEW session was closed"); + case STARTING: + poolStats.startingCount--; + break; + case READY: + { + AfeHandle afeHandle = afe.get(); + // If the session was available & idle, then we need to remove it + if (afeHandle.sessions.remove(this)) { + poolStats.readyCount--; + if (afeHandle.sessions.isEmpty()) { + afesWithReadySessions.remove(afeHandle); + } + } + break; + } + case CLOSING: + case WAIT_SERVER_CLOSE: + // noop + break; + case CLOSED: + throw new IllegalStateException("double close"); + } + + allSessions.remove(this); + } + } + + /** Simple counters for the sessions contained in this list. */ + @NotThreadSafe + static class PoolStats { + private int startingCount; + private int readyCount; + private int inUseCount; + private int expectedCapacity; + + PoolStats() { + reset(); + } + + void reset() { + startingCount = 0; + readyCount = 0; + inUseCount = 0; + expectedCapacity = 0; + } + + /** Number of Sessions that are being prepped, but not ready for use. */ + int getStartingCount() { + return startingCount; + } + + /** Number of Sessions ready for immediate use. */ + int getReadyCount() { + return readyCount; + } + + /** + * Number of Sessions that are in use and thus unavailable. This includes sessions that will not + * be returned to the pool because they will be closed when the go idle. + */ + int getInUseCount() { + return inUseCount; + } + + /** + * Number of sessions should be usable in the short term future. Includes sessions that are + * starting, idle and in used. + */ + int getExpectedCapacity() { + return expectedCapacity; + } + + @VisibleForTesting + TestHelper getTestHelper() { + return new TestHelper(); + } + + @Override + public String toString() { + return String.format( + "PoolStats{startingCount=%d, readyCount=%d, inUseCount=%d, expectedCapacity=%d}", + startingCount, readyCount, inUseCount, expectedCapacity); + } + + @VisibleForTesting + class TestHelper { + void setStartingCount(int n) { + startingCount = n; + } + + void setReadyCount(int n) { + readyCount = n; + } + + void setExpectedCapacity(int n) { + expectedCapacity = n; + } + + void setInUseCount(int n) { + inUseCount = n; + } + } + } + + /** Typesafe wrapper around the applicationFrontendId the server sent us */ + @AutoValue + abstract static class AfeId { + protected abstract long getId(); + + static AfeId extract(PeerInfo peerInfo) { + return new AutoValue_SessionList_AfeId(peerInfo.getApplicationFrontendId()); + } + } + + static class AfeHandle { + // All sessions in the queue are ready to be used + @VisibleForTesting final Queue sessions; + // Last time this afe was used. It will be consulted when we need to garbage collect + // afe that have disappeared + private Instant lastConnected = Instant.now(); + // Tracks number ready and inUse sessions, also used for garbage collection + private int refCount = 0; + + private final PeakEwma transportLatency = new PeakEwma(Duration.of(500, ChronoUnit.MICROS)); + private final PeakEwma e2eLatency = new PeakEwma(Duration.ofMillis(1)); + + public AfeHandle() { + sessions = new ArrayDeque<>(); + } + + void updateLatency(Duration e2eLatency, Duration backendLatency) { + this.transportLatency.update(e2eLatency.minus(backendLatency)); + this.e2eLatency.update(e2eLatency); + } + + double getTransportCost() { + return transportLatency.getCost(); + } + + double getE2eCost() { + return e2eLatency.getCost(); + } + + int getNumOutstanding() { + return refCount - sessions.size(); + } + } + + static class PeakEwma { + // Use the last 100ms as a look back window + private final double decayNs = TimeUnit.MILLISECONDS.toNanos(100); + private long timestamp = System.nanoTime(); + private double cost; + + public PeakEwma(Duration initialLatency) { + this.cost = initialLatency.toNanos(); + } + + public double getCost() { + return cost; + } + + void update(Duration rtt) { + if (rtt.compareTo(Duration.ZERO) <= 0) { + LOG.warning("Ignoring latency<= 0: " + rtt); + return; + } + + long now = System.nanoTime(); + long rttNs = rtt.toNanos(); + + if (cost < rttNs) { + this.cost = rttNs; + } else { + long elapsed = Math.max(now - timestamp, 0); + double decay = Math.exp(-elapsed / decayNs); + double recency = 1.0 - decay; + this.cost = cost * decay + rttNs * recency; + } + this.timestamp = now; + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPool.java new file mode 100644 index 000000000000..0b8cd1cdaea6 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPool.java @@ -0,0 +1,37 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.protobuf.Message; +import io.grpc.Metadata; + +public interface SessionPool { + void start(OpenReqT openReq, Metadata md); + + VRpc newCall( + VRpcDescriptor desc); + + void close(CloseSessionRequest req); + + SessionPoolInfo getInfo(); + + int getConsecutiveUnimplementedFailures(); + + boolean hasSession(); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java new file mode 100644 index 000000000000..9a69907965b8 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java @@ -0,0 +1,841 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.api.Util; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.ForwardingVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.Session.Listener; +import com.google.cloud.bigtable.data.v2.internal.session.Session.OpenParams; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.SessionDescriptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.base.Stopwatch; +import com.google.protobuf.ByteString; +import com.google.protobuf.Message; +import io.grpc.CallOptions; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.protobuf.StatusProto; +import io.opentelemetry.context.Scope; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +public class SessionPoolImpl implements SessionPool { + private static final Logger DEFAULT_LOGGER = Logger.getLogger(SessionPoolImpl.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + private enum PoolState { + NEW, + STARTED, + CLOSED + } + + private static final int PROTOCOL_VERSION = 0; + + private final Metrics metrics; + private final FeatureFlags featureFlags; + private final SessionPoolInfo info; + private long sessionNum = 0; + private final SessionFactory factory; + private final SessionDescriptor descriptor; + + // Set once by start(), and read by both user & grpc threads + private volatile OpenParams openParams; + + @GuardedBy("this") + private PoolState poolState = PoolState.NEW; + + @VisibleForTesting + @GuardedBy("this") + final SessionList sessions; + + @GuardedBy("this") + private final DynamicPicker picker; + + @GuardedBy("this") + private final PoolSizer poolSizer; + + // TODO: we need to close pendingVRpcs when deadline expires + @GuardedBy("this") + private final Deque> pendingRpcs = new ArrayDeque<>(); + + private final Watchdog watchdog; + + @GuardedBy("this") + private int consecutiveFailures = 0; + + /** + * When the client fallback to a non-session AFE session creation will return unimplemented + * errors. In which case the requests should fallback to classic client instead of waiting for an + * available session. + */ + private volatile int consecutiveUnimplementedFailures = 0; + + private final ScheduledFuture afeListPruneTask; + + private final ScheduledFuture heartbeatMonitor; + + private final ScheduledExecutorService executorService; + + @GuardedBy("this") + private ScheduledFuture retryCreateSessionFuture = null; + + // TODO: get the max from ClientConfiguration + @GuardedBy("this") + private final SessionCreationBudget budget; + + private final ClientConfigurationManager configManager; + private final ClientConfigurationManager.ListenerHandle configListenerHandle; + + private final DebugTagTracer debugTagTracer; + + @SuppressWarnings("GuardedBy") + public SessionPoolImpl( + Metrics metrics, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + SessionDescriptor sessionDescriptor, + String name, + ScheduledExecutorService executorService) { + this( + metrics, + featureFlags, + clientInfo, + configManager, + channelPool, + callOptions, + sessionDescriptor, + name, + executorService, + createInitialBudget(configManager.getClientConfiguration())); + } + + @SuppressWarnings("GuardedBy") + @VisibleForTesting + SessionPoolImpl( + Metrics metrics, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ClientConfigurationManager configManager, + ChannelPool channelPool, + CallOptions callOptions, + SessionDescriptor sessionDescriptor, + String name, + ScheduledExecutorService executorService, + SessionCreationBudget budget) { + this.metrics = metrics; + this.featureFlags = featureFlags; + this.info = SessionPoolInfo.create(clientInfo, sessionDescriptor, name); + this.factory = + new SessionFactory(channelPool, sessionDescriptor.getMethodDescriptor(), callOptions); + this.descriptor = sessionDescriptor; + this.executorService = executorService; + + sessions = new SessionList(); + LoadBalancingOptions lbOptions = + configManager + .getClientConfiguration() + .getSessionConfiguration() + .getSessionPoolConfiguration() + .getLoadBalancingOptions(); + picker = new DynamicPicker(sessions, lbOptions.getLoadBalancingStrategyCase()); + poolSizer = + new PoolSizer( + sessions.getStats(), + pendingRpcs::size, + configManager + .getClientConfiguration() + .getSessionConfiguration() + .getSessionPoolConfiguration()); + + debugTagTracer = metrics.getDebugTagTracer(); + + // Watchdog checks for sessions in WAIT_SERVER_CLOSE state and runs every 5 minutes + watchdog = new Watchdog(this, executorService, Duration.ofMinutes(5), sessions, debugTagTracer); + // Heartbeat monitor checks for sessions in READY state with active vRPCs and runs more + // frequently + heartbeatMonitor = + executorService.scheduleAtFixedRate( + () -> { + synchronized (SessionPoolImpl.this) { + sessions.checkHeartbeat(Clock.systemUTC()); + } + }, + SessionImpl.HEARTBEAT_CHECK_INTERVAL.toMillis(), + SessionImpl.HEARTBEAT_CHECK_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + afeListPruneTask = + executorService.scheduleAtFixedRate( + () -> { + synchronized (SessionPoolImpl.this) { + sessions.prune(); + } + }, + SessionList.SESSION_LIST_PRUNE_INTERVAL.toMillis(), + SessionList.SESSION_LIST_PRUNE_INTERVAL.toMillis(), + TimeUnit.MILLISECONDS); + + this.budget = budget; + + this.configManager = configManager; + this.configListenerHandle = + configManager.addListener( + clientConfig -> clientConfig.getSessionConfiguration().getSessionPoolConfiguration(), + newConfig -> { + synchronized (SessionPoolImpl.this) { + budget.updateConfig(newConfig); + poolSizer.updateConfig(newConfig); + picker.updateConfig(newConfig); + } + }); + } + + @Override + public SessionPoolInfo getInfo() { + return info; + } + + @Override + public void close(CloseSessionRequest req) { + configListenerHandle.close(); + + synchronized (this) { + if (poolState == PoolState.CLOSED) { + logger.fine(String.format("Tried to close a closed SessionPool %s", info.getLogName())); + return; + } + logger.fine(String.format("Closing session pool %s for reason %s", info.getLogName(), req)); + + poolState = PoolState.CLOSED; + + for (PendingVRpc pendingRpc : pendingRpcs) { + pendingRpc.cancel("SessionPool closed: " + req, null); + } + afeListPruneTask.cancel(false); + heartbeatMonitor.cancel(false); + if (retryCreateSessionFuture != null) { + retryCreateSessionFuture.cancel(false); + retryCreateSessionFuture = null; + } + watchdog.close(); + sessions.close(req); + } + } + + @Override + public synchronized void start(OpenReqT openReq, Metadata md) { + Preconditions.checkState(poolState == PoolState.NEW); + + Metadata mergedMd = new Metadata(); + mergedMd.merge(md); + mergedMd.merge(Util.composeMetadata(featureFlags, descriptor.extractHeaderParams(openReq))); + + openParams = + OpenParams.create( + mergedMd, + OpenSessionRequest.newBuilder() + .setProtocolVersion(PROTOCOL_VERSION) + .setFlags(featureFlags) + .setConsecutiveFailedConnectionAttempts(0) // will be updated each handshake attempt + .setRoutingCookie(ByteString.EMPTY) // set when each session is renegotiated + .setPayload(openReq.toByteString()) // will be set on start + .build()); + poolState = PoolState.STARTED; // TODO: maybe need a READY state as well? + + // Pre-start + for (int i = poolSizer.getScaleDelta(); i > 0; i--) { + createSession(openParams); + } + + watchdog.start(); + } + + private static SessionCreationBudget createInitialBudget( + ClientConfiguration clientConfiguration) { + SessionClientConfiguration.SessionPoolConfiguration sessionPoolConfig = + clientConfiguration.getSessionConfiguration().getSessionPoolConfiguration(); + // Always use the config from the server. The budget should only be 0 when the + // session load is 0. + return SessionCreationBudget.create( + sessionPoolConfig.getNewSessionCreationBudget(), + SessionUtil.toJavaDuration(sessionPoolConfig.getNewSessionCreationPenalty())); + } + + private int getMaxConsecutiveFailures(ClientConfigurationManager configManager) { + return configManager + .getClientConfiguration() + .getSessionConfiguration() + .getSessionPoolConfiguration() + .getConsecutiveSessionFailureThreshold(); + } + + private synchronized void createSession(OpenParams openParams) { + if (!budget.tryReserveSession()) { + debugTagTracer.record(TelemetryConfiguration.Level.DEBUG, "session_pool_no_budget"); + logger.fine( + String.format( + "Refusing to add a new session due to exhausted %s concurrent create session requests", + budget.getMaxConcurrentRequest())); + // Retry create session if we run out of budget. In the edge case where we get a new VRpc + // after failing to create any sessions and exhausting all the budget, we'll retry session + // creation once the budget becomes available so the VRpc still has a chance to succeed. + maybeScheduleCreateSessionRetry(); + return; + } + + // Explicit create session streams in a detached context + // We don't want to propagate the rpc deadline nor the trace context + Context prevContext = Context.ROOT.attach(); + try { + try (Scope ignored = io.opentelemetry.context.Context.root().makeCurrent()) { + + SessionStream stream = factory.createNew(); + Session session = new SessionImpl(metrics, info, sessionNum++, stream); + SessionHandle handle = sessions.newHandle(session); + + Metadata localMd = new Metadata(); + localMd.merge(openParams.metadata()); + session.start( + openParams.request(), + localMd, + new Listener() { + @Override + public void onReady(OpenSessionResponse msg) { + SessionPoolImpl.this.onSessionReady(handle, msg); + } + + @Override + public void onGoAway(GoAwayResponse msg) { + SessionPoolImpl.this.onSessionGoAway(handle, msg); + } + + @Override + public void onClose(SessionState prevState, Status status, Metadata trailers) { + SessionPoolImpl.this.onSessionClose(handle, prevState, status, trailers); + } + }); + } + } finally { + Context.ROOT.detach(prevContext); + } + } + + @GuardedBy("this") + private void maybeScheduleCreateSessionRetry() { + if (retryCreateSessionFuture != null) { + return; + } + // This interval could be 0 or negative if nextAvailableBudget is now. In which case + // we'll retry after 1 millisecond to avoid retrying in a busy loop. + long retryIntervalMs = + Duration.between(Instant.now(), budget.getNextAvailableBudget()).toMillis(); + if (retryIntervalMs < 1) { + retryIntervalMs = 1; + } + retryCreateSessionFuture = + executorService.schedule( + () -> { + synchronized (this) { + retryCreateSessionFuture = null; + if (poolState != PoolState.CLOSED && poolSizer.getScaleDelta() > 0) { + createSession(openParams); + } + } + }, + retryIntervalMs, + TimeUnit.MILLISECONDS); + } + + private synchronized void onSessionReady(SessionHandle handle, OpenSessionResponse ignored) { + logger.log( + Level.FINE, + "Session {0} in state {1}", + new Object[] {handle.getSession().getLogName(), handle.getSession().getState()}); + + consecutiveFailures = 0; + consecutiveUnimplementedFailures = 0; + + if (poolState != PoolState.STARTED) { + logger.fine( + String.format( + "%s Session became ready after pool transitioned to %s, ignoring", + handle.getSession().getLogName(), poolState)); + // The session will be closed as part of SessionList#close + return; + } + handle.onSessionStarted(); + + budget.onSessionCreationSuccess(); + + // handle pending rpcs + tryDrainPendingRpcs(); + } + + private synchronized void onVRpcComplete( + SessionHandle handle, Duration elapsed, VRpcResult result) { + handle.onVRpcFinish(elapsed, result); + + // pool is shutting down, dont try to drain vrpcs + if (poolState != PoolState.STARTED) { + return; + } + // Session is shutting down, don't try to drain vrpcs + if (handle.getSession().getState() != SessionState.READY) { + return; + } + tryDrainPendingRpcs(); + } + + private synchronized void onSessionGoAway(SessionHandle handle, GoAwayResponse msg) { + handle.onSessionClosing(); + + // If the session received refresh config or pool requires a replacement, keep the current + // session and request a replacement. + // TODO: remove the check on if the open params is updated. In the future, server should + // broadcast session refresh config to all the sessions that needs reconnect and client + // just need to recreate sessions when pool sizer requries a replacement. + if (handle.getSession().isOpenParamsUpdated() || poolSizer.handleGoAway(msg)) { + logger.fine( + String.format( + "Adding new session to replace a going away session %s", + handle.getSession().getLogName())); + createSession(handle.getSession().getOpenParams()); + } + } + + private void onSessionClose( + SessionHandle handle, SessionState prevState, Status status, Metadata trailers) { + + List> toBeClosed = new ArrayList<>(); + + synchronized (this) { + logger.fine( + String.format("Removing closed session from pool %s", handle.getSession().getLogName())); + + handle.onSessionClosed(prevState); + + // If the pool is closed then there is nothing else to do + // dont need to create a replacement session and pending vRpcs get cleaned up in close() + if (poolState == PoolState.CLOSED) { + return; + } + + // Handle abnormal close. This can happen if the Session was aborted due to underlying stream + // termination + if (prevState != SessionState.WAIT_SERVER_CLOSE) { + consecutiveFailures++; + if (status.getCode() == Status.Code.UNIMPLEMENTED) { + consecutiveUnimplementedFailures++; + } else { + consecutiveUnimplementedFailures = 0; + } + // TODO: decide if max consecutive failures should be capped per client + if (consecutiveFailures >= getMaxConsecutiveFailures(configManager)) { + toBeClosed = popClosableRpcs(); + } + + if (prevState == SessionState.STARTING) { + budget.onSessionCreationFailure(); + } + + // TODO: backoff creating a new session when consecutive failures > max? + if (poolSizer.handleSessionClose(StatusProto.fromStatusAndTrailers(status, trailers))) { + logger.fine( + String.format( + "Replacing abnormally closed session %s", handle.getSession().getLogName())); + createSession(openParams.withIncrementedAttempts()); + } + } + } + + if (!toBeClosed.isEmpty()) { + // vRPCs failing with consecutive failures should fail + VRpcResult result = + VRpcResult.createRejectedError( + Status.UNAVAILABLE.withDescription( + String.format( + "Session failed with consecutive failures. Most recent server status: %s, metadata: %s.", + status, trailers))); + for (PendingVRpc vrpc : toBeClosed) { + try { + vrpc.getListener().onClose(result); + } catch (Throwable t) { + logger.log(Level.WARNING, "Exception when closing request", t); + } + } + } + } + + @GuardedBy("this") + private void tryDrainPendingRpcs() { + while (!pendingRpcs.isEmpty()) { + if (pendingRpcs.peek().isCancelled) { + pendingRpcs.pop(); + continue; + } + Optional handle = picker.pickSession(); + if (!handle.isPresent()) { + break; + } + handle.get().onVRpcStarted(); + PendingVRpc rpc = pendingRpcs.removeFirst(); + rpc.drainTo(handle.get()); + } + } + + @GuardedBy("this") + private List> popClosableRpcs() { + List> toBeClosed = new ArrayList<>(); + Iterator> iter = pendingRpcs.iterator(); + while (iter.hasNext()) { + PendingVRpc vrpc = iter.next(); + // vrpcs that have started on a session gets closed in SessionImpl. Do not double close. + if (!vrpc.isCancelled && vrpc.realCall == null) { + iter.remove(); + toBeClosed.add(vrpc); + } + } + return toBeClosed; + } + + @Override + public synchronized VRpc newCall( + VRpcDescriptor desc) { + Optional handle = picker.pickSession(); + if (handle.isPresent()) { + return newRealCall(desc, handle.get()); + } + if (logger.isLoggable(Level.FINE)) { + logger.fine( + String.format( + "%s Creating new rpc as pending, numPending: %d, %s", + info.getLogName(), pendingRpcs.size(), sessions.getStats())); + } + return new PendingVRpc<>(desc); + } + + @GuardedBy("this") + private VRpc newRealCall( + VRpcDescriptor desc, SessionHandle handle) { + + return new ForwardingVRpc(handle.getSession().newCall(desc)) { + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + final Stopwatch stopwatch = Stopwatch.createStarted(); + super.start( + req, + ctx, + new ForwardListener(listener) { + @Override + public void onClose(VRpcResult result) { + SessionPoolImpl.this.onVRpcComplete(handle, stopwatch.elapsed(), result); + super.onClose(result); + } + }); + } + }; + } + + // Used in the shim layer for fallback decisions. Called on every RPC and we're ok with seeing + // slightly outdated value. + @Override + public int getConsecutiveUnimplementedFailures() { + return consecutiveUnimplementedFailures; + } + + // Used in the shim layer for fallback decisions. Called on every RPC. + @Override + public synchronized boolean hasSession() { + return sessions.getStats().getReadyCount() + sessions.getStats().getInUseCount() > 0; + } + + class PendingVRpc implements VRpc { + private final VRpcDescriptor desc; + + private ReqT req; + private VRpcCallContext ctx; + private VRpcListener listener; + + private boolean isCancelled = false; + private VRpc realCall; + + private ScheduledFuture deadlineMonitor; + + public PendingVRpc(VRpcDescriptor desc) { + this.desc = desc; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + Preconditions.checkState(this.req == null, "request is already started"); + Preconditions.checkNotNull(req, "request can't be null"); + Preconditions.checkNotNull(ctx, "ctx can't be null"); + Preconditions.checkNotNull(listener, "listener can't be null"); + + this.req = req; + this.ctx = ctx; + this.listener = listener; + this.deadlineMonitor = monitorDeadline(executorService, ctx.getOperationInfo().getDeadline()); + + synchronized (SessionPoolImpl.this) { + if (SessionPoolImpl.this.poolState != PoolState.STARTED) { + listener.onClose( + VRpcResult.createUncommitedError( + Status.UNAVAILABLE.withCause( + new IllegalStateException("SessionPool is closed")))); + return; + } + pendingRpcs.add(this); + + if (logger.isLoggable(Level.FINE)) { + logger.fine( + String.format( + "starting pending call, numPending: %d, %s", + pendingRpcs.size(), sessions.getStats())); + } + + if (poolSizer.handleNewCall()) { + logger.fine( + String.format("Adding session to handle incoming vrpc %s", info.getLogName())); + createSession(openParams); + } + + tryDrainPendingRpcs(); + } + } + + // It's safe to call cancel on a vrpc more than once. It'll be a noop after the initial + // call. Cancelled vrpcs are removed from the pending vrpc queue the next time we + // drain the queue. + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + Status status = Status.CANCELLED; + if (message != null) { + status = status.withDescription(message); + } + if (cause != null) { + status = status.withCause(cause); + } + cancel(status, false); + } + + // Cancel could race with drainTo which sets the real call. Assign realCall to a NOOP_CALL + // so if drainTo gets called at the same time, it'll just get swallowed and we're only calling + // onClose once on the listener. The cancel could also come from deadline monitor when + // the deadline expires. In this case if the real call is already set, we want to real call + // to handle the deadline and return early. + private void cancel(Status status, boolean onlyCancelPendingCall) { + boolean delegateToRealCall = true; + synchronized (SessionPoolImpl.this) { + if (isCancelled) { + return; + } + isCancelled = true; + if (realCall == null) { + this.realCall = NOOP_CALL; + delegateToRealCall = false; + } else if (onlyCancelPendingCall) { + return; + } + } + if (delegateToRealCall) { + realCall.cancel(status.getDescription(), status.getCause()); + } else { + listener.onClose(VRpcResult.createRejectedError(status)); + } + } + + @Override + public void requestNext() { + if (realCall != null) { + realCall.requestNext(); + return; + } + throw new IllegalStateException("requestNext can't be called until data has been received"); + } + + private void drainTo(SessionHandle handle) { + synchronized (SessionPoolImpl.this) { + if (realCall == null) { + this.realCall = newRealCall(desc, handle); + } + } + this.realCall.start(req, ctx, listener); + if (deadlineMonitor != null) { + deadlineMonitor.cancel(false); + } + } + + private VRpcListener getListener() { + return listener; + } + + private ScheduledFuture monitorDeadline( + ScheduledExecutorService executorService, Deadline deadline) { + return executorService.schedule( + () -> + // This could race with user cancel. Setting onlyCancelPendingCall to true + // so that if the real call is set, this cancellation is going to be a noop. + cancel( + Status.DEADLINE_EXCEEDED.withDescription("Deadline exceeded waiting for session"), + true), + deadline.timeRemaining(TimeUnit.NANOSECONDS), + TimeUnit.NANOSECONDS); + } + } + + static class Watchdog implements Runnable { + private static final Logger LOG = Logger.getLogger(Watchdog.class.getName()); + + private final Object lock; + private final ScheduledExecutorService executor; + private final Duration interval; + private final SessionList sessions; + private ScheduledFuture future; + private final Clock clock; + private final DebugTagTracer debugTagTracer; + + // TODO: fix lock sharing + public Watchdog( + Object lock, + ScheduledExecutorService executor, + Duration interval, + SessionList sessionList, + DebugTagTracer debugTagTracer) { + this(lock, executor, interval, sessionList, debugTagTracer, Clock.systemUTC()); + } + + @VisibleForTesting + Watchdog( + Object lock, + ScheduledExecutorService executor, + Duration interval, + SessionList sessionList, + DebugTagTracer debugTagTracer, + Clock clock) { + this.lock = lock; + this.executor = executor; + this.interval = interval; + this.sessions = sessionList; + this.debugTagTracer = debugTagTracer; + this.clock = clock; + } + + public void start() { + future = + executor.scheduleAtFixedRate( + this, interval.toMillis(), interval.toMillis(), TimeUnit.MILLISECONDS); + } + + @Override + public void run() { + Set allSessions; + synchronized (lock) { + allSessions = sessions.getAllSessions(); + } + + for (SessionHandle handle : allSessions) { + Session s = handle.getSession(); + + if (s.getState() != SessionState.WAIT_SERVER_CLOSE) { + continue; + } + + Duration stateDuration = Duration.between(s.getLastStateChange(), Instant.now(clock)); + if (stateDuration.compareTo(interval) < 0) { + continue; + } + + debugTagTracer.record(TelemetryConfiguration.Level.WARN, "watchdog_close_session"); + LOG.fine( + String.format( + "Found session %s that lingered too long in WAIT_SERVER_CLOSE state, canceling session", + handle.getSession().getLogName())); + handle + .getSession() + .forceClose( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_ERROR) + .setDescription( + String.format( + "Watchdog found session %s in awaiting close for too long. Last activity was %s ago.", + handle.getSession().getLogName(), + Duration.between( + handle.getSession().getLastStateChange(), Instant.now(clock)))) + .build()); + } + } + + public void close() { + if (future != null) { + future.cancel(false); + } + } + } + + private static final VRpc NOOP_CALL = + new VRpc() { + @Override + public void start(Object req, VRpcCallContext ctx, VRpcListener listener) {} + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) {} + + @Override + public void requestNext() {} + }; +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolInfo.java new file mode 100644 index 000000000000..3fcf322a0236 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolInfo.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.SessionType; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.SessionDescriptor; +import com.google.common.base.Ascii; + +@AutoValue +public abstract class SessionPoolInfo { + public abstract ClientInfo getClientInfo(); + + public abstract SessionType getType(); + + public abstract String getTypeLabel(); + + public abstract String getName(); + + public abstract String getLogName(); + + public static SessionPoolInfo create( + ClientInfo clientInfo, SessionDescriptor descriptor, String name) { + SessionType type = descriptor.getType(); + String typeStr = Ascii.toLowerCase(type.name().replace("SESSION_TYPE_", "")); + String logName = String.format("%s(%s)", typeStr, name); + + return new AutoValue_SessionPoolInfo(clientInfo, type, typeStr, name, logName); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionUtil.java new file mode 100644 index 000000000000..ab0313468a03 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionUtil.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.SessionProto; +import com.google.bigtable.v2.SessionType; +import com.google.common.base.Preconditions; +import com.google.protobuf.Message; +import com.google.protobuf.util.Durations; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoMethodDescriptorSupplier; +import java.time.Duration; + +final class SessionUtil { + private SessionUtil() {} + + static SessionType extractSessionTypeFromMethod(MethodDescriptor desc) { + ProtoMethodDescriptorSupplier schemaDescriptor = + (ProtoMethodDescriptorSupplier) desc.getSchemaDescriptor(); + + SessionType sessionType = + schemaDescriptor + .getMethodDescriptor() + .getOptions() + .getExtension(SessionProto.rpcSessionType); + + Preconditions.checkNotNull(sessionType, "%s missing rpc_session_type annotation", desc); + Preconditions.checkState( + sessionType != SessionType.SESSION_TYPE_UNSET, + "%s missing rpc_session_type annotation", + desc); + + return sessionType; + } + + static SessionType extractOpenSessionTypeFromOpenMsg(Message openReq) { + SessionType sessionType = + openReq.getDescriptorForType().getOptions().getExtension(SessionProto.openSessionType); + Preconditions.checkNotNull( + sessionType, "%s missing open_session_type annotation", openReq.getDescriptorForType()); + Preconditions.checkState( + sessionType != SessionType.SESSION_TYPE_UNSET, + "%s missing rpc_session_type annotation", + openReq.getDescriptorForType()); + return sessionType; + } + + static Duration toJavaDuration(com.google.protobuf.Duration duration) { + return Duration.ofMillis(Durations.toMillis(duration)); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SimplePicker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SimplePicker.java new file mode 100644 index 000000000000..d80eb252291d --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SimplePicker.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.AfeHandle; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import java.util.List; +import java.util.Optional; +import java.util.Random; + +class SimplePicker extends Picker { + private final SessionList sessionList; + private final Random random = new Random(); + + public SimplePicker(SessionList sessionList) { + this.sessionList = sessionList; + } + + @Override + Optional pickSession() { + List readyAfes = sessionList.getAfesWithReadySessions(); + if (readyAfes.isEmpty()) { + return Optional.empty(); + } + + AfeHandle afeHandle = readyAfes.get(random.nextInt(readyAfes.size())); + return sessionList.checkoutSession(afeHandle); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptor.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptor.java new file mode 100644 index 000000000000..bffb3259d3ad --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptor.java @@ -0,0 +1,330 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.AuthorizedViewRequest; +import com.google.bigtable.v2.AuthorizedViewResponse; +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.MaterializedViewRequest; +import com.google.bigtable.v2.MaterializedViewResponse; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.RowSet; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.SessionType; +import com.google.bigtable.v2.TableRequest; +import com.google.bigtable.v2.TableResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Message; +import io.grpc.MethodDescriptor; +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Function; + +/** + * Static descriptor for virtual RPCs. + * + *

Contains a const for each supported vRPC. The descriptors help ensure vRPC are statically + * typed and provide encoding/decoding. + * + *

The structure of the descriptor is to have a constant for each vRPC and the constant is + * defined using a pair of encoder/decoder factories for that vRPC family. + */ +public final class VRpcDescriptor { + public static final SessionDescriptor TABLE_SESSION = + new SessionDescriptor<>( + BigtableGrpc.getOpenTableMethod(), + r -> + String.format( + "%s(%s, %s, %s)", + SessionType.SESSION_TYPE_TABLE, + r.getTableName(), + r.getAppProfileId(), + r.getPermission()), + r -> + ImmutableMap.of( + "open_session.payload.table_name", r.getTableName(), + "open_session.payload.app_profile_id", r.getAppProfileId(), + "open_session.payload.permission", r.getPermission().name())); + + public static final SessionDescriptor AUTHORIZED_VIEW_SESSION = + new SessionDescriptor<>( + BigtableGrpc.getOpenAuthorizedViewMethod(), + r -> + String.format( + "%s(%s, %s, %s)", + SessionType.SESSION_TYPE_AUTHORIZED_VIEW, + r.getAuthorizedViewName(), + r.getAppProfileId(), + r.getPermission()), + r -> + ImmutableMap.of( + "open_session.payload.authorized_view_name", + r.getAuthorizedViewName(), + "open_session.payload.app_profile_id", + r.getAppProfileId(), + "open_session.payload.permission", + r.getPermission().name())); + + public static final SessionDescriptor MATERIALIZED_VIEW_SESSION = + new SessionDescriptor<>( + BigtableGrpc.getOpenMaterializedViewMethod(), + r -> + String.format( + "%s(%s, %s, %s)", + SessionType.SESSION_TYPE_MATERIALIZED_VIEW, + r.getMaterializedViewName(), + r.getAppProfileId(), + r.getPermission()), + r -> + ImmutableMap.of( + "open_session.payload.materialized_view_name", + r.getMaterializedViewName(), + "open_session.payload.app_profile_id", + r.getAppProfileId(), + "open_session.payload.permission", + r.getPermission().name())); + + // region vRPC definitions + public static final VRpcDescriptor< + OpenTableRequest, SessionReadRowRequest, SessionReadRowResponse> + READ_ROW = + new VRpcDescriptor<>( + TABLE_SESSION, + MethodInfo.of("Bigtable.ReadRow", false), + createTableEncoder(TableRequest.Builder::setReadRow), + createTableDecoder(TableResponse::getReadRow), + (name, appProfileId, req) -> + ReadRowsRequest.newBuilder() + .setTableName(name) + .setAppProfileId(appProfileId) + .setRows(RowSet.newBuilder().addRowKeys(req.getKey()).build()) + .setFilter(req.getFilter()) + .setRowsLimit(1) + .build()); + + public static final VRpcDescriptor< + OpenTableRequest, SessionMutateRowRequest, SessionMutateRowResponse> + MUTATE_ROW = + new VRpcDescriptor<>( + TABLE_SESSION, + MethodInfo.of("Bigtable.MutateRow", false), + createTableEncoder(TableRequest.Builder::setMutateRow), + createTableDecoder(TableResponse::getMutateRow), + (name, appProfileId, req) -> + MutateRowRequest.newBuilder() + .setTableName(name) + .setAppProfileId(appProfileId) + .setRowKey(req.getKey()) + .addAllMutations(req.getMutationsList()) + .build()); + + public static final VRpcDescriptor< + OpenAuthorizedViewRequest, SessionReadRowRequest, SessionReadRowResponse> + READ_ROW_AUTH_VIEW = + new VRpcDescriptor<>( + AUTHORIZED_VIEW_SESSION, + MethodInfo.of("Bigtable.ReadRow", false), + createAuthViewEncoder(AuthorizedViewRequest.Builder::setReadRow), + createAuthViewDecoder(AuthorizedViewResponse::getReadRow), + (name, appProfileId, req) -> + ReadRowsRequest.newBuilder() + .setAuthorizedViewName(name) + .setAppProfileId(appProfileId) + .setRows(RowSet.newBuilder().addRowKeys(req.getKey()).build()) + .setFilter(req.getFilter()) + .setRowsLimit(1) + .build()); + + public static final VRpcDescriptor< + OpenAuthorizedViewRequest, SessionMutateRowRequest, SessionMutateRowResponse> + MUTATE_ROW_AUTH_VIEW = + new VRpcDescriptor<>( + AUTHORIZED_VIEW_SESSION, + MethodInfo.of("Bigtable.MutateRow", false), + createAuthViewEncoder(AuthorizedViewRequest.Builder::setMutateRow), + createAuthViewDecoder(AuthorizedViewResponse::getMutateRow), + (name, appProfileId, req) -> + MutateRowRequest.newBuilder() + .setAuthorizedViewName(name) + .setAppProfileId(appProfileId) + .setRowKey(req.getKey()) + .addAllMutations(req.getMutationsList()) + .build()); + + public static final VRpcDescriptor< + OpenMaterializedViewRequest, SessionReadRowRequest, SessionReadRowResponse> + READ_ROW_MAT_VIEW = + new VRpcDescriptor<>( + MATERIALIZED_VIEW_SESSION, + MethodInfo.of("Bigtable.ReadRow", false), + createMatViewEncoder(MaterializedViewRequest.Builder::setReadRow), + createMatViewDecoder(MaterializedViewResponse::getReadRow), + (name, appProfileId, req) -> + ReadRowsRequest.newBuilder() + .setMaterializedViewName(name) + .setAppProfileId(appProfileId) + .setRows(RowSet.newBuilder().addRowKeys(req.getKey()).build()) + .setFilter(req.getFilter()) + .setRowsLimit(1) + .build()); + + // endregion + + // region vRPC family encoder/decoder factories + private static Encoder createTableEncoder( + BiConsumer subEncoder) { + return req -> { + TableRequest.Builder builder = TableRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createTableDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(TableResponse.parseFrom(bytes)); + } + + private static Encoder createAuthViewEncoder( + BiConsumer subEncoder) { + return req -> { + AuthorizedViewRequest.Builder builder = AuthorizedViewRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createAuthViewDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(AuthorizedViewResponse.parseFrom(bytes)); + } + + private static Encoder createMatViewEncoder( + BiConsumer subEncoder) { + return req -> { + MaterializedViewRequest.Builder builder = MaterializedViewRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createMatViewDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(MaterializedViewResponse.parseFrom(bytes)); + } + + // endregion + + private final SessionDescriptor session; + private final MethodInfo methodInfo; + private final Encoder encoder; + private final Decoder decoder; + private final LegacyConverter legacyConverter; + + VRpcDescriptor( + SessionDescriptor session, + MethodInfo methodInfo, + Encoder encoder, + Decoder decoder, + LegacyConverter legacyConverter) { + this.session = session; + this.methodInfo = methodInfo; + this.encoder = encoder; + this.decoder = decoder; + this.legacyConverter = legacyConverter; + } + + public SessionDescriptor getSessionDescriptor() { + return session; + } + + public MethodInfo getMethodInfo() { + return methodInfo; + } + + public RespT decode(ByteString bytes) throws InvalidProtocolBufferException { + return decoder.decode(bytes); + } + + public ByteString encode(ReqT req) { + return encoder.encode(req); + } + + public Message toLegacyProto(String name, String appProfileId, ReqT sessionRequest) { + return legacyConverter.convert(name, appProfileId, sessionRequest); + } + + interface Decoder { + RespT decode(ByteString bytes) throws InvalidProtocolBufferException; + } + + interface Encoder { + ByteString encode(ReqT req); + } + + @FunctionalInterface + interface LegacyConverter { + Message convert(String name, String appProfileId, ReqT sessionRequest); + } + + public static final class SessionDescriptor { + private final SessionType type; + private final MethodDescriptor methodDescriptor; + private final Function> headerPopulator; + private final Function logNameExtractor; + + public SessionDescriptor( + MethodDescriptor methodDescriptor, + Function logNameExtractor, + Function> headerPopulator) { + this.type = SessionUtil.extractSessionTypeFromMethod(methodDescriptor); + this.methodDescriptor = methodDescriptor; + this.logNameExtractor = logNameExtractor; + this.headerPopulator = headerPopulator; + } + + public SessionType getType() { + return type; + } + + public MethodDescriptor getMethodDescriptor() { + return methodDescriptor; + } + + public Map extractHeaderParams(OpenReqT req) { + Preconditions.checkArgument(SessionUtil.extractOpenSessionTypeFromOpenMsg(req) == type); + return headerPopulator.apply(req); + } + + public String getLogName(OpenReqT req) { + return logNameExtractor.apply(req); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcImpl.java new file mode 100644 index 000000000000..b2d16c7a0998 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcImpl.java @@ -0,0 +1,199 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.VirtualRpcRequest; +import com.google.bigtable.v2.VirtualRpcRequest.Metadata; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.protobuf.Message; +import com.google.protobuf.MessageLite; +import com.google.protobuf.util.Durations; +import io.grpc.Status; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * This class is the intermediary between a user and a {@link SessionImpl}. + * + *

    + *
  • {@link #start(MessageLite, VRpcCallContext, VRpcListener)} must be the first method called + * by the user + *
  • {@link #cancel(String, Throwable)} and {@link #requestNext()} can be called by any thread + *
  • {@link #requestNext()} can only be called after {@link + * com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener#onMessage} is + * invoked with a {@link VirtualRpcResponse} indicating that there is more data. + *
  • All {@code handle*} methods are expected to be called sequentially by {@link SessionImpl} + *
+ * + *

The expectation is that all happens-before state transitions are conducted via the {@link + * SessionImpl}/gRPC's executor and no synchronization has to occur here. + */ +class VRpcImpl + implements VRpc { + private static final Logger DEFAULT_LOGGER = Logger.getLogger(VRpcImpl.class.getName()); + private Logger logger = DEFAULT_LOGGER; + + // Narrow view of SessionImpl + interface VRpcSessionApi { + Status startRpc(VRpcImpl rpc, VirtualRpcRequest payload); + + void cancelRpc(long rpcId, @Nullable String message, @Nullable Throwable cause); + } + + private enum State { + NEW, + STARTED, + CLOSED + } + + private final VRpcSessionApi session; + private final VRpcDescriptor desc; + final long rpcId; + private VRpcListener listener; + private PeerInfo peerInfo; + + private AtomicReference state; + + public VRpcImpl( + VRpcSessionApi session, + VRpcDescriptor desc, + long rpcId, + PeerInfo peerInfo) { + this.session = session; + this.desc = desc; + this.rpcId = rpcId; + this.state = new AtomicReference<>(State.NEW); + this.peerInfo = peerInfo; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + this.listener = listener; + + Status status; + boolean retryable = true; + + if (state.get() != State.NEW) { + status = Status.INTERNAL.withDescription("VRpc already started in state: " + state.get()); + retryable = false; + } else if (ctx.getOperationInfo().getDeadline().timeRemaining(TimeUnit.MICROSECONDS) + < TimeUnit.MILLISECONDS.toMicros(1)) { + // Don't send RPCs that don't have any hope of succeeding + status = + Status.DEADLINE_EXCEEDED.withDescription("Remaining deadline is too short to send RPC"); + retryable = false; + } else { + state.set(State.STARTED); + Metadata vRpcMetadata = + Metadata.newBuilder() + .setAttemptNumber(ctx.getOperationInfo().getAttemptNumber()) + .setTraceparent(ctx.getTraceParent()) + .build(); + ctx.getTracer().onRequestSent(peerInfo); + status = + session.startRpc( + this, + VirtualRpcRequest.newBuilder() + .setRpcId(rpcId) + .setMetadata(vRpcMetadata) + .setDeadline( + Durations.fromNanos( + ctx.getOperationInfo().getDeadline().timeRemaining(TimeUnit.NANOSECONDS))) + .setPayload(desc.encode(req)) + .build()); + // if status is not OK, the session might not be ready and the vRPC can be retried on a + // different session + } + + if (!status.isOk()) { + if (!state.compareAndSet(State.STARTED, State.CLOSED)) { + return; + } + // TODO: loop through the session executor + if (retryable) { + listener.onClose(VRpcResult.createUncommitedError(status)); + } else { + listener.onClose(VRpcResult.createRejectedError(status)); + } + } + } + + void handleSessionClose(VRpcResult result) { + if (!state.compareAndSet(State.STARTED, State.CLOSED)) { + logger.warning("tried to close a vRPC after it was already closed state: " + state.get()); + return; + } + + listener.onClose(result); + } + + void handleResponse(VirtualRpcResponse response) { + if (!state.compareAndSet(State.STARTED, State.CLOSED)) { + // This can happen if the call was cancelled just before the response arrived. + // Silently ignore it. + return; + } + // TODO: handle streaming + + RespT resp; + try { + resp = desc.decode(response.getPayload()); + } catch (Throwable e) { + // TODO: notify Session to cancel the vRPC + // Right now, vrpc streaming & cancellation is not supported, so notifying SessionImpl is + // unnecessary. In the future handleResponse will need to notify that Session that the user + // was already notified of the error and no further notifications should be delivered + VRpcResult result = + VRpcResult.createLocalTransportError( + Status.INTERNAL.withDescription("Failed to decode VRpc payload").withCause(e)); + listener.onClose(result); + return; + } + + try { + listener.onMessage(resp); + } catch (Throwable e) { + VRpcResult result = VRpcResult.createUserError(e); + listener.onClose(result); + return; + } + + listener.onClose(VRpcResult.createServerOk(response)); + } + + void handleError(VRpcResult result) { + if (state.getAndSet(State.CLOSED) == State.CLOSED) { + return; + } + + listener.onClose(result); + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + session.cancelRpc(rpcId, message, cause); + } + + @Override + public void requestNext() { + throw new UnsupportedOperationException("streamed RPCs are not supported yet"); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManager.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManager.java new file mode 100644 index 000000000000..c367d5c6443b --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManager.java @@ -0,0 +1,542 @@ +/* + * Copyright 2026 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.internal.util; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.ClientConfiguration.PollingCase; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.TelemetryConfiguration; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.Util; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.TextFormat; +import com.google.protobuf.util.Durations; +import io.grpc.CallOptions; +import io.grpc.ClientCall; +import io.grpc.ClientCall.Listener; +import io.grpc.Deadline; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.Status; +import io.grpc.Status.Code; +import io.grpc.StatusRuntimeException; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; + +/** + * ClientConfiguration controls how the data client should behave. For example, it controls how much + * of the traffic should go through jetstream vs unary. It also controls how frequent the client + * should poll for a new configuration and how long the configuration is valid for. + */ +public class ClientConfigurationManager implements AutoCloseable { + private static final Logger logger = Logger.getLogger(ClientConfigurationManager.class.getName()); + + public static final String OVERRIDE_SYS_PROP_KEY = "bigtable.internal.client-config-override"; + + public interface ConfigListener { + void onChange(T newValue); + } + + public interface ListenerHandle extends Closeable { + @Override + void close(); + } + + private class ListenerEntry implements ListenerHandle { + private final Function extractor; + private final ConfigListener listener; + + private ListenerEntry(Function extractor, ConfigListener listener) { + this.extractor = extractor; + this.listener = listener; + } + + private void maybeNotify(ClientConfiguration oldConfig, ClientConfiguration newConfig) { + T oldValue = extractor.apply(oldConfig); + T newValue = extractor.apply(newConfig); + if (Objects.equals(oldValue, newValue)) { + return; + } + listener.onChange(newValue); + } + + @Override + public void close() { + synchronized (ClientConfigurationManager.this) { + if (notifying) { + pendingListenerRemovals.add(this); + } else { + listeners.remove(this); + } + } + } + } + + private final Metadata metadata; + private final GetClientConfigurationRequest request; + private final ChannelProvider channelProvider; + + @GuardedBy("this") + private ManagedChannel channel; + + private final DebugTagTracer debugTagTracer; + private final ScheduledExecutorService executor; + + private final ClientConfiguration defaultConfig; + private final Optional overrideConfig; + + private final Duration defaultDeadline = Duration.ofSeconds(5); + + @GuardedBy("this") + @Nonnull + private ClientConfiguration clientConfiguration; + + @GuardedBy("this") + @Nonnull + private Instant validUntil = Instant.MAX; + + @GuardedBy("this") + private final List> listeners = new ArrayList<>(); + + @GuardedBy("this") + private boolean notifying = false; + + @GuardedBy("this") + private final Set> pendingListenerRemovals = new HashSet<>(); + + @GuardedBy("this") + @Nullable + private ScheduledFuture nextPoll = null; + + @GuardedBy("this") + private boolean closing = false; + + public ClientConfigurationManager( + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + DebugTagTracer tracer, + ScheduledExecutorService executor) + throws IOException { + this(System.getProperties(), featureFlags, clientInfo, channelProvider, tracer, executor); + } + + ClientConfigurationManager( + Properties sysProps, + FeatureFlags featureFlags, + ClientInfo clientInfo, + ChannelProvider channelProvider, + DebugTagTracer tracer, + ScheduledExecutorService executor) + throws IOException { + this.defaultConfig = loadDefault(); + this.overrideConfig = + Optional.ofNullable(sysProps.getProperty(OVERRIDE_SYS_PROP_KEY)) + .map( + str -> { + try { + return TextFormat.parse(str, ClientConfiguration.class); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse bigtable.internal.client-config-override", e); + } + }); + + if (overrideConfig.isPresent()) { + logger.log( + Level.INFO, + () -> + "Local client config override: " + + TextFormat.printer() + .emittingSingleLine(true) + .printToString(overrideConfig.get())); + } + featureFlags = channelProvider.updateFeatureFlags(featureFlags); + this.clientConfiguration = defaultConfig; + + this.metadata = + Util.composeMetadata( + featureFlags, + ImmutableMap.of( + "instance_name", clientInfo.getInstanceName().toString(), + "app_profile_id", clientInfo.getAppProfileId())); + this.request = + GetClientConfigurationRequest.newBuilder() + .setInstanceName(clientInfo.getInstanceName().toString()) + .setAppProfileId(clientInfo.getAppProfileId()) + .build(); + + this.channelProvider = channelProvider; + this.channel = channelProvider.newChannelBuilder().build(); + this.debugTagTracer = tracer; + this.executor = executor; + } + + public static ClientConfiguration loadDefault() throws IOException { + try (InputStream is = + ClientConfiguration.class.getResourceAsStream( + "/bigtable-default-client-config.textproto")) { + Preconditions.checkNotNull(is, "Failed to load default config"); + + try (Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) { + ClientConfiguration.Builder builder = ClientConfiguration.newBuilder(); + TextFormat.getParser().merge(reader, builder); + return builder.build(); + } + } + } + + /** + * Start polling client configuration. The first poll should be blocking and client should fall + * back to unary if it fails. + */ + public CompletableFuture start() { + CompletableFuture f = startPolling(); + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = + f.whenComplete( + (cfg, error) -> { + if (error != null) { + debugTagTracer.record( + TelemetryConfiguration.Level.ERROR, "client_config_fetch_failed"); + logger.log(Level.WARNING, "Failed to fetch initial config", error); + } else { + logger.log(Level.CONFIG, "Got initial config: {0}", cfg); + } + }); + return f; + } + + @Override + public synchronized void close() { + closing = true; + if (nextPoll != null) { + nextPoll.cancel(true); + } + channel.shutdown(); + } + + /** Gets the client configuration. */ + @Nonnull + public synchronized ClientConfiguration getClientConfiguration() { + return this.clientConfiguration; + } + + ClientConfiguration getDefaultConfig() { + return defaultConfig; + } + + public synchronized ListenerHandle addListener( + Function extractor, ConfigListener listener) { + ListenerEntry entry = new ListenerEntry<>(extractor, listener); + listeners.add(entry); + return entry; + } + + private CompletableFuture startPolling() { + CompletableFuture result = new CompletableFuture<>(); + sendRequestWithRetries(0, result); + return result; + } + + private synchronized void sendRequestWithRetries( + int attemptCount, CompletableFuture finalResult) { + if (closing) { + finalResult.completeExceptionally(new RuntimeException("Client is closing")); + return; + } + + CompletableFuture currentRequest = sendRequest(); + // We only schedule the next poll after successfully getting a client config + // from the server. + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = + currentRequest.whenComplete( + (result, throwable) -> { + // Config updated + if (throwable == null) { + setClientConfiguration(result); + scheduleNextPoll(); + finalResult.complete(result); + return; + } + + // Handle failure and retry if necessary + if (handleFailedFetch(throwable, attemptCount)) { + debugTagTracer.record( + TelemetryConfiguration.Level.ERROR, "client_config_fetch_failed"); + replaceChannel(); + long delay = getRetryDelay(attemptCount); + @SuppressWarnings("UnusedVariable") + ScheduledFuture ignored2 = + executor.schedule( + () -> sendRequestWithRetries(attemptCount + 1, finalResult), + delay, + TimeUnit.MILLISECONDS); + } else { + scheduleNextPoll(); + finalResult.completeExceptionally(throwable); + } + }); + } + + @GuardedBy("this") + private CompletableFuture sendRequest() { + CompletableFuture future = new CompletableFuture<>(); + + ClientCall call = + channel.newCall( + BigtableGrpc.getGetClientConfigurationMethod(), + CallOptions.DEFAULT.withDeadline( + Deadline.after(defaultDeadline.toMillis(), TimeUnit.MILLISECONDS))); + call.start( + new Listener() { + @Override + public void onMessage(ClientConfiguration cfg) { + cfg = normalizeConfig(cfg); + future.complete(cfg); + } + + @Override + public void onClose(Status status, Metadata trailers) { + if (!status.isOk()) { + future.completeExceptionally(status.asRuntimeException()); + } + } + }, + metadata); + call.sendMessage(request); + call.halfClose(); + call.request(1); + + return future; + } + + @SuppressWarnings("deprecation") + private ClientConfiguration normalizeConfig(ClientConfiguration cfg) { + ClientConfiguration.Builder builder = cfg.toBuilder(); + + // TODO: remove this once server is updated + // Patch PollingConfiguration (migrating PollingInterval) + if (!cfg.hasPollingConfiguration()) { + builder.setPollingConfiguration( + defaultConfig.getPollingConfiguration().toBuilder() + .setPollingInterval(cfg.getPollingInterval())); + } + + // TODO: remove this once server is updated + // Patch SessionPoolConfiguration (migrating LoadBalancingOptions) + if (!cfg.getSessionConfiguration().hasSessionPoolConfiguration()) { + builder + .getSessionConfigurationBuilder() + .clearLoadBalancingOptions() + .setSessionPoolConfiguration( + defaultConfig.getSessionConfiguration().getSessionPoolConfiguration().toBuilder() + .setLoadBalancingOptions(cfg.getSessionConfiguration().getLoadBalancingOptions()) + .build()); + } else { + // ignore LoadBalancing options when we migrated to SessionPoolConfig + builder.getSessionConfigurationBuilder().clearLoadBalancingOptions(); + } + // TODO: remove this once server is updated + // Patch ChannelPoolConfiguration + if (!cfg.getSessionConfiguration().hasChannelConfiguration()) { + builder + .getSessionConfigurationBuilder() + .setChannelConfiguration( + defaultConfig.getSessionConfiguration().getChannelConfiguration()); + } + + // Patch debug tag level + switch (cfg.getTelemetryConfiguration().getDebugTagLevel()) { + case UNRECOGNIZED: + case LEVEL_UNSPECIFIED: + builder + .getTelemetryConfigurationBuilder() + .setDebugTagLevel(defaultConfig.getTelemetryConfiguration().getDebugTagLevel()); + } + + // Inject overrides + overrideConfig.ifPresent(builder::mergeFrom); + + // When sessions are disabled make sure to clear out the config + if (cfg.getSessionConfiguration().getSessionLoad() == 0) { + builder.clearSessionConfiguration(); + return builder.build(); + } + + return builder.build(); + } + + public boolean areSessionsRequired() { + return overrideConfig.map(c -> c.getSessionConfiguration().getSessionLoad() > 0).orElse(false); + } + + private long getRetryDelay(int attempt) { + // the attempt is the total number of attempts starting from 0. The first request + // is sent immediately, and the second request is sent after 2 ^ 0 ms (with jitter) etc. + // Initial delay is 1 ms. + return ThreadLocalRandom.current().nextLong((long) Math.pow(2, attempt)); + } + + private synchronized void scheduleNextPoll() { + if (closing) { + return; + } + + if (!clientConfiguration.hasPollingConfiguration()) { + return; + } + long delayMs = + Durations.toMillis(clientConfiguration.getPollingConfiguration().getPollingInterval()); + + this.nextPoll = + executor.schedule( + () -> { + @SuppressWarnings("UnusedVariable") + CompletableFuture ignored = startPolling(); + }, + delayMs, + TimeUnit.MILLISECONDS); + } + + private synchronized void setClientConfiguration(ClientConfiguration result) { + ClientConfiguration old = this.clientConfiguration; + + clientConfiguration = result; + if (clientConfiguration.hasPollingConfiguration()) { + this.validUntil = + Instant.now() + .plus( + toJavaDuration( + clientConfiguration.getPollingConfiguration().getValidityDuration())); + } else if (clientConfiguration.getStopPolling()) { + this.validUntil = Instant.MAX; + } + + maybeLogConfigChange(old, result); + notifyListeners(old, clientConfiguration); + } + + private void maybeLogConfigChange(ClientConfiguration oldCfg, ClientConfiguration newCfg) { + if (shouldLogConfigChange(oldCfg, newCfg)) { + logger.log(Level.CONFIG, "ClientConfig changed to: {0}", newCfg); + } + } + + private boolean shouldLogConfigChange(ClientConfiguration oldCfg, ClientConfiguration newCfg) { + if (oldCfg.getPollingCase() != newCfg.getPollingCase()) { + return true; + } + // round down interval to minimize noise from jitter + if (oldCfg.getPollingCase() == PollingCase.POLLING_CONFIGURATION) { + long oldInterval = Durations.toMinutes(oldCfg.getPollingConfiguration().getPollingInterval()); + long newInterval = Durations.toMinutes(newCfg.getPollingConfiguration().getPollingInterval()); + if (oldInterval == newInterval) { + ClientConfiguration.Builder roundedOldCfgBuilder = oldCfg.toBuilder(); + roundedOldCfgBuilder + .getPollingConfigurationBuilder() + .setPollingInterval(newCfg.getPollingConfiguration().getPollingInterval()); + oldCfg = roundedOldCfgBuilder.build(); + } + } + return oldCfg.equals(newCfg); + } + + @GuardedBy("this") + private void notifyListeners(ClientConfiguration oldConfig, ClientConfiguration newConfig) { + notifying = true; + // Snapshot the listeners so that new listeners added this cycle dont get notified + List> snapshot = new ArrayList<>(listeners); + + for (ListenerEntry e : snapshot) { + if (pendingListenerRemovals.contains(e)) { + continue; + } + e.maybeNotify(oldConfig, newConfig); + } + + listeners.removeAll(pendingListenerRemovals); + pendingListenerRemovals.clear(); + notifying = false; + } + + private synchronized boolean handleFailedFetch(Throwable throwable, int attempt) { + if (validUntil.isBefore(Instant.now())) { + setClientConfiguration(defaultConfig); + } + + // Figure out if we should retry + if (!(throwable instanceof StatusRuntimeException)) { + return false; + } + Code statusCode = Status.fromThrowable(throwable).getCode(); + // do not retry non-retryable errors + switch (statusCode) { + case PERMISSION_DENIED: + case UNAUTHENTICATED: + logger.warning("instance.ping permission is required"); + return false; + case NOT_FOUND: + case INVALID_ARGUMENT: + return false; + default: + if (closing) { + return false; + } + return attempt < getClientConfiguration().getPollingConfiguration().getMaxRpcRetryCount(); + } + } + + private synchronized void replaceChannel() { + channel.shutdownNow(); + channel = channelProvider.newChannelBuilder().build(); + } + + private static Duration toJavaDuration(com.google.protobuf.Duration protobufDuration) { + return Duration.ofMillis(Durations.toMillis(protobufDuration)); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java index f448f22ef16f..ffac399e7262 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java @@ -21,6 +21,7 @@ import com.google.bigtable.v2.RowFilter; import com.google.bigtable.v2.RowRange; import com.google.bigtable.v2.RowSet; +import com.google.bigtable.v2.SessionReadRowRequest; import com.google.cloud.bigtable.data.v2.internal.ByteStringComparator; import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; @@ -312,6 +313,19 @@ public ByteStringRange getBound() { return RowSetUtil.getBound(builder.getRows()); } + @InternalApi + public TargetId getTargetId() { + return targetId; + } + + @InternalApi + public SessionReadRowRequest toSessionPointProto() { + return SessionReadRowRequest.newBuilder() + .setKey(this.builder.getRows().getRowKeysList().get(0)) + .setFilter(this.builder.getFilter()) + .build(); + } + /** * Creates the request protobuf. This method is considered an internal implementation detail and * not meant to be used by applications. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java index 38d822afcbfd..3208fc4e5880 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java @@ -20,6 +20,7 @@ import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsRequest.Entry; +import com.google.bigtable.v2.SessionMutateRowRequest; import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; @@ -255,6 +256,19 @@ public RowMutation mergeToCell( return this; } + @InternalApi + public TargetId getTargetId() { + return targetId; + } + + @InternalApi + public SessionMutateRowRequest toSessionProto() { + return SessionMutateRowRequest.newBuilder() + .setKey(key) + .addAllMutations(mutation.getMutations()) + .build(); + } + @InternalApi public MutateRowRequest toProto(RequestContext requestContext) { MutateRowRequest.Builder builder = MutateRowRequest.newBuilder(); 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 bcec4c540360..2d5022900ed4 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 @@ -158,6 +158,9 @@ public void onClose(Status status, Metadata trailers) { return future; } + // Internal headers (bigtable-features and user-agent) are merged in ClientContext and set on + // the transport channel. So when primeChannel is called from gax, the managed channel already has + // those headers. This is tested in EnhancedBigtableStubTest. private static Metadata createMetadata(Map headers, PingAndWarmRequest request) { Metadata metadata = new Metadata(); 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 c4f882e2f719..103381f76c28 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 @@ -28,6 +28,9 @@ import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials; import com.google.cloud.bigtable.data.v2.internal.JwtCredentialsWithAudience; import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.compat.DisabledShim; +import com.google.cloud.bigtable.data.v2.internal.compat.Shim; +import com.google.cloud.bigtable.data.v2.internal.compat.ShimImpl; import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; import com.google.cloud.bigtable.data.v2.internal.csm.MetricsImpl; @@ -38,6 +41,7 @@ import com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider; import com.google.cloud.bigtable.gaxx.grpc.BigtableTransportChannelProvider; import com.google.cloud.bigtable.gaxx.grpc.ChannelPrimer; +import com.google.common.base.Preconditions; import io.grpc.ManagedChannelBuilder; import io.opencensus.stats.Stats; import io.opencensus.stats.StatsRecorder; @@ -69,6 +73,7 @@ public class BigtableClientContext { // the background executor shared for OTEL instances and monitoring client and all other // background tasks private final ExecutorProvider backgroundExecutorProvider; + private final Shim sessionShim; public static BigtableClientContext create(EnhancedBigtableStubSettings settings) throws IOException { @@ -90,7 +95,7 @@ public static BigtableClientContext create( patchCredentials(builder); // Fix the credentials so that they can be shared - Credentials credentials = null; + @Nullable Credentials credentials = null; if (builder.getCredentialsProvider() != null) { credentials = builder.getCredentialsProvider().getCredentials(); } @@ -189,8 +194,15 @@ public static BigtableClientContext create( ClientContext clientContext = ClientContext.create(builder.build()); metrics.start(); + + Shim shim = + settings.isSessionsEnabled() + ? ShimImpl.create(clientInfo, credentials, metrics, backgroundExecutor, settings) + : new DisabledShim(); + try { - return new BigtableClientContext(false, clientInfo, clientContext, metrics, executorProvider); + return new BigtableClientContext( + false, shim, clientInfo, clientContext, metrics, executorProvider); } catch (IOException | RuntimeException t) { metrics.close(); throw t; @@ -219,12 +231,14 @@ private static void configureGrpcOtel( private BigtableClientContext( boolean isChild, + Shim shim, ClientInfo clientInfo, ClientContext clientContext, Metrics metrics, ExecutorProvider backgroundExecutorProvider) throws IOException { this.isChild = isChild; + this.sessionShim = shim; this.clientInfo = clientInfo; this.metrics = metrics; @@ -248,8 +262,14 @@ public ClientContext getClientContext() { public BigtableClientContext createChild(InstanceName instanceName, String appProfileId) throws IOException { + // TODO: either mark BigtableDataClientFactory as deprecated or figure out how to make it + // work with Sessions + Preconditions.checkState( + sessionShim instanceof DisabledShim, "Sessions don't support BigtableDataClientFactory"); + return new BigtableClientContext( true, + sessionShim, clientInfo.toBuilder().setInstanceName(instanceName).setAppProfileId(appProfileId).build(), clientContext, metrics, @@ -261,6 +281,8 @@ public void close() throws Exception { return; } + sessionShim.close(); + for (BackgroundResource resource : clientContext.getBackgroundResources()) { resource.close(); } @@ -315,4 +337,8 @@ private static void setupCookieHolder( return managedChannelBuilder; }); } + + public Shim getSessionShim() { + return sessionShim; + } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java index 44bcc00fb640..56b7d634f11a 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java @@ -299,14 +299,19 @@ public UnaryCallable createReadRowCallable(RowAdapter (query) -> query.limit(1).toProto(requestContext), Functions.identity()); - return new BigtableUnaryOperationCallable<>( - readRowCallable, - clientContext - .getDefaultCallContext() - .withRetrySettings(perOpSettings.readRowSettings.getRetrySettings()), - clientContext.getTracerFactory(), - getSpanName("ReadRow"), - /* allowNoResponse= */ true); + BigtableUnaryOperationCallable classic = + new BigtableUnaryOperationCallable<>( + readRowCallable, + clientContext + .getDefaultCallContext() + .withRetrySettings(perOpSettings.readRowSettings.getRetrySettings()), + clientContext.getTracerFactory(), + getSpanName("ReadRow"), + /* allowNoResponse= */ true); + + return bigtableClientContext + .getSessionShim() + .decorateReadRow(classic, rowAdapter, perOpSettings.readRowSettings); } private ServerStreamingCallable createReadRowsBaseCallable( @@ -600,14 +605,19 @@ public ApiFuture> futureCall(String s, ApiCallContext apiCallCon * */ private UnaryCallable createMutateRowCallable() { - return createUnaryCallable( - BigtableGrpc.getMutateRowMethod(), - req -> - composeRequestParams( - req.getAppProfileId(), req.getTableName(), req.getAuthorizedViewName()), - perOpSettings.mutateRowSettings, - req -> req.toProto(requestContext), - resp -> null); + UnaryCallable classic = + createUnaryCallable( + BigtableGrpc.getMutateRowMethod(), + req -> + composeRequestParams( + req.getAppProfileId(), req.getTableName(), req.getAuthorizedViewName()), + perOpSettings.mutateRowSettings, + req -> req.toProto(requestContext), + resp -> null); + + return bigtableClientContext + .getSessionShim() + .decorateMutateRow(classic, perOpSettings.mutateRowSettings); } /** diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index dcd0879b4065..59b7e90aa644 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -110,6 +110,9 @@ public class EnhancedBigtableStubSettings extends StubSettings PEER_INFO_KEY = Metadata.Key.of("bigtable-peer-info", Metadata.ASCII_STRING_MARSHALLER); - @Nullable private volatile ResponseParams responseParams; + @Nullable private volatile ClusterInformation clusterInfo; @Nullable private volatile PeerInfo peerInfo; @Nullable private volatile Duration gfeTiming; @Nullable private volatile Util.IpProtocol ipProtocol; - private boolean isAlts = false; + private volatile boolean isAlts = false; @Nullable - public ResponseParams getResponseParams() { - return responseParams; + public ClusterInformation getClusterInfo() { + return clusterInfo; } @Nullable @@ -139,14 +140,14 @@ public boolean isAlts() { } private void reset() { - responseParams = null; + clusterInfo = null; peerInfo = null; gfeTiming = null; ipProtocol = Util.IpProtocol.UNKNOWN; } void onResponseHeaders(Metadata md, Attributes attributes) { - responseParams = extractResponseParams(md); + clusterInfo = extractClusterInfo(md); gfeTiming = extractGfeLatency(md); peerInfo = extractPeerInfo(md, gfeTiming, attributes); ipProtocol = extractIpProtocol(attributes); @@ -157,8 +158,8 @@ void onClose(Status status, Metadata trailers, Attributes attributes) { if (ipProtocol == null) { ipProtocol = extractIpProtocol(attributes); } - if (responseParams == null) { - responseParams = extractResponseParams(trailers); + if (clusterInfo == null) { + clusterInfo = extractClusterInfo(trailers); } } @@ -193,44 +194,54 @@ private static Duration extractGfeLatency(Metadata metadata) { private static PeerInfo extractPeerInfo( Metadata metadata, Duration gfeTiming, Attributes attributes) { String encodedStr = metadata.get(PEER_INFO_KEY); - if (Strings.isNullOrEmpty(encodedStr)) { - return null; + PeerInfo peerInfo = PeerInfo.newBuilder().build(); + if (!Strings.isNullOrEmpty(encodedStr)) { + try { + byte[] decoded = Base64.getUrlDecoder().decode(encodedStr); + peerInfo = PeerInfo.parseFrom(decoded); + } catch (Exception e) { + throw new IllegalArgumentException( + "Failed to parse " + + PEER_INFO_KEY.name() + + " from the response header value: " + + encodedStr); + } } - try { - byte[] decoded = Base64.getUrlDecoder().decode(encodedStr); - PeerInfo peerInfo = PeerInfo.parseFrom(decoded); - PeerInfo.TransportType effectiveTransport = peerInfo.getTransportType(); - - // TODO: remove this once transport_type is being sent by the server - // This is a temporary workaround to detect directpath until its available from the server - if (effectiveTransport == PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN) { - boolean isAlts = AltsContextUtil.check(attributes); - if (isAlts) { - effectiveTransport = PeerInfo.TransportType.TRANSPORT_TYPE_DIRECT_ACCESS; - } else if (gfeTiming != null) { - effectiveTransport = PeerInfo.TransportType.TRANSPORT_TYPE_CLOUD_PATH; - } - } - if (effectiveTransport != PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN) { - peerInfo = peerInfo.toBuilder().setTransportType(effectiveTransport).build(); - } - return peerInfo; - } catch (Exception e) { - throw new IllegalArgumentException( - "Failed to parse " - + PEER_INFO_KEY.name() - + " from the response header value: " - + encodedStr); + // TODO: remove this once transport_type is being sent by the server + // This is a temporary workaround to detect directpath until its available from + // the server + if (peerInfo.getTransportType() == PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN) { + peerInfo = + peerInfo.toBuilder() + .setTransportType(inferTransportType(gfeTiming, attributes)) + .build(); + } + + return peerInfo; + } + + private static PeerInfo.TransportType inferTransportType( + Duration gfeTiming, Attributes attributes) { + boolean isAlts = AltsContextUtil.check(attributes); + if (isAlts) { + return PeerInfo.TransportType.TRANSPORT_TYPE_DIRECT_ACCESS; + } else if (gfeTiming != null) { + return PeerInfo.TransportType.TRANSPORT_TYPE_CLOUD_PATH; } + return PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN; } @Nullable - private static ResponseParams extractResponseParams(Metadata metadata) { - byte[] responseParams = metadata.get(LOCATION_METADATA_KEY); - if (responseParams != null) { + private static ClusterInformation extractClusterInfo(Metadata metadata) { + byte[] encoded = metadata.get(LOCATION_METADATA_KEY); + if (encoded != null) { try { - return ResponseParams.parseFrom(responseParams); + ResponseParams responseParams = ResponseParams.parseFrom(encoded); + return ClusterInformation.newBuilder() + .setZoneId(responseParams.getZoneId()) + .setClusterId(responseParams.getClusterId()) + .build(); } catch (InvalidProtocolBufferException e) { // Fail silently and return null } 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 912384965404..fd3a9f86ff2a 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 @@ -531,7 +531,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Cell", + "name": "com.google.bigtable.v2.AuthorizedViewRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -540,7 +540,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Cell$Builder", + "name": "com.google.bigtable.v2.AuthorizedViewRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -549,7 +549,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.CheckAndMutateRowRequest", + "name": "com.google.bigtable.v2.AuthorizedViewResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -558,7 +558,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.CheckAndMutateRowRequest$Builder", + "name": "com.google.bigtable.v2.AuthorizedViewResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -567,7 +567,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.CheckAndMutateRowResponse", + "name": "com.google.bigtable.v2.BackendIdentifier", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -576,7 +576,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.CheckAndMutateRowResponse$Builder", + "name": "com.google.bigtable.v2.BackendIdentifier$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -585,7 +585,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Column", + "name": "com.google.bigtable.v2.Cell", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -594,7 +594,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Column$Builder", + "name": "com.google.bigtable.v2.Cell$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -603,7 +603,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ColumnMetadata", + "name": "com.google.bigtable.v2.CheckAndMutateRowRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -612,7 +612,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ColumnMetadata$Builder", + "name": "com.google.bigtable.v2.CheckAndMutateRowRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -621,7 +621,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ColumnRange", + "name": "com.google.bigtable.v2.CheckAndMutateRowResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -630,7 +630,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ColumnRange$Builder", + "name": "com.google.bigtable.v2.CheckAndMutateRowResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -639,7 +639,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ExecuteQueryRequest", + "name": "com.google.bigtable.v2.ClientConfiguration", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -648,7 +648,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ExecuteQueryRequest$Builder", + "name": "com.google.bigtable.v2.ClientConfiguration$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -657,7 +657,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ExecuteQueryResponse", + "name": "com.google.bigtable.v2.ClientConfiguration$PollingConfiguration", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -666,7 +666,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ExecuteQueryResponse$Builder", + "name": "com.google.bigtable.v2.ClientConfiguration$PollingConfiguration$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -675,7 +675,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Family", + "name": "com.google.bigtable.v2.CloseSessionRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -684,7 +684,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Family$Builder", + "name": "com.google.bigtable.v2.CloseSessionRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -693,7 +693,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.FeatureFlags", + "name": "com.google.bigtable.v2.CloseSessionRequest$CloseSessionReason", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -702,7 +702,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.FeatureFlags$Builder", + "name": "com.google.bigtable.v2.ClusterInformation", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -711,7 +711,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.FullReadStatsView", + "name": "com.google.bigtable.v2.ClusterInformation$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -720,7 +720,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.FullReadStatsView$Builder", + "name": "com.google.bigtable.v2.Column", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -729,7 +729,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest", + "name": "com.google.bigtable.v2.Column$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -738,7 +738,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest$Builder", + "name": "com.google.bigtable.v2.ColumnMetadata", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -747,7 +747,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse", + "name": "com.google.bigtable.v2.ColumnMetadata$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -756,7 +756,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse$Builder", + "name": "com.google.bigtable.v2.ColumnRange", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -765,7 +765,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Idempotency", + "name": "com.google.bigtable.v2.ColumnRange$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -774,7 +774,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Idempotency$Builder", + "name": "com.google.bigtable.v2.ErrorResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -783,7 +783,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowRequest", + "name": "com.google.bigtable.v2.ErrorResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -792,7 +792,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowRequest$Builder", + "name": "com.google.bigtable.v2.ExecuteQueryRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -801,7 +801,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowResponse", + "name": "com.google.bigtable.v2.ExecuteQueryRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -810,7 +810,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowResponse$Builder", + "name": "com.google.bigtable.v2.ExecuteQueryResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -819,7 +819,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsRequest", + "name": "com.google.bigtable.v2.ExecuteQueryResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -828,7 +828,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsRequest$Builder", + "name": "com.google.bigtable.v2.Family", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -837,7 +837,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsRequest$Entry", + "name": "com.google.bigtable.v2.Family$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -846,7 +846,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsRequest$Entry$Builder", + "name": "com.google.bigtable.v2.FeatureFlags", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -855,7 +855,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsResponse", + "name": "com.google.bigtable.v2.FeatureFlags$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -864,7 +864,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsResponse$Builder", + "name": "com.google.bigtable.v2.FullReadStatsView", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -873,7 +873,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsResponse$Entry", + "name": "com.google.bigtable.v2.FullReadStatsView$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -882,7 +882,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.MutateRowsResponse$Entry$Builder", + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -891,7 +891,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation", + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -900,7 +900,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$AddToCell", + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -909,7 +909,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$AddToCell$Builder", + "name": "com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -918,7 +918,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$Builder", + "name": "com.google.bigtable.v2.GetClientConfigurationRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -927,7 +927,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn", + "name": "com.google.bigtable.v2.GetClientConfigurationRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -936,7 +936,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn$Builder", + "name": "com.google.bigtable.v2.GoAwayResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -945,7 +945,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily", + "name": "com.google.bigtable.v2.GoAwayResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -954,7 +954,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily$Builder", + "name": "com.google.bigtable.v2.HeartbeatResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -963,7 +963,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$DeleteFromRow", + "name": "com.google.bigtable.v2.HeartbeatResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -972,7 +972,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$DeleteFromRow$Builder", + "name": "com.google.bigtable.v2.Idempotency", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -981,7 +981,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$MergeToCell", + "name": "com.google.bigtable.v2.Idempotency$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -990,7 +990,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$MergeToCell$Builder", + "name": "com.google.bigtable.v2.LoadBalancingOptions", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -999,7 +999,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$SetCell", + "name": "com.google.bigtable.v2.LoadBalancingOptions$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1008,7 +1008,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Mutation$SetCell$Builder", + "name": "com.google.bigtable.v2.LoadBalancingOptions$LeastInFlight", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1017,7 +1017,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PartialResultSet", + "name": "com.google.bigtable.v2.LoadBalancingOptions$LeastInFlight$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1026,7 +1026,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PartialResultSet$Builder", + "name": "com.google.bigtable.v2.LoadBalancingOptions$PeakEwma", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1035,7 +1035,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PeerInfo", + "name": "com.google.bigtable.v2.LoadBalancingOptions$PeakEwma$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1044,7 +1044,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PeerInfo$Builder", + "name": "com.google.bigtable.v2.LoadBalancingOptions$Random", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1053,7 +1053,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PeerInfo$TransportType", + "name": "com.google.bigtable.v2.LoadBalancingOptions$Random$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1062,7 +1062,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PingAndWarmRequest", + "name": "com.google.bigtable.v2.MaterializedViewRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1071,7 +1071,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PingAndWarmRequest$Builder", + "name": "com.google.bigtable.v2.MaterializedViewRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1080,7 +1080,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PingAndWarmResponse", + "name": "com.google.bigtable.v2.MaterializedViewResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1089,7 +1089,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PingAndWarmResponse$Builder", + "name": "com.google.bigtable.v2.MaterializedViewResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1098,7 +1098,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PrepareQueryRequest", + "name": "com.google.bigtable.v2.MutateRowRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1107,7 +1107,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PrepareQueryRequest$Builder", + "name": "com.google.bigtable.v2.MutateRowRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1116,7 +1116,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PrepareQueryResponse", + "name": "com.google.bigtable.v2.MutateRowResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1125,7 +1125,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.PrepareQueryResponse$Builder", + "name": "com.google.bigtable.v2.MutateRowResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1134,7 +1134,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoFormat", + "name": "com.google.bigtable.v2.MutateRowsRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1143,7 +1143,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoFormat$Builder", + "name": "com.google.bigtable.v2.MutateRowsRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1152,7 +1152,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoRows", + "name": "com.google.bigtable.v2.MutateRowsRequest$Entry", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1161,7 +1161,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoRows$Builder", + "name": "com.google.bigtable.v2.MutateRowsRequest$Entry$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1170,7 +1170,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoRowsBatch", + "name": "com.google.bigtable.v2.MutateRowsResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1179,7 +1179,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoRowsBatch$Builder", + "name": "com.google.bigtable.v2.MutateRowsResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1188,7 +1188,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoSchema", + "name": "com.google.bigtable.v2.MutateRowsResponse$Entry", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1197,7 +1197,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ProtoSchema$Builder", + "name": "com.google.bigtable.v2.MutateRowsResponse$Entry$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1206,7 +1206,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RateLimitInfo", + "name": "com.google.bigtable.v2.Mutation", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1215,7 +1215,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RateLimitInfo$Builder", + "name": "com.google.bigtable.v2.Mutation$AddToCell", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1224,7 +1224,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamRequest", + "name": "com.google.bigtable.v2.Mutation$AddToCell$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1233,7 +1233,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamRequest$Builder", + "name": "com.google.bigtable.v2.Mutation$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1242,7 +1242,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse", + "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1251,7 +1251,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Builder", + "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1260,7 +1260,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$CloseStream", + "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1269,7 +1269,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$CloseStream$Builder", + "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1278,7 +1278,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange", + "name": "com.google.bigtable.v2.Mutation$DeleteFromRow", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1287,7 +1287,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange$Builder", + "name": "com.google.bigtable.v2.Mutation$DeleteFromRow$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1296,7 +1296,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange$Type", + "name": "com.google.bigtable.v2.Mutation$MergeToCell", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1305,7 +1305,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Heartbeat", + "name": "com.google.bigtable.v2.Mutation$MergeToCell$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1314,7 +1314,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Heartbeat$Builder", + "name": "com.google.bigtable.v2.Mutation$SetCell", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1323,7 +1323,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk", + "name": "com.google.bigtable.v2.Mutation$SetCell$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1332,7 +1332,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$Builder", + "name": "com.google.bigtable.v2.OpenAuthorizedViewRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1341,7 +1341,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$ChunkInfo", + "name": "com.google.bigtable.v2.OpenAuthorizedViewRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1350,7 +1350,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$ChunkInfo$Builder", + "name": "com.google.bigtable.v2.OpenAuthorizedViewRequest$Permission", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1359,7 +1359,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadIterationStats", + "name": "com.google.bigtable.v2.OpenAuthorizedViewResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1368,7 +1368,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadIterationStats$Builder", + "name": "com.google.bigtable.v2.OpenAuthorizedViewResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1377,7 +1377,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest", + "name": "com.google.bigtable.v2.OpenMaterializedViewRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1386,7 +1386,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest$Builder", + "name": "com.google.bigtable.v2.OpenMaterializedViewRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1395,7 +1395,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse", + "name": "com.google.bigtable.v2.OpenMaterializedViewRequest$Permission", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1404,7 +1404,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse$Builder", + "name": "com.google.bigtable.v2.OpenMaterializedViewResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1413,7 +1413,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadModifyWriteRule", + "name": "com.google.bigtable.v2.OpenMaterializedViewResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1422,7 +1422,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadModifyWriteRule$Builder", + "name": "com.google.bigtable.v2.OpenSessionRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1431,7 +1431,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadRowsRequest", + "name": "com.google.bigtable.v2.OpenSessionRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1440,7 +1440,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadRowsRequest$Builder", + "name": "com.google.bigtable.v2.OpenSessionResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1449,7 +1449,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadRowsRequest$RequestStatsView", + "name": "com.google.bigtable.v2.OpenSessionResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1458,7 +1458,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadRowsResponse", + "name": "com.google.bigtable.v2.OpenTableRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1467,7 +1467,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadRowsResponse$Builder", + "name": "com.google.bigtable.v2.OpenTableRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1476,7 +1476,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk", + "name": "com.google.bigtable.v2.OpenTableRequest$Permission", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1485,7 +1485,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk$Builder", + "name": "com.google.bigtable.v2.OpenTableResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1494,7 +1494,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RequestLatencyStats", + "name": "com.google.bigtable.v2.OpenTableResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1503,7 +1503,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RequestLatencyStats$Builder", + "name": "com.google.bigtable.v2.PartialResultSet", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1512,7 +1512,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RequestStats", + "name": "com.google.bigtable.v2.PartialResultSet$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1521,7 +1521,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RequestStats$Builder", + "name": "com.google.bigtable.v2.PeerInfo", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1530,7 +1530,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ResponseParams", + "name": "com.google.bigtable.v2.PeerInfo$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1539,7 +1539,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ResponseParams$Builder", + "name": "com.google.bigtable.v2.PeerInfo$TransportType", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1548,7 +1548,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ResultSetMetadata", + "name": "com.google.bigtable.v2.PingAndWarmRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1557,7 +1557,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ResultSetMetadata$Builder", + "name": "com.google.bigtable.v2.PingAndWarmRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1566,7 +1566,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Row", + "name": "com.google.bigtable.v2.PingAndWarmResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1575,7 +1575,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Row$Builder", + "name": "com.google.bigtable.v2.PingAndWarmResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1584,7 +1584,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter", + "name": "com.google.bigtable.v2.PrepareQueryRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1593,7 +1593,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter$Builder", + "name": "com.google.bigtable.v2.PrepareQueryRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1602,7 +1602,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter$Chain", + "name": "com.google.bigtable.v2.PrepareQueryResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1611,7 +1611,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter$Chain$Builder", + "name": "com.google.bigtable.v2.PrepareQueryResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1620,7 +1620,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter$Condition", + "name": "com.google.bigtable.v2.ProtoFormat", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1629,7 +1629,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter$Condition$Builder", + "name": "com.google.bigtable.v2.ProtoFormat$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1638,7 +1638,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter$Interleave", + "name": "com.google.bigtable.v2.ProtoRows", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1647,7 +1647,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowFilter$Interleave$Builder", + "name": "com.google.bigtable.v2.ProtoRows$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1656,7 +1656,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowRange", + "name": "com.google.bigtable.v2.ProtoRowsBatch", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1665,7 +1665,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowRange$Builder", + "name": "com.google.bigtable.v2.ProtoRowsBatch$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1674,7 +1674,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowSet", + "name": "com.google.bigtable.v2.ProtoSchema", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1683,7 +1683,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.RowSet$Builder", + "name": "com.google.bigtable.v2.ProtoSchema$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1692,7 +1692,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.SampleRowKeysRequest", + "name": "com.google.bigtable.v2.RateLimitInfo", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1701,7 +1701,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.SampleRowKeysRequest$Builder", + "name": "com.google.bigtable.v2.RateLimitInfo$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1710,7 +1710,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.SampleRowKeysResponse", + "name": "com.google.bigtable.v2.ReadChangeStreamRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1719,7 +1719,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.SampleRowKeysResponse$Builder", + "name": "com.google.bigtable.v2.ReadChangeStreamRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1728,7 +1728,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.StreamContinuationToken", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1737,7 +1737,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.StreamContinuationToken$Builder", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1746,7 +1746,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.StreamContinuationTokens", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$CloseStream", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1755,7 +1755,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.StreamContinuationTokens$Builder", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$CloseStream$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1764,7 +1764,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.StreamPartition", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1773,7 +1773,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.StreamPartition$Builder", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1782,7 +1782,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.TimestampRange", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$DataChange$Type", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1791,7 +1791,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.TimestampRange$Builder", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Heartbeat", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1800,7 +1800,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$Heartbeat$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1809,7 +1809,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1818,7 +1818,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$Builder", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1827,7 +1827,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$ChunkInfo", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1836,7 +1836,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount$Builder", + "name": "com.google.bigtable.v2.ReadChangeStreamResponse$MutationChunk$ChunkInfo$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1845,7 +1845,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$Max", + "name": "com.google.bigtable.v2.ReadIterationStats", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1854,7 +1854,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$Max$Builder", + "name": "com.google.bigtable.v2.ReadIterationStats$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1863,7 +1863,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$Min", + "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1872,7 +1872,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$Min$Builder", + "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1881,7 +1881,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$Sum", + "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1890,7 +1890,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Aggregate$Sum$Builder", + "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1899,7 +1899,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Array", + "name": "com.google.bigtable.v2.ReadModifyWriteRule", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1908,7 +1908,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Array$Builder", + "name": "com.google.bigtable.v2.ReadModifyWriteRule$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1917,7 +1917,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bool", + "name": "com.google.bigtable.v2.ReadRowsRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1926,7 +1926,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bool$Builder", + "name": "com.google.bigtable.v2.ReadRowsRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1935,7 +1935,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Builder", + "name": "com.google.bigtable.v2.ReadRowsRequest$RequestStatsView", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1944,7 +1944,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bytes", + "name": "com.google.bigtable.v2.ReadRowsResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1953,7 +1953,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bytes$Builder", + "name": "com.google.bigtable.v2.ReadRowsResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1962,7 +1962,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bytes$Encoding", + "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1971,7 +1971,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Builder", + "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1980,7 +1980,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Raw", + "name": "com.google.bigtable.v2.RequestLatencyStats", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1989,7 +1989,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Raw$Builder", + "name": "com.google.bigtable.v2.RequestLatencyStats$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -1998,7 +1998,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Date", + "name": "com.google.bigtable.v2.RequestStats", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2007,7 +2007,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Date$Builder", + "name": "com.google.bigtable.v2.RequestStats$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2016,7 +2016,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Enum", + "name": "com.google.bigtable.v2.ResponseParams", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2025,7 +2025,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Enum$Builder", + "name": "com.google.bigtable.v2.ResponseParams$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2034,7 +2034,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Float32", + "name": "com.google.bigtable.v2.ResultSetMetadata", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2043,7 +2043,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Float32$Builder", + "name": "com.google.bigtable.v2.ResultSetMetadata$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2052,7 +2052,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Float64", + "name": "com.google.bigtable.v2.Row", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2061,7 +2061,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Float64$Builder", + "name": "com.google.bigtable.v2.Row$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2070,7 +2070,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64", + "name": "com.google.bigtable.v2.RowFilter", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2079,7 +2079,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64$Builder", + "name": "com.google.bigtable.v2.RowFilter$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2088,7 +2088,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64$Encoding", + "name": "com.google.bigtable.v2.RowFilter$Chain", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2097,7 +2097,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64$Encoding$BigEndianBytes", + "name": "com.google.bigtable.v2.RowFilter$Chain$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2106,7 +2106,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64$Encoding$BigEndianBytes$Builder", + "name": "com.google.bigtable.v2.RowFilter$Condition", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2115,7 +2115,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64$Encoding$Builder", + "name": "com.google.bigtable.v2.RowFilter$Condition$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2124,7 +2124,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64$Encoding$OrderedCodeBytes", + "name": "com.google.bigtable.v2.RowFilter$Interleave", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2133,7 +2133,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Int64$Encoding$OrderedCodeBytes$Builder", + "name": "com.google.bigtable.v2.RowFilter$Interleave$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2142,7 +2142,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Map", + "name": "com.google.bigtable.v2.RowRange", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2151,7 +2151,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Map$Builder", + "name": "com.google.bigtable.v2.RowRange$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2160,7 +2160,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Proto", + "name": "com.google.bigtable.v2.RowSet", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2169,7 +2169,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Proto$Builder", + "name": "com.google.bigtable.v2.RowSet$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2178,7 +2178,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String", + "name": "com.google.bigtable.v2.SampleRowKeysRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2187,7 +2187,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String$Builder", + "name": "com.google.bigtable.v2.SampleRowKeysRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2196,7 +2196,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String$Encoding", + "name": "com.google.bigtable.v2.SampleRowKeysResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2205,7 +2205,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String$Encoding$Builder", + "name": "com.google.bigtable.v2.SampleRowKeysResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2214,7 +2214,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Bytes", + "name": "com.google.bigtable.v2.SessionClientConfiguration", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2223,7 +2223,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Bytes$Builder", + "name": "com.google.bigtable.v2.SessionClientConfiguration$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2232,7 +2232,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Raw", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2241,7 +2241,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Raw$Builder", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2250,7 +2250,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$CloudPathOnly", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2259,7 +2259,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Builder", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$CloudPathOnly$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2268,7 +2268,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessOnly", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2277,7 +2277,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding$Builder", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessOnly$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2286,7 +2286,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding$DelimitedBytes", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessWithFallback", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2295,7 +2295,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding$DelimitedBytes$Builder", + "name": "com.google.bigtable.v2.SessionClientConfiguration$ChannelPoolConfiguration$DirectAccessWithFallback$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2304,7 +2304,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding$OrderedCodeBytes", + "name": "com.google.bigtable.v2.SessionClientConfiguration$SessionPoolConfiguration", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2313,7 +2313,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding$OrderedCodeBytes$Builder", + "name": "com.google.bigtable.v2.SessionClientConfiguration$SessionPoolConfiguration$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2322,7 +2322,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding$Singleton", + "name": "com.google.bigtable.v2.SessionMutateRowRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2331,7 +2331,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Encoding$Singleton$Builder", + "name": "com.google.bigtable.v2.SessionMutateRowRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2340,7 +2340,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Field", + "name": "com.google.bigtable.v2.SessionMutateRowResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2349,7 +2349,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Struct$Field$Builder", + "name": "com.google.bigtable.v2.SessionMutateRowResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2358,7 +2358,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Timestamp", + "name": "com.google.bigtable.v2.SessionParametersResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2367,7 +2367,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Timestamp$Builder", + "name": "com.google.bigtable.v2.SessionParametersResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2376,7 +2376,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Timestamp$Encoding", + "name": "com.google.bigtable.v2.SessionReadRowRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2385,7 +2385,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Type$Timestamp$Encoding$Builder", + "name": "com.google.bigtable.v2.SessionReadRowRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2394,7 +2394,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Value", + "name": "com.google.bigtable.v2.SessionReadRowResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2403,7 +2403,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.Value$Builder", + "name": "com.google.bigtable.v2.SessionReadRowResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2412,7 +2412,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ValueRange", + "name": "com.google.bigtable.v2.SessionRefreshConfig", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2421,7 +2421,7 @@ "allPublicClasses": true }, { - "name": "com.google.bigtable.v2.ValueRange$Builder", + "name": "com.google.bigtable.v2.SessionRefreshConfig$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2430,7 +2430,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.Any", + "name": "com.google.bigtable.v2.SessionRefreshConfig$Metadata", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2439,7 +2439,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.Any$Builder", + "name": "com.google.bigtable.v2.SessionRefreshConfig$Metadata$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2448,7 +2448,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.BoolValue", + "name": "com.google.bigtable.v2.SessionRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2457,7 +2457,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.BoolValue$Builder", + "name": "com.google.bigtable.v2.SessionRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2466,7 +2466,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.BytesValue", + "name": "com.google.bigtable.v2.SessionRequestStats", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2475,7 +2475,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.BytesValue$Builder", + "name": "com.google.bigtable.v2.SessionRequestStats$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2484,7 +2484,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "name": "com.google.bigtable.v2.SessionResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2493,7 +2493,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "name": "com.google.bigtable.v2.SessionResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2502,7 +2502,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "name": "com.google.bigtable.v2.SessionType", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2511,7 +2511,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "name": "com.google.bigtable.v2.StreamContinuationToken", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2520,7 +2520,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "name": "com.google.bigtable.v2.StreamContinuationToken$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2529,7 +2529,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "name": "com.google.bigtable.v2.StreamContinuationTokens", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2538,7 +2538,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$Edition", + "name": "com.google.bigtable.v2.StreamContinuationTokens$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2547,7 +2547,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "name": "com.google.bigtable.v2.StreamPartition", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2556,7 +2556,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "name": "com.google.bigtable.v2.StreamPartition$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2565,7 +2565,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "name": "com.google.bigtable.v2.TableRequest", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2574,7 +2574,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "name": "com.google.bigtable.v2.TableRequest$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2583,7 +2583,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "name": "com.google.bigtable.v2.TableResponse", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2592,7 +2592,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "name": "com.google.bigtable.v2.TableResponse$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2601,7 +2601,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "name": "com.google.bigtable.v2.TelemetryConfiguration", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2610,7 +2610,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "name": "com.google.bigtable.v2.TelemetryConfiguration$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2619,7 +2619,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "name": "com.google.bigtable.v2.TelemetryConfiguration$Level", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2628,7 +2628,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "name": "com.google.bigtable.v2.TimestampRange", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2637,7 +2637,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "name": "com.google.bigtable.v2.TimestampRange$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2646,7 +2646,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "name": "com.google.bigtable.v2.Type", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2655,7 +2655,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "name": "com.google.bigtable.v2.Type$Aggregate", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2664,7 +2664,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "name": "com.google.bigtable.v2.Type$Aggregate$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2673,7 +2673,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "name": "com.google.bigtable.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2682,7 +2682,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "name": "com.google.bigtable.v2.Type$Aggregate$HyperLogLogPlusPlusUniqueCount$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2691,7 +2691,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "name": "com.google.bigtable.v2.Type$Aggregate$Max", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2700,7 +2700,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnforceNamingStyle", + "name": "com.google.bigtable.v2.Type$Aggregate$Max$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2709,7 +2709,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "name": "com.google.bigtable.v2.Type$Aggregate$Min", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2718,7 +2718,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "name": "com.google.bigtable.v2.Type$Aggregate$Min$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2727,7 +2727,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "name": "com.google.bigtable.v2.Type$Aggregate$Sum", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2736,7 +2736,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "name": "com.google.bigtable.v2.Type$Aggregate$Sum$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2745,7 +2745,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "name": "com.google.bigtable.v2.Type$Array", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2754,7 +2754,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "name": "com.google.bigtable.v2.Type$Array$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2763,7 +2763,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature", + "name": "com.google.bigtable.v2.Type$Bool", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2772,7 +2772,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "name": "com.google.bigtable.v2.Type$Bool$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2781,7 +2781,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "name": "com.google.bigtable.v2.Type$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2790,7 +2790,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "name": "com.google.bigtable.v2.Type$Bytes", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2799,7 +2799,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "name": "com.google.bigtable.v2.Type$Bytes$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2808,7 +2808,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "name": "com.google.bigtable.v2.Type$Bytes$Encoding", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2817,7 +2817,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2826,7 +2826,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Raw", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2835,7 +2835,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "name": "com.google.bigtable.v2.Type$Bytes$Encoding$Raw$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2844,7 +2844,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "name": "com.google.bigtable.v2.Type$Date", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2853,7 +2853,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "name": "com.google.bigtable.v2.Type$Date$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2862,7 +2862,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "name": "com.google.bigtable.v2.Type$Enum", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2871,7 +2871,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "name": "com.google.bigtable.v2.Type$Enum$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2880,7 +2880,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "name": "com.google.bigtable.v2.Type$Float32", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2889,7 +2889,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "name": "com.google.bigtable.v2.Type$Float32$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2898,7 +2898,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "name": "com.google.bigtable.v2.Type$Float64", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2907,7 +2907,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport", + "name": "com.google.bigtable.v2.Type$Float64$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2916,7 +2916,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$Builder", + "name": "com.google.bigtable.v2.Type$Int64", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2925,7 +2925,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "name": "com.google.bigtable.v2.Type$Int64$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2934,7 +2934,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "name": "com.google.bigtable.v2.Type$Int64$Encoding", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2943,7 +2943,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "name": "com.google.bigtable.v2.Type$Int64$Encoding$BigEndianBytes", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2952,7 +2952,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "name": "com.google.bigtable.v2.Type$Int64$Encoding$BigEndianBytes$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2961,7 +2961,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "name": "com.google.bigtable.v2.Type$Int64$Encoding$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2970,7 +2970,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "name": "com.google.bigtable.v2.Type$Int64$Encoding$OrderedCodeBytes", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2979,7 +2979,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "name": "com.google.bigtable.v2.Type$Int64$Encoding$OrderedCodeBytes$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2988,7 +2988,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "name": "com.google.bigtable.v2.Type$Map", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -2997,7 +2997,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "name": "com.google.bigtable.v2.Type$Map$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3006,7 +3006,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "name": "com.google.bigtable.v2.Type$Proto", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3015,7 +3015,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "name": "com.google.bigtable.v2.Type$Proto$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3024,7 +3024,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "name": "com.google.bigtable.v2.Type$String", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3033,7 +3033,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "name": "com.google.bigtable.v2.Type$String$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3042,7 +3042,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "name": "com.google.bigtable.v2.Type$String$Encoding", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3051,7 +3051,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "name": "com.google.bigtable.v2.Type$String$Encoding$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3060,7 +3060,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Bytes", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3069,7 +3069,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Bytes$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3078,7 +3078,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Raw", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3087,7 +3087,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "name": "com.google.bigtable.v2.Type$String$Encoding$Utf8Raw$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3096,7 +3096,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "name": "com.google.bigtable.v2.Type$Struct", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3105,7 +3105,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "name": "com.google.bigtable.v2.Type$Struct$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3114,7 +3114,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "name": "com.google.bigtable.v2.Type$Struct$Encoding", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3123,7 +3123,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "name": "com.google.bigtable.v2.Type$Struct$Encoding$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3132,7 +3132,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "name": "com.google.bigtable.v2.Type$Struct$Encoding$DelimitedBytes", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3141,7 +3141,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "name": "com.google.bigtable.v2.Type$Struct$Encoding$DelimitedBytes$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3150,7 +3150,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "name": "com.google.bigtable.v2.Type$Struct$Encoding$OrderedCodeBytes", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3159,7 +3159,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "name": "com.google.bigtable.v2.Type$Struct$Encoding$OrderedCodeBytes$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3168,7 +3168,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "name": "com.google.bigtable.v2.Type$Struct$Encoding$Singleton", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3177,7 +3177,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "name": "com.google.bigtable.v2.Type$Struct$Encoding$Singleton$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3186,7 +3186,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "name": "com.google.bigtable.v2.Type$Struct$Field", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3195,7 +3195,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "name": "com.google.bigtable.v2.Type$Struct$Field$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3204,7 +3204,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "name": "com.google.bigtable.v2.Type$Timestamp", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3213,7 +3213,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "name": "com.google.bigtable.v2.Type$Timestamp$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3222,7 +3222,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "name": "com.google.bigtable.v2.Type$Timestamp$Encoding", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3231,7 +3231,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$SymbolVisibility", + "name": "com.google.bigtable.v2.Type$Timestamp$Encoding$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3240,7 +3240,7 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "name": "com.google.bigtable.v2.Value", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3249,7 +3249,907 @@ "allPublicClasses": true }, { - "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "name": "com.google.bigtable.v2.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest$Metadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcRequest$Metadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.VirtualRpcResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnforceNamingStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", "queryAllDeclaredConstructors": true, "queryAllPublicConstructors": true, "queryAllDeclaredMethods": true, @@ -3437,6 +4337,258 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.rpc.BadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.rpc.Status", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-bigtable/src/main/resources/bigtable-default-client-config.textproto b/google-cloud-bigtable/src/main/resources/bigtable-default-client-config.textproto new file mode 100644 index 000000000000..44306311bb97 --- /dev/null +++ b/google-cloud-bigtable/src/main/resources/bigtable-default-client-config.textproto @@ -0,0 +1,49 @@ +# proto-file: google/bigtable/v2/bigtable.proto +# proto-message: google.bigtable.v2.ClientConfiguration + +polling_configuration { + polling_interval { + seconds: 300 + } + validity_duration { + seconds: 315576000000 + } + max_rpc_retry_count: 5 +} + +session_configuration { + session_load: 0 + + channel_configuration { + min_server_count: 2 + max_server_count: 25 + per_server_session_count: 10 + direct_access_with_fallback { + check_interval { + seconds: 60 + } + error_rate_threshold: 0.8 + } + } + + session_pool_configuration { + headroom: 0.5 + min_session_count: 5 + max_session_count: 400 + new_session_creation_budget: 50 + new_session_creation_penalty { + seconds: 60 + } + consecutive_session_failure_threshold: 10 + new_session_queue_length: 10 + load_balancing_options { + least_in_flight { + random_subset_size: 0 + } + } + } +} + +telemetry_configuration { + debug_tag_level: WARN +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java index e07f7a4a5a7d..2ee9d4014047 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java @@ -26,7 +26,7 @@ public class VersionTest { @Test public void testVersion() { - assertThat(Version.VERSION).matches("\\d+\\.\\d+\\.\\d(?:-SNAPSHOT)?"); + assertThat(Version.VERSION).matches("\\d+\\.\\d+\\.\\d(?:-session)?(?:-SNAPSHOT)?"); assertThat(Version.VERSION).isGreaterThan("1.22.0"); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewNameTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewNameTest.java new file mode 100644 index 000000000000..4d706ef29088 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/AuthorizedViewNameTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class AuthorizedViewNameTest { + + @Test + public void testParseOk() { + String name = "projects/fake-p/instances/fake-i/tables/fake-t/authorizedViews/fake-v"; + AuthorizedViewName parsed = AuthorizedViewName.parse(name); + + assertThat(parsed) + .isEqualTo( + AuthorizedViewName.builder() + .setProjectId("fake-p") + .setInstanceId("fake-i") + .setTableId("fake-t") + .setAuthorizedViewId("fake-v") + .build()); + } + + @Test + public void testParseFail() { + assertThrows(IllegalArgumentException.class, () -> AuthorizedViewName.parse("")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "project/fake-p/instances/fake-i/tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instance/fake-i/tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/table/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables/fake-t/authorizedView/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects//instances/fake-i/tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances//tables/fake-t/authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables//authorizedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables/fake-t/authorizedViews")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/tables/fake-t/authorizedViews/fake-v/extra")); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/ClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/ClientTest.java new file mode 100644 index 000000000000..7a92e5eb608a --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/ClientTest.java @@ -0,0 +1,352 @@ +/* + * Copyright 2026 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.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.OpenAuthorizedViewRequest; +import com.google.bigtable.v2.OpenMaterializedViewRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.protobuf.ByteString; +import com.google.protobuf.util.Durations; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.Server; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class ClientTest { + private ClientConfiguration defaultConfig; + + private ScheduledExecutorService executor; + private FakeBigtableService service; + private Server server; + private Client client; + private InstanceName instanceName = + InstanceName.parse("projects/fake-project/instances/fake-instance"); + + @BeforeEach + void setUp() throws IOException { + ClientConfiguration.Builder builder = ClientConfigurationManager.loadDefault().toBuilder(); + builder.setSessionConfiguration( + SessionClientConfiguration.newBuilder() + .setSessionLoad(1) + .setSessionPoolConfiguration( + SessionClientConfiguration.SessionPoolConfiguration.newBuilder() + .setNewSessionCreationBudget(10) + .setNewSessionCreationPenalty(Durations.fromMinutes(1)) + .setHeadroom(0.5f) + .setMinSessionCount(5) + .setMaxSessionCount(20) + .setNewSessionQueueLength(10) + .setConsecutiveSessionFailureThreshold(10))); + defaultConfig = builder.build(); + + executor = Executors.newScheduledThreadPool(4); + service = new FakeBigtableService(); + server = FakeServiceBuilder.create(service).intercept(new PeerInfoInterceptor()).start(); + + ClientSettings settings = + ClientSettings.builder() + .setChannelProvider( + new ChannelProviders.EmulatorChannelProvider("localhost", server.getPort())) + .setInstanceName(instanceName) + .setAppProfileId("default") + .build(); + + client = Client.create(settings); + } + + @AfterEach + void tearDown() { + client.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + public void testRequestFails() { + TableAsync table = + client.openTableAsync("fake-table", OpenTableRequest.Permission.PERMISSION_READ); + CompletableFuture future = + table.readRow( + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(), + Deadline.after(1, TimeUnit.MINUTES)); + + ExecutionException exception = assertThrows(ExecutionException.class, future::get); + assertThat(exception).hasCauseThat().isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) exception.getCause(); + assertThat(vRpcException).hasMessageThat().contains("Session failed with consecutive failures"); + + table.close(); + } + + @Test + public void testDeadlineRespected() { + TableAsync table = + client.openTableAsync("fake-table", OpenTableRequest.Permission.PERMISSION_READ); + CompletableFuture future = + table.readRow( + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(), + Deadline.after(10, TimeUnit.MILLISECONDS)); + + ExecutionException exception = assertThrows(ExecutionException.class, future::get); + assertThat(exception).hasCauseThat().isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) exception.getCause(); + assertThat(vRpcException).hasMessageThat().contains("DEADLINE_EXCEEDED"); + + table.close(); + } + + @Test + public void testGrpcContextDeadlineRespected() { + TableAsync table = + client.openTableAsync("fake-table", OpenTableRequest.Permission.PERMISSION_READ); + + Context.current() + .withDeadline(Deadline.after(10, TimeUnit.MILLISECONDS), executor) + .run( + () -> { + CompletableFuture future = + table.readRow( + SessionReadRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("key")) + .build(), + Deadline.after(1, TimeUnit.MINUTES)); + ExecutionException exception = assertThrows(ExecutionException.class, future::get); + assertThat(exception).hasCauseThat().isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) exception.getCause(); + assertThat(vRpcException).hasMessageThat().contains("DEADLINE_EXCEEDED"); + }); + + table.close(); + } + + @Test + public void testOpenAuthorizedViewRequestSent() throws Exception { + AuthorizedViewAsync view = + client.openAuthorizedViewAsync( + "fake-table", "fake-view", OpenAuthorizedViewRequest.Permission.PERMISSION_READ); + + // wait for session to start + Thread.sleep(500); + + OpenAuthorizedViewRequest expectedPayload = + OpenAuthorizedViewRequest.newBuilder() + .setAuthorizedViewName( + AuthorizedViewName.builder() + .setProjectId(instanceName.getProjectId()) + .setInstanceId(instanceName.getInstanceId()) + .setTableId("fake-table") + .setAuthorizedViewId("fake-view") + .build() + .toString()) + .setAppProfileId("default") + .setPermission(OpenAuthorizedViewRequest.Permission.PERMISSION_READ) + .build(); + + assertThat(service.openSessionRequests.get(0).getOpenSession().getPayload()) + .isEqualTo(expectedPayload.toByteString()); + + SessionReadRowRequest read = + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(); + + CompletableFuture future1 = + view.readRow(read, Deadline.after(1, TimeUnit.MINUTES)); + + future1.get(); + + ByteString payload = service.vrpcRequests.get(0).getVirtualRpc().getPayload(); + assertThat(payload).isEqualTo(VRpcDescriptor.READ_ROW_AUTH_VIEW.encode(read)); + + SessionMutateRowRequest mutate = + SessionMutateRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("key")) + .addMutations( + Mutation.newBuilder().setDeleteFromRow(Mutation.DeleteFromRow.getDefaultInstance())) + .build(); + CompletableFuture future2 = + view.mutateRow(mutate, Deadline.after(1, TimeUnit.MINUTES)); + + future2.get(); + + payload = service.vrpcRequests.get(1).getVirtualRpc().getPayload(); + assertThat(payload).isEqualTo(VRpcDescriptor.MUTATE_ROW_AUTH_VIEW.encode(mutate)); + + view.close(); + } + + @Test + public void testMaterializedViewRequestSent() throws Exception { + MaterializedViewAsync view = + client.openMaterializedViewAsync( + "fake-view", OpenMaterializedViewRequest.Permission.PERMISSION_READ); + + // Wait for session to start + Thread.sleep(500); + + OpenMaterializedViewRequest expected = + OpenMaterializedViewRequest.newBuilder() + .setMaterializedViewName( + MaterializedViewName.builder() + .setProjectId(instanceName.getProjectId()) + .setInstanceId(instanceName.getInstanceId()) + .setMaterializedViewId("fake-view") + .build() + .toString()) + .setPermission(OpenMaterializedViewRequest.Permission.PERMISSION_READ) + .setAppProfileId("default") + .build(); + + assertThat(service.openSessionRequests.get(0).getOpenSession().getPayload()) + .isEqualTo(expected.toByteString()); + + SessionReadRowRequest read = + SessionReadRowRequest.newBuilder().setKey(ByteString.copyFromUtf8("key")).build(); + + CompletableFuture future = + view.readRow(read, Deadline.after(1, TimeUnit.MINUTES)); + + future.get(); + + assertThat(service.vrpcRequests.get(0).getVirtualRpc().getPayload()) + .isEqualTo(VRpcDescriptor.READ_ROW_MAT_VIEW.encode(read)); + + view.close(); + } + + class FakeBigtableService extends BigtableGrpc.BigtableImplBase { + private final List openSessionRequests = new ArrayList<>(); + private final List vrpcRequests = new ArrayList<>(); + + @Override + public void getClientConfiguration( + GetClientConfigurationRequest request, + StreamObserver responseObserver) { + responseObserver.onNext(defaultConfig); + responseObserver.onCompleted(); + } + + @Override + public StreamObserver openTable( + StreamObserver responseObserver) { + // Make openTable take a long time and return a noop which will cause the session creation to + // fail. + try { + Thread.sleep(10); + } catch (Exception e) { + // dont care + } + return super.openTable(responseObserver); + } + + @Override + public StreamObserver openAuthorizedView( + StreamObserver responseObserver) { + return new StreamObserver() { + @Override + public void onNext(SessionRequest sessionRequest) { + if (sessionRequest.hasOpenSession()) { + openSessionRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setOpenSession(OpenSessionResponse.getDefaultInstance()) + .build()); + } else if (sessionRequest.hasVirtualRpc()) { + vrpcRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(sessionRequest.getVirtualRpc().getRpcId()) + .build()) + .build()); + } + } + + @Override + public void onError(Throwable throwable) {} + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + } + + @Override + public StreamObserver openMaterializedView( + StreamObserver responseObserver) { + return new StreamObserver() { + @Override + public void onNext(SessionRequest sessionRequest) { + if (sessionRequest.hasOpenSession()) { + openSessionRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setOpenSession(OpenSessionResponse.getDefaultInstance()) + .build()); + } else if (sessionRequest.hasVirtualRpc()) { + vrpcRequests.add(sessionRequest); + responseObserver.onNext( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(sessionRequest.getVirtualRpc().getRpcId()) + .build()) + .build()); + } + } + + @Override + public void onError(Throwable throwable) {} + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java index 09778bd46ee6..4a93ff70042d 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewNameTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewNameTest.java new file mode 100644 index 000000000000..4d46042c1625 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/MaterializedViewNameTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 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.internal.api; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class MaterializedViewNameTest { + + @Test + public void testParseOk() { + String name = "projects/fake-p/instances/fake-i/materializedViews/fake-v"; + + assertThat(MaterializedViewName.parse(name)) + .isEqualTo( + MaterializedViewName.builder() + .setProjectId("fake-p") + .setInstanceId("fake-i") + .setMaterializedViewId("fake-v") + .build()); + } + + @Test + public void testParseError() { + assertThrows(IllegalArgumentException.class, () -> AuthorizedViewName.parse("")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("project/fake-p/instances/fake-i/materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instance/fake-i/materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instances/fake-i/materializedView/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects//instances/fake-i/materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instances//materializedViews/fake-v")); + assertThrows( + IllegalArgumentException.class, + () -> AuthorizedViewName.parse("projects/fake-p/instances/fake-i/materializedViews/")); + assertThrows( + IllegalArgumentException.class, + () -> + AuthorizedViewName.parse( + "projects/fake-p/instances/fake-i/materializedViews/fake-v/extra")); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableBaseTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableBaseTest.java new file mode 100644 index 000000000000..54406abe51a8 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableBaseTest.java @@ -0,0 +1,213 @@ +/* + * Copyright 2026 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.internal.api; + +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.VRpcCallContextSubject.assertThat; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionMutateRowResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPool; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.protobuf.Message; +import io.grpc.Deadline; +import io.grpc.Metadata; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class TableBaseTest { + + private TableBase table; + private final FakeSessionPool fakeSessionPool = new FakeSessionPool(); + private final Metrics noopMetrics = new NoopMetrics(); + private final ScheduledExecutorService mockExecutor = + Mockito.mock(ScheduledExecutorService.class); + private static final ClientInfo clientInfo = + ClientInfo.builder() + .setInstanceName( + InstanceName.builder() + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .build()) + .setAppProfileId("default") + .build(); + private Deadline deadline; + private UnaryResponseFuture f; + + @BeforeEach + public void setup() { + table = + new TableBase( + fakeSessionPool, + VRpcDescriptor.READ_ROW, + VRpcDescriptor.MUTATE_ROW, + noopMetrics, + mockExecutor); + deadline = Deadline.after(1, TimeUnit.MINUTES); + f = new UnaryResponseFuture<>(); + } + + @Test + public void testAddToCellNotIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder().setAddToCell(Mutation.AddToCell.getDefaultInstance()).build()) + .build(), + f, + deadline); + + assertThat(fakeSessionPool.lastVRpc.ctx).isNotIdempotent(); + } + + @Test + public void testMergeToCellNotIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder().setMergeToCell(Mutation.MergeToCell.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isNotIdempotent(); + } + + @Test + public void testSetCellSystemTimestampNotIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder() + .setSetCell(Mutation.SetCell.newBuilder().setTimestampMicros(-1).build())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isNotIdempotent(); + } + + @Test + public void testDeleteFromRowIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder().setDeleteFromRow(Mutation.DeleteFromRow.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + @Test + public void testDeleteFromColumnIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder() + .setDeleteFromColumn(Mutation.DeleteFromColumn.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + @Test + public void testDeleteFromCfIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations( + Mutation.newBuilder() + .setDeleteFromFamily(Mutation.DeleteFromFamily.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + @Test + public void testSetCellIdempotent() { + table.mutateRow( + SessionMutateRowRequest.newBuilder() + .addMutations(Mutation.newBuilder().setSetCell(Mutation.SetCell.getDefaultInstance())) + .build(), + f, + deadline); + assertThat(fakeSessionPool.lastVRpc.ctx).isIdempotent(); + } + + static class FakeSessionPool implements SessionPool { + + private FakeVRpc lastVRpc = null; + + @Override + public void start(OpenTableRequest openReq, Metadata md) {} + + @Override + public void close(CloseSessionRequest req) {} + + @Override + public SessionPoolInfo getInfo() { + return SessionPoolInfo.create(clientInfo, VRpcDescriptor.TABLE_SESSION, "fake-pool"); + } + + @Override + public VRpc newCall( + VRpcDescriptor desc) { + FakeVRpc localVRpc = new FakeVRpc<>(); + this.lastVRpc = localVRpc; + return localVRpc; + } + + @Override + public int getConsecutiveUnimplementedFailures() { + return 0; + } + + @Override + public boolean hasSession() { + return true; + } + } + + static class FakeVRpc implements VRpc { + private VRpcCallContext ctx; + + @Override + public void start(Object req, VRpcCallContext ctx, VRpcListener ignored) { + this.ctx = ctx; + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) {} + + @Override + public void requestNext() {} + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java index fd8e8310a70f..7a09185f3dce 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImplTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImplTest.java new file mode 100644 index 000000000000..978da523ed73 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImplTest.java @@ -0,0 +1,378 @@ +/* + * Copyright 2026 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.internal.channels; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream.Listener; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer; +import io.grpc.Attributes; +import io.grpc.CallOptions; +import io.grpc.ClientCall; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Clock; +import java.time.Instant; +import java.util.Base64; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class ChannelPoolDpImplTest { + @Mock private ScheduledExecutorService bgExecutor; + + @Mock private Supplier channelSupplier; + + @Mock private ClientCall clientCall; + + @Mock private ManagedChannel channel; + + @Captor private ArgumentCaptor> listener; + + private final DebugTagTracer debugTagTracer = NoopMetrics.NoopDebugTracer.INSTANCE; + + private static final ChannelPoolConfiguration defaultConfig = + ChannelPoolConfiguration.newBuilder() + .setMinServerCount(2) + .setMaxServerCount(25) + .setPerServerSessionCount(10) + .build(); + + @Test + void testInitialService() { + when(channelSupplier.get()).thenReturn(channel); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + pool.serviceChannels(); + + verify(channelSupplier, times(pool.minGroups)).get(); + + pool.close(); + } + + @Test + void testNewStreamStartsASingleChannel() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + + ChannelPool pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + SessionStream ignored = + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT); + + // Only 1 channel created + verify(channelSupplier, times(1)).get(); + // And that channel was asked to create a new session + verify(channel, times(1)).newCall(any(), any()); + + pool.close(); + } + + @Test + void testSecondChannelCreatedWhenFirstIsFull() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // Starting channels are half-filled. + for (int i = 0; i < pool.softMaxPerGroup / 2; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT); + } + // Only 1 channel created. + verify(channelSupplier, times(1)).get(); + // And that channel was asked to create all the sessions on until max + verify(channel, times(pool.softMaxPerGroup / 2)).newCall(any(), any()); + + // Next call triggers creation of a new channel. + ManagedChannel otherChannel = Mockito.mock(ManagedChannel.class); + doReturn(otherChannel).when(channelSupplier).get(); + when(otherChannel.newCall(any(), any())).thenReturn(clientCall); + + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT); + verify(channelSupplier, times(2)).get(); + verify(otherChannel, times(1)).newCall(any(), any()); + + pool.close(); + } + + @Test + void testClosingASessionFreesASlot() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // fill up the channel + for (int i = 0; i < pool.softMaxPerGroup / 2; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + + // release one session + ClientCall.Listener value = listener.getValue(); + value.onClose(Status.OK, new Metadata()); + + // next call should not trigger creation of another channel + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // So invocation count should stay at 1 from the first channel + verify(channelSupplier, times(1)).get(); + + pool.close(); + } + + @Test + void testLeastLoadedChannelGetsNext() { + ManagedChannel channel1 = mock(ManagedChannel.class); + when(channel1.newCall(any(), any())).thenReturn(clientCall); + + ManagedChannel channel2 = mock(ManagedChannel.class); + when(channel2.newCall(any(), any())).thenReturn(clientCall); + + when(channelSupplier.get()).thenReturn(channel1, channel2); + doNothing().when(clientCall).start(listener.capture(), any()); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + // fill up 2 channels + for (int i = 0; i < pool.softMaxPerGroup; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + verify(channelSupplier, times(2)).get(); + + List> allListeners = listener.getAllValues(); + + // release one session + allListeners.get(0).onClose(Status.OK, new Metadata()); + + // next call should be created on the first channel + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // Now the first channel has an extra call + verify(channel1, times(pool.softMaxPerGroup / 2 + 1)).newCall(any(), any()); + + pool.close(); + } + + @Test + void testDownsize() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + doReturn(Attributes.EMPTY).when(clientCall).getAttributes(); + + Clock clock = Mockito.mock(Clock.class); + when(clock.instant()).thenReturn(Instant.now()); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl( + channelSupplier, defaultConfig, "pool", debugTagTracer, bgExecutor, clock); + + int numChannels = 5; + int numSessions = numChannels * pool.softMaxPerGroup / 2; + + for (int i = 0; i < numSessions; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + + verify(channelSupplier, times(numChannels)).get(); + + int i = 0; + // Start and finish all sessions. + for (ClientCall.Listener listener : listener.getAllValues()) { + // Afe Id of 0 creates an empty protobuf which does not get picks up in + // onHeaders, this is why we start with 555. + PeerInfo peerInfo = + PeerInfo.newBuilder().setApplicationFrontendId(555 + i / numChannels).build(); + Metadata headers = new Metadata(); + headers.put( + SessionStreamImpl.PEER_INFO_KEY, + Base64.getEncoder().encodeToString(peerInfo.toByteArray())); + listener.onHeaders(headers); + i++; + listener.onClose(Status.OK, new Metadata()); + } + + when(clock.instant()).thenReturn(Instant.now()); + pool.serviceChannels(); + verify(channel, times(numChannels - pool.minGroups)).shutdown(); + + pool.close(); + } + + @Test + void testDownsizeToOptimal() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + doReturn(Attributes.EMPTY).when(clientCall).getAttributes(); + + Clock clock = Mockito.mock(Clock.class); + when(clock.instant()).thenReturn(Instant.now()); + + ChannelPoolDpImpl pool = + new ChannelPoolDpImpl( + channelSupplier, defaultConfig, "pool", debugTagTracer, bgExecutor, clock); + + int numChannels = 5; + int numSessions = numChannels * pool.softMaxPerGroup / 2; + + for (int i = 0; i < numSessions; i++) { + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + } + + verify(channelSupplier, times(numChannels)).get(); + + int i = 0; + // Start all sessions. + for (ClientCall.Listener listener : listener.getAllValues()) { + // Afe Id of 0 creates an empty protobuf which does not get picks up in + // onHeaders, this is why we start with 555. + PeerInfo peerInfo = + PeerInfo.newBuilder().setApplicationFrontendId(555 + i / numChannels).build(); + Metadata headers = new Metadata(); + headers.put( + SessionStreamImpl.PEER_INFO_KEY, + Base64.getEncoder().encodeToString(peerInfo.toByteArray())); + listener.onHeaders(headers); + i++; + } + + // Now we have 25 sessions on 5 channel groups each of 1 channel. + // Let's close 6 sessions from different channels/AFEs. + i = 0; + for (ClientCall.Listener listener : listener.getAllValues()) { + if (i % 4 == 0 && i != 0) { + listener.onClose(Status.OK, new Metadata()); + } + i++; + } + + // Now we should have 19 sessions on 5 channel groups each of 1 channel. + // I.e. dumpState + // FINE: ChannelPool channelGroups: 5, channels: 5, starting channels: 0, totalStreams: 19, + // AFEs: 5, distribution: [4, 4, 4, 4, 3] + when(clock.instant()).thenReturn(Instant.now()); + pool.serviceChannels(); + + // Should scale down to 4 channels. 19 / 5 round up = 4. + verify(channel, times(numChannels - 4)).shutdown(); + + pool.close(); + } + + @Test + void testRecycleChannelOnUnimplemented() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + + ChannelPool pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + // Only 1 channel created initially + verify(channelSupplier, times(1)).get(); + + // Release with UNIMPLEMENTED status + ClientCall.Listener value = listener.getValue(); + value.onClose(Status.UNIMPLEMENTED, new Metadata()); + + // The channel should be shutdown + verify(channel, times(1)).shutdown(); + + // And a new channel should be requested from the supplier + verify(channelSupplier, times(2)).get(); + + pool.close(); + } + + @Test + void testRecycleChannelInGroupOnUnimplemented() { + when(channelSupplier.get()).thenReturn(channel); + when(channel.newCall(any(), any())).thenReturn(clientCall); + doNothing().when(clientCall).start(listener.capture(), any()); + doReturn(Attributes.EMPTY).when(clientCall).getAttributes(); + + ChannelPool pool = + new ChannelPoolDpImpl(channelSupplier, defaultConfig, debugTagTracer, bgExecutor); + + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + ClientCall.Listener value = listener.getValue(); + + // Assign to a group by providing AFE ID + PeerInfo peerInfo = PeerInfo.newBuilder().setApplicationFrontendId(555).build(); + Metadata headers = new Metadata(); + headers.put( + SessionStreamImpl.PEER_INFO_KEY, + Base64.getEncoder().encodeToString(peerInfo.toByteArray())); + value.onHeaders(headers); + + // This call is successful + value.onClose(Status.OK, new Metadata()); + + // Another call + pool.newStream(FakeSessionGrpc.getOpenSessionMethod(), CallOptions.DEFAULT) + .start(Mockito.mock(Listener.class), new Metadata()); + + value = listener.getValue(); + + // Release with UNIMPLEMENTED status + value.onClose(Status.UNIMPLEMENTED, new Metadata()); + + // The channel should be shutdown + verify(channel, times(1)).shutdown(); + + // And a new channel should be requested from the supplier + verify(channelSupplier, times(2)).get(); + + pool.close(); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPoolTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPoolTest.java new file mode 100644 index 000000000000..08aa7b3afe1f --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/channels/FallbackChannelPoolTest.java @@ -0,0 +1,365 @@ +/* + * Copyright 2026 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.internal.channels; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.lenient; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import com.google.cloud.bigtable.data.v2.internal.channels.SessionStream.Listener; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import io.grpc.CallOptions; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class FallbackChannelPoolTest { + @Mock private ChannelPool primary; + @Mock private ChannelPool secondary; + @Mock private ScheduledExecutorService exec; + @Mock private ScheduledFuture future; + @Mock private SessionStream primaryStream; + @Mock private SessionStream secondaryStream; + @Mock private Listener listener; + @Captor ArgumentCaptor listenerCaptor; + private Map invocationCount; + + private static final MethodDescriptor methodDescriptor = + FakeSessionGrpc.getOpenSessionMethod(); + + private FallbackConfiguration config; + private FallbackChannelPool pool; + private Runnable checkTask; + private Metrics metrics; + + @BeforeEach + void setUp() { + invocationCount = new HashMap<>(); + config = + FallbackConfiguration.builder() + .setEnabled(true) + .setErrorRate(0.5) + .setCheckInterval(Duration.ofSeconds(10)) + .setPrimary("Primary", primary) + .setFallback("Fallback", secondary) + .build(); + + // Capture the runnable passed to schedule + when(exec.schedule(any(Runnable.class), anyLong(), any(TimeUnit.class))) + .thenAnswer( + invocation -> { + checkTask = invocation.getArgument(0); + return future; + }); + + lenient().when(primary.newStream(any(), any())).thenReturn(primaryStream); + lenient().when(secondary.newStream(any(), any())).thenReturn(secondaryStream); + + metrics = new NoopMetrics(); + pool = new FallbackChannelPool(config, metrics.getPoolFallbackListener(), exec); + } + + @AfterEach + void tearDown() { + pool.close(); + metrics.close(); + } + + // Makes a call on the fallback channel pool, verifies the `stream` mock got the + // invocation. + private Listener openSessionGetListener(SessionStream stream) { + Integer count = invocationCount.getOrDefault(stream, 0); + count++; + invocationCount.put(stream, count); + + SessionStream s = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + s.start(listener, new Metadata()); + verify(stream, times(count)).start(listenerCaptor.capture(), any()); + return listenerCaptor.getValue(); + } + + // Makes a call on the fallback channel pool, verifies the `stream` mock got the + // invocation and + // opens session successfully. + private void openSessionSuccessfully(SessionStream stream) { + openSessionGetListener(stream).onBeforeSessionStart(PeerInfo.getDefaultInstance()); + } + + // Makes a call on the fallback channel pool, verifies the `stream` mock got the + // invocation and + // terminates the call with the `status`. + private void openSessionWithError(SessionStream stream, Status status) { + openSessionGetListener(stream).onClose(status, new Metadata()); + } + + @Test + void testLifecycle() { + pool.start(); + verify(primary).start(); + verify(secondary).start(); + verify(exec) + .schedule( + any(Runnable.class), + eq(config.getCheckInterval().toMillis()), + eq(TimeUnit.MILLISECONDS)); + + pool.close(); + verify(primary).close(); + verify(secondary).close(); + verify(future).cancel(false); + } + + @Test + void testRoutesToPrimaryByDefault() { + pool.start(); + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + + verify(primary).newStream(any(), any()); + verify(secondary, never()).newStream(any(), any()); + + // Verify delegation + stream.sendMessage(null); + verify(primaryStream).sendMessage(null); + } + + @Test + void testFallbackTrigger() { + pool.start(); + + // 1. Success + openSessionSuccessfully(primaryStream); + + // 2. Failure + openSessionWithError(primaryStream, Status.UNAVAILABLE); + + // Current stats: 1 success, 1 failure. Total 2. Rate 0.5. + // Config error rate is 0.5. So 0.5 >= 0.5 is true. Should switch. + + checkTask.run(); // Execute check + + // Next stream should go to secondary + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + + // Verify delegation + stream.sendMessage(null); + verify(secondaryStream).sendMessage(null); + } + + @Test + void testForceCloseDoesNotCountAsFailure() { + pool.start(); + + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + stream.start(listener, new Metadata()); + + verify(primaryStream).start(listenerCaptor.capture(), any()); + Listener primaryListener = listenerCaptor.getValue(); + primaryListener.onBeforeSessionStart(PeerInfo.getDefaultInstance()); + + stream.forceClose("test", null); + primaryListener.onClose(Status.CANCELLED, new Metadata()); + + // 1 success, 0 failure (ignored). + // Should not fallback. + + checkTask.run(); + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + } + + @Test + void testPeerInfoIgnoresFailures() { + pool.start(); + + Listener primaryListener = openSessionGetListener(primaryStream); + primaryListener.onBeforeSessionStart(PeerInfo.getDefaultInstance()); + + primaryListener.onClose(Status.UNAVAILABLE, new Metadata()); + + // 1 success, 0 failure (ignored). + // Should not fallback. + + checkTask.run(); + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + } + + @Test + void testStartExceptionCountsAsFailure() { + doThrow(new RuntimeException("boom")).when(primaryStream).start(any(), any()); + + pool.start(); + SessionStream stream = pool.newStream(methodDescriptor, CallOptions.DEFAULT); + + try { + stream.start(listener, new Metadata()); + } catch (RuntimeException e) { + // expected + } + + // 1 failure. Rate 1.0 > 0.5. + checkTask.run(); + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + } + + @Test + void testUpdateConfigChangesInterval() { + pool.start(); + verify(exec) + .schedule( + any(Runnable.class), + eq(config.getCheckInterval().toMillis()), + eq(TimeUnit.MILLISECONDS)); + + Duration newInterval = Duration.ofSeconds(20); + FallbackConfiguration newConfig = config.toBuilder().setCheckInterval(newInterval).build(); + pool.updateConfig(newConfig); + + // checkTask.run() should reschedule with the new interval + checkTask.run(); + verify(exec) + .schedule(any(Runnable.class), eq(newInterval.toMillis()), eq(TimeUnit.MILLISECONDS)); + } + + @Test + void testUpdateConfigDisablesFallback() { + pool.start(); + // Trigger fallback + openSessionWithError(primaryStream, Status.UNAVAILABLE); + + checkTask.run(); // Now using secondary + + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + + // Disable fallback + FallbackConfiguration disabledConfig = config.toBuilder().setEnabled(false).build(); + pool.updateConfig(disabledConfig); + + // Should switch back to primary + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(primary, times(2)).newStream(any(), any()); + + // Even with failures, should not switch to secondary anymore + openSessionWithError(primaryStream, Status.UNAVAILABLE); + + checkTask.run(); + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, times(1)).newStream(any(), any()); // Still 1 from before + } + + @Test + void testUpdateConfigChangesErrorRate() { + pool.start(); + // One failure and one success = 50% + openSessionWithError(primaryStream, Status.UNAVAILABLE); + openSessionSuccessfully(primaryStream); + + // Update error rate to be higher + FallbackConfiguration newConfig = config.toBuilder().setErrorRate(0.6).build(); + pool.updateConfig(newConfig); + + checkTask.run(); + // 0.5 < 0.6, so should NOT switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + + // Update to a lower error rate + newConfig = config.toBuilder().setErrorRate(0.5).build(); + pool.updateConfig(newConfig); + + // One failure and one success = 50% + openSessionWithError(primaryStream, Status.UNAVAILABLE); + openSessionSuccessfully(primaryStream); + + checkTask.run(); + // 0.5 >= 0.5, so should switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + } + + @Test + void testUpdateConfigEnablesFallback() { + FallbackConfiguration disabledConfig = config.toBuilder().setEnabled(false).build(); + pool = new FallbackChannelPool(disabledConfig, metrics.getPoolFallbackListener(), exec); + + pool.start(); + // Primary failure + openSessionWithError(primaryStream, Status.UNAVAILABLE); + // Current error rate 1.0 + + checkTask.run(); + // Fallback is disabled, should NOT switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary, never()).newStream(any(), any()); + + // Update config to enable fallback + FallbackConfiguration newConfig = config.toBuilder().setEnabled(true).build(); + pool.updateConfig(newConfig); + + // Primary failure + openSessionWithError(primaryStream, Status.UNAVAILABLE); + // Current error rate 1.0 + + checkTask.run(); + // 1.0 > 0.5, so should switch + pool.newStream(methodDescriptor, CallOptions.DEFAULT); + verify(secondary).newStream(any(), any()); + } + + @Test + void testRescheduleAfterCheck() { + pool.start(); + verify(exec, times(1)).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + + checkTask.run(); + verify(exec, times(2)).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + + checkTask.run(); + verify(exec, times(3)).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class)); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapterTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapterTest.java new file mode 100644 index 000000000000..92c43430e067 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/compat/FutureAdapterTest.java @@ -0,0 +1,37 @@ +/* + * Copyright 2026 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.internal.compat; + +import static com.google.common.truth.Truth.assertWithMessage; + +import io.grpc.Context; +import io.grpc.Context.CancellableContext; +import java.util.concurrent.CompletableFuture; +import org.junit.jupiter.api.Test; + +class FutureAdapterTest { + @Test + void testCancellation() { + CompletableFuture inner = new CompletableFuture<>(); + CancellableContext cancellableContext = Context.current().withCancellation(); + FutureAdapter f = new FutureAdapter<>(inner, cancellableContext); + f.cancel(true); + + assertWithMessage("Inner future should be cancelled").that(inner.isCancelled()).isTrue(); + + assertWithMessage("gRPC context is cancelled").that(cancellableContext.isCancelled()).isTrue(); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java index 9e91a6c1d8f6..2f157180faef 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,16 +26,21 @@ import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.ClusterInformation; import com.google.bigtable.v2.PeerInfo; import com.google.bigtable.v2.PeerInfo.TransportType; -import com.google.bigtable.v2.ResponseParams; import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util; import com.google.cloud.bigtable.data.v2.internal.csm.exporter.BigtableCloudMonitoringExporter; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientSessionDuration.SessionCloseVRpcState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; import com.google.cloud.bigtable.gaxx.grpc.BigtableChannelPoolSettings.LoadBalancingStrategy; import com.google.cloud.monitoring.v3.MetricServiceClient; import com.google.cloud.monitoring.v3.MetricServiceSettings; @@ -87,8 +92,9 @@ public class MetricRegistryExportTest { private EnvInfo envInfo; private ClientInfo clientInfo = ClientInfo.builder().setInstanceName(INSTANCE_NAME).setAppProfileId(appProfileId).build(); + private SessionPoolInfo poolInfo; private MethodInfo methodInfo; - private ResponseParams clusterInfo; + private ClusterInformation clusterInfo; private PeerInfo peerInfo; private MonitoredResource expectedTableMonitoredResource; @@ -108,6 +114,8 @@ void setUp() throws Exception { .setHostName("my-vm") .build(); + poolInfo = SessionPoolInfo.create(clientInfo, VRpcDescriptor.TABLE_SESSION, tableId); + fakeServiceChannel = ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); @@ -127,17 +135,17 @@ void setUp() throws Exception { metricReader = PeriodicMetricReader.create(exporter); meterProvider = SdkMeterProvider.builder().registerMetricReader(metricReader).build(); - registry = metricRegistry.newRecorderRegistry(meterProvider); + registry = metricRegistry.newInternalRecorderRegistry(meterProvider); methodInfo = MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); clusterInfo = - ResponseParams.newBuilder().setZoneId(clusterZone).setClusterId(clusterId).build(); + ClusterInformation.newBuilder().setZoneId(clusterZone).setClusterId(clusterId).build(); peerInfo = PeerInfo.newBuilder() .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_CLOUD_PATH) .setGoogleFrontendId(123) - .setApplicationFrontendZone("us-east1-c") + .setApplicationFrontendRegion("us-east1") .setApplicationFrontendSubzone("ab") .build(); @@ -269,8 +277,8 @@ void testAttemptLatency2() { "transport_type", "session_cloudpath", "status", "UNAVAILABLE", "client_uid", envInfo.getUid(), - "transport_region", "", - "transport_zone", peerInfo.getApplicationFrontendZone(), + "transport_region", Util.formatTransportRegion(peerInfo), + "transport_zone", "", "transport_subzone", peerInfo.getApplicationFrontendSubzone(), "client_name", clientInfo.getClientName(), "app_profile", clientInfo.getAppProfileId(), @@ -639,6 +647,110 @@ void testBatchWriteQps() { .build()); } + @Test + void testSessionDuration() { + registry.sessionDuration.record( + poolInfo, + peerInfo, + Status.Code.DATA_LOSS, + CloseSessionReason.CLOSE_SESSION_REASON_USER, + SessionCloseVRpcState.SomeOk, + true, + Duration.ofMinutes(5)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/session/durations"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "session_type", "table", // derived from SessionType + "session_name", poolInfo.getName(), + "afe_location", peerInfo.getApplicationFrontendSubzone(), + "transport_type", "session_cloudpath", + "closing_reason", "CLOSE_SESSION_REASON_USER", + "vrpcs", "some_ok", + "ready", "true", + "status", "DATA_LOSS"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue( + Distribution.newBuilder() + .setCount(1) + .setMean((double) Duration.ofMinutes(5).toMillis()))) + .build()); + } + + @Test + void testSessionOpenLatency() { + registry.sessionOpenLatency.record( + poolInfo, peerInfo, Status.Code.DATA_LOSS, Duration.ofMillis(10)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/session/open_latencies"); + + Truth.assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "session_type", "table", // derived from SessionType + "session_name", poolInfo.getName(), + "afe_location", peerInfo.getApplicationFrontendSubzone(), + "transport_type", "session_cloudpath", + "status", "DATA_LOSS"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue(Distribution.newBuilder().setCount(1).setMean(10))) + .build()); + } + + @Test + void testSessionUptime() { + registry.sessionUptime.record(poolInfo, peerInfo, true, Duration.ofMinutes(10)); + metricReader.forceFlush().join(1, TimeUnit.MINUTES); + + TimeSeries timeSeries = + metricService.getSingleTimeSeriesByName( + "bigtable.googleapis.com/internal/client/session/uptime"); + + assertThat(timeSeries.getResource()).isEqualTo(expectedClientMonitoredResource); + + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsExactly( + "session_type", "table", // derived from SessionType + "session_name", poolInfo.getName(), + "afe_location", peerInfo.getApplicationFrontendSubzone(), + "transport_type", "session_cloudpath", + "ready", "true"); + + assertThat(timeSeries.getPointsList()) + .comparingExpectedFieldsOnly() + .containsExactly( + Point.newBuilder() + .setValue( + TypedValue.newBuilder() + .setDistributionValue( + Distribution.newBuilder() + .setCount(1) + .setMean((double) Duration.ofMinutes(10).toMillis()))) + .build()); + } + @Test void testPacemaker() { registry.pacemakerDelay.record(clientInfo, "background", Duration.ofMillis(1)); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsIsolationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsIsolationTest.java new file mode 100644 index 000000000000..bc4b3a8eb263 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsIsolationTest.java @@ -0,0 +1,161 @@ +/* + * Copyright 2026 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.internal.csm; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.ClientTransportLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableApplicationBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableAttemptLatency2; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableClientBlockingLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableConnectivityErrorCount; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableFirstResponseLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableOperationLatency; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRemainingDeadline; +import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRetryCount; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.truth.Correspondence; +import io.grpc.Deadline; +import io.opencensus.stats.StatsRecorder; +import io.opencensus.tags.Tagger; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class MetricsIsolationTest { + private ScheduledExecutorService executor; + private InMemoryMetricReader internalReader; + private InMemoryMetricReader userReader; + private MetricsImpl metrics; + private ClientInfo clientInfo; + + private static final Correspondence METRIC_DATA_NAME = + Correspondence.transforming(MetricData::getName, "metric data name"); + + private static final List PUBLIC_METRICS = + ImmutableList.of( + TableAttemptLatency.NAME, + TableOperationLatency.NAME, + TableFirstResponseLatency.NAME, + TableRetryCount.NAME, + TableConnectivityErrorCount.NAME, + TableApplicationBlockingLatency.NAME, + TableClientBlockingLatency.NAME); + + private static final List INTERNAL_METRICS = + ImmutableList.of( + TableAttemptLatency2.NAME, ClientTransportLatency.NAME, TableRemainingDeadline.NAME); + + @BeforeEach + void setUp() { + executor = Executors.newSingleThreadScheduledExecutor(); + internalReader = InMemoryMetricReader.create(); + userReader = InMemoryMetricReader.create(); + + clientInfo = + ClientInfo.builder() + .setInstanceName(InstanceName.of("project", "instance")) + .setAppProfileId("profile") + .build(); + + SdkMeterProvider internalMeterProvider = + SdkMeterProvider.builder().registerMetricReader(internalReader).build(); + OpenTelemetrySdk internalOtel = + OpenTelemetrySdk.builder().setMeterProvider(internalMeterProvider).build(); + + SdkMeterProvider userMeterProvider = + SdkMeterProvider.builder().registerMetricReader(userReader).build(); + OpenTelemetry userOtel = OpenTelemetrySdk.builder().setMeterProvider(userMeterProvider).build(); + + MetricRegistry registry = new MetricRegistry(); + + metrics = + new MetricsImpl( + registry, + clientInfo, + Mockito.mock(ApiTracerFactory.class), + internalOtel, + userOtel, + Mockito.mock(Tagger.class), + Mockito.mock(StatsRecorder.class), + executor); + } + + @AfterEach + void tearDown() { + metrics.close(); + executor.shutdown(); + } + + @Test + void testMetricsIsolation() { + metrics.start(); + + SessionPoolInfo poolInfo = + SessionPoolInfo.create( + ClientInfo.builder() + .setClientName("fake-client") + .setInstanceName(InstanceName.of("fake-project", "fake-instance")) + .setAppProfileId("default") + .build(), + VRpcDescriptor.TABLE_SESSION, + "fake-session"); + + // 1. Trigger shared and attemptLatency2 metrics (VRpcTracer) + VRpcTracer tracer = + metrics.newTableTracer( + poolInfo, VRpcDescriptor.READ_ROW, Deadline.after(1, TimeUnit.MINUTES)); + + tracer.onAttemptStart(null); + tracer.onRequestSent(PeerInfo.getDefaultInstance()); + tracer.onAttemptFinish(VRpcResult.createServerOk(VirtualRpcResponse.getDefaultInstance())); + tracer.onOperationFinish(VRpcResult.createServerOk(VirtualRpcResponse.getDefaultInstance())); + + // user metric should have exactly PUBLIC_METRICS + assertThat(userReader.collectAllMetrics()) + .comparingElementsUsing(METRIC_DATA_NAME) + .containsAtLeastElementsIn(PUBLIC_METRICS); + assertThat(userReader.collectAllMetrics()) + .comparingElementsUsing(METRIC_DATA_NAME) + .containsNoneIn(INTERNAL_METRICS); + + // internal metric should have exactly PUBLIC_METRICS + INTERNAL_METRICS + assertThat(internalReader.collectAllMetrics()) + .comparingElementsUsing(METRIC_DATA_NAME) + .containsAtLeastElementsIn(Iterables.concat(PUBLIC_METRICS, INTERNAL_METRICS)); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java index e97cb1dd5205..f92f375bdb26 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java index 8ab52111aa8d..55df4aee7f82 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java index 782b04928e5c..5e981f1f4bed 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,10 +38,7 @@ void ensureAllTransportTypeHaveExpectedPrefix() { @Test public void testOk() { - TagValue tagValue = - TagValue.create( - com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util.extractStatus(null) - .name()); + TagValue tagValue = TagValue.create(Util.extractStatus(null).name()); assertThat(tagValue.asString()).isEqualTo("OK"); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java index 8be676d6a8f5..dfd41325962b 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,7 @@ import com.google.api.core.ApiFutures; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.bigtable.v2.TableName; -import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.TableName; import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; import com.google.cloud.bigtable.data.v2.internal.csm.attributes.EnvInfo; @@ -102,7 +101,7 @@ public void setUp() { clientInfo = ClientInfo.builder() - .setInstanceName(InstanceName.of(tableName.getProject(), tableName.getInstance())) + .setInstanceName(tableName.getInstanceName()) .setAppProfileId(appProfileId) .build(); @@ -113,9 +112,9 @@ public void setUp() { attributes = Attributes.builder() - .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, tableName.getProject()) - .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstance()) - .put(TableSchema.TABLE_ID_KEY, tableName.getTable()) + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, tableName.getProjectId()) + .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstanceId()) + .put(TableSchema.TABLE_ID_KEY, tableName.getTableId()) .put(TableSchema.CLUSTER_ID_KEY, cluster) .put(TableSchema.ZONE_ID_KEY, zone) .put(MetricLabels.APP_PROFILE_KEY, appProfileId) @@ -158,9 +157,9 @@ public void testExportingSumData() throws InterruptedException { assertThat(timeSeries.getResource().getLabelsMap()) .containsExactly( - TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProject(), - TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstance(), - TableSchema.TABLE_ID_KEY.getKey(), tableName.getTable(), + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProjectId(), + TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstanceId(), + TableSchema.TABLE_ID_KEY.getKey(), tableName.getTableId(), TableSchema.CLUSTER_ID_KEY.getKey(), cluster, TableSchema.ZONE_ID_KEY.getKey(), zone); @@ -215,9 +214,9 @@ public void testExportingHistogramData() throws InterruptedException { assertThat(timeSeries.getResource().getLabelsMap()) .containsExactly( - TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProject(), - TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstance(), - TableSchema.TABLE_ID_KEY.getKey(), tableName.getTable(), + TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProjectId(), + TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstanceId(), + TableSchema.TABLE_ID_KEY.getKey(), tableName.getTableId(), TableSchema.CLUSTER_ID_KEY.getKey(), cluster, TableSchema.ZONE_ID_KEY.getKey(), zone); @@ -245,9 +244,9 @@ public void testExportingSumDataInBatches() { for (int i = 0; i < 250; i++) { Attributes testAttributes = Attributes.builder() - .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, tableName.getProject()) - .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstance()) - .put(TableSchema.TABLE_ID_KEY, tableName.getTable() + i) + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, tableName.getProjectId()) + .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstanceId()) + .put(TableSchema.TABLE_ID_KEY, tableName.getTableId() + i) .put(TableSchema.CLUSTER_ID_KEY, cluster) .put(TableSchema.ZONE_ID_KEY, zone) .put(MetricLabels.APP_PROFILE_KEY, appProfileId) @@ -287,11 +286,11 @@ public void testExportingSumDataInBatches() { assertThat(timeSeries.getResource().getLabelsMap()) .containsExactly( TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), - tableName.getProject(), + tableName.getProjectId(), TableSchema.INSTANCE_ID_KEY.getKey(), - tableName.getInstance(), + tableName.getInstanceId(), TableSchema.TABLE_ID_KEY.getKey(), - tableName.getTable() + i, + tableName.getTableId() + i, TableSchema.CLUSTER_ID_KEY.getKey(), cluster, TableSchema.ZONE_ID_KEY.getKey(), @@ -326,7 +325,7 @@ public void testTimeSeriesForMetricWithGceOrGkeResource() throws InterruptedExce ClientInfo clientInfo = ClientInfo.builder() - .setInstanceName(InstanceName.of(tableName.getProject(), tableName.getInstance())) + .setInstanceName(tableName.getInstanceName()) .setAppProfileId(appProfileId) .build(); @@ -343,9 +342,9 @@ public void testTimeSeriesForMetricWithGceOrGkeResource() throws InterruptedExce endEpoch, Attributes.of( ClientSchema.BIGTABLE_PROJECT_ID_KEY, - tableName.getProject(), + tableName.getProjectId(), ClientSchema.INSTANCE_ID_KEY, - tableName.getInstance(), + tableName.getInstanceId(), ClientSchema.APP_PROFILE_KEY, appProfileId, ClientSchema.CLIENT_NAME, @@ -372,7 +371,7 @@ public void testTimeSeriesForMetricWithGceOrGkeResource() throws InterruptedExce CreateTimeSeriesRequest request = mockMetricServiceStub.requests.poll(1, TimeUnit.MINUTES); - assertThat(request.getName()).isEqualTo("projects/" + tableName.getProject()); + assertThat(request.getName()).isEqualTo("projects/" + tableName.getProjectId()); assertThat(request.getTimeSeriesList()).hasSize(1); TimeSeries timeSeries = request.getTimeSeriesList().get(0); @@ -380,8 +379,8 @@ public void testTimeSeriesForMetricWithGceOrGkeResource() throws InterruptedExce assertThat(timeSeries.getResource().getLabelsMap()) .isEqualTo( ImmutableMap.builder() - .put("project_id", tableName.getProject()) - .put("instance", tableName.getInstance()) + .put("project_id", tableName.getProjectId()) + .put("instance", tableName.getInstanceId()) .put("app_profile", appProfileId) .put("client_project", gceProjectId) .put("region", "cleint-region") @@ -395,8 +394,8 @@ public void testTimeSeriesForMetricWithGceOrGkeResource() throws InterruptedExce assertThat(timeSeries.getMetric().getLabelsMap()) .isEqualTo( ImmutableMap.builder() - .put(ClientSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProject()) - .put(ClientSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstance()) + .put(ClientSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), tableName.getProjectId()) + .put(ClientSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstanceId()) .put(ClientSchema.APP_PROFILE_KEY.getKey(), appProfileId) .put(ClientSchema.CLIENT_NAME.getKey(), clientInfo.getClientName()) .put(MetricLabels.CLIENT_UID.getKey(), envInfo.getUid()) @@ -483,11 +482,11 @@ public void testExportingToMultipleProjects() throws InterruptedException { .containsExactly( ImmutableMap.of( TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), - tableName.getProject(), + tableName.getProjectId(), TableSchema.INSTANCE_ID_KEY.getKey(), - tableName.getInstance(), + tableName.getInstanceId(), TableSchema.TABLE_ID_KEY.getKey(), - tableName.getTable(), + tableName.getTableId(), TableSchema.CLUSTER_ID_KEY.getKey(), cluster, TableSchema.ZONE_ID_KEY.getKey(), @@ -496,9 +495,9 @@ public void testExportingToMultipleProjects() throws InterruptedException { TableSchema.BIGTABLE_PROJECT_ID_KEY.getKey(), "another-project", TableSchema.INSTANCE_ID_KEY.getKey(), - tableName.getInstance(), + tableName.getInstanceId(), TableSchema.TABLE_ID_KEY.getKey(), - tableName.getTable(), + tableName.getTableId(), TableSchema.CLUSTER_ID_KEY.getKey(), cluster, TableSchema.ZONE_ID_KEY.getKey(), diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java index 5385bb876b08..548a53600c17 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java @@ -197,7 +197,7 @@ public void setUp() throws Exception { BuiltinMetricsTracerFactory facotry = new BuiltinMetricsTracerFactory( - mr.newRecorderRegistry(otel.getMeterProvider()), clientInfo); + mr.newInternalRecorderRegistry(otel.getMeterProvider()), clientInfo); // Add an interceptor to add server-timing in headers ServerInterceptor trailersInterceptor = diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java index d265e76267ff..8f835db87db9 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2025 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,7 +90,7 @@ public void setUp() { tracker = new ChannelPoolMetricsTracer( - mr.newRecorderRegistry(openTelemetry.getMeterProvider()), clientInfo); + mr.newInternalRecorderRegistry(openTelemetry.getMeterProvider()), clientInfo); runnableCaptor = ArgumentCaptor.forClass(Runnable.class); // Configure mockScheduler to capture the runnable when tracker.start() is called diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracerTest.java new file mode 100644 index 000000000000..12f041fa851c --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeVRpcTracerTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.common.collect.ImmutableList; +import io.grpc.Status; +import java.time.Duration; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class CompositeVRpcTracerTest { + + @Mock VRpcTracer child1; + @Mock VRpcTracer child2; + private CompositeVRpcTracer compositeVRpcTracer; + + @BeforeEach + void setup() { + compositeVRpcTracer = new CompositeVRpcTracer(ImmutableList.of(child1, child2)); + } + + @Test + void onOperationStartTest() { + compositeVRpcTracer.onOperationStart(); + verify(child1, times(1)).onOperationStart(); + verify(child2, times(1)).onOperationStart(); + } + + @Test + void onAttemptStartTest() { + SessionReadRowRequest request = SessionReadRowRequest.getDefaultInstance(); + compositeVRpcTracer.onAttemptStart(request); + verify(child1, times(1)).onAttemptStart(request); + verify(child2, times(1)).onAttemptStart(request); + } + + @Test + void onRequestSentTest() { + PeerInfo fakePeerInfo = PeerInfo.getDefaultInstance(); + compositeVRpcTracer.onRequestSent(fakePeerInfo); + verify(child1, times(1)).onRequestSent(fakePeerInfo); + verify(child2, times(1)).onRequestSent(fakePeerInfo); + } + + @Test + void onApplicationBlockingLatenciesTest() { + Duration elapsed = Duration.ofMillis(5); + compositeVRpcTracer.recordApplicationBlockingLatencies(elapsed); + verify(child1, times(1)).recordApplicationBlockingLatencies(elapsed); + verify(child2, times(1)).recordApplicationBlockingLatencies(elapsed); + } + + @Test + void onAttemptFinishTest() { + VRpc.VRpcResult result = VRpc.VRpcResult.createLocalTransportError(Status.UNAVAILABLE); + compositeVRpcTracer.onAttemptFinish(result); + verify(child1, times(1)).onAttemptFinish(result); + verify(child2, times(1)).onAttemptFinish(result); + } + + @Test + void onOperationFinishTest() { + VRpc.VRpcResult result = VRpc.VRpcResult.createLocalTransportError(Status.UNAVAILABLE); + compositeVRpcTracer.onOperationFinish(result); + verify(child1, times(1)).onOperationFinish(result); + verify(child2, times(1)).onOperationFinish(result); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerTest.java new file mode 100644 index 000000000000..62a802dfeb0d --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/VRpcTracerTest.java @@ -0,0 +1,515 @@ +/* + * Copyright 2026 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.internal.csm.tracers; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; + +import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.Action; +import com.google.bigtable.v2.OpenFakeSessionRequest.ActionList; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionRequestStats; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricRegistry.RecorderRegistry; +import com.google.cloud.bigtable.data.v2.internal.csm.MetricsImpl; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.middleware.RetryingVRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.FakeDescriptor; +import com.google.cloud.bigtable.data.v2.internal.session.Session; +import com.google.cloud.bigtable.data.v2.internal.session.SessionFactory; +import com.google.cloud.bigtable.data.v2.internal.session.SessionImpl; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.common.base.Stopwatch; +import com.google.common.base.Suppliers; +import com.google.common.collect.Range; +import com.google.common.truth.Correspondence; +import com.google.protobuf.ByteString; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import com.google.rpc.RetryInfo; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.Server; +import io.opencensus.stats.Stats; +import io.opencensus.tags.Tags; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.time.Duration; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class VRpcTracerTest { + private static final Correspondence METRIC_DATA_BY_NAME = + Correspondence.transforming(MetricData::getName, "MetricData name"); + + private ScheduledExecutorService executor; + + private Server server; + private ChannelPool channelPool; + private SessionPoolInfo poolInfo; + + private MetricRegistry metricRegistry; + private RecorderRegistry recorderRegistry; + private InMemoryMetricReader metricReader; + private MetricsImpl metrics; + private Session session; + private final FakeSessionListener sessionListener = new FakeSessionListener(); + + private final String clusterId = "fake-cluster"; + private final String zoneId = "us-east1-a"; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + server = + FakeServiceBuilder.create(new FakeSessionService(executor)) + .intercept(new PeerInfoInterceptor()) + .start(); + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + ClientInfo clientInfo = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + poolInfo = SessionPoolInfo.create(clientInfo, FakeDescriptor.FAKE_SESSION, "fake-pool"); + + metricReader = InMemoryMetricReader.create(); + OpenTelemetrySdk otel = + OpenTelemetrySdk.builder() + .setMeterProvider(SdkMeterProvider.builder().registerMetricReader(metricReader).build()) + .build(); + + metricRegistry = new MetricRegistry(); + recorderRegistry = metricRegistry.newInternalRecorderRegistry(otel.getMeterProvider()); + + metrics = + new MetricsImpl( + metricRegistry, + clientInfo, + BaseApiTracerFactory.getInstance(), + otel, + null, + Tags.getTagger(), + Stats.getStatsRecorder(), + executor); + + // TODO: extract this out to a SimpleSessionPoolImpl that simply wraps a single Session + SessionFactory sessionFactory = + new SessionFactory( + channelPool, FakeDescriptor.FAKE_SESSION.getMethodDescriptor(), CallOptions.DEFAULT); + session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + } + + @AfterEach + void tearDown() { + if (session != null) { + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + } + channelPool.close(); + metrics.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + public void operationLatencyTest() throws Exception { + // Set up a session to return 1 error response with a retry delay and 1 vrpc response. + com.google.protobuf.Duration retryDelay = Durations.fromMillis(50); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 1)) + .addActions(createResponse(2, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + sessionListener.popUntil(OpenSessionResponse.class); + + // Test + CompletableFuture opFinished = new CompletableFuture<>(); + Stopwatch stopwatch = Stopwatch.createStarted(); + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture userFuture = new UnaryResponseFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + super.onOperationFinish(result); + // operation finished is called after listener.close() which means that userFuture gets + // resolved before tracer.onOperationFinish is called. Set a opFinished future here so + // the elapsed time includes everything. + opFinished.complete(null); + } + }; + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + userFuture); + SessionFakeScriptedResponse response = userFuture.get(); + assertThat(response).isEqualToDefaultInstance(); + opFinished.get(); + long maxOpLatency = stopwatch.elapsed(TimeUnit.MILLISECONDS); + + long operationLatencies = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/operation_latencies", + Attributes.empty()); + + assertThat(operationLatencies).isIn(Range.closed(Durations.toMillis(retryDelay), maxOpLatency)); + } + + @Test + public void attemptLatencyTest() throws Exception { + // Set up a session that returns an error response with a retry delay and a vrpc response. + com.google.protobuf.Duration retryDelay = Durations.fromMillis(50); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 1)) + .addActions(createResponse(2, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + sessionListener.popUntil(OpenSessionResponse.class); + + // Test + Stopwatch stopwatch = Stopwatch.createStarted(); + AtomicLong maxAttemptLatency = new AtomicLong(); + DelayedVRpc delayedVRpc = + new DelayedVRpc<>( + () -> new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor)); + UnaryResponseFuture userFuture = new UnaryResponseFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + super.onAttemptFinish(result); + if (!result.getStatus().isOk()) { + maxAttemptLatency.set(stopwatch.elapsed(TimeUnit.MILLISECONDS)); + } + } + }; + delayedVRpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + userFuture); + + long sessionDelay = 5L; + Thread.sleep(sessionDelay); + delayedVRpc.execute(); + + SessionFakeScriptedResponse response = userFuture.get(); + assertThat(response).isEqualToDefaultInstance(); + + long firstAttemptLatency = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/attempt_latencies", + Attributes.builder().put("status", Code.UNAVAILABLE.name()).build()); + assertThat(firstAttemptLatency).isIn(Range.closed(sessionDelay, maxAttemptLatency.get())); + } + + @Test + public void retryCountTest() throws Exception { + // Set up a session to return 2 error responses and a VRpc response. + com.google.protobuf.Duration retryDelay = Durations.fromMillis(0); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 1)) + .addActions(createErrorResponse(Code.UNAVAILABLE_VALUE, retryDelay, 2)) + .addActions(createResponse(3, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + sessionListener.popUntil(OpenSessionResponse.class); + + // Test + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + CompletableFuture opFinished = new CompletableFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onOperationFinish(VRpc.VRpcResult result) { + super.onOperationFinish(result); + opFinished.complete(null); + } + }; + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + SessionFakeScriptedResponse response = f.get(); + assertThat(response).isEqualToDefaultInstance(); + opFinished.get(); + + long retryCount = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/retry_count", + Attributes.empty()); + assertThat(retryCount).isEqualTo(2); + } + + @Test + public void clientBlockingLatencySessionDelayTest() throws Exception { + // Set up a session that returns a VRpc response after a fake delay + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions(createResponse(1, clusterId, zoneId)) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + + // Test + DelayedVRpc delayedVRpc = + new DelayedVRpc<>( + () -> new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor)); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + CompletableFuture attemptFinished = new CompletableFuture<>(); + MethodInfo methodInfo = + MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + VRpcTracer tracer = + new VRpcTracerImpl( + recorderRegistry, poolInfo, methodInfo, Deadline.after(1, TimeUnit.MINUTES)) { + @Override + public void onAttemptFinish(VRpc.VRpcResult result) { + super.onAttemptFinish(result); + attemptFinished.complete(null); + } + }; + assertThat(sessionListener.popNext(Duration.ofSeconds(2))) + .isInstanceOf(OpenSessionResponse.class); + + delayedVRpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + long sessionDelay = 200; + Thread.sleep(sessionDelay); + delayedVRpc.execute(); + + SessionFakeScriptedResponse response = f.get(); + assertThat(response).isEqualToDefaultInstance(); + attemptFinished.get(); + + long clientBlockingLatency = + getMetricValue( + metricReader, + "bigtable.googleapis.com/internal/client/throttling_latencies", + Attributes.empty()); + + assertThat(clientBlockingLatency).isAtLeast(sessionDelay); + } + + private Action createErrorResponse( + int errorCode, com.google.protobuf.Duration retryDelay, long rpcId) { + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder().setCode(errorCode).setMessage("fake error").build(); + ErrorResponse errorResponse = + ErrorResponse.newBuilder() + .setRpcId(rpcId) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(retryDelay).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + return Action.newBuilder().setErrorResponse(errorResponse).build(); + } + + private Action createResponse(long rpcId, String clusterId, String zoneId) { + VirtualRpcResponse response = + VirtualRpcResponse.newBuilder() + .setRpcId(rpcId) + .setClusterInfo( + ClusterInformation.newBuilder().setClusterId(clusterId).setZoneId(zoneId).build()) + .setStats(SessionRequestStats.getDefaultInstance()) + .setPayload(ByteString.EMPTY) + .build(); + + return Action.newBuilder().setResponse(response).build(); + } + + // Get the metric value that matches any of the attributes in the attribute map + private static long getMetricValue( + InMemoryMetricReader reader, String metricName, Attributes attributes) { + Collection allMetricData = reader.collectAllMetrics(); + List matchingMetadata = + allMetricData.stream() + .filter(md -> METRIC_DATA_BY_NAME.compare(md, metricName)) + .collect(Collectors.toList()); + assertWithMessage( + "Found multiple MetricData with the same name: %s, in: %s", + metricName, matchingMetadata) + .that(matchingMetadata.size()) + .isAtMost(1); + + if (!matchingMetadata.isEmpty()) { + MetricData metricData = matchingMetadata.get(0); + + Collection points = + metricData.getData().getPoints().stream() + .filter( + pd -> + pd.getAttributes() + .asMap() + .entrySet() + .containsAll(attributes.asMap().entrySet())) + .collect(Collectors.toList()); + + assertWithMessage("ambiguous labels matched too many points").that(points).hasSize(1); + + switch (metricData.getType()) { + case HISTOGRAM: + HistogramPointData hd = (HistogramPointData) points.iterator().next(); + return (long) hd.getSum() / hd.getCount(); + case LONG_SUM: + LongPointData ld = (LongPointData) points.iterator().next(); + return ld.getValue(); + default: + return 0; + } + } + + // MetricData was not found, assert on original collection to get a descriptive error message + assertThat(allMetricData).comparingElementsUsing(METRIC_DATA_BY_NAME).contains(metricName); + throw new IllegalStateException( + "MetricData was missing then appeared, this should never happen"); + } + + static class DelayedVRpc implements VRpc { + + private final Supplier> supplier; + + private ReqT req; + private VRpcCallContext ctx; + private VRpcListener listener; + + DelayedVRpc(Supplier> supplier) { + this.supplier = supplier; + } + + @Override + public void start(ReqT req, VRpcCallContext ctx, VRpcListener listener) { + this.req = req; + this.ctx = ctx; + this.listener = listener; + } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + throw new UnsupportedOperationException(); + } + + @Override + public void requestNext() { + throw new UnsupportedOperationException(); + } + + public void execute() { + supplier.get().start(req, ctx, listener); + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpcTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpcTest.java new file mode 100644 index 000000000000..d26eecd5d3ac --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/ForwardingVRpcTest.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 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.internal.middleware; + +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import io.grpc.Deadline; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class ForwardingVRpcTest { + @Mock private VRpc innerVRpc; + + @Mock private VRpcListener outerListener; + + @Captor private ArgumentCaptor> innerListenerCaptor; + + private final VRpcTracer tracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + + @Test + void proxyOkTest() { + ForwardingVRpc outerVRpc = new ForwardingVRpc<>(innerVRpc); + VRpcCallContext ctx = + VRpcCallContext.create(Deadline.after(10, TimeUnit.SECONDS), false, tracer); + // Start + outerVRpc.start("req", ctx, outerListener); + verify(innerVRpc).start(Mockito.eq("req"), Mockito.same(ctx), innerListenerCaptor.capture()); + + // Listener + VRpcListener innerListener = innerListenerCaptor.getValue(); + + // Listener.onMessage + innerListener.onMessage("response"); + verify(outerListener).onMessage("response"); + + // Listener.onClose + VRpcResult result = + VRpcResult.createServerOk(VirtualRpcResponse.newBuilder().setRpcId(1).build()); + innerListener.onClose(result); + verify(outerListener).onClose(result); + } + + @Test + void proxyCancelTest() { + ForwardingVRpc outerVRpc = new ForwardingVRpc<>(innerVRpc); + VRpcCallContext ctx = + VRpcCallContext.create(Deadline.after(10, TimeUnit.SECONDS), false, tracer); + // Start + outerVRpc.start("req", ctx, outerListener); + Throwable t = new RuntimeException(); + outerVRpc.cancel("reason", t); + + verify(innerVRpc).cancel("reason", t); + } + + @Test + void proxyRequestNextTest() { + ForwardingVRpc outerVRpc = new ForwardingVRpc<>(innerVRpc); + VRpcCallContext ctx = + VRpcCallContext.create(Deadline.after(10, TimeUnit.SECONDS), false, tracer); + outerVRpc.start("req", ctx, outerListener); + verify(innerVRpc).start(Mockito.anyString(), Mockito.any(), innerListenerCaptor.capture()); + VRpcListener innerListener = innerListenerCaptor.getValue(); + innerListener.onMessage("s"); + + outerVRpc.requestNext(); + verify(innerVRpc, times(1)).requestNext(); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpcTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpcTest.java new file mode 100644 index 000000000000..b9af925d4871 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/RetryingVRpcTest.java @@ -0,0 +1,412 @@ +/* + * Copyright 2026 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.internal.middleware; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.api.VRpcException; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.session.FakeDescriptor; +import com.google.cloud.bigtable.data.v2.internal.session.SessionFactory; +import com.google.cloud.bigtable.data.v2.internal.session.SessionImpl; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolInfo; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.common.base.Suppliers; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import com.google.rpc.RetryInfo; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.Status; +import java.io.IOException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class RetryingVRpcTest { + private ScheduledExecutorService executor; + + private Server server; + private ChannelPool channelPool; + private final VRpcTracer tracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private Metrics metrics; + + private SessionPoolInfo poolInfo; + private SessionFactory sessionFactory; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + server = + FakeServiceBuilder.create(new FakeSessionService(executor)) + .intercept(new PeerInfoInterceptor()) + .start(); + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + ClientInfo clientInfo = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + + // TODO: extract this out to a SimpleSessionPoolImpl that simply wraps a single Session + poolInfo = SessionPoolInfo.create(clientInfo, FakeDescriptor.FAKE_SESSION, "fake-pool"); + sessionFactory = + new SessionFactory( + channelPool, FakeDescriptor.FAKE_SESSION.getMethodDescriptor(), CallOptions.DEFAULT); + } + + @AfterEach + void tearDown() { + channelPool.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + void noRetryTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + public void retryServerError() throws Exception { + int requestTag = 1; + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // expected responses: 1 deadline exceeded error followed by a response. + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded error") + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(Durations.fromMillis(10)).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + requestTag, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .build()) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setResponse( + VirtualRpcResponse.newBuilder() + .setRpcId(2) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .setPayload(ByteString.EMPTY) + .build())) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(requestTag).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + public void retryDeadlineRespectedTest() throws Exception { + int requestTag = 1; + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // Deadline is < retryDelay + responseDealy, we should not schedule retry and fail with the + // server + // returned error + Duration retryDelay = Durations.fromSeconds(1); + Duration responseDelay = Durations.fromMillis(500); + Duration deadline = Durations.fromSeconds(1); + + String errorMessage = "fake unavailable error"; + // server responses: 1 unavailable error followed by an OK response + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.UNAVAILABLE.getNumber()) + .setMessage(errorMessage) + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(retryDelay).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + requestTag, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .setDelay(responseDelay) + .build()) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setResponse( + VirtualRpcResponse.newBuilder() + .setRpcId(2) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .setPayload(ByteString.EMPTY) + .build())) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(requestTag).build(), + VRpc.VRpcCallContext.create( + Deadline.after(Durations.toMillis(deadline), TimeUnit.MILLISECONDS), true, tracer), + f); + ExecutionException exception = assertThrows(ExecutionException.class, f::get); + assertThat(exception).hasMessageThat().contains(errorMessage); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + public void vRpcFailureTest() throws Exception { + // vrpc error on the session should not close the stream + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // expected responses: 1 deadline exceeded error followed by a response. + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded error") + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .build()) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + VRpcException cause = + (VRpcException) assertThrows(ExecutionException.class, () -> f.get()).getCause(); + assertThat(cause).hasMessageThat().isEqualTo("DEADLINE_EXCEEDED: fake deadline exceeded error"); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isEqualTo(Status.OK); + } + + @Test + void cancelInScheduledState() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + + // expected responses: 1 deadline exceeded error followed by a response. + com.google.rpc.Status status = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded error") + .build(); + ErrorResponse error = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(status) + .setRetryInfo(RetryInfo.newBuilder().setRetryDelay(Durations.fromSeconds(1)).build()) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 1, + OpenFakeSessionRequest.ActionList.newBuilder() + .setRepeat(false) + .addActions( + OpenFakeSessionRequest.Action.newBuilder() + .setErrorResponse(error) + .build()) + .build()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + // Verify that session has started + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + RetryingVRpc retrying = + new RetryingVRpc<>(() -> session.newCall(FakeDescriptor.SCRIPTED), executor); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + retrying.start( + SessionFakeScriptedRequest.newBuilder().setTag(1).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + // Wait for the first attempt to fail and get scheduled for retry + Thread.sleep(50); + + retrying.cancel("test cancel", null); + + ExecutionException executionException = assertThrows(ExecutionException.class, f::get); + assertThat(executionException.getCause()).isInstanceOf(VRpcException.class); + VRpcException vRpcException = (VRpcException) executionException.getCause(); + assertThat(vRpcException.getStatus().getCode()).isEqualTo(Status.Code.CANCELLED); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpcCallContextTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpcCallContextTest.java new file mode 100644 index 000000000000..f9312e614920 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/middleware/VRpcCallContextTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2026 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.internal.middleware; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.base.Ticker; +import com.google.common.collect.Range; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class VRpcCallContextTest { + + @Test + public void testDeadline() { + FakeTicker fakeTicker = new FakeTicker(System.nanoTime()); + VRpc.OperationInfo operationInfo = + VRpc.OperationInfo.create(fakeTicker, Duration.ofMinutes(1), true); + assertThat(operationInfo.getDeadline().timeRemaining(TimeUnit.SECONDS)) + .isIn(Range.closed(58L, 60L)); + + fakeTicker.increment(Duration.ofSeconds(10)); + assertThat(operationInfo.getDeadline().timeRemaining(TimeUnit.SECONDS)) + .isIn(Range.closed(48L, 50L)); + + fakeTicker.increment(Duration.ofSeconds(10)); + VRpc.OperationInfo nextAttempt = operationInfo.createForNextAttempt(); + assertThat(nextAttempt.getDeadline().timeRemaining(TimeUnit.SECONDS)) + .isIn(Range.closed(38L, 40L)); + + fakeTicker.increment(Duration.ofSeconds(50)); + assertThat(nextAttempt.getDeadline().isExpired()).isTrue(); + } + + private static class FakeTicker extends Ticker { + private long nanoTime; + + FakeTicker(long time) { + this.nanoTime = time; + } + + void increment(Duration duration) { + this.nanoTime += duration.toNanos(); + } + + @Override + public long read() { + return nanoTime; + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/FakeDescriptor.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/FakeDescriptor.java new file mode 100644 index 000000000000..f7cee4eb0da5 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/FakeDescriptor.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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.internal.session; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.FakeSessionOpRequest; +import com.google.bigtable.v2.FakeSessionOpResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.MethodInfo; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.Decoder; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.Encoder; +import com.google.cloud.bigtable.data.v2.internal.session.VRpcDescriptor.SessionDescriptor; +import com.google.common.collect.ImmutableMap; +import java.util.function.BiConsumer; +import java.util.function.Function; + +public class FakeDescriptor { + public static final SessionDescriptor FAKE_SESSION = + new SessionDescriptor<>( + FakeSessionGrpc.getOpenSessionMethod(), r -> "FAKE_SESSION", r -> ImmutableMap.of()); + public static VRpcDescriptor< + OpenFakeSessionRequest, SessionFakeScriptedRequest, SessionFakeScriptedResponse> + SCRIPTED = + new VRpcDescriptor<>( + FAKE_SESSION, + MethodInfo.of("Bigtable.FakeMethod", false), + createFakeEncoder(FakeSessionOpRequest.Builder::setScriptedRequest), + createFakeDecoder(FakeSessionOpResponse::getScripted), + (name, appProfileId, req) -> { + throw new UnsupportedOperationException(); + }); + + private static Encoder createFakeEncoder( + BiConsumer subEncoder) { + return req -> { + FakeSessionOpRequest.Builder builder = FakeSessionOpRequest.newBuilder(); + subEncoder.accept(builder, req); + return builder.build().toByteString(); + }; + } + + private static Decoder createFakeDecoder( + Function subDecoder) { + return (bytes) -> subDecoder.apply(FakeSessionOpResponse.parseFrom(bytes)); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizerTest.java new file mode 100644 index 000000000000..136195dc3312 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizerTest.java @@ -0,0 +1,216 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.cloud.bigtable.data.v2.internal.session.PoolSizer.Sized; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.PoolStats; +import com.google.common.base.Preconditions; +import com.google.rpc.Status; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; + +class PoolSizerTest { + + private static final float IDLE_SESSION_HEADROOM_RATIO = 0.5f; + private static final int MIN_IDLE_SESSIONS = 5; + private static final int MAX_IDLE_SESSIONS = 400; + private static final int PENDING_RPCS_PER_SESSION = 10; + + private static final SessionClientConfiguration.SessionPoolConfiguration DEFAULT_CONFIG = + SessionClientConfiguration.SessionPoolConfiguration.newBuilder() + .setHeadroom(IDLE_SESSION_HEADROOM_RATIO) + .setMinSessionCount(MIN_IDLE_SESSIONS) + .setMaxSessionCount(MAX_IDLE_SESSIONS) + .setNewSessionQueueLength(PENDING_RPCS_PER_SESSION) + .build(); + + @Test + void testInitial() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + assertThat(sizer.getScaleDelta()).isEqualTo(MIN_IDLE_SESSIONS); + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testTestEquilibrium() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setReadyCount(MIN_IDLE_SESSIONS); + stats.getTestHelper().setExpectedCapacity(MIN_IDLE_SESSIONS); + + assertThat(sizer.getScaleDelta()).isEqualTo(0); + assertThat(sizer.handleNewCall()).isFalse(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testPendingRpcs() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 9; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + Preconditions.checkState( + pendingRpcsCount.getSize() > MIN_IDLE_SESSIONS, + "Test requires the pendingCount to be larger than ready count"); + + int numReadySessions = MIN_IDLE_SESSIONS; + + stats.getTestHelper().setReadyCount(numReadySessions); + stats.getTestHelper().setInUseCount(0); + stats.getTestHelper().setExpectedCapacity(numReadySessions); + assertThat(sizer.getScaleDelta()) + .isEqualTo( + (int) Math.ceil((float) pendingRpcsCount.getSize() / PENDING_RPCS_PER_SESSION) + - numReadySessions + + MIN_IDLE_SESSIONS); + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testInUseWithNewCall() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setReadyCount(0); + stats.getTestHelper().setInUseCount(1); + stats.getTestHelper().setExpectedCapacity(1); + + // Ensure that we always have at least MIN_IDLE_SESSIONS sessions available + // Separately we want to have IDLE_SESSION_HEADROOM_RATIO available sessions, but in this case + // MIN_IDLE_SESSIONS is the primary indicator + assertThat(sizer.getScaleDelta()).isEqualTo(MIN_IDLE_SESSIONS); + // Remain steady in band + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testInUseWithNewCall2() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setReadyCount(0); + stats.getTestHelper().setInUseCount(20); + stats.getTestHelper().setExpectedCapacity(20); + + // Separately we want to have IDLE_SESSION_HEADROOM_RATIO available sessions + // Separately we want to ensure that we always have at least MIN_IDLE_SESSIONS sessions + // but in this case the ratio is the primary indicator available + assertThat(sizer.getScaleDelta()).isEqualTo(10); + // Remain steady in band + assertThat(sizer.handleNewCall()).isTrue(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testEquilibriumWhenStarting() { + PoolStats stats = new PoolStats(); + Sized pendingRpcsCount = () -> 0; + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + stats.getTestHelper().setStartingCount(MIN_IDLE_SESSIONS); + stats.getTestHelper().setExpectedCapacity(MIN_IDLE_SESSIONS); + + assertThat(sizer.getScaleDelta()).isEqualTo(0); + // Remain steady in band + assertThat(sizer.handleNewCall()).isFalse(); + assertThat(sizer.handleGoAway(GoAwayResponse.getDefaultInstance())).isTrue(); + assertThat(sizer.handleSessionClose(Status.getDefaultInstance())).isTrue(); + } + + @Test + void testEquilibriumWhenStartingWithLoad() { + PoolStats stats = new PoolStats(); + final AtomicInteger pendingCount = new AtomicInteger(0); + Sized pendingRpcsCount = () -> pendingCount.get(); + PoolSizer sizer = new PoolSizer(stats, pendingRpcsCount, DEFAULT_CONFIG); + + assertThat(sizer.getScaleDelta()).isEqualTo(MIN_IDLE_SESSIONS); + + // Started 5 sessions on startup to satisfy PoolSizer.MIN_IDLE_SESSIONS. + stats.getTestHelper().setStartingCount(MIN_IDLE_SESSIONS); + stats.getTestHelper().setExpectedCapacity(MIN_IDLE_SESSIONS); + + // Requests start to pile up while we still have our first 5 sessions starting. + int incomingRequests = 100; + for (int i = 0; i < incomingRequests; i++) { + // When we start a pending vRPC we add it to the list... + pendingCount.incrementAndGet(); + // ... and call handleNewCall() on the sizer. + boolean newCallVerdict = sizer.handleNewCall(); + if (i % PENDING_RPCS_PER_SESSION == 0) { + // For 1st, 11th, 21st, 31st etc. pending call we should demand a new session to be started. + assertThat(newCallVerdict).isTrue(); + } else { + assertThat(newCallVerdict).isFalse(); + } + + int forPending = (int) Math.ceil((float) pendingCount.get() / PENDING_RPCS_PER_SESSION); + int sessionsNeeded = forPending + stats.getInUseCount(); + int desiredIdleSessions = (int) Math.ceil(sessionsNeeded * IDLE_SESSION_HEADROOM_RATIO); + desiredIdleSessions = + Math.max(Math.min(desiredIdleSessions, MAX_IDLE_SESSIONS), MIN_IDLE_SESSIONS); + int desiredCapacity = sessionsNeeded + desiredIdleSessions; + + assertThat(sizer.getScaleDelta()) + .isEqualTo(Math.max(0, desiredCapacity - stats.getExpectedCapacity())); + + if (newCallVerdict) { + // Starting new session as instructed by handleNewCall(). + stats.getTestHelper().setStartingCount(stats.getStartingCount() + 1); + stats.getTestHelper().setExpectedCapacity(stats.getExpectedCapacity() + 1); + } + } + + // After 100 pending RPCs we have 15 sessions starting (10 + 5 for idle headroom). + assertThat(stats.getExpectedCapacity()).isEqualTo(15); + assertThat(sizer.getScaleDelta()).isEqualTo(0); + assertThat(sizer.handleNewCall()).isFalse(); + + // Simulate one session has started. + stats.getTestHelper().setStartingCount(stats.getStartingCount() - 1); + stats.getTestHelper().setReadyCount(stats.getReadyCount() + 1); + // One pending would be immediately taken. + pendingCount.decrementAndGet(); + stats.getTestHelper().setReadyCount(stats.getReadyCount() - 1); + stats.getTestHelper().setInUseCount(stats.getInUseCount() + 1); + // And two more sessions would be requested. + // We still have pending calls for 10 sessions. + // + 1 in-use session now + // + 6 for idle headroom (50% of 11) + // = 17 sessions needed, but we only have 15 + assertThat(sizer.getScaleDelta()).isEqualTo(2); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudgetTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudgetTest.java new file mode 100644 index 000000000000..1eb9bbd467b9 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionCreationBudgetTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import java.time.Duration; +import java.time.Instant; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class SessionCreationBudgetTest { + + private FakeClock clock; + private Duration penalty; + + @BeforeEach + public void setup() { + clock = new FakeClock(Instant.now()); + penalty = Duration.ofMinutes(1); + } + + @Test + public void test() { + SessionCreationBudget budget = new SessionCreationBudget(1, penalty, clock); + // Try reserve 2 sessions, the second one should return false + assertThat(budget.tryReserveSession()).isTrue(); + assertThat(budget.tryReserveSession()).isFalse(); + + // Release the session, try reserve again should return true + budget.onSessionCreationSuccess(); + assertThat(budget.tryReserveSession()).isTrue(); + + // Release the session as failure, try reserve again should false because of penalty + budget.onSessionCreationFailure(); + assertThat(budget.tryReserveSession()).isFalse(); + + // increment the clock, try reserver again should return true + clock.increment(penalty.plus(Duration.ofNanos(1))); + assertThat(budget.tryReserveSession()).isTrue(); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImplTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImplTest.java new file mode 100644 index 000000000000..d3cc31ef8973 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImplTest.java @@ -0,0 +1,513 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.StatusSubject.assertThat; +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.VRpcResultSubject.assertThat; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.ErrorResponse; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.Action; +import com.google.bigtable.v2.OpenFakeSessionRequest.ActionList; +import com.google.bigtable.v2.OpenFakeSessionRequest.StreamError; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionParametersResponse; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.api.VRpcException; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult.State; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeVRpcListener; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.common.base.Stopwatch; +import com.google.common.base.Suppliers; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import io.grpc.CallOptions; +import io.grpc.Deadline; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.Server; +import io.grpc.Status; +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class SessionImplTest { + private ScheduledExecutorService executor; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private Metrics metrics; + + private Server server; + private ChannelPool channelPool; + private SessionFactory sessionFactory; + private final VRpcTracer tracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + private SessionPoolInfo poolInfo; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + server = + FakeServiceBuilder.create(new FakeSessionService(executor)) + .intercept(new PeerInfoInterceptor()) + .start(); + + ClientInfo clientInfo = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + + // TODO: extract this out to a SimpleSessionPoolImpl that simply wraps a single Session + poolInfo = SessionPoolInfo.create(clientInfo, FakeDescriptor.FAKE_SESSION, "fake-pool"); + sessionFactory = + new SessionFactory( + channelPool, FakeDescriptor.FAKE_SESSION.getMethodDescriptor(), CallOptions.DEFAULT); + } + + @AfterEach + void tearDown() { + channelPool.close(); + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + void sessionSendAndCloseTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void sessionCloseBeforeInit() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .build()); + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void sessionGoAwayTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + Duration goAwayDelay = Duration.ofMillis(100); + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .setGoAwayDelay(Durations.fromMillis(goAwayDelay.toMillis())) + .putVrpcActions(0, ActionList.getDefaultInstance()) + .putVrpcActions(1, ActionList.getDefaultInstance()) + .putVrpcActions(2, ActionList.getDefaultInstance()) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + // Send vRPCs until after a goaway time + Stopwatch stopwatch = Stopwatch.createStarted(); + while (stopwatch.elapsed(TimeUnit.MILLISECONDS) < goAwayDelay.toMillis()) { + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + f.get(); + } + + assertThat(sessionListener.popUntil(GoAwayResponse.class)).isInstanceOf(GoAwayResponse.class); + + // Make sure we can't send vrpc after receiving goaway + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(1).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThrows(ExecutionException.class, f::get); + + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void streamErrorDuringRpcTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + Status.Code actualCode = Status.Code.INTERNAL; + com.google.rpc.Status actualSessionStatusProto = + com.google.rpc.Status.newBuilder() + .setCode(actualCode.value()) + .setMessage("fake internal error") + .build(); + + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .setStreamError( + StreamError.newBuilder() + .setDelay(Durations.fromMillis(200)) + .setStatus(actualSessionStatusProto)) + .putVrpcActions( + 0, + ActionList.newBuilder() + .addActions( + Action.newBuilder() + .setResponse(VirtualRpcResponse.getDefaultInstance()) + .setDelay( + com.google.protobuf.Duration.newBuilder() + .setNanos(300000000)) + .build()) + .build()) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + + sessionListener.popUntil(OpenSessionResponse.class); + + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + VRpcException error = (VRpcException) assertThrows(ExecutionException.class, f::get).getCause(); + assertThat(error) + .hasMessageThat() + .isEqualTo( + "UNAVAILABLE: vRPC failed due to transport error\n" + + "Transport error: INTERNAL: fake internal error. PeerInfo: application_frontend_subzone: \"ll\" transport_type: TRANSPORT_TYPE_SESSION_DIRECT_ACCESS application_frontend_region: \"local\""); + assertThat(error.getResult()).state().isEqualTo(State.TRANSPORT_FAILURE); + // TODO: fix server Latency definition - need to split node latency from transport latency + assertThat(error.getResult()).backendLatency().isEqualTo(Duration.ZERO); + + Status status = sessionListener.popUntil(Status.class); + assertThat(status).code().isEqualTo(actualCode); + assertThat(status) + .description() + .isEqualTo( + actualSessionStatusProto.getMessage() + + ". PeerInfo: application_frontend_subzone: \"ll\" transport_type: TRANSPORT_TYPE_SESSION_DIRECT_ACCESS application_frontend_region: \"local\""); + } + + @Test + void rpcErrorDuringRpcTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + com.google.rpc.Status expectedRpcStatus = + com.google.rpc.Status.newBuilder() + .setCode(Code.DEADLINE_EXCEEDED_VALUE) + .setMessage("fake deadline exceeded") + .build(); + + ErrorResponse errorResponse = + ErrorResponse.newBuilder() + .setRpcId(1) + .setStatus(expectedRpcStatus) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .build(); + + ActionList errorActionList = + ActionList.newBuilder() + .addActions(Action.newBuilder().setErrorResponse(errorResponse).build()) + .build(); + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions(0, errorActionList) + .putVrpcActions(1, ActionList.getDefaultInstance()) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + + sessionListener.popUntil(OpenSessionResponse.class); + + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + // error response + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + VRpcException error = (VRpcException) assertThrows(ExecutionException.class, f::get).getCause(); + assertThat(error).hasMessageThat().isEqualTo("DEADLINE_EXCEEDED: fake deadline exceeded"); + assertThat(error.getResult()).state().isEqualTo(State.SERVER_RESULT); + // TODO: fix server Latency definition - need to split node latency from transport latency + assertThat(error.getResult()).backendLatency().isEqualTo(Duration.ZERO); + + // Sending another vRPC after a failed vRPC is ok + f = new UnaryResponseFuture<>(); + rpc = session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(1).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + // shouldn't throw an error + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + + session.close(CloseSessionRequest.getDefaultInstance()); + + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void localErrorTest() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(), + new Metadata(), + sessionListener); + + sessionListener.popUntil(OpenSessionResponse.class); + + RuntimeException expectedError = new RuntimeException("my fake onMessageError"); + FakeVRpcListener rpcListener = + new FakeVRpcListener() { + @Override + public void onMessage(SessionFakeScriptedResponse msg) { + throw expectedError; + } + }; + + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + rpcListener); + + VRpcResult result = (VRpcResult) rpcListener.popNext(); + + // TODO: Need a different State to represent local processing failure + assertThat(result).state().isEqualTo(State.USER_FAILURE); + // The status is INTERNAL with a desc explaining the failure was due to local handling + assertThat(result).status().code().isEqualTo(Status.CANCELLED.getCode()); + assertThat(result) + .status() + .description() + .isEqualTo("Cancelling RPC due to exception thrown by user callback"); + assertThat(result).status().cause().isSameInstanceAs(expectedError); + } + + @Test + void testHeartbeat() throws Exception { + FakeClock clock = new FakeClock(Instant.now()); + + Instant time = clock.instant(); + + SessionImpl session = new SessionImpl(metrics, clock, poolInfo, 0, sessionFactory.createNew()); + + int keepAliveDurationMs = 150; + + FakeSessionListener sessionListener = new FakeSessionListener(); + OpenSessionRequest openSessionRequest = + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .setSessionParams( + SessionParametersResponse.newBuilder() + .setKeepAlive(Durations.fromMillis(keepAliveDurationMs)) + .build()) + .putVrpcActions(0, ActionList.getDefaultInstance()) + .build() + .toByteString()) + .build(); + session.start(openSessionRequest, new Metadata(), sessionListener); + assertThat(sessionListener.popUntil(OpenSessionResponse.class)) + .isInstanceOf(OpenSessionResponse.class); + + assertThat(session.getNextHeartbeat()).isEqualTo(time.plus(SessionImpl.FUTURE_TIME)); + + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + f); + + assertThat(session.getNextHeartbeat()) + .isEqualTo(time.plus(Duration.ofMillis(keepAliveDurationMs))); + + assertThat(f.get()).isEqualTo(SessionFakeScriptedResponse.getDefaultInstance()); + + assertThat(session.getNextHeartbeat()).isEqualTo(time.plus(SessionImpl.FUTURE_TIME)); + + session.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("test closed session") + .build()); + assertThat(sessionListener.popUntil(Status.class)).isOk(); + } + + @Test + void testCancel() throws Exception { + SessionImpl session = new SessionImpl(metrics, poolInfo, 0, sessionFactory.createNew()); + + int responseDelayMs = 200; + // Configure the fake service to delay the response, giving us time to cancel it + ActionList actions = + ActionList.newBuilder() + .addActions( + Action.newBuilder() + .setDelay(Durations.fromMillis(responseDelayMs)) + .setResponse(VirtualRpcResponse.getDefaultInstance())) + .build(); + + FakeSessionListener sessionListener = new FakeSessionListener(); + session.start( + OpenSessionRequest.newBuilder() + .setPayload( + OpenFakeSessionRequest.newBuilder() + .putVrpcActions(0, actions) + .build() + .toByteString()) + .build(), + new Metadata(), + sessionListener); + + // Wait for the session to be ready + sessionListener.popUntil(OpenSessionResponse.class); + + // Start the RPC + FakeVRpcListener rpcListener = new FakeVRpcListener<>(); + VRpc rpc = + session.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, tracer), + rpcListener); + + // Cancel it immediately + rpc.cancel("test cancel", null); + + // Verify that the rpc was closed with a CANCELLED status + VRpcResult result = rpcListener.popUntil(VRpcResult.class); + assertThat(result).state().isEqualTo(State.UNCOMMITED); + assertThat(result).status().code().isEqualTo(Status.Code.CANCELLED); + assertThat(result).status().description().isEqualTo("test cancel"); + + // Verify that the response is ignored + Thread.sleep(responseDelayMs + 10); + assertThat(rpcListener.getOnMessageCount()).isEqualTo(0); + + session.close(CloseSessionRequest.getDefaultInstance()); + sessionListener.popUntil(Status.class); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionListTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionListTest.java new file mode 100644 index 000000000000..def4986a95c1 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionListTest.java @@ -0,0 +1,476 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.ClusterInformation; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.SessionRequestStats; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.PoolStats; +import com.google.cloud.bigtable.data.v2.internal.session.SessionList.SessionHandle; +import com.google.protobuf.Message; +import com.google.protobuf.util.Durations; +import io.grpc.Metadata; +import java.time.Duration; +import java.time.Instant; +import org.junit.jupiter.api.Test; + +class SessionListTest { + private final FakeSession fakeSession = new FakeSession(); + + private static final VRpcResult OK_RESULT = + VRpcResult.createServerOk( + VirtualRpcResponse.newBuilder() + .setRpcId(1) + .setClusterInfo(ClusterInformation.getDefaultInstance()) + .setStats( + SessionRequestStats.newBuilder().setBackendLatency(Durations.fromMicros(500))) + .build()); + private static final Duration FAKE_VRPC_E2E_LATENCY = Duration.ofMillis(1); + + @Test + void testInitialStats() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testInitialToStarting() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + list.newHandle(fakeSession); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).hasSize(1); + + assertThat(stats.getStartingCount()).isEqualTo(1); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + @Test + void testStartingToReady() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + handle.onSessionStarted(); + + assertThat(list.getAfesWithReadySessions()).hasSize(1); + assertThat(list.getAfesWithReadySessions().get(0).sessions).containsExactly(handle); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(1); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + // TODO: StartingToGoAway? or to REMOVED + + @Test + void testReadyToInUse() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(1); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + @Test + void testReadyInUseToIdle() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + assertThat(list.getAfesWithReadySessions().get(0).sessions).containsExactly(handle); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(1); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(1); + } + + @Test + void testReadyIdleToSoftClosing() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + // idle session after a goaway skips CLOSING + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testReadyInUseToSoftClosing() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSING; + handle.onSessionClosing(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(1); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingInUseToAwaitClose() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + // idle ready session skips CLOSING + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingInUseToAwaitCloseWhileRpcIsActive() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSING; + handle.onSessionClosing(); + + // Session will auto transition to WAIT_SERVER_CLOSE from CLOSING when vRpc finishes + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).containsExactly(handle); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testStartingToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + // server killed the session before it started + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.STARTING); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testReadyIdleToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.READY); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testReadyInUseToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSED; + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + handle.onSessionClosed(SessionState.READY); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingIdleToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.WAIT_SERVER_CLOSE); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testClosingInUseToClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + + fakeSession.state = SessionState.CLOSING; + handle.onSessionClosing(); + + // Simulate hard session close when a vRpc is outstanding + fakeSession.state = SessionState.CLOSED; + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + handle.onSessionClosed(SessionState.CLOSING); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + @Test + void testAwaitCloseToSoftClosed() { + SessionList list = new SessionList(); + PoolStats stats = list.getStats(); + + fakeSession.state = SessionState.STARTING; + SessionHandle handle = list.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + handle = list.checkoutSession(list.getAfesWithReadySessions().get(0)).get(); + handle.onVRpcFinish(FAKE_VRPC_E2E_LATENCY, OK_RESULT); + + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + fakeSession.state = SessionState.CLOSED; + handle.onSessionClosed(SessionState.WAIT_SERVER_CLOSE); + + assertThat(list.getAfesWithReadySessions()).isEmpty(); + assertThat(list.getAllSessions()).isEmpty(); + + assertThat(stats.getStartingCount()).isEqualTo(0); + assertThat(stats.getReadyCount()).isEqualTo(0); + assertThat(stats.getInUseCount()).isEqualTo(0); + assertThat(stats.getExpectedCapacity()).isEqualTo(0); + } + + // Minimal impl of Session that only exposes state to test SessionList + private static class FakeSession implements Session { + private SessionState state = SessionState.NEW; + + @Override + public SessionState getState() { + return state; + } + + @Override + public PeerInfo getPeerInfo() { + return PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .setApplicationFrontendId(1234) + .setApplicationFrontendRegion("us-east1") + .setApplicationFrontendSubzone("xx") + .build(); + } + + @Override + public Instant getLastStateChange() { + throw new UnsupportedOperationException(); + } + + @Override + public OpenParams getOpenParams() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isOpenParamsUpdated() { + return false; + } + + @Override + public String getLogName() { + throw new UnsupportedOperationException(); + } + + @Override + public Instant getNextHeartbeat() { + return Instant.now().plus(Duration.ofMinutes(5)); + } + + @Override + public void start(OpenSessionRequest req, Metadata headers, Listener sessionListener) { + throw new UnsupportedOperationException(); + } + + @Override + public void close(CloseSessionRequest req) { + throw new UnsupportedOperationException(); + } + + @Override + public void forceClose(CloseSessionRequest reason) { + throw new UnsupportedOperationException(); + } + + @Override + public + VRpc newCall(VRpcDescriptor descriptor) + throws IllegalStateException { + throw new UnsupportedOperationException(); + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImplTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImplTest.java new file mode 100644 index 000000000000..aff2e3c81481 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImplTest.java @@ -0,0 +1,535 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.cloud.bigtable.data.v2.internal.test_helpers.VRpcResultSubject.assertThat; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.StreamError; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.SessionFakeScriptedRequest; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionRefreshConfig; +import com.google.bigtable.v2.SessionRequest; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.api.UnaryResponseFuture; +import com.google.cloud.bigtable.data.v2.internal.api.VRpcException; +import com.google.cloud.bigtable.data.v2.internal.channels.ChannelPool; +import com.google.cloud.bigtable.data.v2.internal.channels.SingleChannelPool; +import com.google.cloud.bigtable.data.v2.internal.csm.Metrics; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.csm.tracers.VRpcTracer; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeSessionService; +import com.google.cloud.bigtable.data.v2.internal.session.fake.PeerInfoInterceptor; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager; +import com.google.common.base.Suppliers; +import com.google.common.collect.Range; +import com.google.common.truth.Correspondence; +import com.google.protobuf.ByteString; +import com.google.protobuf.util.Durations; +import com.google.rpc.Code; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.Context; +import io.grpc.Deadline; +import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import java.io.IOException; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Answers; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@Nested +@ExtendWith(MockitoExtension.class) +public class SessionPoolImplTest { + private static final ClientInfo CLIENT_INFO = + ClientInfo.builder() + .setAppProfileId("default") + .setInstanceName(InstanceName.parse("projects/fake-project/instances/fake-instance")) + .build(); + + private static Correspondence + OPEN_SESSION_REQUEST_CORRESPONDENCE = + Correspondence.transforming(SessionRequest::getOpenSession, "open session"); + + private ScheduledExecutorService executor; + + @Mock(answer = Answers.RETURNS_DEEP_STUBS) + private Metrics metrics; + + @Mock private ClientConfigurationManager configManager; + + private Server server; + private final VRpcTracer vrpcTracer = NoopMetrics.NoopVrpcTracer.INSTANCE; + private ChannelPool channelPool; + private SessionPoolImpl sessionPool; + private FakeSessionService fakeService; + private HeaderInterceptor headerInterceptor; + + @BeforeEach + void setUp() throws IOException { + executor = Executors.newScheduledThreadPool(4); + fakeService = new FakeSessionService(executor); + headerInterceptor = new HeaderInterceptor(); + server = + FakeServiceBuilder.create(fakeService) + .intercept(new PeerInfoInterceptor()) + .intercept(headerInterceptor) + .start(); + + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + + ClientConfigurationManager.ListenerHandle listenerHandle = + Mockito.mock(ClientConfigurationManager.ListenerHandle.class); + when(configManager.getClientConfiguration()) + .thenReturn(ClientConfigurationManager.loadDefault()); + when(configManager.addListener(any(), any())).thenReturn(listenerHandle); + doNothing().when(listenerHandle).close(); + + sessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + channelPool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + executor); + } + + @AfterEach + void tearDown() { + sessionPool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("close session") + .build()); + channelPool.close(); + // channel gets shutdown in channelPool.close() + server.shutdownNow(); + executor.shutdownNow(); + } + + @Test + public void consecutiveFailuresTest() { + com.google.rpc.Status errorStatus = + com.google.rpc.Status.newBuilder() + .setCode(Code.INTERNAL_VALUE) + .setMessage("fake internal error") + .build(); + + OpenFakeSessionRequest request = + OpenFakeSessionRequest.newBuilder() + .setStreamError( + StreamError.newBuilder() + .setStatus(errorStatus) + .setDelay(Durations.fromMillis(0)) + .build()) + .build(); + sessionPool.start(request, new Metadata()); + + UnaryResponseFuture f = new UnaryResponseFuture<>(); + VRpc rpc = + sessionPool.newCall(FakeDescriptor.SCRIPTED); + rpc.start( + SessionFakeScriptedRequest.newBuilder().setTag(0).build(), + VRpc.VRpcCallContext.create(Deadline.after(1, TimeUnit.MINUTES), true, vrpcTracer), + f); + + VRpcException exception = + (VRpcException) assertThrows(ExecutionException.class, f::get).getCause(); + assertThat(exception) + .hasMessageThat() + .contains( + "UNAVAILABLE: Session failed with consecutive failures." + + " Most recent server status: Status{code=INTERNAL, " + + "description=fake internal error. PeerInfo: transport_type: TRANSPORT_TYPE_SESSION_UNKNOWN, cause=null}"); + } + + @Test + void pendingVRpcDrainTest() throws ExecutionException, InterruptedException, TimeoutException { + // delay all messages to force the first vrpc to be queued + + SessionPool testSessionPool = null; + + // Create a channel that will delay all response messages by 10ms + try (ChannelPool delayedPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .intercept(new DelayedClientInterceptor(Duration.ofMillis(10))) + .build()))) { + + delayedPool.start(); + + // wrap it with a session pool + testSessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + delayedPool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + executor); + + // session ack should be delayed by at least 10ms + testSessionPool.start(OpenFakeSessionRequest.getDefaultInstance(), new Metadata()); + + // Start a vRpc that will be put in the pending queue due to slow session start + VRpc vrpc = + testSessionPool.newCall(FakeDescriptor.SCRIPTED); + CompletableFuture resultFuture = new CompletableFuture<>(); + vrpc.start( + SessionFakeScriptedRequest.getDefaultInstance(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.SECONDS), true, vrpcTracer), + new VRpc.VRpcListener() { + @Override + public void onMessage(SessionFakeScriptedResponse msg) {} + + @Override + public void onClose(VRpcResult result) { + resultFuture.complete(result); + } + }); + + // Ensure that the rpc eventually succeeded + VRpcResult result = resultFuture.get(1, TimeUnit.MINUTES); + assertThat(result).isOk(); + + } finally { + if (testSessionPool != null) { + testSessionPool.close(CloseSessionRequest.getDefaultInstance()); + } + } + } + + @Test + void testCreateSessionDoesntPropagateDeadline() { + DeadlineInterceptor deadlineInterceptor = new DeadlineInterceptor(); + try (ChannelPool capturedDeadlinePool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", server.getPort(), InsecureChannelCredentials.create()) + .intercept(deadlineInterceptor) + .build()))) { + + capturedDeadlinePool.start(); + + SessionPoolImpl testSessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + capturedDeadlinePool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + executor); + + Context.current() + .withDeadlineAfter(1, TimeUnit.MINUTES, executor) + .run( + () -> + testSessionPool.start( + OpenFakeSessionRequest.getDefaultInstance(), new Metadata())); + + assertThat(deadlineInterceptor.getObservedDeadline()).isNull(); + + testSessionPool.close(CloseSessionRequest.getDefaultInstance()); + } + } + + @Nested + class RetrySessionCreation { + + private FakeClock fakeClock; + private ScheduledExecutorService mockExecutor; + private FakeSessionService fakeService; + private ChannelPool channelPool; + private SessionPoolImpl sessionPool; + + private final Duration penalty = Duration.ofMinutes(1); + + @BeforeEach + void setUp() throws Exception { + fakeClock = new FakeClock(Instant.now()); + mockExecutor = mock(ScheduledExecutorService.class, Mockito.RETURNS_DEEP_STUBS); + + Duration penalty = Duration.ofMinutes(1); + SessionCreationBudget budget = new SessionCreationBudget(10, penalty, fakeClock); + + fakeService = new FakeSessionService(executor); + Server rejectRequestServer = + FakeServiceBuilder.create(fakeService).intercept(new PeerInfoInterceptor()).start(); + + channelPool = + new SingleChannelPool( + Suppliers.ofInstance( + Grpc.newChannelBuilderForAddress( + "localhost", + rejectRequestServer.getPort(), + InsecureChannelCredentials.create()) + .build())); + channelPool.start(); + + sessionPool = + new SessionPoolImpl<>( + metrics, + FeatureFlags.getDefaultInstance(), + CLIENT_INFO, + configManager, + channelPool, + CallOptions.DEFAULT, + FakeDescriptor.FAKE_SESSION, + "fake-pool", + mockExecutor, + budget); + } + + @AfterEach + void tearDown() { + sessionPool.close( + CloseSessionRequest.newBuilder() + .setReason(CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_USER) + .setDescription("close session") + .build()); + server.shutdown(); + channelPool.close(); + } + + @Test + public void test() throws Exception { + ArgumentCaptor runnableCaptor = ArgumentCaptor.forClass(Runnable.class); + ArgumentCaptor delayCaptor = ArgumentCaptor.forClass(Long.class); + + // start the pool + sessionPool.start( + OpenFakeSessionRequest.newBuilder() + .setStreamError(StreamError.getDefaultInstance()) + .build(), + new Metadata()); + + // Session creations should fail and a task to retry session creation should be scheduled. + // The delay should be around budget creation failure penalty. It'll take some time for the + // job to exhaust all the creation budget so set a delay before verifying. + int waitForReadyMs = 1000; + verify(mockExecutor, Mockito.timeout(waitForReadyMs)) + .schedule(runnableCaptor.capture(), delayCaptor.capture(), eq(TimeUnit.MILLISECONDS)); + assertThat(delayCaptor.getValue()) + .isIn( + Range.openClosed( + penalty.minus(Duration.ofMillis(waitForReadyMs)).toMillis(), penalty.toMillis())); + + // we should have received some open requests + int requestsBefore = fakeService.getOpenRequestCount().get(); + assertThat(requestsBefore).isGreaterThan(0); + + // vrpc will queue in the PendingVRpcs queue + VRpc vrpc = + sessionPool.newCall(FakeDescriptor.SCRIPTED); + UnaryResponseFuture f = new UnaryResponseFuture<>(); + vrpc.start( + SessionFakeScriptedRequest.getDefaultInstance(), + VRpcCallContext.create(Deadline.after(1, TimeUnit.SECONDS), true, vrpcTracer), + f); + + // Advance the clock so there's more budget to create sessions + fakeClock.increment(penalty.plusMillis(1)); + + // Run the scheduled task, pool sizer will return a positive scale factor because there's a + // pending vrpc + runnableCaptor.getValue().run(); + + // The retry task will try to open new sessions. This will fail and schedule another retry. + verify(mockExecutor, Mockito.timeout(1000).times(2)) + .schedule(any(Runnable.class), anyLong(), eq(TimeUnit.MILLISECONDS)); + + // the retry will exhaust the budget again. we should see double the request compared to + // before + int requestsAfter = fakeService.getOpenRequestCount().get(); + assertThat(requestsAfter).isGreaterThan(requestsBefore); + } + } + + @Test + public void refreshConfigTest() throws Exception { + OpenSessionRequest refreshRequest = + OpenSessionRequest.newBuilder() + .setPayload(OpenFakeSessionRequest.getDefaultInstance().toByteString()) + .build(); + String refreshHeaderKey = "x-refresh-header"; + Metadata.Key metadataKey = Metadata.Key.of(refreshHeaderKey, Metadata.ASCII_STRING_MARSHALLER); + SessionRefreshConfig refreshConfig = + SessionRefreshConfig.newBuilder() + .setOptimizedOpenRequest(refreshRequest) + .addMetadata( + SessionRefreshConfig.Metadata.newBuilder() + .setKey(refreshHeaderKey) + .setValue(ByteString.copyFromUtf8("refresh_value"))) + .build(); + + OpenFakeSessionRequest request = + OpenFakeSessionRequest.newBuilder() + .setRefreshConfig(refreshConfig) + .setRefreshConfigDelay(Durations.fromMillis(100)) + .setGoAwayDelay(Durations.fromMillis(120)) + .build(); + + sessionPool.start(request, new Metadata()); + + Thread.sleep(500); + + List requests = fakeService.getSessionRequests(); + assertThat(requests.size()).isGreaterThan(1); + assertThat(requests) + .comparingElementsUsing(OPEN_SESSION_REQUEST_CORRESPONDENCE) + .contains(refreshRequest); + + // Verify headers + List headers = headerInterceptor.getHeadersList(); + boolean containsHeader = false; + for (Metadata header : headers) { + if (header.containsKey(metadataKey)) { + containsHeader = true; + assertThat(header.get(metadataKey)).isEqualTo("refresh_value"); + } + } + assertThat(containsHeader).isTrue(); + } + + private static class DelayedClientInterceptor implements ClientInterceptor { + private final Duration delay; + + private DelayedClientInterceptor(Duration delay) { + this.delay = delay; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + return new SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onMessage(RespT message) { + try { + // delay all messages to force the first vrpc to be queued + Thread.sleep(delay.toMillis()); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + super.onMessage(message); + } + }, + headers); + } + }; + } + } + + private static class DeadlineInterceptor implements ClientInterceptor { + private volatile Deadline observedDeadline; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + if (method.getBareMethodName().equals("OpenSession")) { + observedDeadline = Context.current().getDeadline(); + } + return next.newCall(method, callOptions); + } + + public Deadline getObservedDeadline() { + return observedDeadline; + } + } + + private static class HeaderInterceptor implements ServerInterceptor { + private final List headersList = new ArrayList<>(); + + @Override + public io.grpc.ServerCall.Listener interceptCall( + ServerCall call, Metadata headers, ServerCallHandler next) { + headersList.add(headers); + return next.startCall(call, headers); + } + + public List getHeadersList() { + return headersList; + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/UtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/UtilTest.java new file mode 100644 index 000000000000..4a42efaf76a7 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/UtilTest.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.OpenTableRequest; +import com.google.bigtable.v2.SessionType; +import org.junit.jupiter.api.Test; + +class UtilTest { + @Test + void testTableOpenRpc() { + SessionType sessionType = + SessionUtil.extractSessionTypeFromMethod(BigtableGrpc.getOpenTableMethod()); + assertThat(sessionType).isEqualTo(SessionType.SESSION_TYPE_TABLE); + } + + @Test + void testTableOpenMsg() { + OpenTableRequest msg = OpenTableRequest.getDefaultInstance(); + SessionType sessionType = SessionUtil.extractOpenSessionTypeFromOpenMsg(msg); + assertThat(sessionType).isEqualTo(SessionType.SESSION_TYPE_TABLE); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptorTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptorTest.java new file mode 100644 index 000000000000..4c1e31294a4b --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcDescriptorTest.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.Cell; +import com.google.bigtable.v2.Column; +import com.google.bigtable.v2.Family; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.Row; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.SessionMutateRowRequest; +import com.google.bigtable.v2.SessionReadRowRequest; +import com.google.bigtable.v2.SessionReadRowResponse; +import com.google.bigtable.v2.TableRequest; +import com.google.bigtable.v2.TableResponse; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import org.junit.jupiter.api.Test; + +class VRpcDescriptorTest { + + @Test + void testReadRow() throws InvalidProtocolBufferException { + assertThat(VRpcDescriptor.READ_ROW.getSessionDescriptor()) + .isEqualTo(VRpcDescriptor.TABLE_SESSION); + + TableResponse tableResp = + TableResponse.newBuilder() + .setReadRow( + SessionReadRowResponse.newBuilder() + .setRow( + Row.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .addFamilies( + Family.newBuilder() + .setName("f") + .addColumns( + Column.newBuilder() + .addCells( + Cell.newBuilder() + .setTimestampMicros(12345) + .setValue(ByteString.copyFromUtf8("value"))))))) + .build(); + assertThat(VRpcDescriptor.READ_ROW.decode(tableResp.toByteString())) + .isEqualTo(tableResp.getReadRow()); + + SessionReadRowRequest req = + SessionReadRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .setFilter(RowFilter.newBuilder().setBlockAllFilter(true)) + .build(); + assertThat(TableRequest.parseFrom(VRpcDescriptor.READ_ROW.encode(req))) + .isEqualTo(TableRequest.newBuilder().setReadRow(req).build()); + } + + @Test + void testToLegacyProtoReadRow() { + SessionReadRowRequest req = + SessionReadRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .setFilter(RowFilter.newBuilder().setBlockAllFilter(true)) + .build(); + ReadRowsRequest legacyReq = + (ReadRowsRequest) VRpcDescriptor.READ_ROW.toLegacyProto("table1", "app1", req); + assertThat(legacyReq.getTableName()).isEqualTo("table1"); + assertThat(legacyReq.getAppProfileId()).isEqualTo("app1"); + assertThat(legacyReq.getRows().getRowKeys(0)).isEqualTo(req.getKey()); + assertThat(legacyReq.getFilter()).isEqualTo(req.getFilter()); + assertThat(legacyReq.getRowsLimit()).isEqualTo(1); + } + + @Test + void testToLegacyProtoMutateRow() { + SessionMutateRowRequest req = + SessionMutateRowRequest.newBuilder() + .setKey(ByteString.copyFromUtf8("rowkey1")) + .addMutations( + Mutation.newBuilder() + .setSetCell( + Mutation.SetCell.newBuilder() + .setFamilyName("f") + .setColumnQualifier(ByteString.copyFromUtf8("c")) + .setValue(ByteString.copyFromUtf8("v")))) + .build(); + MutateRowRequest legacyReq = + (MutateRowRequest) VRpcDescriptor.MUTATE_ROW.toLegacyProto("table1", "app1", req); + assertThat(legacyReq.getTableName()).isEqualTo("table1"); + assertThat(legacyReq.getAppProfileId()).isEqualTo("app1"); + assertThat(legacyReq.getRowKey()).isEqualTo(req.getKey()); + assertThat(legacyReq.getMutationsList()).isEqualTo(req.getMutationsList()); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/WatchdogTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/WatchdogTest.java new file mode 100644 index 000000000000..94bd6fcc5049 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/WatchdogTest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 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.internal.session; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.OpenSessionRequest; +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import com.google.cloud.bigtable.data.v2.internal.session.SessionPoolImpl.Watchdog; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; +import com.google.protobuf.Message; +import io.grpc.Metadata; +import java.time.Duration; +import java.time.Instant; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class WatchdogTest { + private final Duration interval = Duration.ofMinutes(5); + private ScheduledExecutorService executor; + private SessionPoolImpl.Watchdog watchdog; + private SessionList sessions; + private FakeSession fakeSession = new FakeSession(); + + private Instant now; + private FakeClock fakeClock; + + @BeforeEach + void setUp() { + executor = Executors.newScheduledThreadPool(4); + + now = Instant.now(); + fakeClock = new FakeClock(now); + sessions = new SessionList(); + watchdog = + new Watchdog( + new Object(), + executor, + interval, + sessions, + NoopMetrics.NoopDebugTracer.INSTANCE, + fakeClock); + } + + @AfterEach + void tearDown() { + executor.shutdownNow(); + } + + @Test + public void awaitCloseTest() { + fakeSession.lastStateChange = fakeClock.instant(); + + fakeSession.state = SessionState.STARTING; + SessionList.SessionHandle handle = sessions.newHandle(fakeSession); + + fakeSession.state = SessionState.READY; + handle.onSessionStarted(); + + fakeSession.state = SessionState.WAIT_SERVER_CLOSE; + handle.onSessionClosing(); + + watchdog.run(); + assertThat(fakeSession.forceCloseReason).isNull(); + + fakeClock.increment(interval.plus(Duration.ofNanos(1))); + watchdog.run(); + + assertThat(fakeSession.forceCloseReason).isNotNull(); + assertThat(fakeSession.forceCloseReason.getDescription()) + .contains("awaiting close for too long"); + } + + private static class FakeSession implements Session { + private static final String sessionName = "fake-session"; + private SessionState state = SessionState.NEW; + private Instant lastStateChange = Instant.now(); + private CloseSessionRequest forceCloseReason = null; + + @Override + public PeerInfo getPeerInfo() { + return PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .setApplicationFrontendId(1234) + .setApplicationFrontendRegion("us-east1") + .setApplicationFrontendSubzone("xx") + .build(); + } + + @Override + public SessionState getState() { + return state; + } + + @Override + public Instant getLastStateChange() { + return lastStateChange; + } + + @Override + public String getLogName() { + return sessionName; + } + + @Override + public Instant getNextHeartbeat() { + return Instant.now().plus(Duration.ofMinutes(5)); + } + + @Override + public OpenParams getOpenParams() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isOpenParamsUpdated() { + return false; + } + + @Override + public void start(OpenSessionRequest req, Metadata headers, Listener sessionListener) { + throw new UnsupportedOperationException(); + } + + @Override + public void close(CloseSessionRequest req) { + throw new UnsupportedOperationException(); + } + + @Override + public void forceClose(CloseSessionRequest reason) { + forceCloseReason = reason; + } + + @Override + public + VRpc newCall(VRpcDescriptor descriptor) + throws IllegalStateException { + throw new UnsupportedOperationException(); + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeClock.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeClock.java new file mode 100644 index 000000000000..6e7b80baf02d --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeClock.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 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.internal.session.fake; + +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; +import java.time.ZoneId; + +public class FakeClock extends Clock { + + private Instant time; + + public FakeClock(Instant time) { + this.time = time; + } + + public void increment(Duration delta) { + this.time = time.plus(delta); + } + + @Override + public ZoneId getZone() { + return null; + } + + @Override + public Clock withZone(ZoneId zone) { + return null; + } + + @Override + public Instant instant() { + return time; + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeServiceBuilder.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeServiceBuilder.java new file mode 100644 index 000000000000..aef206ffd545 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeServiceBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026 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.internal.session.fake; + +import io.grpc.BindableService; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.ServerInterceptor; +import io.grpc.ServerTransportFilter; +import java.io.IOException; +import java.net.BindException; +import java.net.ServerSocket; +import java.util.ArrayList; +import java.util.List; + +public class FakeServiceBuilder { + private final List interceptors = new ArrayList<>(); + private final List services = new ArrayList<>(); + private final List transportFilters = new ArrayList<>(); + + public static FakeServiceBuilder create(BindableService... services) { + return new FakeServiceBuilder(services); + } + + private FakeServiceBuilder(BindableService[] services) { + for (BindableService service : services) { + this.addService(service); + } + } + + public FakeServiceBuilder intercept(ServerInterceptor interceptor) { + interceptors.add(interceptor); + return this; + } + + public FakeServiceBuilder addService(BindableService service) { + services.add(service); + return this; + } + + public FakeServiceBuilder addTransportFilter(ServerTransportFilter transportFilter) { + transportFilters.add(transportFilter); + return this; + } + + public Server start() throws IOException { + IOException lastError = null; + + for (int i = 0; i < 10; i++) { + try { + return startWithoutRetries(); + } catch (IOException e) { + lastError = e; + if (e.getCause() instanceof BindException) { + continue; + } + if (e.getMessage().contains("Failed to bind to address")) { + continue; + } + break; + } + } + + throw lastError; + } + + private Server startWithoutRetries() throws IOException { + int port; + try (ServerSocket ss = new ServerSocket(0)) { + port = ss.getLocalPort(); + } + ServerBuilder builder = ServerBuilder.forPort(port); + interceptors.forEach(builder::intercept); + services.forEach(builder::addService); + transportFilters.forEach(builder::addTransportFilter); + + return builder.build().start(); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionListener.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionListener.java new file mode 100644 index 000000000000..d7063eddeda7 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionListener.java @@ -0,0 +1,79 @@ +/* + * Copyright 2026 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.internal.session.fake; + +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.cloud.bigtable.data.v2.internal.session.Session; +import com.google.cloud.bigtable.data.v2.internal.session.Session.SessionState; +import io.grpc.Metadata; +import io.grpc.Status; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.BlockingDeque; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +public class FakeSessionListener implements Session.Listener { + private BlockingDeque msgs = new LinkedBlockingDeque<>(); + + @Override + public void onReady(OpenSessionResponse msg) { + msgs.add(msg); + } + + @Override + public void onGoAway(GoAwayResponse msg) { + msgs.add(msg); + } + + @Override + public void onClose(SessionState prevState, Status status, Metadata trailers) { + msgs.add(status); + } + + @SuppressWarnings("unchecked") + public T popUntil(Class cls) throws InterruptedException, TimeoutException { + List seen = new ArrayList<>(); + + Object msg = null; + while (!cls.isInstance(msg)) { + try { + msg = popNext(); + seen.add(msg); + } catch (TimeoutException e) { + throw new TimeoutException( + "Timed out waiting to popUntil event of: " + cls + ", seen: " + seen); + } + } + return (T) msg; + } + + public Object popNext() throws InterruptedException, TimeoutException { + return popNext(Duration.ofSeconds(1)); + } + + public Object popNext(Duration timeout) throws InterruptedException, TimeoutException { + Object obj = msgs.poll(timeout.toMillis(), TimeUnit.MILLISECONDS); + if (obj == null) { + throw new TimeoutException("Timed out waiting to popNext Session event"); + } + return obj; + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionService.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionService.java new file mode 100644 index 000000000000..1b575fd2d261 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeSessionService.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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.internal.session.fake; + +import com.google.bigtable.v2.FakeSessionGrpc; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionResponse; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.atomic.AtomicInteger; + +public class FakeSessionService extends FakeSessionGrpc.FakeSessionImplBase { + + private final ScheduledExecutorService executor; + private final AtomicInteger openRequestCount = new AtomicInteger(0); + + private final List sessionRequests = new ArrayList<>(); + + public FakeSessionService(ScheduledExecutorService executor) { + this.executor = executor; + } + + @Override + public StreamObserver openSession( + StreamObserver responseObserver) { + openRequestCount.incrementAndGet(); + SessionHandler handler = new SessionHandler(executor, responseObserver); + return new StreamObserver() { + @Override + public void onNext(SessionRequest value) { + sessionRequests.add(value); + handler.onNext(value); + } + + @Override + public void onError(Throwable t) { + handler.onError(t); + } + + @Override + public void onCompleted() { + handler.onCompleted(); + } + }; + } + + public AtomicInteger getOpenRequestCount() { + return openRequestCount; + } + + public java.util.List getSessionRequests() { + return sessionRequests; + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeVRpcListener.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeVRpcListener.java new file mode 100644 index 000000000000..524bb2795f61 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/FakeVRpcListener.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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.internal.session.fake; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcListener; +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import java.time.Duration; +import java.util.concurrent.BlockingDeque; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +public class FakeVRpcListener implements VRpcListener { + private BlockingDeque msgs = new LinkedBlockingDeque<>(); + private final AtomicInteger onMessageCount = new AtomicInteger(0); + + @Override + public void onMessage(RespT msg) { + onMessageCount.getAndIncrement(); + msgs.add(msg); + } + + @Override + public void onClose(VRpcResult result) { + msgs.add(result); + } + + @SuppressWarnings("unchecked") + public T popUntil(Class cls) throws InterruptedException { + Object obj = null; + while (!cls.isInstance(obj)) { + obj = popNext(); + } + return (T) obj; + } + + public Object popNext() throws InterruptedException { + return popNext(Duration.ofSeconds(1)); + } + + public Object popNext(Duration timeout) throws InterruptedException { + return msgs.poll(timeout.toMillis(), TimeUnit.MILLISECONDS); + } + + public int getOnMessageCount() { + return onMessageCount.get(); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/PeerInfoInterceptor.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/PeerInfoInterceptor.java new file mode 100644 index 000000000000..1cbf2651b10f --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/PeerInfoInterceptor.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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.internal.session.fake; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; +import io.grpc.Metadata; +import io.grpc.ServerCall; +import io.grpc.ServerCall.Listener; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import java.util.Base64; + +public class PeerInfoInterceptor implements ServerInterceptor { + private static final Metadata.Key PEER_INFO_KEY = + Metadata.Key.of("bigtable-peer-info", Metadata.ASCII_STRING_MARSHALLER); + + @Override + public Listener interceptCall( + ServerCall call, Metadata headers, ServerCallHandler next) { + + return next.startCall( + new SimpleForwardingServerCall(call) { + @Override + public void sendHeaders(Metadata headers) { + PeerInfo peerInfo = + PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_DIRECT_ACCESS) + .setApplicationFrontendRegion("local") + .setApplicationFrontendSubzone("ll") + .build(); + String encoded = Base64.getUrlEncoder().encodeToString(peerInfo.toByteArray()); + headers.put(PEER_INFO_KEY, encoded); + super.sendHeaders(headers); + } + }, + headers); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/SessionHandler.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/SessionHandler.java new file mode 100644 index 000000000000..f1e4b4055931 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/fake/SessionHandler.java @@ -0,0 +1,438 @@ +/* + * Copyright 2026 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.internal.session.fake; + +import com.google.bigtable.v2.CloseSessionRequest; +import com.google.bigtable.v2.FakeSessionOpRequest; +import com.google.bigtable.v2.FakeSessionOpResponse; +import com.google.bigtable.v2.GoAwayResponse; +import com.google.bigtable.v2.OpenFakeSessionRequest; +import com.google.bigtable.v2.OpenFakeSessionRequest.Action; +import com.google.bigtable.v2.OpenFakeSessionRequest.ActionList; +import com.google.bigtable.v2.OpenFakeSessionResponse; +import com.google.bigtable.v2.OpenSessionResponse; +import com.google.bigtable.v2.SessionFakeScriptedResponse; +import com.google.bigtable.v2.SessionParametersResponse; +import com.google.bigtable.v2.SessionRequest; +import com.google.bigtable.v2.SessionRequest.PayloadCase; +import com.google.bigtable.v2.SessionResponse; +import com.google.bigtable.v2.VirtualRpcRequest; +import com.google.bigtable.v2.VirtualRpcResponse; +import com.google.common.base.Preconditions; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.util.Durations; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import java.time.Duration; +import java.util.ArrayDeque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; + +public class SessionHandler implements StreamObserver { + public static final long AUTOMATIC_RPC_ID = -1; + + private final ScheduledExecutorService executor; + private final StreamObserver respStream; + private final Set> timers = new HashSet<>(); + private State state; + + public SessionHandler( + ScheduledExecutorService executor, StreamObserver respStream) { + this.executor = executor; + this.respStream = respStream; + + this.state = new NewState(this); + } + + // gRPC event handlers + @Override + public synchronized void onNext(SessionRequest msg) { + state = state.onMessage(msg); + } + + @Override + public synchronized void onError(Throwable t) { + state = state.onClose(Status.fromThrowable(t)); + } + + @Override + public synchronized void onCompleted() {} + + // helpers + ScheduledFuture delay(Duration amount, Supplier f) { + ScheduledFuture timer = + executor.schedule( + () -> { + synchronized (SessionHandler.this) { + state = f.get(); + } + }, + amount.toMillis(), + TimeUnit.MILLISECONDS); + timers.add(timer); + return timer; + } + + void writeResponse(SessionResponse response) { + respStream.onNext(response); + } + + State terminateWithError(Status status) { + respStream.onError(status.asRuntimeException()); + timers.forEach(t -> t.cancel(true)); + timers.clear(); + + return DoneState.INSTANCE; + } + + State terminateSuccess() { + state = DoneState.INSTANCE; + respStream.onCompleted(); + timers.forEach(t -> t.cancel(true)); + timers.clear(); + return state; + } + + interface State { + State onMessage(SessionRequest sReq); + + State onClose(Status status); + } + + static class NewState implements State { + private final SessionHandler handler; + + NewState(SessionHandler handler) { + this.handler = handler; + } + + @Override + public State onMessage(SessionRequest sReq) { + Preconditions.checkState( + sReq.getPayloadCase() == PayloadCase.OPEN_SESSION, + "NewState expected an OpenSession msg, got: %s", + sReq); + + OpenFakeSessionRequest oReq; + try { + oReq = OpenFakeSessionRequest.parseFrom(sReq.getOpenSession().getPayload()); + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + + if (oReq.hasStreamError()) { + Status status = + Status.fromCodeValue(oReq.getStreamError().getStatus().getCode()) + .withDescription(oReq.getStreamError().getStatus().getMessage()); + + if (Durations.ZERO.equals(oReq.getStreamError().getDelay())) { + return handler.terminateWithError(status); + } else { + ScheduledFuture ignored = + handler.delay( + Duration.ofMillis(Durations.toMillis(oReq.getStreamError().getDelay())), + () -> handler.state = handler.terminateWithError(status)); + } + } + + // TODO: populate this + SessionParametersResponse params = + SessionParametersResponse.newBuilder().setKeepAlive(Durations.fromSeconds(1)).build(); + + if (oReq.hasSessionParams()) { + params = oReq.getSessionParams(); + } + handler.writeResponse(SessionResponse.newBuilder().setSessionParameters(params).build()); + + handler.writeResponse( + SessionResponse.newBuilder() + .setOpenSession( + OpenSessionResponse.newBuilder() + .setPayload(OpenFakeSessionResponse.newBuilder().build().toByteString())) + .build()); + + Duration goAwayDelay = + oReq.hasGoAwayDelay() + ? Duration.ofMillis(Durations.toMillis(oReq.getGoAwayDelay())) + : Duration.ofMinutes(1); + + if (oReq.equals(OpenFakeSessionRequest.getDefaultInstance())) { + oReq = + OpenFakeSessionRequest.newBuilder() + .putVrpcActions( + 0, + ActionList.newBuilder() + .setRepeat(true) + .addActions( + Action.newBuilder() + .setResponse(VirtualRpcResponse.getDefaultInstance()) + .build()) + .build()) + .build(); + } + + return new RunningState(handler, goAwayDelay, oReq); + } + + @Override + public State onClose(Status status) { + return DoneState.INSTANCE; + } + } + + static class RunningState implements State { + private static final Duration HALF_CLOSE_WAIT_TIMEOUT = Duration.ofSeconds(1); + + private final SessionHandler helper; + private ScheduledFuture lifecycleTimer; + private boolean vRpcActive = false; + private boolean gotHalfClose = false; + + private final Map actionsMap; + private final Map actionQueues = new HashMap<>(); + + public RunningState( + SessionHandler helper, Duration goAwayDelay, OpenFakeSessionRequest request) { + this.helper = helper; + this.actionsMap = request.getVrpcActionsMap(); + + lifecycleTimer = helper.delay(goAwayDelay, this::handleGoAwayTimer); + + if (request.hasRefreshConfig()) { + Duration refreshDelay = + Duration.ofMillis( + com.google.protobuf.util.Durations.toMillis(request.getRefreshConfigDelay())); + helper.delay(refreshDelay, () -> handleRefreshConfigTimer(request.getRefreshConfig())); + } + } + + @Override + public State onMessage(SessionRequest request) { + switch (request.getPayloadCase()) { + case VIRTUAL_RPC: + State state = dispatchVRpc(request.getVirtualRpc()); + return state; + case CLOSE_SESSION: + return handleCloseMsg(request.getCloseSession()); + default: + return helper.terminateWithError( + Status.INTERNAL.withDescription("Unexpected payload: " + request)); + } + } + + private State dispatchVRpc(VirtualRpcRequest request) { + if (gotHalfClose) { + return helper.terminateWithError( + Status.INTERNAL.withDescription("got vRpc after client sent halfClose")); + } + Preconditions.checkState(!vRpcActive, "only 1 outstanding vRPC is supported"); + + FakeSessionOpRequest innerReq; + try { + innerReq = FakeSessionOpRequest.parseFrom(request.getPayload()); + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + + this.vRpcActive = true; + + switch (innerReq.getPayloadCase()) { + case SCRIPTED_REQUEST: + long tag = innerReq.getScriptedRequest().getTag(); + ActionList actionList = actionsMap.get(tag); + Preconditions.checkNotNull(actionList, "tag not in action map: " + tag); + if (actionQueues.get(tag) == null) { + actionQueues.put(tag, createActionQueue(actionList)); + } + return handleVRpcScripted(request.getRpcId(), actionQueues.get(tag)); + default: + return helper.terminateWithError( + Status.INVALID_ARGUMENT.withDescription("Unexpected vRpc type: " + request)); + } + } + + private State handleVRpcScripted(long rpcId, ActionQueue actionQueue) { + if (helper.state != this) { + return helper.state; + } + + Action action = actionQueue.getNextAction(); + if (action.hasDelay()) { + @SuppressWarnings("UnusedVariable") + ScheduledFuture ignored = + helper.delay( + Duration.ofMillis(Durations.toMillis(action.getDelay())), + () -> handleResponse(action, rpcId)); + } else { + handleResponse(action, rpcId); + } + + return this; + } + + private State handleResponse(Action action, long rpcId) { + if (action.equals(Action.getDefaultInstance())) { + helper.writeResponse( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(rpcId) + .setPayload( + FakeSessionOpResponse.newBuilder() + .setScripted(SessionFakeScriptedResponse.getDefaultInstance()) + .build() + .toByteString())) + .build()); + } + + if (action.hasResponse()) { + if (action.getResponse().equals(VirtualRpcResponse.getDefaultInstance())) { + helper.writeResponse( + SessionResponse.newBuilder() + .setVirtualRpc( + VirtualRpcResponse.newBuilder() + .setRpcId(rpcId) + .setPayload( + FakeSessionOpResponse.newBuilder() + .setScripted(SessionFakeScriptedResponse.getDefaultInstance()) + .build() + .toByteString())) + .build()); + + } else { + VirtualRpcResponse response = action.getResponse(); + if (response.getRpcId() == AUTOMATIC_RPC_ID) { + response = response.toBuilder().setRpcId(rpcId).build(); + } + helper.writeResponse(SessionResponse.newBuilder().setVirtualRpc(response).build()); + } + } + + if (action.hasErrorResponse()) { + helper.writeResponse( + SessionResponse.newBuilder().setError(action.getErrorResponse()).build()); + } + + vRpcActive = false; + return this; + } + + private State handleGoAwayTimer() { + if (helper.state != this) { + return helper.state; + } + helper.writeResponse( + SessionResponse.newBuilder() + .setGoAway( + GoAwayResponse.newBuilder() + .setReason("session_expiry") + .setDescription("Session needs to be refreshed") + .build()) + .build()); + this.lifecycleTimer = helper.delay(HALF_CLOSE_WAIT_TIMEOUT, this::handleCloseWaitTimeout); + return this; + } + + private State handleRefreshConfigTimer(com.google.bigtable.v2.SessionRefreshConfig config) { + if (helper.state != this) { + return helper.state; + } + helper.writeResponse(SessionResponse.newBuilder().setSessionRefreshConfig(config).build()); + return this; + } + + private ActionQueue createActionQueue(ActionList actionList) { + ActionQueue actionQueue; + if (actionList.equals(ActionList.getDefaultInstance())) { + Queue actions = new ArrayDeque<>(); + actions.add(Action.getDefaultInstance()); + actionQueue = new ActionQueue(true, actions); + } else { + actionQueue = + new ActionQueue(actionList.getRepeat(), new ArrayDeque<>(actionList.getActionsList())); + } + return actionQueue; + } + + // HalfClose + @Override + public State onClose(Status status) { + lifecycleTimer.cancel(true); + gotHalfClose = true; + + if (!vRpcActive) { + return helper.terminateSuccess(); + } + + return this; + } + + private State handleCloseWaitTimeout() { + if (helper.state != this) { + return helper.state; + } + + return helper.terminateWithError( + Status.INTERNAL.withDescription("client did not acknowledge a GO_AWAY response in time")); + } + + private State handleCloseMsg(CloseSessionRequest ignored) { + return helper.terminateSuccess(); + } + } + + static class DoneState implements State { + static final DoneState INSTANCE = new DoneState(); + + private DoneState() {} + + @Override + public State onMessage(SessionRequest request) { + return this; + } + + @Override + public State onClose(Status status) { + return this; + } + } + + static class ActionQueue { + private final boolean isRepeat; + private final Queue actions; + + ActionQueue(boolean repeat, Queue actions) { + this.isRepeat = repeat; + this.actions = actions; + } + + Action getNextAction() { + if (isRepeat) { + return actions.peek(); + } else { + return actions.poll(); + } + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/StatusSubject.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/StatusSubject.java new file mode 100644 index 000000000000..3dd5c4b0398a --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/StatusSubject.java @@ -0,0 +1,60 @@ +/* + * 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.internal.test_helpers; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.StringSubject; +import com.google.common.truth.Subject; +import com.google.common.truth.ThrowableSubject; +import io.grpc.Status; +import io.grpc.Status.Code; +import javax.annotation.Nullable; + +public class StatusSubject extends Subject { + private final @Nullable Status actual; + + private StatusSubject(FailureMetadata failureMetadata, @Nullable Status subject) { + super(failureMetadata, subject); + this.actual = subject; + } + + public void isOk() { + code().isEqualTo(Code.OK); + } + + public Subject code() { + return check("code").that(actual.getCode()); + } + + public StringSubject description() { + return check("description").that(actual.getDescription()); + } + + public ThrowableSubject cause() { + return check("cause").that(actual.getCause()); + } + + public static StatusSubject assertThat(@Nullable Status status) { + return assertAbout(statuses()).that(status); + } + + public static Factory statuses() { + return StatusSubject::new; + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcCallContextSubject.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcCallContextSubject.java new file mode 100644 index 000000000000..29aa3b139390 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcCallContextSubject.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 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.internal.test_helpers; + +import static com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcCallContext; +import static com.google.common.truth.Truth.assertAbout; + +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import javax.annotation.Nullable; + +public class VRpcCallContextSubject extends Subject { + private final @Nullable VRpcCallContext actual; + + private VRpcCallContextSubject(FailureMetadata metadata, @Nullable VRpcCallContext subject) { + super(metadata, subject); + this.actual = subject; + } + + public void isIdempotent() { + check("operationinfo.isidempotent").that(actual.getOperationInfo().isIdempotent()).isTrue(); + } + + public void isNotIdempotent() { + check("operationinfo.isidempotent").that(actual.getOperationInfo().isIdempotent()).isFalse(); + } + + public static VRpcCallContextSubject assertThat(@Nullable VRpcCallContext context) { + return assertAbout(vRpcCallContexts()).that(context); + } + + public static Factory vRpcCallContexts() { + return VRpcCallContextSubject::new; + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcResultSubject.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcResultSubject.java new file mode 100644 index 000000000000..28b741e09548 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/test_helpers/VRpcResultSubject.java @@ -0,0 +1,77 @@ +/* + * Copyright 2026 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.internal.test_helpers; + +import static com.google.common.truth.Truth.assertAbout; + +import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc.VRpcResult; +import com.google.common.truth.ComparableSubject; +import com.google.common.truth.FailureMetadata; +import com.google.common.truth.Subject; +import com.google.rpc.RetryInfo; +import java.time.Duration; +import java.util.Optional; +import javax.annotation.Nullable; + +public final class VRpcResultSubject extends Subject { + private final @Nullable VRpcResult actual; + + private VRpcResultSubject(FailureMetadata failureMetadata, @Nullable VRpcResult subject) { + super(failureMetadata, subject); + this.actual = subject; + } + + public Subject state() { + return check("state").that(actual.getState()); + } + + public Subject rejected() { + return check("rejected").that(actual.getRejected()); + } + + public void hasRetryInfo() { + check("retryInfo").that(actual.getRetryInfo()).isNotNull(); + } + + public ComparableSubject retryInfoDelay() { + return check("retryInfo.delay") + .that( + Optional.ofNullable(actual.getRetryInfo()) + .map(RetryInfo::getRetryDelay) + .map(d -> Duration.ofSeconds(d.getSeconds()).plus(Duration.ofNanos(d.getNanos()))) + .orElse(null)); + } + + public ComparableSubject backendLatency() { + return check("retryInfo.backendLatency").that(actual.getBackendLatency()); + } + + public void isOk() { + status().isOk(); + } + + public StatusSubject status() { + return check("status").about(StatusSubject.statuses()).that(actual.getStatus()); + } + + public static VRpcResultSubject assertThat(@Nullable VRpcResult vRpcResult) { + return assertAbout(vrpcResults()).that(vRpcResult); + } + + public static Factory vrpcResults() { + return VRpcResultSubject::new; + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManagerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManagerTest.java new file mode 100644 index 000000000000..d069c72ea290 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManagerTest.java @@ -0,0 +1,360 @@ +/* + * Copyright 2026 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.internal.util; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import com.google.bigtable.v2.BigtableGrpc; +import com.google.bigtable.v2.ClientConfiguration; +import com.google.bigtable.v2.FeatureFlags; +import com.google.bigtable.v2.GetClientConfigurationRequest; +import com.google.bigtable.v2.LoadBalancingOptions; +import com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight; +import com.google.bigtable.v2.LoadBalancingOptions.PeakEwma; +import com.google.bigtable.v2.SessionClientConfiguration; +import com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration; +import com.google.cloud.bigtable.data.v2.FakeServiceBuilder; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders; +import com.google.cloud.bigtable.data.v2.internal.api.ChannelProviders.ForwardingChannelProvider; +import com.google.cloud.bigtable.data.v2.internal.api.InstanceName; +import com.google.cloud.bigtable.data.v2.internal.csm.NoopMetrics; +import com.google.cloud.bigtable.data.v2.internal.csm.attributes.ClientInfo; +import com.google.cloud.bigtable.data.v2.internal.util.ClientConfigurationManager.ConfigListener; +import com.google.protobuf.TextFormat; +import com.google.protobuf.util.Durations; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Server; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class ClientConfigurationManagerTest { + private static final FeatureFlags FEATURE_FLAGS = FeatureFlags.getDefaultInstance(); + + private static final ClientInfo CLIENT_INFO = + ClientInfo.builder() + .setClientName("fake-client") + .setInstanceName(InstanceName.of("fake-project", "fake-instance")) + .setAppProfileId("default") + .build(); + + private Server server; + private FakeConfigService service; + private ChannelProviders.ChannelProvider channelProvider; + @Mock private ScheduledExecutorService mockExecutor; + private final OutstandingRpcCounter outstandingRpcCounter = new OutstandingRpcCounter(); + private ClientConfigurationManager manager; + private final NoopMetrics.NoopDebugTracer noopDebugTracer = NoopMetrics.NoopDebugTracer.INSTANCE; + + @BeforeEach + void setUp() throws IOException { + service = new FakeConfigService(); + + server = FakeServiceBuilder.create(service).start(); + + channelProvider = + new ForwardingChannelProvider( + new ChannelProviders.EmulatorChannelProvider("localhost", server.getPort())) { + @Override + public ManagedChannelBuilder newChannelBuilder() { + return super.newChannelBuilder().intercept(outstandingRpcCounter); + } + }; + + manager = + new ClientConfigurationManager( + FEATURE_FLAGS, CLIENT_INFO, channelProvider, noopDebugTracer, mockExecutor); + } + + @AfterEach + void tearDown() { + manager.close(); + server.shutdown(); + } + + @Test + void initialFetchTest() throws ExecutionException, InterruptedException { + // Check the initial config is correct + ClientConfiguration initialConfig = manager.start().get(); + assertThat(initialConfig).isEqualTo(service.config.get()); + + // Make sure that the next poll was scheduled + ArgumentCaptor pollDelayCaptor = ArgumentCaptor.forClass(Long.class); + verify(mockExecutor, times(1)) + .schedule(any(Runnable.class), pollDelayCaptor.capture(), eq(TimeUnit.MILLISECONDS)); + + assertThat(pollDelayCaptor.getValue()) + .isEqualTo( + Durations.toMillis( + service.config.get().getPollingConfiguration().getPollingInterval())); + } + + @Test + void notifyListenerTest() throws Exception { + // Fetch initial config + manager.start().get(); + + ArgumentCaptor runnableCaptor = ArgumentCaptor.forClass(Runnable.class); + verify(mockExecutor, times(1)).schedule(runnableCaptor.capture(), anyLong(), any()); + + // Add a listener + @SuppressWarnings("unchecked") + ConfigListener mockListener = Mockito.mock(ConfigListener.class); + manager.addListener(ClientConfiguration::getSessionConfiguration, mockListener); + + // force a fetch + runnableCaptor.getValue().run(); + outstandingRpcCounter.waitUntilRpcsDone(); + // Config didnt change so listener shouldnt be invoked + verify(mockListener, never()).onChange(any()); + + // Change an unrelated config + ClientConfiguration.Builder builder = service.config.get().toBuilder(); + builder.getPollingConfigurationBuilder().setPollingInterval(Durations.fromMinutes(100)); + service.config.set(builder.build()); + runnableCaptor.getValue().run(); + outstandingRpcCounter.waitUntilRpcsDone(); + // And make sure that the listener isn't invoked + verify(mockListener, never()).onChange(any()); + + // Now modify the relevant config section + builder + .getSessionConfigurationBuilder() + .getSessionPoolConfigurationBuilder() + .setLoadBalancingOptions( + LoadBalancingOptions.newBuilder() + .setLeastInFlight(LeastInFlight.newBuilder().setRandomSubsetSize(10))); + service.config.set(builder.build()); + // force a run + runnableCaptor.getValue().run(); + outstandingRpcCounter.waitUntilRpcsDone(); + verify(mockListener, times(1)).onChange(eq(builder.build().getSessionConfiguration())); + } + + @Test + void testDisabledSessions() throws ExecutionException, InterruptedException { + ClientConfiguration.Builder builder = manager.getDefaultConfig().toBuilder(); + builder.getSessionConfigurationBuilder().setSessionLoad(0); + ClientConfiguration disabledCfg = builder.build(); + + // Default config should have entries for session & channel pools + assertThat(disabledCfg.getSessionConfiguration().getSessionPoolConfiguration()) + .isNotEqualToDefaultInstance(); + assertThat(disabledCfg.getSessionConfiguration().getChannelConfiguration()) + .isNotEqualToDefaultInstance(); + + service.config.set(disabledCfg); + // Fetch initial config + ClientConfiguration resolvedConfig = manager.start().get(); + // But since the load is zero, the session & channel pool configs should be cleared + assertThat(resolvedConfig.getSessionConfiguration().getSessionPoolConfiguration()) + .isEqualToDefaultInstance(); + assertThat(resolvedConfig.getSessionConfiguration().getChannelConfiguration()) + .isEqualToDefaultInstance(); + } + + @Deprecated + @Test + void testMigrateSessionPool() throws ExecutionException, InterruptedException { + ClientConfiguration defaultConfig = manager.getDefaultConfig(); + + // Override LoadBalancingOptions + LoadBalancingOptions loadBalancingOptions = + LoadBalancingOptions.newBuilder() + .setPeakEwma(PeakEwma.newBuilder().setRandomSubsetSize(0)) + .build(); + + ClientConfiguration.Builder legacyBuilder = defaultConfig.toBuilder(); + + // Enable sessions + legacyBuilder.getSessionConfigurationBuilder().setSessionLoad(0.1f); + + // Now patch default config to be a legacy config + // During migration, LoadBalancingOptions are a toplevel config, so clear out the + // SessionPoolConfiguration and set the toplevel option + legacyBuilder + .getSessionConfigurationBuilder() + .setLoadBalancingOptions(loadBalancingOptions) + .clearSessionPoolConfiguration() + .clearChannelConfiguration(); + ClientConfiguration legacyCfg = legacyBuilder.build(); + + service.config.set(legacyCfg); + // Fetch initial config + ClientConfiguration resolvedConfig = manager.start().get(); + + // Make sure that SessionPoolConfiguration got patched with SessionPool & ChannelPool configs + // And ensure that the toplevel LoadBalancingOptions got migrated + ClientConfiguration.Builder expectedConfig = legacyCfg.toBuilder(); + expectedConfig + .getSessionConfigurationBuilder() + .clearLoadBalancingOptions() + .setSessionPoolConfiguration( + defaultConfig.getSessionConfiguration().getSessionPoolConfiguration().toBuilder() + .setLoadBalancingOptions(loadBalancingOptions)) + .setChannelConfiguration(defaultConfig.getSessionConfiguration().getChannelConfiguration()); + + assertThat(resolvedConfig).isEqualTo(expectedConfig.build()); + } + + @Test + void testSysPropOverride() throws Exception { + manager.close(); + + String clientConfigOverrides = + TextFormat.printer() + .printToString( + ClientConfiguration.newBuilder() + .setSessionConfiguration( + SessionClientConfiguration.newBuilder() + .setSessionLoad(0.75f) + .setSessionPoolConfiguration( + SessionPoolConfiguration.newBuilder().setHeadroom(0.7f))) + .build()); + Properties sysProps = new Properties(); + sysProps.setProperty(ClientConfigurationManager.OVERRIDE_SYS_PROP_KEY, clientConfigOverrides); + manager = + new ClientConfigurationManager( + sysProps, FEATURE_FLAGS, CLIENT_INFO, channelProvider, noopDebugTracer, mockExecutor); + + ClientConfiguration initialConfig = manager.start().get(); + + // The effective config should be the server config with the overlayed fields + ClientConfiguration.Builder expectedConfig = service.config.get().toBuilder(); + expectedConfig.getSessionConfigurationBuilder().setSessionLoad(0.75f); + expectedConfig + .getSessionConfigurationBuilder() + .getSessionPoolConfigurationBuilder() + .setHeadroom(0.7f); + + assertThat(initialConfig).isEqualTo(expectedConfig.build()); + assertThat(manager.areSessionsRequired()).isTrue(); + } + + /** Verify that proto merging works when the override the same as the default value */ + @Test + void testSysPropOverrideSessionLoadZero() throws Exception { + manager.close(); + + String clientConfigOverrides = + TextFormat.printer() + .printToString( + ClientConfiguration.newBuilder() + .setSessionConfiguration( + SessionClientConfiguration.newBuilder().setSessionLoad(0)) + .build()); + Properties sysProps = new Properties(); + sysProps.setProperty(ClientConfigurationManager.OVERRIDE_SYS_PROP_KEY, clientConfigOverrides); + manager = + new ClientConfigurationManager( + sysProps, FEATURE_FLAGS, CLIENT_INFO, channelProvider, noopDebugTracer, mockExecutor); + + ClientConfiguration initialConfig = manager.start().get(); + + // The effective config should be the server config with the overlayed fields + ClientConfiguration.Builder expectedConfig = service.config.get().toBuilder(); + expectedConfig.getSessionConfigurationBuilder().setSessionLoad(0); + + assertThat(initialConfig).isEqualTo(service.config.get()); + } + + static class FakeConfigService extends BigtableGrpc.BigtableImplBase { + private final AtomicReference config = new AtomicReference<>(); + + public FakeConfigService() throws IOException { + ClientConfiguration.Builder builder = ClientConfigurationManager.loadDefault().toBuilder(); + builder.getSessionConfigurationBuilder().setSessionLoad(0.25f); + config.set(builder.build()); + } + + @Override + public void getClientConfiguration( + GetClientConfigurationRequest request, + StreamObserver responseObserver) { + responseObserver.onNext(config.get()); + responseObserver.onCompleted(); + } + } + + private static class OutstandingRpcCounter implements ClientInterceptor { + private int numOutstandingRpcs = 0; + private final Object lock = new Object(); + + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, CallOptions callOptions, Channel channel) { + synchronized (lock) { + numOutstandingRpcs++; + } + return new ForwardingClientCall.SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void start(Listener responseListener, Metadata headers) { + super.start( + new ForwardingClientCallListener.SimpleForwardingClientCallListener( + responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + super.onClose(status, trailers); + synchronized (lock) { + numOutstandingRpcs--; + lock.notify(); + } + } + }, + headers); + } + }; + } + + void waitUntilRpcsDone() throws InterruptedException { + synchronized (lock) { + while (numOutstandingRpcs > 0) { + lock.wait(); + } + } + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java index 6b3a23e5a8a3..16569ef97e71 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java @@ -20,6 +20,7 @@ import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.Mutation.SetCell; +import com.google.bigtable.v2.SessionMutateRowRequest; import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.common.primitives.Longs; @@ -29,6 +30,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -280,4 +282,22 @@ public void fromProtoTest() { .matches(NameUtil.formatAuthorizedViewName(projectId, instanceId, AUTHORIZED_VIEW_ID)); assertThat(overriddenRequest.getAppProfileId()).matches(appProfile); } + + @Test + public void toSessionProtoTest() { + RowMutation rowMutation = + RowMutation.create(TABLE_ID, TEST_KEY) + .setCell("cf1", "q1", "v1") + .setCell("cf2", "q2", "v2"); + + List mutations = + rowMutation.toProto(REQUEST_CONTEXT).getMutationsList(); + + SessionMutateRowRequest expected = + SessionMutateRowRequest.newBuilder().setKey(TEST_KEY).addAllMutations(mutations).build(); + + SessionMutateRowRequest sessionProto = rowMutation.toSessionProto(); + + assertThat(sessionProto).isEqualTo(expected); + } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java index 182fd68726df..3fd220490593 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java @@ -623,6 +623,12 @@ public void testAllMethodsAreCalled() { methods.add("PingAndWarm"); methods.add("ExecuteQuery"); // TODO remove when retries are implemented + // Session APIs. Routing cookie is handled differently + methods.add("OpenAuthorizedView"); + methods.add("OpenMaterializedView"); + methods.add("GetClientConfiguration"); + methods.add("OpenTable"); + assertThat(methods).containsExactlyElementsIn(expected); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java index 2f243978d12a..971f2646263e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java @@ -906,6 +906,7 @@ public void isRefreshingChannelFalseValueTest() { "areInternalMetricsEnabled", "jwtAudience", "directPathConfig", + "sessionsEnabled", }; @Test diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java index bfc94dea5001..0e2ac99a138f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java @@ -333,6 +333,8 @@ public void testPingAndWarmFeatureFlags() throws InterruptedException, IOExcepti assertThat(featureFlags.getLastScannedRowResponses()).isTrue(); assertThat(featureFlags.getRoutingCookie()).isTrue(); assertThat(featureFlags.getRetryInfo()).isTrue(); + assertThat(featureFlags.getPeerInfo()).isTrue(); + assertThat(featureFlags.getSessionsCompatible()).isTrue(); } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java index 4903433a656e..8b93a043f6ca 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java @@ -231,6 +231,12 @@ public void testAllMethods() { methods.add("PingAndWarm"); methods.add("ExecuteQuery"); // TODO remove when retries are implemented + // Session APIs. RetryInfo is handled differently + methods.add("OpenAuthorizedView"); + methods.add("OpenMaterializedView"); + methods.add("GetClientConfiguration"); + methods.add("OpenTable"); + assertThat(methods).containsExactlyElementsIn(expected); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java index 6b748b1a59bb..aaa68b175d7f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java @@ -19,6 +19,7 @@ import com.google.api.core.SettableApiFuture; import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.internal.session.fake.FakeClock; 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; @@ -26,7 +27,6 @@ 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; @@ -49,7 +49,7 @@ public class ChannelPoolHealthCheckerTest { @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); @Mock private BigtableChannelPrimer mockPrimer; private ListeningScheduledExecutorService executor; - @Mock private Clock mockClock; + private FakeClock fakeClock; private ChannelPoolHealthChecker healthChecker; private List channelList; @@ -59,10 +59,8 @@ public void setUp() { 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")); + fakeClock = new FakeClock(Instant.parse("2025-08-01T10:00:00Z")); + healthChecker = new ChannelPoolHealthChecker(entrySupplier, mockPrimer, executor, fakeClock); } // Helper method to create test entries @@ -113,11 +111,10 @@ public void testOnComplete_cancellationIsFailure() { @Test public void testPruning_removesOldProbesAndCounters() { Entry entry = createTestEntry(); - healthChecker.addProbeResult(entry, ProbeResult.create(mockClock.instant(), false)); + healthChecker.addProbeResult(entry, ProbeResult.create(fakeClock.instant(), false)); assertThat(entry.failedProbesInWindow.get()).isEqualTo(1); - Instant newTime = mockClock.instant().plus(Duration.ofMinutes(6)); - Mockito.when(mockClock.instant()).thenReturn(newTime); + fakeClock.increment(Duration.ofMinutes(6)); healthChecker.pruneHistory(entry); // Manually call for direct testing assertThat(entry.probeHistory).isEmpty(); diff --git a/google-cloud-bigtable/src/test/proto/google/bigtable/v2/fake.proto b/google-cloud-bigtable/src/test/proto/google/bigtable/v2/fake.proto new file mode 100644 index 000000000000..bf2c5eec5a05 --- /dev/null +++ b/google-cloud-bigtable/src/test/proto/google/bigtable/v2/fake.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +import "google/bigtable/v2/bigtable.proto"; +import "google/bigtable/v2/session.proto"; +import "google/protobuf/duration.proto"; +import "google/rpc/status.proto"; + +package google.bigtable.v2; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; +option java_multiple_files = true; +option java_package = "com.google.bigtable.v2"; +option java_outer_classname = "FakeSessionProto"; + +service FakeSession { + rpc OpenSession(stream SessionRequest) returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = SESSION_TYPE_TEST; + } +} + +message OpenFakeSessionRequest { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TEST; + + google.protobuf.Duration go_away_delay = 2; + + // session set up phase + message StreamError { + google.rpc.Status status = 1; + map metadata = 2; + + // create a session but return a stream error after the delay + google.protobuf.Duration delay = 3; + } + + StreamError stream_error = 3; + SessionParametersResponse session_params = 4; + + // session steady phase + message Action { + google.protobuf.Duration delay = 1; + oneof payload { + VirtualRpcResponse response = 2; + ErrorResponse error_response = 3; + } + } + message ActionList { + bool repeat = 1; // if we should reuse the same action + repeated Action actions = 2; + } + map vrpc_actions = 6; + google.bigtable.v2.SessionRefreshConfig refresh_config = 7; + google.protobuf.Duration refresh_config_delay = 8; +} + +message OpenFakeSessionResponse { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TEST; +} + +message FakeSessionOpRequest { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TEST; + + oneof payload { + SessionFakeScriptedRequest scripted_request = 1; + } +} + +message SessionFakeScriptedRequest { + int64 tag = 1; +} + +message SessionFakeScriptedResponse { + string message = 1; +} + +message FakeSessionOpResponse { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TEST; + + oneof payload { + SessionFakeScriptedResponse scripted = 1; + } +} 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 d579262bb98e..2dc40ecdec88 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 @@ -511,6 +511,180 @@ private BigtableGrpc() {} return getExecuteQueryMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration> + getGetClientConfigurationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetClientConfiguration", + requestType = com.google.bigtable.v2.GetClientConfigurationRequest.class, + responseType = com.google.bigtable.v2.ClientConfiguration.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration> + getGetClientConfigurationMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration> + getGetClientConfigurationMethod; + if ((getGetClientConfigurationMethod = BigtableGrpc.getGetClientConfigurationMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getGetClientConfigurationMethod = BigtableGrpc.getGetClientConfigurationMethod) + == null) { + BigtableGrpc.getGetClientConfigurationMethod = + getGetClientConfigurationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetClientConfiguration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.GetClientConfigurationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.ClientConfiguration.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("GetClientConfiguration")) + .build(); + } + } + } + return getGetClientConfigurationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenTableMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OpenTable", + requestType = com.google.bigtable.v2.SessionRequest.class, + responseType = com.google.bigtable.v2.SessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenTableMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenTableMethod; + if ((getOpenTableMethod = BigtableGrpc.getOpenTableMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getOpenTableMethod = BigtableGrpc.getOpenTableMethod) == null) { + BigtableGrpc.getOpenTableMethod = + getOpenTableMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "OpenTable")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("OpenTable")) + .build(); + } + } + } + return getOpenTableMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenAuthorizedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OpenAuthorizedView", + requestType = com.google.bigtable.v2.SessionRequest.class, + responseType = com.google.bigtable.v2.SessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenAuthorizedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenAuthorizedViewMethod; + if ((getOpenAuthorizedViewMethod = BigtableGrpc.getOpenAuthorizedViewMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getOpenAuthorizedViewMethod = BigtableGrpc.getOpenAuthorizedViewMethod) == null) { + BigtableGrpc.getOpenAuthorizedViewMethod = + getOpenAuthorizedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "OpenAuthorizedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionResponse.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("OpenAuthorizedView")) + .build(); + } + } + } + return getOpenAuthorizedViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenMaterializedViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OpenMaterializedView", + requestType = com.google.bigtable.v2.SessionRequest.class, + responseType = com.google.bigtable.v2.SessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenMaterializedViewMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + getOpenMaterializedViewMethod; + if ((getOpenMaterializedViewMethod = BigtableGrpc.getOpenMaterializedViewMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getOpenMaterializedViewMethod = BigtableGrpc.getOpenMaterializedViewMethod) == null) { + BigtableGrpc.getOpenMaterializedViewMethod = + getOpenMaterializedViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "OpenMaterializedView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.SessionResponse.getDefaultInstance())) + .setSchemaDescriptor( + new BigtableMethodDescriptorSupplier("OpenMaterializedView")) + .build(); + } + } + } + return getOpenMaterializedViewMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static BigtableStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -750,6 +924,67 @@ default void executeQuery( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getExecuteQueryMethod(), responseObserver); } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default void getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetClientConfigurationMethod(), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default io.grpc.stub.StreamObserver openTable( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getOpenTableMethod(), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default io.grpc.stub.StreamObserver openAuthorizedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getOpenAuthorizedViewMethod(), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + default io.grpc.stub.StreamObserver openMaterializedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getOpenMaterializedViewMethod(), responseObserver); + } } /** @@ -980,6 +1215,70 @@ public void executeQuery( request, responseObserver); } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public void getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClientConfigurationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public io.grpc.stub.StreamObserver openTable( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getOpenTableMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public io.grpc.stub.StreamObserver openAuthorizedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getOpenAuthorizedViewMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public io.grpc.stub.StreamObserver openMaterializedView( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getOpenMaterializedViewMethod(), getCallOptions()), + responseObserver); + } } /** @@ -1175,6 +1474,73 @@ public com.google.bigtable.v2.PrepareQueryResponse prepareQuery( return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( getChannel(), getExecuteQueryMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public com.google.bigtable.v2.ClientConfiguration getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetClientConfigurationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + openTable() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getOpenTableMethod(), getCallOptions()); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + openAuthorizedView() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getOpenAuthorizedViewMethod(), getCallOptions()); + } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse> + openMaterializedView() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getOpenMaterializedViewMethod(), getCallOptions()); + } } /** @@ -1362,6 +1728,21 @@ public java.util.Iterator executeQu return io.grpc.stub.ClientCalls.blockingServerStreamingCall( getChannel(), getExecuteQueryMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public com.google.bigtable.v2.ClientConfiguration getClientConfiguration( + com.google.bigtable.v2.GetClientConfigurationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClientConfigurationMethod(), getCallOptions(), request); + } } /** @@ -1457,6 +1838,22 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getPrepareQueryMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * This RPC is only intended to be used by the official Cloud Bigtable client
+     * libraries to implement the Bigtable Session based protocol. It is subject
+     * to change without notice.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.ClientConfiguration> + getClientConfiguration(com.google.bigtable.v2.GetClientConfigurationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClientConfigurationMethod(), getCallOptions()), request); + } } private static final int METHODID_READ_ROWS = 0; @@ -1470,6 +1867,10 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions private static final int METHODID_READ_CHANGE_STREAM = 8; private static final int METHODID_PREPARE_QUERY = 9; private static final int METHODID_EXECUTE_QUERY = 10; + private static final int METHODID_GET_CLIENT_CONFIGURATION = 11; + private static final int METHODID_OPEN_TABLE = 12; + private static final int METHODID_OPEN_AUTHORIZED_VIEW = 13; + private static final int METHODID_OPEN_MATERIALIZED_VIEW = 14; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1555,6 +1956,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_CLIENT_CONFIGURATION: + serviceImpl.getClientConfiguration( + (com.google.bigtable.v2.GetClientConfigurationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; default: throw new AssertionError(); } @@ -1565,6 +1972,21 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv public io.grpc.stub.StreamObserver invoke( io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { + case METHODID_OPEN_TABLE: + return (io.grpc.stub.StreamObserver) + serviceImpl.openTable( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_OPEN_AUTHORIZED_VIEW: + return (io.grpc.stub.StreamObserver) + serviceImpl.openAuthorizedView( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_OPEN_MATERIALIZED_VIEW: + return (io.grpc.stub.StreamObserver) + serviceImpl.openMaterializedView( + (io.grpc.stub.StreamObserver) + responseObserver); default: throw new AssertionError(); } @@ -1644,6 +2066,31 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.bigtable.v2.ExecuteQueryRequest, com.google.bigtable.v2.ExecuteQueryResponse>(service, METHODID_EXECUTE_QUERY))) + .addMethod( + getGetClientConfigurationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.bigtable.v2.GetClientConfigurationRequest, + com.google.bigtable.v2.ClientConfiguration>( + service, METHODID_GET_CLIENT_CONFIGURATION))) + .addMethod( + getOpenTableMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse>( + service, METHODID_OPEN_TABLE))) + .addMethod( + getOpenAuthorizedViewMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse>( + service, METHODID_OPEN_AUTHORIZED_VIEW))) + .addMethod( + getOpenMaterializedViewMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.bigtable.v2.SessionRequest, com.google.bigtable.v2.SessionResponse>( + service, METHODID_OPEN_MATERIALIZED_VIEW))) .build(); } @@ -1704,6 +2151,10 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getReadChangeStreamMethod()) .addMethod(getPrepareQueryMethod()) .addMethod(getExecuteQueryMethod()) + .addMethod(getGetClientConfigurationMethod()) + .addMethod(getOpenTableMethod()) + .addMethod(getOpenAuthorizedViewMethod()) + .addMethod(getOpenMaterializedViewMethod()) .build(); } } diff --git a/pom.xml b/pom.xml index 467131895bc7..5142817f86dd 100644 --- a/pom.xml +++ b/pom.xml @@ -209,6 +209,7 @@ org.mockito mockito-bom + 4.11.0 pom import diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequest.java new file mode 100644 index 000000000000..587e10e50ea9 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequest.java @@ -0,0 +1,925 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A request wrapper for operations on an authorized view. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class AuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.AuthorizedViewRequest) + AuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthorizedViewRequest"); + } + + // Use AuthorizedViewRequest.newBuilder() to construct. + private AuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AuthorizedViewRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewRequest.class, + com.google.bigtable.v2.AuthorizedViewRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.AuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.AuthorizedViewRequest other = + (com.google.bigtable.v2.AuthorizedViewRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest 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.v2.AuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest 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.v2.AuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.AuthorizedViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request wrapper for operations on an authorized view. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.AuthorizedViewRequest) + com.google.bigtable.v2.AuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewRequest.class, + com.google.bigtable.v2.AuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.AuthorizedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.AuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewRequest build() { + com.google.bigtable.v2.AuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewRequest buildPartial() { + com.google.bigtable.v2.AuthorizedViewRequest result = + new com.google.bigtable.v2.AuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.AuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.AuthorizedViewRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.AuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.v2.AuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.AuthorizedViewRequest other) { + if (other == com.google.bigtable.v2.AuthorizedViewRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowRequest.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowRequest.newBuilder( + (com.google.bigtable.v2.SessionReadRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowRequest.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionReadRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowRequest.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowRequest.newBuilder( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowRequest.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.AuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.AuthorizedViewRequest) + private static final com.google.bigtable.v2.AuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.AuthorizedViewRequest(); + } + + public static com.google.bigtable.v2.AuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..ab0b9e4e23b6 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface AuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.AuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowRequest getReadRow(); + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowRequest getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.AuthorizedViewRequest.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponse.java new file mode 100644 index 000000000000..e7bfbdc73e11 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponse.java @@ -0,0 +1,925 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A response wrapper for operations on an authorized view. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewResponse} + */ +@com.google.protobuf.Generated +public final class AuthorizedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.AuthorizedViewResponse) + AuthorizedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthorizedViewResponse"); + } + + // Use AuthorizedViewResponse.newBuilder() to construct. + private AuthorizedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AuthorizedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewResponse.class, + com.google.bigtable.v2.AuthorizedViewResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.AuthorizedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.AuthorizedViewResponse other = + (com.google.bigtable.v2.AuthorizedViewResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse 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.v2.AuthorizedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse 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.v2.AuthorizedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.AuthorizedViewResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A response wrapper for operations on an authorized view. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.AuthorizedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.AuthorizedViewResponse) + com.google.bigtable.v2.AuthorizedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.AuthorizedViewResponse.class, + com.google.bigtable.v2.AuthorizedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.AuthorizedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.AuthorizedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewResponse build() { + com.google.bigtable.v2.AuthorizedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewResponse buildPartial() { + com.google.bigtable.v2.AuthorizedViewResponse result = + new com.google.bigtable.v2.AuthorizedViewResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.AuthorizedViewResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.AuthorizedViewResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.AuthorizedViewResponse) { + return mergeFrom((com.google.bigtable.v2.AuthorizedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.AuthorizedViewResponse other) { + if (other == com.google.bigtable.v2.AuthorizedViewResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowResponse.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowResponse.newBuilder( + (com.google.bigtable.v2.SessionReadRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowResponse.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionReadRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowResponse.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowResponse.newBuilder( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowResponse.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.AuthorizedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.AuthorizedViewResponse) + private static final com.google.bigtable.v2.AuthorizedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.AuthorizedViewResponse(); + } + + public static com.google.bigtable.v2.AuthorizedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.AuthorizedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponseOrBuilder.java new file mode 100644 index 000000000000..4c56458ed6d4 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewResponseOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface AuthorizedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.AuthorizedViewResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowResponse getReadRow(); + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowResponse getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.AuthorizedViewResponse.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifier.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifier.java new file mode 100644 index 000000000000..e951f9ad6caa --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifier.java @@ -0,0 +1,802 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Information about the connected backends from a session client's
+ * perspective. This information may be used to make choices about session
+ * re-establishment en-masse for sessions with the same backend identifiers.
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.BackendIdentifier} + */ +@com.google.protobuf.Generated +public final class BackendIdentifier extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.BackendIdentifier) + BackendIdentifierOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackendIdentifier"); + } + + // Use BackendIdentifier.newBuilder() to construct. + private BackendIdentifier(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BackendIdentifier() { + applicationFrontendZone_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.BackendIdentifier.class, + com.google.bigtable.v2.BackendIdentifier.Builder.class); + } + + public static final int GOOGLE_FRONTEND_ID_FIELD_NUMBER = 1; + private long googleFrontendId_ = 0L; + + /** + * + * + *
+   * An opaque identifier for the Google Frontend which serviced this request.
+   * Only set when not using DirectAccess.
+   * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + @java.lang.Override + public long getGoogleFrontendId() { + return googleFrontendId_; + } + + public static final int APPLICATION_FRONTEND_ID_FIELD_NUMBER = 2; + private long applicationFrontendId_ = 0L; + + /** + * + * + *
+   * An opaque identifier for the application frontend which serviced this
+   * request.
+   * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + @java.lang.Override + public long getApplicationFrontendId() { + return applicationFrontendId_; + } + + public static final int APPLICATION_FRONTEND_ZONE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationFrontendZone_ = ""; + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The applicationFrontendZone. + */ + @java.lang.Override + public java.lang.String getApplicationFrontendZone() { + java.lang.Object ref = applicationFrontendZone_; + 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(); + applicationFrontendZone_ = s; + return s; + } + } + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The bytes for applicationFrontendZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { + java.lang.Object ref = applicationFrontendZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (googleFrontendId_ != 0L) { + output.writeInt64(1, googleFrontendId_); + } + if (applicationFrontendId_ != 0L) { + output.writeInt64(2, applicationFrontendId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendZone_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, applicationFrontendZone_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (googleFrontendId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, googleFrontendId_); + } + if (applicationFrontendId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, applicationFrontendId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendZone_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, applicationFrontendZone_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.BackendIdentifier)) { + return super.equals(obj); + } + com.google.bigtable.v2.BackendIdentifier other = (com.google.bigtable.v2.BackendIdentifier) obj; + + if (getGoogleFrontendId() != other.getGoogleFrontendId()) return false; + if (getApplicationFrontendId() != other.getApplicationFrontendId()) return false; + if (!getApplicationFrontendZone().equals(other.getApplicationFrontendZone())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + GOOGLE_FRONTEND_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGoogleFrontendId()); + hash = (37 * hash) + APPLICATION_FRONTEND_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getApplicationFrontendId()); + hash = (37 * hash) + APPLICATION_FRONTEND_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getApplicationFrontendZone().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.BackendIdentifier 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.v2.BackendIdentifier parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.BackendIdentifier 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.v2.BackendIdentifier parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.BackendIdentifier parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.BackendIdentifier parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.BackendIdentifier parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.BackendIdentifier prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Information about the connected backends from a session client's
+   * perspective. This information may be used to make choices about session
+   * re-establishment en-masse for sessions with the same backend identifiers.
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.BackendIdentifier} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.BackendIdentifier) + com.google.bigtable.v2.BackendIdentifierOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.BackendIdentifier.class, + com.google.bigtable.v2.BackendIdentifier.Builder.class); + } + + // Construct using com.google.bigtable.v2.BackendIdentifier.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + googleFrontendId_ = 0L; + applicationFrontendId_ = 0L; + applicationFrontendZone_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier getDefaultInstanceForType() { + return com.google.bigtable.v2.BackendIdentifier.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier build() { + com.google.bigtable.v2.BackendIdentifier result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier buildPartial() { + com.google.bigtable.v2.BackendIdentifier result = + new com.google.bigtable.v2.BackendIdentifier(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.BackendIdentifier result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.googleFrontendId_ = googleFrontendId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.applicationFrontendId_ = applicationFrontendId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.applicationFrontendZone_ = applicationFrontendZone_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.BackendIdentifier) { + return mergeFrom((com.google.bigtable.v2.BackendIdentifier) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.BackendIdentifier other) { + if (other == com.google.bigtable.v2.BackendIdentifier.getDefaultInstance()) return this; + if (other.getGoogleFrontendId() != 0L) { + setGoogleFrontendId(other.getGoogleFrontendId()); + } + if (other.getApplicationFrontendId() != 0L) { + setApplicationFrontendId(other.getApplicationFrontendId()); + } + if (!other.getApplicationFrontendZone().isEmpty()) { + applicationFrontendZone_ = other.applicationFrontendZone_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + googleFrontendId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + applicationFrontendId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + applicationFrontendZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long googleFrontendId_; + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + @java.lang.Override + public long getGoogleFrontendId() { + return googleFrontendId_; + } + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @param value The googleFrontendId to set. + * @return This builder for chaining. + */ + public Builder setGoogleFrontendId(long value) { + + googleFrontendId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An opaque identifier for the Google Frontend which serviced this request.
+     * Only set when not using DirectAccess.
+     * 
+ * + * int64 google_frontend_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearGoogleFrontendId() { + bitField0_ = (bitField0_ & ~0x00000001); + googleFrontendId_ = 0L; + onChanged(); + return this; + } + + private long applicationFrontendId_; + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + @java.lang.Override + public long getApplicationFrontendId() { + return applicationFrontendId_; + } + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @param value The applicationFrontendId to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendId(long value) { + + applicationFrontendId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * An opaque identifier for the application frontend which serviced this
+     * request.
+     * 
+ * + * int64 application_frontend_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendId() { + bitField0_ = (bitField0_ & ~0x00000002); + applicationFrontendId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object applicationFrontendZone_ = ""; + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @return The applicationFrontendZone. + */ + public java.lang.String getApplicationFrontendZone() { + java.lang.Object ref = applicationFrontendZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationFrontendZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @return The bytes for applicationFrontendZone. + */ + public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { + java.lang.Object ref = applicationFrontendZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @param value The applicationFrontendZone to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationFrontendZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendZone() { + applicationFrontendZone_ = getDefaultInstance().getApplicationFrontendZone(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The zone of the application frontend that served this request.
+     * 
+ * + * string application_frontend_zone = 3; + * + * @param value The bytes for applicationFrontendZone to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationFrontendZone_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.BackendIdentifier) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.BackendIdentifier) + private static final com.google.bigtable.v2.BackendIdentifier DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.BackendIdentifier(); + } + + public static com.google.bigtable.v2.BackendIdentifier getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BackendIdentifier parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifierOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifierOrBuilder.java new file mode 100644 index 000000000000..e9662179256c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BackendIdentifierOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface BackendIdentifierOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.BackendIdentifier) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An opaque identifier for the Google Frontend which serviced this request.
+   * Only set when not using DirectAccess.
+   * 
+ * + * int64 google_frontend_id = 1; + * + * @return The googleFrontendId. + */ + long getGoogleFrontendId(); + + /** + * + * + *
+   * An opaque identifier for the application frontend which serviced this
+   * request.
+   * 
+ * + * int64 application_frontend_id = 2; + * + * @return The applicationFrontendId. + */ + long getApplicationFrontendId(); + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The applicationFrontendZone. + */ + java.lang.String getApplicationFrontendZone(); + + /** + * + * + *
+   * The zone of the application frontend that served this request.
+   * 
+ * + * string application_frontend_zone = 3; + * + * @return The bytes for applicationFrontendZone. + */ + com.google.protobuf.ByteString getApplicationFrontendZoneBytes(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java index 3a75fff0acf6..da1b7d619751 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java @@ -187,11 +187,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "proto\032\027google/api/client.proto\032\037google/a" + "pi/field_behavior.proto\032\031google/api/reso" + "urce.proto\032\030google/api/routing.proto\032\035go" - + "ogle/bigtable/v2/data.proto\032&google/bigt" - + "able/v2/request_stats.proto\032\036google/bigt" - + "able/v2/types.proto\032\036google/protobuf/dur" - + "ation.proto\032\037google/protobuf/timestamp.p" - + "roto\032\036google/protobuf/wrappers.proto\032\027google/rpc/status.proto\"\314\004\n" + + "ogle/bigtable/v2/data.proto\032&google/bigtable/v2/request_stats.proto\032 google/bigt" + + "able/v2/session.proto\032\036google/bigtable/v" + + "2/types.proto\032\036google/protobuf/duration." + + "proto\032\037google/protobuf/timestamp.proto\032\036" + + "google/protobuf/wrappers.proto\032\027google/rpc/status.proto\"\314\004\n" + "\017ReadRowsRequest\022>\n\n" + "table_name\030\001 \001(\tB*\340A\001\372A$\n" + "\"bigtableadmin.googleapis.com/Table\022Q\n" @@ -203,8 +203,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\004rows\030\002 \001(\0132\032.google.bigtable.v2.RowSet\022-\n" + "\006filter\030\003 \001(\0132\035.google.bigtable.v2.RowFilter\022\022\n\n" + "rows_limit\030\004 \001(\003\022P\n" - + "\022request_stats_view\030\006 \001(\01624.g" - + "oogle.bigtable.v2.ReadRowsRequest.RequestStatsView\022\020\n" + + "\022request_stats_view\030\006 \001(\01624.google." + + "bigtable.v2.ReadRowsRequest.RequestStatsView\022\020\n" + "\010reversed\030\007 \001(\010\"f\n" + "\020RequestStatsView\022\"\n" + "\036REQUEST_STATS_VIEW_UNSPECIFIED\020\000\022\026\n" @@ -252,16 +252,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\024authorized_view_name\030\005 \001(\tB3\340A\001\372A-\n" + "+bigtableadmin.googleapis.com/AuthorizedView\022\026\n" + "\016app_profile_id\030\003 \001(\t\022A\n" - + "\007entries\030\002 \003(\0132+.google.bi" - + "gtable.v2.MutateRowsRequest.EntryB\003\340A\002\032\204\001\n" + + "\007entries\030\002" + + " \003(\0132+.google.bigtable.v2.MutateRowsRequest.EntryB\003\340A\002\032\204\001\n" + "\005Entry\022\017\n" + "\007row_key\030\001 \001(\014\0224\n" + "\tmutations\030\002 \003(\0132\034.google.bigtable.v2.MutationB\003\340A\002\0224\n" + "\013idempotency\030\003 \001(\0132\037.google.bigtable.v2.Idempotency\"\344\001\n" + "\022MutateRowsResponse\022=\n" + "\007entries\030\001 \003(\0132,.google.bigtable.v2.MutateRowsResponse.Entry\022?\n" - + "\017rate_limit_info\030\003" - + " \001(\0132!.google.bigtable.v2.RateLimitInfoH\000\210\001\001\032:\n" + + "\017rate_limit_info\030\003 \001(\0132!" + + ".google.bigtable.v2.RateLimitInfoH\000\210\001\001\032:\n" + "\005Entry\022\r\n" + "\005index\030\001 \001(\003\022\"\n" + "\006status\030\002 \001(\0132\022.google.rpc.StatusB\022\n" @@ -315,30 +315,29 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\022heartbeat_duration\030\007 \001(\0132\031.google.protobuf.DurationB\014\n\n" + "start_from\"\251\n\n" + "\030ReadChangeStreamResponse\022N\n" - + "\013data_change\030\001 \001(\01327.googl" - + "e.bigtable.v2.ReadChangeStreamResponse.DataChangeH\000\022K\n" - + "\theartbeat\030\002 \001(\01326.google." - + "bigtable.v2.ReadChangeStreamResponse.HeartbeatH\000\022P\n" - + "\014close_stream\030\003 \001(\01328.google." - + "bigtable.v2.ReadChangeStreamResponse.CloseStreamH\000\032\364\001\n\r" + + "\013data_change\030\001 \001(\01327.google.bigt" + + "able.v2.ReadChangeStreamResponse.DataChangeH\000\022K\n" + + "\theartbeat\030\002 \001(\01326.google.bigtab" + + "le.v2.ReadChangeStreamResponse.HeartbeatH\000\022P\n" + + "\014close_stream\030\003 \001(\01328.google.bigtab" + + "le.v2.ReadChangeStreamResponse.CloseStreamH\000\032\364\001\n\r" + "MutationChunk\022X\n\n" - + "chunk_info\030\001 \001(\0132D.google.bigtable.v2.ReadChange" - + "StreamResponse.MutationChunk.ChunkInfo\022.\n" + + "chunk_info\030\001 \001" + + "(\0132D.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo\022.\n" + "\010mutation\030\002 \001(\0132\034.google.bigtable.v2.Mutation\032Y\n" + "\tChunkInfo\022\032\n" + "\022chunked_value_size\030\001 \001(\005\022\034\n" - + "\024chunked_value_offset\030\002 \001(\005\022\022\n" - + "\n" + + "\024chunked_value_offset\030\002 \001(\005\022\022\n\n" + "last_chunk\030\003 \001(\010\032\306\003\n\n" + "DataChange\022J\n" - + "\004type\030\001" - + " \001(\0162<.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type\022\031\n" + + "\004type\030\001 \001(\016" + + "2<.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Type\022\031\n" + "\021source_cluster_id\030\002 \001(\t\022\017\n" + "\007row_key\030\003 \001(\014\0224\n" + "\020commit_timestamp\030\004 \001(\0132\032.google.protobuf.Timestamp\022\022\n\n" + "tiebreaker\030\005 \001(\005\022J\n" - + "\006chunks\030\006 \003" - + "(\0132:.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk\022\014\n" + + "\006chunks\030\006 \003(\0132:.g" + + "oogle.bigtable.v2.ReadChangeStreamResponse.MutationChunk\022\014\n" + "\004done\030\010 \001(\010\022\r\n" + "\005token\030\t \001(\t\022;\n" + "\027estimated_low_watermark\030\n" @@ -349,8 +348,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\022GARBAGE_COLLECTION\020\002\022\020\n" + "\014CONTINUATION\020\003\032\221\001\n" + "\tHeartbeat\022G\n" - + "\022continuation_token\030\001 \001(\0132+.g" - + "oogle.bigtable.v2.StreamContinuationToken\022;\n" + + "\022continuation_token\030\001" + + " \001(\0132+.google.bigtable.v2.StreamContinuationToken\022;\n" + "\027estimated_low_watermark\030\002" + " \001(\0132\032.google.protobuf.Timestamp\032\270\001\n" + "\013CloseStream\022\"\n" @@ -384,8 +383,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\016app_profile_id\030\002 \001(\tB\003\340A\001\022\022\n" + "\005query\030\003 \001(\tB\003\340A\002\0227\n" + "\014proto_format\030\004 \001(\0132\037.google.bigtable.v2.ProtoFormatH\000\022Q\n" - + "\013param_types\030\006 \003(\01327.google.bigtable.v" - + "2.PrepareQueryRequest.ParamTypesEntryB\003\340A\002\032K\n" + + "\013param_types\030\006" + + " \003(\01327.google.bigtable.v2.PrepareQueryRequest.ParamTypesEntryB\003\340A\002\032K\n" + "\017ParamTypesEntry\022\013\n" + "\003key\030\001 \001(\t\022\'\n" + "\005value\030\002 \001(\0132\030.google.bigtable.v2.Type:\0028\001B\r\n" @@ -393,121 +392,129 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\024PrepareQueryResponse\0227\n" + "\010metadata\030\001 \001(\0132%.google.bigtable.v2.ResultSetMetadata\022\026\n" + "\016prepared_query\030\002 \001(\014\022/\n" - + "\013valid_until\030\003 \001(\0132\032.google.protobuf.Timestamp2\333\'\n" + + "\013valid_until\030\003 \001(\0132\032.google.protobuf.Timestamp2\215+\n" + "\010Bigtable\022\325\004\n" - + "\010ReadRows\022#.go" - + "ogle.bigtable.v2.ReadRowsRequest\032$.google.bigtable.v2.ReadRowsResponse\"\373\003\332A\n" - + "table_name\332A\031table_name,app_profile_id\202\323\344\223\002\361" - + "\001\"9/v2/{table_name=projects/*/instances/" - + "*/tables/*}:readRows:\001*ZZ\"U/v2/{authorized_view_name=projects/*/instances/*/tabl" - + "es/*/authorizedViews/*}:readRows:\001*ZU\"P/v2/{materialized_view_name=projects/*/in" - + "stances/*/materializedViews/*}:readRows:\001*\212\323\344\223\002\323\001\022:\n\n" + + "\010ReadRows\022#.google.b" + + "igtable.v2.ReadRowsRequest\032$.google.bigtable.v2.ReadRowsResponse\"\373\003\332A\n" + + "table_name\332A\031table_name,app_profile_id\202\323\344\223\002\361\001\"9/v2" + + "/{table_name=projects/*/instances/*/tables/*}:readRows:\001*ZZ\"U/v2/{authorized_vie" + + "w_name=projects/*/instances/*/tables/*/authorizedViews/*}:readRows:\001*ZU\"P/v2/{ma" + + "terialized_view_name=projects/*/instance" + + "s/*/materializedViews/*}:readRows:\001*\212\323\344\223\002\323\001\022:\n\n" + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + "\016app_profile_id\022G\n" + "\024authorized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022:\n" + "\026materialized_view_name\022 {name=projects/*/instances/*}/**0\001\022\352\004\n\r" - + "SampleRowKeys\022(.google.bigtable.v2.SampleRowKeysReque" - + "st\032).google.bigtable.v2.SampleRowKeysResponse\"\201\004\332A\n" - + "table_name\332A\031table_name,app_p" - + "rofile_id\202\323\344\223\002\367\001\022>/v2/{table_name=projec" - + "ts/*/instances/*/tables/*}:sampleRowKeysZ\\\022Z/v2/{authorized_view_name=projects/*" - + "/instances/*/tables/*/authorizedViews/*}:sampleRowKeysZW\022U/v2/{materialized_view" - + "_name=projects/*/instances/*/materializedViews/*}:sampleRowKeys\212\323\344\223\002\323\001\022:\n\n" + + "SampleRowKeys\022(.google.bigtable.v2.SampleRowKeysRequest\032).g" + + "oogle.bigtable.v2.SampleRowKeysResponse\"\201\004\332A\n" + + "table_name\332A\031table_name,app_profile" + + "_id\202\323\344\223\002\367\001\022>/v2/{table_name=projects/*/i" + + "nstances/*/tables/*}:sampleRowKeysZ\\\022Z/v2/{authorized_view_name=projects/*/insta" + + "nces/*/tables/*/authorizedViews/*}:sampleRowKeysZW\022U/v2/{materialized_view_name=" + + "projects/*/instances/*/materializedViews/*}:sampleRowKeys\212\323\344\223\002\323\001\022:\n\n" + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + "\016app_profile_id\022G\n" + "\024authorized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022:\n" + "\026materialized_view_name\022 {name=projects/*/instances/*}/**0\001\022\351\003\n" - + "\tMutateRow\022$.google.bigtable.v2.MutateRowRequest\032%.google.bigtable.v2.Mut" - + "ateRowResponse\"\216\003\332A\034table_name,row_key,m" - + "utations\332A+table_name,row_key,mutations," - + "app_profile_id\202\323\344\223\002\234\001\":/v2/{table_name=p" - + "rojects/*/instances/*/tables/*}:mutateRow:\001*Z[\"V/v2/{authorized_view_name=projec" - + "ts/*/instances/*/tables/*/authorizedViews/*}:mutateRow:\001*\212\323\344\223\002\227\001\022:\n\n" + + "\tMutateRow\022$.google.bigtable.v2.MutateRowRequest\032%.google.bigtable.v2.MutateRow" + + "Response\"\216\003\332A\034table_name,row_key,mutatio" + + "ns\332A+table_name,row_key,mutations,app_pr" + + "ofile_id\202\323\344\223\002\234\001\":/v2/{table_name=project" + + "s/*/instances/*/tables/*}:mutateRow:\001*Z[\"V/v2/{authorized_view_name=projects/*/i" + + "nstances/*/tables/*/authorizedViews/*}:mutateRow:\001*\212\323\344\223\002\227\001\022:\n\n" + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + "\016app_profile_id\022G\n" - + "\024authorized_vie" - + "w_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\334\003\n\n" - + "MutateRows\022%.google.bigtable.v2.MutateRowsRequest\032&.google.b" - + "igtable.v2.MutateRowsResponse\"\374\002\332A\022table" - + "_name,entries\332A!table_name,entries,app_p" - + "rofile_id\202\323\344\223\002\236\001\";/v2/{table_name=projec" - + "ts/*/instances/*/tables/*}:mutateRows:\001*Z\\\"W/v2/{authorized_view_name=projects/*" - + "/instances/*/tables/*/authorizedViews/*}:mutateRows:\001*\212\323\344\223\002\227\001\022:\n\n" + + "\024authorized_view_name" + + "\022/{table_name=projects/*/instances/*/tables/*}/**\022\334\003\n\n" + + "MutateRows\022%.google.bigtable.v2.MutateRowsRequest\032&.google.bigtabl" + + "e.v2.MutateRowsResponse\"\374\002\332A\022table_name," + + "entries\332A!table_name,entries,app_profile" + + "_id\202\323\344\223\002\236\001\";/v2/{table_name=projects/*/i" + + "nstances/*/tables/*}:mutateRows:\001*Z\\\"W/v2/{authorized_view_name=projects/*/insta" + + "nces/*/tables/*/authorizedViews/*}:mutateRows:\001*\212\323\344\223\002\227\001\022:\n\n" + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + "\016app_profile_id\022G\n" - + "\024authorized_view_n" - + "ame\022/{table_name=projects/*/instances/*/tables/*}/**0\001\022\335\004\n" - + "\021CheckAndMutateRow\022,.google.bigtable.v2.CheckAndMutateRowReque" - + "st\032-.google.bigtable.v2.CheckAndMutateRo" - + "wResponse\"\352\003\332ABtable_name,row_key,predic" - + "ate_filter,true_mutations,false_mutations\332AQtable_name,row_key,predicate_filter," - + "true_mutations,false_mutations,app_profi" - + "le_id\202\323\344\223\002\254\001\"B/v2/{table_name=projects/*" - + "/instances/*/tables/*}:checkAndMutateRow:\001*Zc\"^/v2/{authorized_view_name=project" - + "s/*/instances/*/tables/*/authorizedViews/*}:checkAndMutateRow:\001*\212\323\344\223\002\227\001\022:\n\n" + + "\024authorized_view_name\022/{" + + "table_name=projects/*/instances/*/tables/*}/**0\001\022\335\004\n" + + "\021CheckAndMutateRow\022,.google.bigtable.v2.CheckAndMutateRowRequest\032-.g" + + "oogle.bigtable.v2.CheckAndMutateRowRespo" + + "nse\"\352\003\332ABtable_name,row_key,predicate_fi" + + "lter,true_mutations,false_mutations\332AQtable_name,row_key,predicate_filter,true_m" + + "utations,false_mutations,app_profile_id\202" + + "\323\344\223\002\254\001\"B/v2/{table_name=projects/*/insta" + + "nces/*/tables/*}:checkAndMutateRow:\001*Zc\"^/v2/{authorized_view_name=projects/*/in" + + "stances/*/tables/*/authorizedViews/*}:checkAndMutateRow:\001*\212\323\344\223\002\227\001\022:\n\n" + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + "\016app_profile_id\022G\n" - + "\024authori" - + "zed_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\356\001\n" - + "\013PingAndWarm\022&.google.bigtable.v2.PingAndWarmRequest\032\'" - + ".google.bigtable.v2.PingAndWarmResponse\"" - + "\215\001\332A\004name\332A\023name,app_profile_id\202\323\344\223\002+\"&/" - + "v2/{name=projects/*/instances/*}:ping:\001*\212\323\344\223\0029\022%\n" + + "\024authorized_vi" + + "ew_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\356\001\n" + + "\013PingAndWarm\022&.google.bigtable.v2.PingAndWarmRequest\032\'.googl" + + "e.bigtable.v2.PingAndWarmResponse\"\215\001\332A\004n" + + "ame\332A\023name,app_profile_id\202\323\344\223\002+\"&/v2/{na" + + "me=projects/*/instances/*}:ping:\001*\212\323\344\223\0029\022%\n" + "\004name\022\035{name=projects/*/instances/*}\022\020\n" + "\016app_profile_id\022\216\004\n" - + "\022ReadModifyWriteRow\022-.google.bigtable.v2.ReadModifyWr" - + "iteRowRequest\032..google.bigtable.v2.ReadM" - + "odifyWriteRowResponse\"\230\003\332A\030table_name,ro" - + "w_key,rules\332A\'table_name,row_key,rules,a" - + "pp_profile_id\202\323\344\223\002\256\001\"C/v2/{table_name=pr" - + "ojects/*/instances/*/tables/*}:readModifyWriteRow:\001*Zd\"_/v2/{authorized_view_nam" - + "e=projects/*/instances/*/tables/*/author" - + "izedViews/*}:readModifyWriteRow:\001*\212\323\344\223\002\227\001\022:\n\n" + + "\022ReadModifyWriteRow\022-.google.bigtable.v2.ReadModifyWriteRow" + + "Request\032..google.bigtable.v2.ReadModifyW" + + "riteRowResponse\"\230\003\332A\030table_name,row_key," + + "rules\332A\'table_name,row_key,rules,app_pro" + + "file_id\202\323\344\223\002\256\001\"C/v2/{table_name=projects" + + "/*/instances/*/tables/*}:readModifyWriteRow:\001*Zd\"_/v2/{authorized_view_name=proj" + + "ects/*/instances/*/tables/*/authorizedViews/*}:readModifyWriteRow:\001*\212\323\344\223\002\227\001\022:\n\n" + "table_name\022,{table_name=projects/*/instances/*/tables/*}\022\020\n" + "\016app_profile_id\022G\n" - + "\024authorized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\273\002\n" - + "%GenerateInitialChangeStreamPartitions\022@.goo" - + "gle.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest\032A.google.bigtable.v" - + "2.GenerateInitialChangeStreamPartitionsResponse\"\212\001\332A\n" - + "table_name\332A\031table_name,app" - + "_profile_id\202\323\344\223\002[\"V/v2/{table_name=proje" - + "cts/*/instances/*/tables/*}:generateInitialChangeStreamPartitions:\001*0\001\022\346\001\n" - + "\020ReadChangeStream\022+.google.bigtable.v2.ReadCha" - + "ngeStreamRequest\032,.google.bigtable.v2.ReadChangeStreamResponse\"u\332A\n" - + "table_name\332A\031table_name,app_profile_id\202\323\344\223\002F\"A/v2/{ta" - + "ble_name=projects/*/instances/*/tables/*}:readChangeStream:\001*0\001\022\251\002\n" - + "\014PrepareQuery\022\'.google.bigtable.v2.PrepareQueryReques" - + "t\032(.google.bigtable.v2.PrepareQueryRespo" - + "nse\"\305\001\332A\023instance_name,query\332A\"instance_" - + "name,query,app_profile_id\202\323\344\223\002<\"7/v2/{in" - + "stance_name=projects/*/instances/*}:prepareQuery:\001*\212\323\344\223\002B\022.\n\r" + + "\024aut" + + "horized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\273\002\n" + + "%GenerateInitialChangeStreamPartitions\022@.google.bi" + + "gtable.v2.GenerateInitialChangeStreamPartitionsRequest\032A.google.bigtable.v2.Gene" + + "rateInitialChangeStreamPartitionsResponse\"\212\001\332A\n" + + "table_name\332A\031table_name,app_profi" + + "le_id\202\323\344\223\002[\"V/v2/{table_name=projects/*/" + + "instances/*/tables/*}:generateInitialChangeStreamPartitions:\001*0\001\022\346\001\n" + + "\020ReadChangeStream\022+.google.bigtable.v2.ReadChangeStr" + + "eamRequest\032,.google.bigtable.v2.ReadChangeStreamResponse\"u\332A\n" + + "table_name\332A\031table_name,app_profile_id\202\323\344\223\002F\"A/v2/{table_na" + + "me=projects/*/instances/*/tables/*}:readChangeStream:\001*0\001\022\251\002\n" + + "\014PrepareQuery\022\'.google.bigtable.v2.PrepareQueryRequest\032(.go" + + "ogle.bigtable.v2.PrepareQueryResponse\"\305\001" + + "\332A\023instance_name,query\332A\"instance_name,q" + + "uery,app_profile_id\202\323\344\223\002<\"7/v2/{instance" + + "_name=projects/*/instances/*}:prepareQuery:\001*\212\323\344\223\002B\022.\n\r" + "instance_name\022\035{name=projects/*/instances/*}\022\020\n" + "\016app_profile_id\022\253\002\n" - + "\014ExecuteQuery\022\'.google.bigtable.v2.ExecuteQueryRequest\032(.google.bigtable." - + "v2.ExecuteQueryResponse\"\305\001\332A\023instance_na" - + "me,query\332A\"instance_name,query,app_profi" - + "le_id\202\323\344\223\002<\"7/v2/{instance_name=projects/*/instances/*}:executeQuery:\001*\212\323\344\223\002B\022.\n" - + "\r" + + "\014ExecuteQuery\022\'.google.bigtable.v2.Exec" + + "uteQueryRequest\032(.google.bigtable.v2.Exe" + + "cuteQueryResponse\"\305\001\332A\023instance_name,que" + + "ry\332A\"instance_name,query,app_profile_id\202" + + "\323\344\223\002<\"7/v2/{instance_name=projects/*/instances/*}:executeQuery:\001*\212\323\344\223\002B\022.\n\r" + "instance_name\022\035{name=projects/*/instances/*}\022\020\n" - + "\016app_profile_id0\001\032\333\002\312A\027bigtable." - + "googleapis.com\322A\275\002https://www.googleapis" - + ".com/auth/bigtable.data,https://www.googleapis.com/auth/bigtable.data.readonly,h" - + "ttps://www.googleapis.com/auth/cloud-bigtable.data,https://www.googleapis.com/au" - + "th/cloud-bigtable.data.readonly,https://www.googleapis.com/auth/cloud-platform,h" - + "ttps://www.googleapis.com/auth/cloud-platform.read-onlyB\365\004\n" + + "\016app_profile_id0\001\022v\n" + + "\026GetClientConfiguration\0221.google.bigtable.v2.GetClientConf" + + "igurationRequest\032\'.google.bigtable.v2.ClientConfiguration\"\000\022`\n" + + "\tOpenTable\022\".googl" + + "e.bigtable.v2.SessionRequest\032#.google.bigtable.v2.SessionResponse\"\006\240\320\245\216\004\001(\0010\001\022i\n" + + "\022OpenAuthorizedView\022\".google.bigtable.v2" + + ".SessionRequest\032#.google.bigtable.v2.SessionResponse\"\006\240\320\245\216\004\002(\0010\001\022k\n" + + "\024OpenMaterializedView\022\".google.bigtable.v2.SessionReq" + + "uest\032#.google.bigtable.v2.SessionRespons" + + "e\"\006\240\320\245\216\004\003(\0010\001\032\333\002\312A\027bigtable.googleapis.c" + + "om\322A\275\002https://www.googleapis.com/auth/bi" + + "gtable.data,https://www.googleapis.com/auth/bigtable.data.readonly,https://www.g" + + "oogleapis.com/auth/cloud-bigtable.data,https://www.googleapis.com/auth/cloud-big" + + "table.data.readonly,https://www.googleapis.com/auth/cloud-platform,https://www.g" + + "oogleapis.com/auth/cloud-platform.read-onlyB\365\004\n" + "\026com.google.bigtable.v2B\r" - + "BigtableProtoP\001Z8cloud.google.com/go" - + "/bigtable/apiv2/bigtablepb;bigtablepb\252\002\030" - + "Google.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\" - + "Bigtable\\V2\352\002\033Google::Cloud::Bigtable::V2\352AP\n" - + "%bigtableadmin.googleapis.com/Insta" - + "nce\022\'projects/{project}/instances/{instance}\352A\\\n" - + "\"bigtableadmin.googleapis.com/Ta" - + "ble\0226projects/{project}/instances/{instance}/tables/{table}\352A\207\001\n" - + "+bigtableadmin.googleapis.com/AuthorizedView\022Xprojects/{" - + "project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}\352A~\n" - + "-bigtableadmin.googleapis.com/MaterializedView\022Mprojects/{project}/instances/{" - + "instance}/materializedViews/{materialized_view}b\006proto3" + + "BigtableProtoP\001Z8cloud.google.com/go/bigtable/ap" + + "iv2/bigtablepb;bigtablepb\252\002\030Google.Cloud" + + ".Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033Google::Cloud::Bigtable::V2\352AP\n" + + "%bigtab" + + "leadmin.googleapis.com/Instance\022\'projects/{project}/instances/{instance}\352A\\\n" + + "\"bigtableadmin.googleapis.com/Table\0226project" + + "s/{project}/instances/{instance}/tables/{table}\352A\207\001\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022Xprojects/{project}/ins" + + "tances/{instance}/tables/{table}/authorizedViews/{authorized_view}\352A~\n" + + "-bigtableadmin.googleapis.com/MaterializedView\022Mpr" + + "ojects/{project}/instances/{instance}/materializedViews/{materialized_view}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -520,6 +527,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.RoutingProto.getDescriptor(), com.google.bigtable.v2.DataProto.getDescriptor(), com.google.bigtable.v2.RequestStatsProto.getDescriptor(), + com.google.bigtable.v2.SessionProto.getDescriptor(), com.google.bigtable.v2.TypesProto.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), @@ -844,6 +852,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.RoutingProto.getDescriptor(); com.google.bigtable.v2.DataProto.getDescriptor(); com.google.bigtable.v2.RequestStatsProto.getDescriptor(); + com.google.bigtable.v2.SessionProto.getDescriptor(); com.google.bigtable.v2.TypesProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); @@ -859,6 +868,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ResourceProto.resourceDefinition); registry.add(com.google.api.ResourceProto.resourceReference); registry.add(com.google.api.RoutingProto.routing); + registry.add(com.google.bigtable.v2.SessionProto.rpcSessionType); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfiguration.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfiguration.java new file mode 100644 index 000000000000..0e8c7601b313 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfiguration.java @@ -0,0 +1,3171 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Configuration for the Session API. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ClientConfiguration} + */ +@com.google.protobuf.Generated +public final class ClientConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ClientConfiguration) + ClientConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClientConfiguration"); + } + + // Use ClientConfiguration.newBuilder() to construct. + private ClientConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ClientConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.Builder.class); + } + + public interface PollingConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return Whether the pollingInterval field is set. + */ + boolean hasPollingInterval(); + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return The pollingInterval. + */ + com.google.protobuf.Duration getPollingInterval(); + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder(); + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return Whether the validityDuration field is set. + */ + boolean hasValidityDuration(); + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return The validityDuration. + */ + com.google.protobuf.Duration getValidityDuration(); + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + com.google.protobuf.DurationOrBuilder getValidityDurationOrBuilder(); + + /** + * + * + *
+     * Number of times the client should retry a failed
+     * GetClientConfiguration RPC per polling interval before giving up.
+     * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return The maxRpcRetryCount. + */ + int getMaxRpcRetryCount(); + } + + /** Protobuf type {@code google.bigtable.v2.ClientConfiguration.PollingConfiguration} */ + public static final class PollingConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + PollingConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PollingConfiguration"); + } + + // Use PollingConfiguration.newBuilder() to construct. + private PollingConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PollingConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder.class); + } + + private int bitField0_; + public static final int POLLING_INTERVAL_FIELD_NUMBER = 1; + private com.google.protobuf.Duration pollingInterval_; + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return Whether the pollingInterval field is set. + */ + @java.lang.Override + public boolean hasPollingInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return The pollingInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getPollingInterval() { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } + + /** + * + * + *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } + + public static final int VALIDITY_DURATION_FIELD_NUMBER = 2; + private com.google.protobuf.Duration validityDuration_; + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return Whether the validityDuration field is set. + */ + @java.lang.Override + public boolean hasValidityDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return The validityDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getValidityDuration() { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } + + /** + * + * + *
+     * How long the client should consider the configuration it receives from
+     * GetClientConfiguration valid for. Once this duration has passed, the
+     * client should consider the configuration invalid and must either:
+     * - Get a new configuration from GetClientConfiguration
+     * - Or if it cannot, use a sane default configuration
+     *
+     * This duration will be at least as long as the polling interval.
+     * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getValidityDurationOrBuilder() { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } + + public static final int MAX_RPC_RETRY_COUNT_FIELD_NUMBER = 6; + private int maxRpcRetryCount_ = 0; + + /** + * + * + *
+     * Number of times the client should retry a failed
+     * GetClientConfiguration RPC per polling interval before giving up.
+     * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return The maxRpcRetryCount. + */ + @java.lang.Override + public int getMaxRpcRetryCount() { + return maxRpcRetryCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPollingInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getValidityDuration()); + } + if (maxRpcRetryCount_ != 0) { + output.writeInt32(6, maxRpcRetryCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPollingInterval()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValidityDuration()); + } + if (maxRpcRetryCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, maxRpcRetryCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.ClientConfiguration.PollingConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration other = + (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) obj; + + if (hasPollingInterval() != other.hasPollingInterval()) return false; + if (hasPollingInterval()) { + if (!getPollingInterval().equals(other.getPollingInterval())) return false; + } + if (hasValidityDuration() != other.hasValidityDuration()) return false; + if (hasValidityDuration()) { + if (!getValidityDuration().equals(other.getValidityDuration())) return false; + } + if (getMaxRpcRetryCount() != other.getMaxRpcRetryCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPollingInterval()) { + hash = (37 * hash) + POLLING_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getPollingInterval().hashCode(); + } + if (hasValidityDuration()) { + hash = (37 * hash) + VALIDITY_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getValidityDuration().hashCode(); + } + hash = (37 * hash) + MAX_RPC_RETRY_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxRpcRetryCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration 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.v2.ClientConfiguration.PollingConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration 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.v2.ClientConfiguration.PollingConfiguration parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.bigtable.v2.ClientConfiguration.PollingConfiguration} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPollingIntervalFieldBuilder(); + internalGetValidityDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pollingInterval_ = null; + if (pollingIntervalBuilder_ != null) { + pollingIntervalBuilder_.dispose(); + pollingIntervalBuilder_ = null; + } + validityDuration_ = null; + if (validityDurationBuilder_ != null) { + validityDurationBuilder_.dispose(); + validityDurationBuilder_ = null; + } + maxRpcRetryCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + getDefaultInstanceForType() { + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration build() { + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration buildPartial() { + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration result = + new com.google.bigtable.v2.ClientConfiguration.PollingConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pollingInterval_ = + pollingIntervalBuilder_ == null ? pollingInterval_ : pollingIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validityDuration_ = + validityDurationBuilder_ == null + ? validityDuration_ + : validityDurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxRpcRetryCount_ = maxRpcRetryCount_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) { + return mergeFrom((com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration other) { + if (other + == com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance()) + return this; + if (other.hasPollingInterval()) { + mergePollingInterval(other.getPollingInterval()); + } + if (other.hasValidityDuration()) { + mergeValidityDuration(other.getValidityDuration()); + } + if (other.getMaxRpcRetryCount() != 0) { + setMaxRpcRetryCount(other.getMaxRpcRetryCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetPollingIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetValidityDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 48: + { + maxRpcRetryCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration pollingInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + pollingIntervalBuilder_; + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return Whether the pollingInterval field is set. + */ + public boolean hasPollingInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + * + * @return The pollingInterval. + */ + public com.google.protobuf.Duration getPollingInterval() { + if (pollingIntervalBuilder_ == null) { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } else { + return pollingIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder setPollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pollingInterval_ = value; + } else { + pollingIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder setPollingInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (pollingIntervalBuilder_ == null) { + pollingInterval_ = builderForValue.build(); + } else { + pollingIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder mergePollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && pollingInterval_ != null + && pollingInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getPollingIntervalBuilder().mergeFrom(value); + } else { + pollingInterval_ = value; + } + } else { + pollingIntervalBuilder_.mergeFrom(value); + } + if (pollingInterval_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public Builder clearPollingInterval() { + bitField0_ = (bitField0_ & ~0x00000001); + pollingInterval_ = null; + if (pollingIntervalBuilder_ != null) { + pollingIntervalBuilder_.dispose(); + pollingIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public com.google.protobuf.Duration.Builder getPollingIntervalBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPollingIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + if (pollingIntervalBuilder_ != null) { + return pollingIntervalBuilder_.getMessageOrBuilder(); + } else { + return pollingInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : pollingInterval_; + } + } + + /** + * + * + *
+       * A duration describing the time between GetClientConfiguration RPCs.
+       * Only strictly positive values are permissible.
+       * 
+ * + * .google.protobuf.Duration polling_interval = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPollingIntervalFieldBuilder() { + if (pollingIntervalBuilder_ == null) { + pollingIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getPollingInterval(), getParentForChildren(), isClean()); + pollingInterval_ = null; + } + return pollingIntervalBuilder_; + } + + private com.google.protobuf.Duration validityDuration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + validityDurationBuilder_; + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return Whether the validityDuration field is set. + */ + public boolean hasValidityDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + * + * @return The validityDuration. + */ + public com.google.protobuf.Duration getValidityDuration() { + if (validityDurationBuilder_ == null) { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } else { + return validityDurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder setValidityDuration(com.google.protobuf.Duration value) { + if (validityDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + validityDuration_ = value; + } else { + validityDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder setValidityDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (validityDurationBuilder_ == null) { + validityDuration_ = builderForValue.build(); + } else { + validityDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder mergeValidityDuration(com.google.protobuf.Duration value) { + if (validityDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && validityDuration_ != null + && validityDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getValidityDurationBuilder().mergeFrom(value); + } else { + validityDuration_ = value; + } + } else { + validityDurationBuilder_.mergeFrom(value); + } + if (validityDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public Builder clearValidityDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + validityDuration_ = null; + if (validityDurationBuilder_ != null) { + validityDurationBuilder_.dispose(); + validityDurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public com.google.protobuf.Duration.Builder getValidityDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetValidityDurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + public com.google.protobuf.DurationOrBuilder getValidityDurationOrBuilder() { + if (validityDurationBuilder_ != null) { + return validityDurationBuilder_.getMessageOrBuilder(); + } else { + return validityDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : validityDuration_; + } + } + + /** + * + * + *
+       * How long the client should consider the configuration it receives from
+       * GetClientConfiguration valid for. Once this duration has passed, the
+       * client should consider the configuration invalid and must either:
+       * - Get a new configuration from GetClientConfiguration
+       * - Or if it cannot, use a sane default configuration
+       *
+       * This duration will be at least as long as the polling interval.
+       * 
+ * + * .google.protobuf.Duration validity_duration = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetValidityDurationFieldBuilder() { + if (validityDurationBuilder_ == null) { + validityDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getValidityDuration(), getParentForChildren(), isClean()); + validityDuration_ = null; + } + return validityDurationBuilder_; + } + + private int maxRpcRetryCount_; + + /** + * + * + *
+       * Number of times the client should retry a failed
+       * GetClientConfiguration RPC per polling interval before giving up.
+       * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return The maxRpcRetryCount. + */ + @java.lang.Override + public int getMaxRpcRetryCount() { + return maxRpcRetryCount_; + } + + /** + * + * + *
+       * Number of times the client should retry a failed
+       * GetClientConfiguration RPC per polling interval before giving up.
+       * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @param value The maxRpcRetryCount to set. + * @return This builder for chaining. + */ + public Builder setMaxRpcRetryCount(int value) { + + maxRpcRetryCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Number of times the client should retry a failed
+       * GetClientConfiguration RPC per polling interval before giving up.
+       * 
+ * + * int32 max_rpc_retry_count = 6; + * + * @return This builder for chaining. + */ + public Builder clearMaxRpcRetryCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxRpcRetryCount_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ClientConfiguration.PollingConfiguration) + private static final com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ClientConfiguration.PollingConfiguration(); + } + + public static com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PollingConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int pollingCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object polling_; + + public enum PollingCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STOP_POLLING(3), + @java.lang.Deprecated + POLLING_INTERVAL(4), + POLLING_CONFIGURATION(5), + POLLING_NOT_SET(0); + private final int value; + + private PollingCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PollingCase valueOf(int value) { + return forNumber(value); + } + + public static PollingCase forNumber(int value) { + switch (value) { + case 3: + return STOP_POLLING; + case 4: + return POLLING_INTERVAL; + case 5: + return POLLING_CONFIGURATION; + case 0: + return POLLING_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PollingCase getPollingCase() { + return PollingCase.forNumber(pollingCase_); + } + + public static final int SESSION_CONFIGURATION_FIELD_NUMBER = 2; + private com.google.bigtable.v2.SessionClientConfiguration sessionConfiguration_; + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return Whether the sessionConfiguration field is set. + */ + @java.lang.Override + public boolean hasSessionConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return The sessionConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration getSessionConfiguration() { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfigurationOrBuilder + getSessionConfigurationOrBuilder() { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } + + public static final int STOP_POLLING_FIELD_NUMBER = 3; + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return Whether the stopPolling field is set. + */ + @java.lang.Override + public boolean hasStopPolling() { + return pollingCase_ == 3; + } + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return The stopPolling. + */ + @java.lang.Override + public boolean getStopPolling() { + if (pollingCase_ == 3) { + return (java.lang.Boolean) polling_; + } + return false; + } + + public static final int POLLING_INTERVAL_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return Whether the pollingInterval field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasPollingInterval() { + return pollingCase_ == 4; + } + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return The pollingInterval. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Duration getPollingInterval() { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int POLLING_CONFIGURATION_FIELD_NUMBER = 5; + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return Whether the pollingConfiguration field is set. + */ + @java.lang.Override + public boolean hasPollingConfiguration() { + return pollingCase_ == 5; + } + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return The pollingConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration getPollingConfiguration() { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder + getPollingConfigurationOrBuilder() { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + + public static final int TELEMETRY_CONFIGURATION_FIELD_NUMBER = 6; + private com.google.bigtable.v2.TelemetryConfiguration telemetryConfiguration_; + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return Whether the telemetryConfiguration field is set. + */ + @java.lang.Override + public boolean hasTelemetryConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return The telemetryConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration getTelemetryConfiguration() { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfigurationOrBuilder + getTelemetryConfigurationOrBuilder() { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSessionConfiguration()); + } + if (pollingCase_ == 3) { + output.writeBool(3, (boolean) ((java.lang.Boolean) polling_)); + } + if (pollingCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Duration) polling_); + } + if (pollingCase_ == 5) { + output.writeMessage( + 5, (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getTelemetryConfiguration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSessionConfiguration()); + } + if (pollingCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, (boolean) ((java.lang.Boolean) polling_)); + } + if (pollingCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Duration) polling_); + } + if (pollingCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTelemetryConfiguration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.ClientConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.ClientConfiguration other = + (com.google.bigtable.v2.ClientConfiguration) obj; + + if (hasSessionConfiguration() != other.hasSessionConfiguration()) return false; + if (hasSessionConfiguration()) { + if (!getSessionConfiguration().equals(other.getSessionConfiguration())) return false; + } + if (hasTelemetryConfiguration() != other.hasTelemetryConfiguration()) return false; + if (hasTelemetryConfiguration()) { + if (!getTelemetryConfiguration().equals(other.getTelemetryConfiguration())) return false; + } + if (!getPollingCase().equals(other.getPollingCase())) return false; + switch (pollingCase_) { + case 3: + if (getStopPolling() != other.getStopPolling()) return false; + break; + case 4: + if (!getPollingInterval().equals(other.getPollingInterval())) return false; + break; + case 5: + if (!getPollingConfiguration().equals(other.getPollingConfiguration())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSessionConfiguration()) { + hash = (37 * hash) + SESSION_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getSessionConfiguration().hashCode(); + } + if (hasTelemetryConfiguration()) { + hash = (37 * hash) + TELEMETRY_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getTelemetryConfiguration().hashCode(); + } + switch (pollingCase_) { + case 3: + hash = (37 * hash) + STOP_POLLING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getStopPolling()); + break; + case 4: + hash = (37 * hash) + POLLING_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getPollingInterval().hashCode(); + break; + case 5: + hash = (37 * hash) + POLLING_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getPollingConfiguration().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration 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.v2.ClientConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration 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.v2.ClientConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.ClientConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Configuration for the Session API. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ClientConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ClientConfiguration) + com.google.bigtable.v2.ClientConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClientConfiguration.class, + com.google.bigtable.v2.ClientConfiguration.Builder.class); + } + + // Construct using com.google.bigtable.v2.ClientConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSessionConfigurationFieldBuilder(); + internalGetTelemetryConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sessionConfiguration_ = null; + if (sessionConfigurationBuilder_ != null) { + sessionConfigurationBuilder_.dispose(); + sessionConfigurationBuilder_ = null; + } + if (pollingIntervalBuilder_ != null) { + pollingIntervalBuilder_.clear(); + } + if (pollingConfigurationBuilder_ != null) { + pollingConfigurationBuilder_.clear(); + } + telemetryConfiguration_ = null; + if (telemetryConfigurationBuilder_ != null) { + telemetryConfigurationBuilder_.dispose(); + telemetryConfigurationBuilder_ = null; + } + pollingCase_ = 0; + polling_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration getDefaultInstanceForType() { + return com.google.bigtable.v2.ClientConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration build() { + com.google.bigtable.v2.ClientConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration buildPartial() { + com.google.bigtable.v2.ClientConfiguration result = + new com.google.bigtable.v2.ClientConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ClientConfiguration result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sessionConfiguration_ = + sessionConfigurationBuilder_ == null + ? sessionConfiguration_ + : sessionConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.telemetryConfiguration_ = + telemetryConfigurationBuilder_ == null + ? telemetryConfiguration_ + : telemetryConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ClientConfiguration result) { + result.pollingCase_ = pollingCase_; + result.polling_ = this.polling_; + if (pollingCase_ == 4 && pollingIntervalBuilder_ != null) { + result.polling_ = pollingIntervalBuilder_.build(); + } + if (pollingCase_ == 5 && pollingConfigurationBuilder_ != null) { + result.polling_ = pollingConfigurationBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ClientConfiguration) { + return mergeFrom((com.google.bigtable.v2.ClientConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ClientConfiguration other) { + if (other == com.google.bigtable.v2.ClientConfiguration.getDefaultInstance()) return this; + if (other.hasSessionConfiguration()) { + mergeSessionConfiguration(other.getSessionConfiguration()); + } + if (other.hasTelemetryConfiguration()) { + mergeTelemetryConfiguration(other.getTelemetryConfiguration()); + } + switch (other.getPollingCase()) { + case STOP_POLLING: + { + setStopPolling(other.getStopPolling()); + break; + } + case POLLING_INTERVAL: + { + mergePollingInterval(other.getPollingInterval()); + break; + } + case POLLING_CONFIGURATION: + { + mergePollingConfiguration(other.getPollingConfiguration()); + break; + } + case POLLING_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + input.readMessage( + internalGetSessionConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 24: + { + polling_ = input.readBool(); + pollingCase_ = 3; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetPollingIntervalFieldBuilder().getBuilder(), extensionRegistry); + pollingCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetPollingConfigurationFieldBuilder().getBuilder(), extensionRegistry); + pollingCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetTelemetryConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int pollingCase_ = 0; + private java.lang.Object polling_; + + public PollingCase getPollingCase() { + return PollingCase.forNumber(pollingCase_); + } + + public Builder clearPolling() { + pollingCase_ = 0; + polling_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.SessionClientConfiguration sessionConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfigurationOrBuilder> + sessionConfigurationBuilder_; + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return Whether the sessionConfiguration field is set. + */ + public boolean hasSessionConfiguration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return The sessionConfiguration. + */ + public com.google.bigtable.v2.SessionClientConfiguration getSessionConfiguration() { + if (sessionConfigurationBuilder_ == null) { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } else { + return sessionConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder setSessionConfiguration( + com.google.bigtable.v2.SessionClientConfiguration value) { + if (sessionConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionConfiguration_ = value; + } else { + sessionConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder setSessionConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.Builder builderForValue) { + if (sessionConfigurationBuilder_ == null) { + sessionConfiguration_ = builderForValue.build(); + } else { + sessionConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder mergeSessionConfiguration( + com.google.bigtable.v2.SessionClientConfiguration value) { + if (sessionConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && sessionConfiguration_ != null + && sessionConfiguration_ + != com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance()) { + getSessionConfigurationBuilder().mergeFrom(value); + } else { + sessionConfiguration_ = value; + } + } else { + sessionConfigurationBuilder_.mergeFrom(value); + } + if (sessionConfiguration_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public Builder clearSessionConfiguration() { + bitField0_ = (bitField0_ & ~0x00000001); + sessionConfiguration_ = null; + if (sessionConfigurationBuilder_ != null) { + sessionConfigurationBuilder_.dispose(); + sessionConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public com.google.bigtable.v2.SessionClientConfiguration.Builder + getSessionConfigurationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSessionConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + public com.google.bigtable.v2.SessionClientConfigurationOrBuilder + getSessionConfigurationOrBuilder() { + if (sessionConfigurationBuilder_ != null) { + return sessionConfigurationBuilder_.getMessageOrBuilder(); + } else { + return sessionConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance() + : sessionConfiguration_; + } + } + + /** + * + * + *
+     * The configuration for Bigtable Sessions.
+     * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfigurationOrBuilder> + internalGetSessionConfigurationFieldBuilder() { + if (sessionConfigurationBuilder_ == null) { + sessionConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfigurationOrBuilder>( + getSessionConfiguration(), getParentForChildren(), isClean()); + sessionConfiguration_ = null; + } + return sessionConfigurationBuilder_; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @return Whether the stopPolling field is set. + */ + public boolean hasStopPolling() { + return pollingCase_ == 3; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @return The stopPolling. + */ + public boolean getStopPolling() { + if (pollingCase_ == 3) { + return (java.lang.Boolean) polling_; + } + return false; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @param value The stopPolling to set. + * @return This builder for chaining. + */ + public Builder setStopPolling(boolean value) { + + pollingCase_ = 3; + polling_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * If the client should cease to check for new configurations, e.g. a
+     * backstop to prevent excessive GetClientConfiguration RPCs.
+     * 
+ * + * bool stop_polling = 3; + * + * @return This builder for chaining. + */ + public Builder clearStopPolling() { + if (pollingCase_ == 3) { + pollingCase_ = 0; + polling_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + pollingIntervalBuilder_; + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return Whether the pollingInterval field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasPollingInterval() { + return pollingCase_ == 4; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return The pollingInterval. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.Duration getPollingInterval() { + if (pollingIntervalBuilder_ == null) { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (pollingCase_ == 4) { + return pollingIntervalBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setPollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polling_ = value; + onChanged(); + } else { + pollingIntervalBuilder_.setMessage(value); + } + pollingCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder setPollingInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (pollingIntervalBuilder_ == null) { + polling_ = builderForValue.build(); + onChanged(); + } else { + pollingIntervalBuilder_.setMessage(builderForValue.build()); + } + pollingCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder mergePollingInterval(com.google.protobuf.Duration value) { + if (pollingIntervalBuilder_ == null) { + if (pollingCase_ == 4 && polling_ != com.google.protobuf.Duration.getDefaultInstance()) { + polling_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) polling_) + .mergeFrom(value) + .buildPartial(); + } else { + polling_ = value; + } + onChanged(); + } else { + if (pollingCase_ == 4) { + pollingIntervalBuilder_.mergeFrom(value); + } else { + pollingIntervalBuilder_.setMessage(value); + } + } + pollingCase_ = 4; + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public Builder clearPollingInterval() { + if (pollingIntervalBuilder_ == null) { + if (pollingCase_ == 4) { + pollingCase_ = 0; + polling_ = null; + onChanged(); + } + } else { + if (pollingCase_ == 4) { + pollingCase_ = 0; + polling_ = null; + } + pollingIntervalBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + public com.google.protobuf.Duration.Builder getPollingIntervalBuilder() { + return internalGetPollingIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder() { + if ((pollingCase_ == 4) && (pollingIntervalBuilder_ != null)) { + return pollingIntervalBuilder_.getMessageOrBuilder(); + } else { + if (pollingCase_ == 4) { + return (com.google.protobuf.Duration) polling_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Deprecated, prerfer polling_configuration.
+     *
+     * A duration describing the time between GetClientConfiguration RPCs.
+     * Only strictly positive values are permissible.
+     * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetPollingIntervalFieldBuilder() { + if (pollingIntervalBuilder_ == null) { + if (!(pollingCase_ == 4)) { + polling_ = com.google.protobuf.Duration.getDefaultInstance(); + } + pollingIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) polling_, getParentForChildren(), isClean()); + polling_ = null; + } + pollingCase_ = 4; + onChanged(); + return pollingIntervalBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder, + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder> + pollingConfigurationBuilder_; + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return Whether the pollingConfiguration field is set. + */ + @java.lang.Override + public boolean hasPollingConfiguration() { + return pollingCase_ == 5; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return The pollingConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + getPollingConfiguration() { + if (pollingConfigurationBuilder_ == null) { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } else { + if (pollingCase_ == 5) { + return pollingConfigurationBuilder_.getMessage(); + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder setPollingConfiguration( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration value) { + if (pollingConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + polling_ = value; + onChanged(); + } else { + pollingConfigurationBuilder_.setMessage(value); + } + pollingCase_ = 5; + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder setPollingConfiguration( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder builderForValue) { + if (pollingConfigurationBuilder_ == null) { + polling_ = builderForValue.build(); + onChanged(); + } else { + pollingConfigurationBuilder_.setMessage(builderForValue.build()); + } + pollingCase_ = 5; + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder mergePollingConfiguration( + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration value) { + if (pollingConfigurationBuilder_ == null) { + if (pollingCase_ == 5 + && polling_ + != com.google.bigtable.v2.ClientConfiguration.PollingConfiguration + .getDefaultInstance()) { + polling_ = + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.newBuilder( + (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_) + .mergeFrom(value) + .buildPartial(); + } else { + polling_ = value; + } + onChanged(); + } else { + if (pollingCase_ == 5) { + pollingConfigurationBuilder_.mergeFrom(value); + } else { + pollingConfigurationBuilder_.setMessage(value); + } + } + pollingCase_ = 5; + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public Builder clearPollingConfiguration() { + if (pollingConfigurationBuilder_ == null) { + if (pollingCase_ == 5) { + pollingCase_ = 0; + polling_ = null; + onChanged(); + } + } else { + if (pollingCase_ == 5) { + pollingCase_ = 0; + polling_ = null; + } + pollingConfigurationBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + public com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder + getPollingConfigurationBuilder() { + return internalGetPollingConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder + getPollingConfigurationOrBuilder() { + if ((pollingCase_ == 5) && (pollingConfigurationBuilder_ != null)) { + return pollingConfigurationBuilder_.getMessageOrBuilder(); + } else { + if (pollingCase_ == 5) { + return (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_; + } + return com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * If the client should continue to check for new configurations.
+     * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder, + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder> + internalGetPollingConfigurationFieldBuilder() { + if (pollingConfigurationBuilder_ == null) { + if (!(pollingCase_ == 5)) { + polling_ = + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.getDefaultInstance(); + } + pollingConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration, + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration.Builder, + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder>( + (com.google.bigtable.v2.ClientConfiguration.PollingConfiguration) polling_, + getParentForChildren(), + isClean()); + polling_ = null; + } + pollingCase_ = 5; + onChanged(); + return pollingConfigurationBuilder_; + } + + private com.google.bigtable.v2.TelemetryConfiguration telemetryConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TelemetryConfiguration, + com.google.bigtable.v2.TelemetryConfiguration.Builder, + com.google.bigtable.v2.TelemetryConfigurationOrBuilder> + telemetryConfigurationBuilder_; + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return Whether the telemetryConfiguration field is set. + */ + public boolean hasTelemetryConfiguration() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return The telemetryConfiguration. + */ + public com.google.bigtable.v2.TelemetryConfiguration getTelemetryConfiguration() { + if (telemetryConfigurationBuilder_ == null) { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } else { + return telemetryConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder setTelemetryConfiguration(com.google.bigtable.v2.TelemetryConfiguration value) { + if (telemetryConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + telemetryConfiguration_ = value; + } else { + telemetryConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder setTelemetryConfiguration( + com.google.bigtable.v2.TelemetryConfiguration.Builder builderForValue) { + if (telemetryConfigurationBuilder_ == null) { + telemetryConfiguration_ = builderForValue.build(); + } else { + telemetryConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder mergeTelemetryConfiguration( + com.google.bigtable.v2.TelemetryConfiguration value) { + if (telemetryConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && telemetryConfiguration_ != null + && telemetryConfiguration_ + != com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance()) { + getTelemetryConfigurationBuilder().mergeFrom(value); + } else { + telemetryConfiguration_ = value; + } + } else { + telemetryConfigurationBuilder_.mergeFrom(value); + } + if (telemetryConfiguration_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public Builder clearTelemetryConfiguration() { + bitField0_ = (bitField0_ & ~0x00000010); + telemetryConfiguration_ = null; + if (telemetryConfigurationBuilder_ != null) { + telemetryConfigurationBuilder_.dispose(); + telemetryConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public com.google.bigtable.v2.TelemetryConfiguration.Builder + getTelemetryConfigurationBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetTelemetryConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + public com.google.bigtable.v2.TelemetryConfigurationOrBuilder + getTelemetryConfigurationOrBuilder() { + if (telemetryConfigurationBuilder_ != null) { + return telemetryConfigurationBuilder_.getMessageOrBuilder(); + } else { + return telemetryConfiguration_ == null + ? com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance() + : telemetryConfiguration_; + } + } + + /** + * + * + *
+     * Configuration for telemetry.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TelemetryConfiguration, + com.google.bigtable.v2.TelemetryConfiguration.Builder, + com.google.bigtable.v2.TelemetryConfigurationOrBuilder> + internalGetTelemetryConfigurationFieldBuilder() { + if (telemetryConfigurationBuilder_ == null) { + telemetryConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.TelemetryConfiguration, + com.google.bigtable.v2.TelemetryConfiguration.Builder, + com.google.bigtable.v2.TelemetryConfigurationOrBuilder>( + getTelemetryConfiguration(), getParentForChildren(), isClean()); + telemetryConfiguration_ = null; + } + return telemetryConfigurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ClientConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ClientConfiguration) + private static final com.google.bigtable.v2.ClientConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ClientConfiguration(); + } + + public static com.google.bigtable.v2.ClientConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.ClientConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfigurationOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfigurationOrBuilder.java new file mode 100644 index 000000000000..c0e671a1f549 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClientConfigurationOrBuilder.java @@ -0,0 +1,226 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ClientConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ClientConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return Whether the sessionConfiguration field is set. + */ + boolean hasSessionConfiguration(); + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + * + * @return The sessionConfiguration. + */ + com.google.bigtable.v2.SessionClientConfiguration getSessionConfiguration(); + + /** + * + * + *
+   * The configuration for Bigtable Sessions.
+   * 
+ * + * .google.bigtable.v2.SessionClientConfiguration session_configuration = 2; + */ + com.google.bigtable.v2.SessionClientConfigurationOrBuilder getSessionConfigurationOrBuilder(); + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return Whether the stopPolling field is set. + */ + boolean hasStopPolling(); + + /** + * + * + *
+   * If the client should cease to check for new configurations, e.g. a
+   * backstop to prevent excessive GetClientConfiguration RPCs.
+   * 
+ * + * bool stop_polling = 3; + * + * @return The stopPolling. + */ + boolean getStopPolling(); + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return Whether the pollingInterval field is set. + */ + @java.lang.Deprecated + boolean hasPollingInterval(); + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + * + * @deprecated google.bigtable.v2.ClientConfiguration.polling_interval is deprecated. See + * google/bigtable/v2/session.proto;l=288 + * @return The pollingInterval. + */ + @java.lang.Deprecated + com.google.protobuf.Duration getPollingInterval(); + + /** + * + * + *
+   * Deprecated, prerfer polling_configuration.
+   *
+   * A duration describing the time between GetClientConfiguration RPCs.
+   * Only strictly positive values are permissible.
+   * 
+ * + * .google.protobuf.Duration polling_interval = 4 [deprecated = true]; + */ + @java.lang.Deprecated + com.google.protobuf.DurationOrBuilder getPollingIntervalOrBuilder(); + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return Whether the pollingConfiguration field is set. + */ + boolean hasPollingConfiguration(); + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + * + * @return The pollingConfiguration. + */ + com.google.bigtable.v2.ClientConfiguration.PollingConfiguration getPollingConfiguration(); + + /** + * + * + *
+   * If the client should continue to check for new configurations.
+   * 
+ * + * .google.bigtable.v2.ClientConfiguration.PollingConfiguration polling_configuration = 5; + * + */ + com.google.bigtable.v2.ClientConfiguration.PollingConfigurationOrBuilder + getPollingConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return Whether the telemetryConfiguration field is set. + */ + boolean hasTelemetryConfiguration(); + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + * + * @return The telemetryConfiguration. + */ + com.google.bigtable.v2.TelemetryConfiguration getTelemetryConfiguration(); + + /** + * + * + *
+   * Configuration for telemetry.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration telemetry_configuration = 6; + */ + com.google.bigtable.v2.TelemetryConfigurationOrBuilder getTelemetryConfigurationOrBuilder(); + + com.google.bigtable.v2.ClientConfiguration.PollingCase getPollingCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequest.java new file mode 100644 index 000000000000..9cb65a2fd5dd --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequest.java @@ -0,0 +1,821 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.CloseSessionRequest} + */ +@com.google.protobuf.Generated +public final class CloseSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.CloseSessionRequest) + CloseSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloseSessionRequest"); + } + + // Use CloseSessionRequest.newBuilder() to construct. + private CloseSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CloseSessionRequest() { + reason_ = 0; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CloseSessionRequest.class, + com.google.bigtable.v2.CloseSessionRequest.Builder.class); + } + + /** + * + * + *
+   * Client-generated reason for terminating the session, including a
+   * plain-text description of why.
+   * 'reason' may be used for metrics, while both may be logged (server-side).
+   * 
+ * + * Protobuf enum {@code google.bigtable.v2.CloseSessionRequest.CloseSessionReason} + */ + public enum CloseSessionReason implements com.google.protobuf.ProtocolMessageEnum { + /** CLOSE_SESSION_REASON_UNSET = 0; */ + CLOSE_SESSION_REASON_UNSET(0), + /** CLOSE_SESSION_REASON_GOAWAY = 1; */ + CLOSE_SESSION_REASON_GOAWAY(1), + /** CLOSE_SESSION_REASON_ERROR = 2; */ + CLOSE_SESSION_REASON_ERROR(2), + /** CLOSE_SESSION_REASON_USER = 3; */ + CLOSE_SESSION_REASON_USER(3), + /** CLOSE_SESSION_REASON_DOWNSIZE = 4; */ + CLOSE_SESSION_REASON_DOWNSIZE(4), + /** CLOSE_SESSION_REASON_MISSED_HEARTBEAT = 5; */ + CLOSE_SESSION_REASON_MISSED_HEARTBEAT(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloseSessionReason"); + } + + /** CLOSE_SESSION_REASON_UNSET = 0; */ + public static final int CLOSE_SESSION_REASON_UNSET_VALUE = 0; + + /** CLOSE_SESSION_REASON_GOAWAY = 1; */ + public static final int CLOSE_SESSION_REASON_GOAWAY_VALUE = 1; + + /** CLOSE_SESSION_REASON_ERROR = 2; */ + public static final int CLOSE_SESSION_REASON_ERROR_VALUE = 2; + + /** CLOSE_SESSION_REASON_USER = 3; */ + public static final int CLOSE_SESSION_REASON_USER_VALUE = 3; + + /** CLOSE_SESSION_REASON_DOWNSIZE = 4; */ + public static final int CLOSE_SESSION_REASON_DOWNSIZE_VALUE = 4; + + /** CLOSE_SESSION_REASON_MISSED_HEARTBEAT = 5; */ + public static final int CLOSE_SESSION_REASON_MISSED_HEARTBEAT_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CloseSessionReason valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static CloseSessionReason forNumber(int value) { + switch (value) { + case 0: + return CLOSE_SESSION_REASON_UNSET; + case 1: + return CLOSE_SESSION_REASON_GOAWAY; + case 2: + return CLOSE_SESSION_REASON_ERROR; + case 3: + return CLOSE_SESSION_REASON_USER; + case 4: + return CLOSE_SESSION_REASON_DOWNSIZE; + case 5: + return CLOSE_SESSION_REASON_MISSED_HEARTBEAT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CloseSessionReason findValueByNumber(int number) { + return CloseSessionReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.CloseSessionRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final CloseSessionReason[] VALUES = values(); + + public static CloseSessionReason valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CloseSessionReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.CloseSessionRequest.CloseSessionReason) + } + + public static final int REASON_FIELD_NUMBER = 1; + private int reason_ = 0; + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason getReason() { + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason result = + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.forNumber(reason_); + return result == null + ? com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.UNRECOGNIZED + : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (reason_ + != com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_UNSET + .getNumber()) { + output.writeEnum(1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reason_ + != com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.CLOSE_SESSION_REASON_UNSET + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.CloseSessionRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.CloseSessionRequest other = + (com.google.bigtable.v2.CloseSessionRequest) obj; + + if (reason_ != other.reason_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REASON_FIELD_NUMBER; + hash = (53 * hash) + reason_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CloseSessionRequest 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.v2.CloseSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CloseSessionRequest 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.v2.CloseSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.CloseSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.CloseSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.CloseSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.CloseSessionRequest) + com.google.bigtable.v2.CloseSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.CloseSessionRequest.class, + com.google.bigtable.v2.CloseSessionRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.CloseSessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reason_ = 0; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest build() { + com.google.bigtable.v2.CloseSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest buildPartial() { + com.google.bigtable.v2.CloseSessionRequest result = + new com.google.bigtable.v2.CloseSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.CloseSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reason_ = reason_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.CloseSessionRequest) { + return mergeFrom((com.google.bigtable.v2.CloseSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.CloseSessionRequest other) { + if (other == com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance()) return this; + if (other.reason_ != 0) { + setReasonValue(other.getReasonValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + reason_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int reason_ = 0; + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @param value The enum numeric value on the wire for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonValue(int value) { + reason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason getReason() { + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason result = + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.forNumber(reason_); + return result == null + ? com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason.UNRECOGNIZED + : result; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason(com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + reason_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + bitField0_ = (bitField0_ & ~0x00000001); + reason_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.CloseSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.CloseSessionRequest) + private static final com.google.bigtable.v2.CloseSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.CloseSessionRequest(); + } + + public static com.google.bigtable.v2.CloseSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloseSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequestOrBuilder.java new file mode 100644 index 000000000000..e7f1fd2994e1 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CloseSessionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface CloseSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.CloseSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + int getReasonValue(); + + /** + * .google.bigtable.v2.CloseSessionRequest.CloseSessionReason reason = 1; + * + * @return The reason. + */ + com.google.bigtable.v2.CloseSessionRequest.CloseSessionReason getReason(); + + /** + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformation.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformation.java new file mode 100644 index 000000000000..9e7d108425e2 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformation.java @@ -0,0 +1,702 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Information on which Cluster served a vRPC, e.g. for Client-Side metrics.
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ClusterInformation} + */ +@com.google.protobuf.Generated +public final class ClusterInformation extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ClusterInformation) + ClusterInformationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClusterInformation"); + } + + // Use ClusterInformation.newBuilder() to construct. + private ClusterInformation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ClusterInformation() { + clusterId_ = ""; + zoneId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClusterInformation.class, + com.google.bigtable.v2.ClusterInformation.Builder.class); + } + + public static final int CLUSTER_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + + /** + * string cluster_id = 1; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + 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(); + clusterId_ = s; + return s; + } + } + + /** + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ZONE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object zoneId_ = ""; + + /** + * string zone_id = 2; + * + * @return The zoneId. + */ + @java.lang.Override + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + 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(); + zoneId_ = s; + return s; + } + } + + /** + * string zone_id = 2; + * + * @return The bytes for zoneId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, clusterId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zoneId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, zoneId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, clusterId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(zoneId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, zoneId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.ClusterInformation)) { + return super.equals(obj); + } + com.google.bigtable.v2.ClusterInformation other = + (com.google.bigtable.v2.ClusterInformation) obj; + + if (!getClusterId().equals(other.getClusterId())) return false; + if (!getZoneId().equals(other.getZoneId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + hash = (37 * hash) + ZONE_ID_FIELD_NUMBER; + hash = (53 * hash) + getZoneId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClusterInformation 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.v2.ClusterInformation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClusterInformation 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.v2.ClusterInformation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClusterInformation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClusterInformation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ClusterInformation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.ClusterInformation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Information on which Cluster served a vRPC, e.g. for Client-Side metrics.
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ClusterInformation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ClusterInformation) + com.google.bigtable.v2.ClusterInformationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ClusterInformation.class, + com.google.bigtable.v2.ClusterInformation.Builder.class); + } + + // Construct using com.google.bigtable.v2.ClusterInformation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + clusterId_ = ""; + zoneId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ClusterInformation_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation getDefaultInstanceForType() { + return com.google.bigtable.v2.ClusterInformation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation build() { + com.google.bigtable.v2.ClusterInformation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation buildPartial() { + com.google.bigtable.v2.ClusterInformation result = + new com.google.bigtable.v2.ClusterInformation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ClusterInformation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.clusterId_ = clusterId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.zoneId_ = zoneId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ClusterInformation) { + return mergeFrom((com.google.bigtable.v2.ClusterInformation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ClusterInformation other) { + if (other == com.google.bigtable.v2.ClusterInformation.getDefaultInstance()) return this; + if (!other.getClusterId().isEmpty()) { + clusterId_ = other.clusterId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getZoneId().isEmpty()) { + zoneId_ = other.zoneId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + clusterId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + zoneId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object clusterId_ = ""; + + /** + * string cluster_id = 1; + * + * @return The clusterId. + */ + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string cluster_id = 1; + * + * @param value The clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clusterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string cluster_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearClusterId() { + clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string cluster_id = 1; + * + * @param value The bytes for clusterId to set. + * @return This builder for chaining. + */ + public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clusterId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object zoneId_ = ""; + + /** + * string zone_id = 2; + * + * @return The zoneId. + */ + public java.lang.String getZoneId() { + java.lang.Object ref = zoneId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zoneId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string zone_id = 2; + * + * @return The bytes for zoneId. + */ + public com.google.protobuf.ByteString getZoneIdBytes() { + java.lang.Object ref = zoneId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zoneId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string zone_id = 2; + * + * @param value The zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zoneId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string zone_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearZoneId() { + zoneId_ = getDefaultInstance().getZoneId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string zone_id = 2; + * + * @param value The bytes for zoneId to set. + * @return This builder for chaining. + */ + public Builder setZoneIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zoneId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ClusterInformation) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ClusterInformation) + private static final com.google.bigtable.v2.ClusterInformation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ClusterInformation(); + } + + public static com.google.bigtable.v2.ClusterInformation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterInformation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformationOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformationOrBuilder.java new file mode 100644 index 000000000000..392d0b7a67b9 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ClusterInformationOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ClusterInformationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ClusterInformation) + com.google.protobuf.MessageOrBuilder { + + /** + * string cluster_id = 1; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + + /** + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * string zone_id = 2; + * + * @return The zoneId. + */ + java.lang.String getZoneId(); + + /** + * string zone_id = 2; + * + * @return The bytes for zoneId. + */ + com.google.protobuf.ByteString getZoneIdBytes(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponse.java new file mode 100644 index 000000000000..8f3bd0504820 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponse.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.ErrorResponse} + */ +@com.google.protobuf.Generated +public final class ErrorResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ErrorResponse) + ErrorResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorResponse"); + } + + // Use ErrorResponse.newBuilder() to construct. + private ErrorResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ErrorResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ErrorResponse.class, + com.google.bigtable.v2.ErrorResponse.Builder.class); + } + + private int bitField0_; + public static final int RPC_ID_FIELD_NUMBER = 1; + private long rpcId_ = 0L; + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + public static final int CLUSTER_INFO_FIELD_NUMBER = 2; + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + @java.lang.Override + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + public static final int STATUS_FIELD_NUMBER = 3; + private com.google.rpc.Status status_; + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int RETRY_INFO_FIELD_NUMBER = 4; + private com.google.rpc.RetryInfo retryInfo_; + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return Whether the retryInfo field is set. + */ + @java.lang.Override + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return The retryInfo. + */ + @java.lang.Override + public com.google.rpc.RetryInfo getRetryInfo() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + @java.lang.Override + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (rpcId_ != 0L) { + output.writeInt64(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getClusterInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getStatus()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getRetryInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rpcId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getClusterInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRetryInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.ErrorResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.ErrorResponse other = (com.google.bigtable.v2.ErrorResponse) obj; + + if (getRpcId() != other.getRpcId()) return false; + if (hasClusterInfo() != other.hasClusterInfo()) return false; + if (hasClusterInfo()) { + if (!getClusterInfo().equals(other.getClusterInfo())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasRetryInfo() != other.hasRetryInfo()) return false; + if (hasRetryInfo()) { + if (!getRetryInfo().equals(other.getRetryInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RPC_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRpcId()); + if (hasClusterInfo()) { + hash = (37 * hash) + CLUSTER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getClusterInfo().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasRetryInfo()) { + hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRetryInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ErrorResponse 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.v2.ErrorResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ErrorResponse 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.v2.ErrorResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ErrorResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ErrorResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.ErrorResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.ErrorResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.ErrorResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.ErrorResponse) + com.google.bigtable.v2.ErrorResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.ErrorResponse.class, + com.google.bigtable.v2.ErrorResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.ErrorResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterInfoFieldBuilder(); + internalGetStatusFieldBuilder(); + internalGetRetryInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rpcId_ = 0L; + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_ErrorResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse build() { + com.google.bigtable.v2.ErrorResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse buildPartial() { + com.google.bigtable.v2.ErrorResponse result = new com.google.bigtable.v2.ErrorResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ErrorResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rpcId_ = rpcId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterInfo_ = + clusterInfoBuilder_ == null ? clusterInfo_ : clusterInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.retryInfo_ = retryInfoBuilder_ == null ? retryInfo_ : retryInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.ErrorResponse) { + return mergeFrom((com.google.bigtable.v2.ErrorResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.ErrorResponse other) { + if (other == com.google.bigtable.v2.ErrorResponse.getDefaultInstance()) return this; + if (other.getRpcId() != 0L) { + setRpcId(other.getRpcId()); + } + if (other.hasClusterInfo()) { + mergeClusterInfo(other.getClusterInfo()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasRetryInfo()) { + mergeRetryInfo(other.getRetryInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rpcId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetClusterInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetRetryInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long rpcId_; + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @param value The rpcId to set. + * @return This builder for chaining. + */ + public Builder setRpcId(long value) { + + rpcId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRpcId() { + bitField0_ = (bitField0_ & ~0x00000001); + rpcId_ = 0L; + onChanged(); + return this; + } + + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + clusterInfoBuilder_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + if (clusterInfoBuilder_ == null) { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } else { + return clusterInfoBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterInfo_ = value; + } else { + clusterInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo( + com.google.bigtable.v2.ClusterInformation.Builder builderForValue) { + if (clusterInfoBuilder_ == null) { + clusterInfo_ = builderForValue.build(); + } else { + clusterInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder mergeClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && clusterInfo_ != null + && clusterInfo_ != com.google.bigtable.v2.ClusterInformation.getDefaultInstance()) { + getClusterInfoBuilder().mergeFrom(value); + } else { + clusterInfo_ = value; + } + } else { + clusterInfoBuilder_.mergeFrom(value); + } + if (clusterInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder clearClusterInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformation.Builder getClusterInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetClusterInfoFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + if (clusterInfoBuilder_ != null) { + return clusterInfoBuilder_.getMessageOrBuilder(); + } else { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + internalGetClusterInfoFieldBuilder() { + if (clusterInfoBuilder_ == null) { + clusterInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder>( + getClusterInfo(), getParentForChildren(), isClean()); + clusterInfo_ = null; + } + return clusterInfoBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
+     * The error from the vRPC and any retry information to consider.
+     * 
+ * + * .google.rpc.Status status = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.rpc.RetryInfo retryInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + retryInfoBuilder_; + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return Whether the retryInfo field is set. + */ + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return The retryInfo. + */ + public com.google.rpc.RetryInfo getRetryInfo() { + if (retryInfoBuilder_ == null) { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } else { + return retryInfoBuilder_.getMessage(); + } + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder setRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryInfo_ = value; + } else { + retryInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder setRetryInfo(com.google.rpc.RetryInfo.Builder builderForValue) { + if (retryInfoBuilder_ == null) { + retryInfo_ = builderForValue.build(); + } else { + retryInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder mergeRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && retryInfo_ != null + && retryInfo_ != com.google.rpc.RetryInfo.getDefaultInstance()) { + getRetryInfoBuilder().mergeFrom(value); + } else { + retryInfo_ = value; + } + } else { + retryInfoBuilder_.mergeFrom(value); + } + if (retryInfo_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public Builder clearRetryInfo() { + bitField0_ = (bitField0_ & ~0x00000008); + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public com.google.rpc.RetryInfo.Builder getRetryInfoBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetRetryInfoFieldBuilder().getBuilder(); + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + if (retryInfoBuilder_ != null) { + return retryInfoBuilder_.getMessageOrBuilder(); + } else { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + } + + /** .google.rpc.RetryInfo retry_info = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + internalGetRetryInfoFieldBuilder() { + if (retryInfoBuilder_ == null) { + retryInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder>( + getRetryInfo(), getParentForChildren(), isClean()); + retryInfo_ = null; + } + return retryInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ErrorResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.ErrorResponse) + private static final com.google.bigtable.v2.ErrorResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.ErrorResponse(); + } + + public static com.google.bigtable.v2.ErrorResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponseOrBuilder.java new file mode 100644 index 000000000000..d29988fedcec --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ErrorResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface ErrorResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ErrorResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + long getRpcId(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + boolean hasClusterInfo(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + com.google.bigtable.v2.ClusterInformation getClusterInfo(); + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder(); + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
+   * The error from the vRPC and any retry information to consider.
+   * 
+ * + * .google.rpc.Status status = 3; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return Whether the retryInfo field is set. + */ + boolean hasRetryInfo(); + + /** + * .google.rpc.RetryInfo retry_info = 4; + * + * @return The retryInfo. + */ + com.google.rpc.RetryInfo getRetryInfo(); + + /** .google.rpc.RetryInfo retry_info = 4; */ + com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java index 37dd639ce276..65808fb8668f 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java @@ -268,7 +268,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @return The query. */ @java.lang.Override @@ -298,7 +298,7 @@ public java.lang.String getQuery() { * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @return The bytes for query. */ @java.lang.Override @@ -355,7 +355,7 @@ public com.google.protobuf.ByteString getPreparedQuery() { * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1122 + * google/bigtable/v2/bigtable.proto;l=1153 * @return Whether the protoFormat field is set. */ @java.lang.Override @@ -375,7 +375,7 @@ public boolean hasProtoFormat() { * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1122 + * google/bigtable/v2/bigtable.proto;l=1153 * @return The protoFormat. */ @java.lang.Override @@ -1430,7 +1430,7 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @return The query. */ @java.lang.Deprecated @@ -1459,7 +1459,7 @@ public java.lang.String getQuery() { * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @return The bytes for query. */ @java.lang.Deprecated @@ -1488,7 +1488,7 @@ public com.google.protobuf.ByteString getQueryBytes() { * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @param value The query to set. * @return This builder for chaining. */ @@ -1516,7 +1516,7 @@ public Builder setQuery(java.lang.String value) { * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1540,7 +1540,7 @@ public Builder clearQuery() { * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @param value The bytes for query to set. * @return This builder for chaining. */ @@ -1655,7 +1655,7 @@ public Builder clearPreparedQuery() { * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1122 + * google/bigtable/v2/bigtable.proto;l=1153 * @return Whether the protoFormat field is set. */ @java.lang.Override @@ -1675,7 +1675,7 @@ public boolean hasProtoFormat() { * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1122 + * google/bigtable/v2/bigtable.proto;l=1153 * @return The protoFormat. */ @java.lang.Override diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java index f29ee2741f2a..262acc8a149a 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java @@ -101,7 +101,7 @@ public interface ExecuteQueryRequestOrBuilder * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @return The query. */ @java.lang.Deprecated @@ -120,7 +120,7 @@ public interface ExecuteQueryRequestOrBuilder * string query = 3 [deprecated = true, (.google.api.field_behavior) = REQUIRED]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.query is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1101 + * google/bigtable/v2/bigtable.proto;l=1132 * @return The bytes for query. */ @java.lang.Deprecated @@ -158,7 +158,7 @@ public interface ExecuteQueryRequestOrBuilder * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1122 + * google/bigtable/v2/bigtable.proto;l=1153 * @return Whether the protoFormat field is set. */ @java.lang.Deprecated @@ -175,7 +175,7 @@ public interface ExecuteQueryRequestOrBuilder * .google.bigtable.v2.ProtoFormat proto_format = 4 [deprecated = true]; * * @deprecated google.bigtable.v2.ExecuteQueryRequest.proto_format is deprecated. See - * google/bigtable/v2/bigtable.proto;l=1122 + * google/bigtable/v2/bigtable.proto;l=1153 * @return The protoFormat. */ @java.lang.Deprecated diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java index 46c908818a84..0f3f05cae226 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java @@ -273,6 +273,44 @@ public boolean getPeerInfo() { return peerInfo_; } + public static final int SESSIONS_COMPATIBLE_FIELD_NUMBER = 12; + private boolean sessionsCompatible_ = false; + + /** + * + * + *
+   * Indicates whether the client supports the Bigtable Sessions API.
+   * 
+ * + * bool sessions_compatible = 12; + * + * @return The sessionsCompatible. + */ + @java.lang.Override + public boolean getSessionsCompatible() { + return sessionsCompatible_; + } + + public static final int SESSIONS_REQUIRED_FIELD_NUMBER = 13; + private boolean sessionsRequired_ = false; + + /** + * + * + *
+   * Internal flag to force sessions for internal projects.
+   * 
+ * + * bool sessions_required = 13; + * + * @return The sessionsRequired. + */ + @java.lang.Override + public boolean getSessionsRequired() { + return sessionsRequired_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -317,6 +355,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (peerInfo_ != false) { output.writeBool(11, peerInfo_); } + if (sessionsCompatible_ != false) { + output.writeBool(12, sessionsCompatible_); + } + if (sessionsRequired_ != false) { + output.writeBool(13, sessionsRequired_); + } getUnknownFields().writeTo(output); } @@ -356,6 +400,12 @@ public int getSerializedSize() { if (peerInfo_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, peerInfo_); } + if (sessionsCompatible_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, sessionsCompatible_); + } + if (sessionsRequired_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, sessionsRequired_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -381,6 +431,8 @@ public boolean equals(final java.lang.Object obj) { if (getTrafficDirectorEnabled() != other.getTrafficDirectorEnabled()) return false; if (getDirectAccessRequested() != other.getDirectAccessRequested()) return false; if (getPeerInfo() != other.getPeerInfo()) return false; + if (getSessionsCompatible() != other.getSessionsCompatible()) return false; + if (getSessionsRequired() != other.getSessionsRequired()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -412,6 +464,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDirectAccessRequested()); hash = (37 * hash) + PEER_INFO_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPeerInfo()); + hash = (37 * hash) + SESSIONS_COMPATIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSessionsCompatible()); + hash = (37 * hash) + SESSIONS_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSessionsRequired()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -568,6 +624,8 @@ public Builder clear() { trafficDirectorEnabled_ = false; directAccessRequested_ = false; peerInfo_ = false; + sessionsCompatible_ = false; + sessionsRequired_ = false; return this; } @@ -633,6 +691,12 @@ private void buildPartial0(com.google.bigtable.v2.FeatureFlags result) { if (((from_bitField0_ & 0x00000200) != 0)) { result.peerInfo_ = peerInfo_; } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.sessionsCompatible_ = sessionsCompatible_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.sessionsRequired_ = sessionsRequired_; + } } @java.lang.Override @@ -677,6 +741,12 @@ public Builder mergeFrom(com.google.bigtable.v2.FeatureFlags other) { if (other.getPeerInfo() != false) { setPeerInfo(other.getPeerInfo()); } + if (other.getSessionsCompatible() != false) { + setSessionsCompatible(other.getSessionsCompatible()); + } + if (other.getSessionsRequired() != false) { + setSessionsRequired(other.getSessionsRequired()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -763,6 +833,18 @@ public Builder mergeFrom( bitField0_ |= 0x00000200; break; } // case 88 + case 96: + { + sessionsCompatible_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 96 + case 104: + { + sessionsRequired_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 104 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1366,6 +1448,118 @@ public Builder clearPeerInfo() { return this; } + private boolean sessionsCompatible_; + + /** + * + * + *
+     * Indicates whether the client supports the Bigtable Sessions API.
+     * 
+ * + * bool sessions_compatible = 12; + * + * @return The sessionsCompatible. + */ + @java.lang.Override + public boolean getSessionsCompatible() { + return sessionsCompatible_; + } + + /** + * + * + *
+     * Indicates whether the client supports the Bigtable Sessions API.
+     * 
+ * + * bool sessions_compatible = 12; + * + * @param value The sessionsCompatible to set. + * @return This builder for chaining. + */ + public Builder setSessionsCompatible(boolean value) { + + sessionsCompatible_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether the client supports the Bigtable Sessions API.
+     * 
+ * + * bool sessions_compatible = 12; + * + * @return This builder for chaining. + */ + public Builder clearSessionsCompatible() { + bitField0_ = (bitField0_ & ~0x00000400); + sessionsCompatible_ = false; + onChanged(); + return this; + } + + private boolean sessionsRequired_; + + /** + * + * + *
+     * Internal flag to force sessions for internal projects.
+     * 
+ * + * bool sessions_required = 13; + * + * @return The sessionsRequired. + */ + @java.lang.Override + public boolean getSessionsRequired() { + return sessionsRequired_; + } + + /** + * + * + *
+     * Internal flag to force sessions for internal projects.
+     * 
+ * + * bool sessions_required = 13; + * + * @param value The sessionsRequired to set. + * @return This builder for chaining. + */ + public Builder setSessionsRequired(boolean value) { + + sessionsRequired_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Internal flag to force sessions for internal projects.
+     * 
+ * + * bool sessions_required = 13; + * + * @return This builder for chaining. + */ + public Builder clearSessionsRequired() { + bitField0_ = (bitField0_ & ~0x00000800); + sessionsRequired_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.FeatureFlags) } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java index 7f41ef555980..c6d5769116e0 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java @@ -163,4 +163,30 @@ public interface FeatureFlagsOrBuilder * @return The peerInfo. */ boolean getPeerInfo(); + + /** + * + * + *
+   * Indicates whether the client supports the Bigtable Sessions API.
+   * 
+ * + * bool sessions_compatible = 12; + * + * @return The sessionsCompatible. + */ + boolean getSessionsCompatible(); + + /** + * + * + *
+   * Internal flag to force sessions for internal projects.
+   * 
+ * + * bool sessions_required = 13; + * + * @return The sessionsRequired. + */ + boolean getSessionsRequired(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java index 92e14798bbe5..b0bbffce2b87 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java @@ -54,7 +54,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n&google/bigtable/v2/feature_flags.proto" - + "\022\022google.bigtable.v2\"\261\002\n\014FeatureFlags\022\025\n" + + "\022\022google.bigtable.v2\"\351\002\n\014FeatureFlags\022\025\n" + "\rreverse_scans\030\001 \001(\010\022\036\n\026mutate_rows_rate" + "_limit\030\003 \001(\010\022\037\n\027mutate_rows_rate_limit2\030" + "\005 \001(\010\022\"\n\032last_scanned_row_responses\030\004 \001(" @@ -62,12 +62,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\007 \001(\010\022#\n\033client_side_metrics_enabled\030\010 \001" + "(\010\022 \n\030traffic_director_enabled\030\t \001(\010\022\037\n\027" + "direct_access_requested\030\n \001(\010\022\021\n\tpeer_in" - + "fo\030\013 \001(\010B\273\001\n\026com.google.bigtable.v2B\021Fea" - + "tureFlagsProtoP\001Z8cloud.google.com/go/bi" - + "gtable/apiv2/bigtablepb;bigtablepb\252\002\030Goo" - + "gle.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\Big" - + "table\\V2\352\002\033Google::Cloud::Bigtable::V2b\006" - + "proto3" + + "fo\030\013 \001(\010\022\033\n\023sessions_compatible\030\014 \001(\010\022\031\n" + + "\021sessions_required\030\r \001(\010B\273\001\n\026com.google." + + "bigtable.v2B\021FeatureFlagsProtoP\001Z8cloud." + + "google.com/go/bigtable/apiv2/bigtablepb;" + + "bigtablepb\252\002\030Google.Cloud.Bigtable.V2\312\002\030" + + "Google\\Cloud\\Bigtable\\V2\352\002\033Google::Cloud" + + "::Bigtable::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -87,6 +88,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "TrafficDirectorEnabled", "DirectAccessRequested", "PeerInfo", + "SessionsCompatible", + "SessionsRequired", }); descriptor.resolveAllFeaturesImmutable(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequest.java new file mode 100644 index 000000000000..bece1ef4436f --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequest.java @@ -0,0 +1,841 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * See GetClientConfiguration() RPC in bigtable.proto. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.GetClientConfigurationRequest} + */ +@com.google.protobuf.Generated +public final class GetClientConfigurationRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GetClientConfigurationRequest) + GetClientConfigurationRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetClientConfigurationRequest"); + } + + // Use GetClientConfigurationRequest.newBuilder() to construct. + private GetClientConfigurationRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetClientConfigurationRequest() { + instanceName_ = ""; + appProfileId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GetClientConfigurationRequest.class, + com.google.bigtable.v2.GetClientConfigurationRequest.Builder.class); + } + + public static final int INSTANCE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceName_ = ""; + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + @java.lang.Override + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + 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(); + instanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appProfileId. + */ + @java.lang.Override + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + 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(); + appProfileId_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appProfileId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.GetClientConfigurationRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.GetClientConfigurationRequest other = + (com.google.bigtable.v2.GetClientConfigurationRequest) obj; + + if (!getInstanceName().equals(other.getInstanceName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INSTANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getInstanceName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest 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.v2.GetClientConfigurationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest 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.v2.GetClientConfigurationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.GetClientConfigurationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * See GetClientConfiguration() RPC in bigtable.proto. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.GetClientConfigurationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.GetClientConfigurationRequest) + com.google.bigtable.v2.GetClientConfigurationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GetClientConfigurationRequest.class, + com.google.bigtable.v2.GetClientConfigurationRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.GetClientConfigurationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceName_ = ""; + appProfileId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.GetClientConfigurationRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.GetClientConfigurationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.GetClientConfigurationRequest build() { + com.google.bigtable.v2.GetClientConfigurationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.GetClientConfigurationRequest buildPartial() { + com.google.bigtable.v2.GetClientConfigurationRequest result = + new com.google.bigtable.v2.GetClientConfigurationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.GetClientConfigurationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instanceName_ = instanceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.GetClientConfigurationRequest) { + return mergeFrom((com.google.bigtable.v2.GetClientConfigurationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.GetClientConfigurationRequest other) { + if (other == com.google.bigtable.v2.GetClientConfigurationRequest.getDefaultInstance()) + return this; + if (!other.getInstanceName().isEmpty()) { + instanceName_ = other.instanceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + instanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object instanceName_ = ""; + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + public java.lang.String getInstanceName() { + java.lang.Object ref = instanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + public com.google.protobuf.ByteString getInstanceNameBytes() { + java.lang.Object ref = instanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearInstanceName() { + instanceName_ = getDefaultInstance().getInstanceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The unique name of the instance for which the client will target
+     * with Data API requests.
+     *
+     * Values are of the form `projects/<project>/instances/<instance>`
+     * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for instanceName to set. + * @return This builder for chaining. + */ + public Builder setInstanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appProfileId. + */ + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appProfileId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appProfileId. + */ + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the AppProfile which will be used by the client when
+     * sending requests in the Data API.
+     *
+     * If not specified, the `default` application profile will be used.
+     * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.GetClientConfigurationRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.GetClientConfigurationRequest) + private static final com.google.bigtable.v2.GetClientConfigurationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.GetClientConfigurationRequest(); + } + + public static com.google.bigtable.v2.GetClientConfigurationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetClientConfigurationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.GetClientConfigurationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequestOrBuilder.java new file mode 100644 index 000000000000..1cb100829d07 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GetClientConfigurationRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface GetClientConfigurationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.GetClientConfigurationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The instanceName. + */ + java.lang.String getInstanceName(); + + /** + * + * + *
+   * Required. The unique name of the instance for which the client will target
+   * with Data API requests.
+   *
+   * Values are of the form `projects/<project>/instances/<instance>`
+   * 
+ * + * + * string instance_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for instanceName. + */ + com.google.protobuf.ByteString getInstanceNameBytes(); + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * Optional. The name of the AppProfile which will be used by the client when
+   * sending requests in the Data API.
+   *
+   * If not specified, the `default` application profile will be used.
+   * 
+ * + * string app_profile_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponse.java new file mode 100644 index 000000000000..bc76b7771535 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponse.java @@ -0,0 +1,852 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.GoAwayResponse} + */ +@com.google.protobuf.Generated +public final class GoAwayResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GoAwayResponse) + GoAwayResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GoAwayResponse"); + } + + // Use GoAwayResponse.newBuilder() to construct. + private GoAwayResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GoAwayResponse() { + reason_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GoAwayResponse.class, + com.google.bigtable.v2.GoAwayResponse.Builder.class); + } + + public static final int REASON_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object reason_ = ""; + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public java.lang.String getReason() { + java.lang.Object ref = reason_; + 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(); + reason_ = s; + return s; + } + } + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The bytes for reason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LAST_RPC_ID_ADMITTED_FIELD_NUMBER = 3; + private long lastRpcIdAdmitted_ = 0L; + + /** + * + * + *
+   * The last vRPC which was admitted by the AFE. The client may expect the
+   * result from the vRPC on the stream before disconnecting, and should
+   * retry vRPCs beyond this boundary.
+   * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return The lastRpcIdAdmitted. + */ + @java.lang.Override + public long getLastRpcIdAdmitted() { + return lastRpcIdAdmitted_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (lastRpcIdAdmitted_ != 0L) { + output.writeInt64(3, lastRpcIdAdmitted_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, reason_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (lastRpcIdAdmitted_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, lastRpcIdAdmitted_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.GoAwayResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.GoAwayResponse other = (com.google.bigtable.v2.GoAwayResponse) obj; + + if (!getReason().equals(other.getReason())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getLastRpcIdAdmitted() != other.getLastRpcIdAdmitted()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REASON_FIELD_NUMBER; + hash = (53 * hash) + getReason().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + LAST_RPC_ID_ADMITTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLastRpcIdAdmitted()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GoAwayResponse 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.v2.GoAwayResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GoAwayResponse 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.v2.GoAwayResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GoAwayResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GoAwayResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.GoAwayResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.GoAwayResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.GoAwayResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.GoAwayResponse) + com.google.bigtable.v2.GoAwayResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.GoAwayResponse.class, + com.google.bigtable.v2.GoAwayResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.GoAwayResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reason_ = ""; + description_ = ""; + lastRpcIdAdmitted_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse build() { + com.google.bigtable.v2.GoAwayResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse buildPartial() { + com.google.bigtable.v2.GoAwayResponse result = + new com.google.bigtable.v2.GoAwayResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.GoAwayResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reason_ = reason_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.lastRpcIdAdmitted_ = lastRpcIdAdmitted_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.GoAwayResponse) { + return mergeFrom((com.google.bigtable.v2.GoAwayResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.GoAwayResponse other) { + if (other == com.google.bigtable.v2.GoAwayResponse.getDefaultInstance()) return this; + if (!other.getReason().isEmpty()) { + reason_ = other.reason_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getLastRpcIdAdmitted() != 0L) { + setLastRpcIdAdmitted(other.getLastRpcIdAdmitted()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + reason_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + lastRpcIdAdmitted_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object reason_ = ""; + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @return The reason. + */ + public java.lang.String getReason() { + java.lang.Object ref = reason_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reason_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @return The bytes for reason. + */ + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + reason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + reason_ = getDefaultInstance().getReason(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Server-generated reason for GOAWAY, including a plain-text description of
+     * why. 'reason' may be used for CSM, while both may be logged.
+     * 
+ * + * string reason = 1; + * + * @param value The bytes for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + reason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long lastRpcIdAdmitted_; + + /** + * + * + *
+     * The last vRPC which was admitted by the AFE. The client may expect the
+     * result from the vRPC on the stream before disconnecting, and should
+     * retry vRPCs beyond this boundary.
+     * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return The lastRpcIdAdmitted. + */ + @java.lang.Override + public long getLastRpcIdAdmitted() { + return lastRpcIdAdmitted_; + } + + /** + * + * + *
+     * The last vRPC which was admitted by the AFE. The client may expect the
+     * result from the vRPC on the stream before disconnecting, and should
+     * retry vRPCs beyond this boundary.
+     * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @param value The lastRpcIdAdmitted to set. + * @return This builder for chaining. + */ + public Builder setLastRpcIdAdmitted(long value) { + + lastRpcIdAdmitted_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The last vRPC which was admitted by the AFE. The client may expect the
+     * result from the vRPC on the stream before disconnecting, and should
+     * retry vRPCs beyond this boundary.
+     * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return This builder for chaining. + */ + public Builder clearLastRpcIdAdmitted() { + bitField0_ = (bitField0_ & ~0x00000004); + lastRpcIdAdmitted_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.GoAwayResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.GoAwayResponse) + private static final com.google.bigtable.v2.GoAwayResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.GoAwayResponse(); + } + + public static com.google.bigtable.v2.GoAwayResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GoAwayResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponseOrBuilder.java new file mode 100644 index 000000000000..3bddd8a3bdfe --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GoAwayResponseOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface GoAwayResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.GoAwayResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The reason. + */ + java.lang.String getReason(); + + /** + * + * + *
+   * Server-generated reason for GOAWAY, including a plain-text description of
+   * why. 'reason' may be used for CSM, while both may be logged.
+   * 
+ * + * string reason = 1; + * + * @return The bytes for reason. + */ + com.google.protobuf.ByteString getReasonBytes(); + + /** + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The last vRPC which was admitted by the AFE. The client may expect the
+   * result from the vRPC on the stream before disconnecting, and should
+   * retry vRPCs beyond this boundary.
+   * 
+ * + * int64 last_rpc_id_admitted = 3; + * + * @return The lastRpcIdAdmitted. + */ + long getLastRpcIdAdmitted(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponse.java new file mode 100644 index 000000000000..3c10f838b891 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponse.java @@ -0,0 +1,394 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.HeartbeatResponse} + */ +@com.google.protobuf.Generated +public final class HeartbeatResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.HeartbeatResponse) + HeartbeatResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HeartbeatResponse"); + } + + // Use HeartbeatResponse.newBuilder() to construct. + private HeartbeatResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private HeartbeatResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.HeartbeatResponse.class, + com.google.bigtable.v2.HeartbeatResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.HeartbeatResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.HeartbeatResponse other = (com.google.bigtable.v2.HeartbeatResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.HeartbeatResponse 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.v2.HeartbeatResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.HeartbeatResponse 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.v2.HeartbeatResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.HeartbeatResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.HeartbeatResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.HeartbeatResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.HeartbeatResponse) + com.google.bigtable.v2.HeartbeatResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.HeartbeatResponse.class, + com.google.bigtable.v2.HeartbeatResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.HeartbeatResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse build() { + com.google.bigtable.v2.HeartbeatResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse buildPartial() { + com.google.bigtable.v2.HeartbeatResponse result = + new com.google.bigtable.v2.HeartbeatResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.HeartbeatResponse) { + return mergeFrom((com.google.bigtable.v2.HeartbeatResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.HeartbeatResponse other) { + if (other == com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.HeartbeatResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.HeartbeatResponse) + private static final com.google.bigtable.v2.HeartbeatResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.HeartbeatResponse(); + } + + public static com.google.bigtable.v2.HeartbeatResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HeartbeatResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponseOrBuilder.java new file mode 100644 index 000000000000..7e298530990c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/HeartbeatResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface HeartbeatResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.HeartbeatResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptions.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptions.java new file mode 100644 index 000000000000..e9443eecbe43 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptions.java @@ -0,0 +1,2567 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Configuration for how to balance vRPCs over sessions. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions} + */ +@com.google.protobuf.Generated +public final class LoadBalancingOptions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions) + LoadBalancingOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LoadBalancingOptions"); + } + + // Use LoadBalancingOptions.newBuilder() to construct. + private LoadBalancingOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LoadBalancingOptions() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.class, + com.google.bigtable.v2.LoadBalancingOptions.Builder.class); + } + + public interface LeastInFlightOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to run the algorithm
+     * on. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + long getRandomSubsetSize(); + } + + /** + * + * + *
+   * Balances vRPCs over backends, preferring to send new vRPCs to AFEs with the
+   * least number of active vRPCs.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.LeastInFlight} + */ + public static final class LeastInFlight extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + LeastInFlightOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LeastInFlight"); + } + + // Use LeastInFlight.newBuilder() to construct. + private LeastInFlight(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private LeastInFlight() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.class, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder.class); + } + + public static final int RANDOM_SUBSET_SIZE_FIELD_NUMBER = 1; + private long randomSubsetSize_ = 0L; + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to run the algorithm
+     * on. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (randomSubsetSize_ != 0L) { + output.writeInt64(1, randomSubsetSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (randomSubsetSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, randomSubsetSize_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight other = + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) obj; + + if (getRandomSubsetSize() != other.getRandomSubsetSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RANDOM_SUBSET_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRandomSubsetSize()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight 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.v2.LoadBalancingOptions.LeastInFlight parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight 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.v2.LoadBalancingOptions.LeastInFlight parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Balances vRPCs over backends, preferring to send new vRPCs to AFEs with the
+     * least number of active vRPCs.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.LeastInFlight} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.class, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + randomSubsetSize_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight build() { + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight result = + new com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.randomSubsetSize_ = randomSubsetSize_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance()) + return this; + if (other.getRandomSubsetSize() != 0L) { + setRandomSubsetSize(other.getRandomSubsetSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + randomSubsetSize_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long randomSubsetSize_; + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to run the algorithm
+       * on. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to run the algorithm
+       * on. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @param value The randomSubsetSize to set. + * @return This builder for chaining. + */ + public Builder setRandomSubsetSize(long value) { + + randomSubsetSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to run the algorithm
+       * on. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearRandomSubsetSize() { + bitField0_ = (bitField0_ & ~0x00000001); + randomSubsetSize_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + private static final com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LeastInFlight parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface PeakEwmaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to compare costs
+     * over. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + long getRandomSubsetSize(); + } + + /** + * + * + *
+   * Balances vRPCs over backends, by maintaining a moving average of each AFE's
+   * round-trip time, weighted by the number of outstanding vRPCs, and
+   * distribute traffic to AFEs where that cost function is smallest.
+   *
+   * See:
+   * https://linkerd.io/2016/03/16/beyond-round-robin-load-balancing-for-latency
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.PeakEwma} + */ + public static final class PeakEwma extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + PeakEwmaOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PeakEwma"); + } + + // Use PeakEwma.newBuilder() to construct. + private PeakEwma(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PeakEwma() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.class, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder.class); + } + + public static final int RANDOM_SUBSET_SIZE_FIELD_NUMBER = 1; + private long randomSubsetSize_ = 0L; + + /** + * + * + *
+     * Of all connected AFEs, the size of the random subset to compare costs
+     * over. Zero implies all connected AFEs.
+     * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (randomSubsetSize_ != 0L) { + output.writeInt64(1, randomSubsetSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (randomSubsetSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, randomSubsetSize_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.LoadBalancingOptions.PeakEwma)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma other = + (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) obj; + + if (getRandomSubsetSize() != other.getRandomSubsetSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RANDOM_SUBSET_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRandomSubsetSize()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma 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.v2.LoadBalancingOptions.PeakEwma parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma 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.v2.LoadBalancingOptions.PeakEwma parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Balances vRPCs over backends, by maintaining a moving average of each AFE's
+     * round-trip time, weighted by the number of outstanding vRPCs, and
+     * distribute traffic to AFEs where that cost function is smallest.
+     *
+     * See:
+     * https://linkerd.io/2016/03/16/beyond-round-robin-load-balancing-for-latency
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.PeakEwma} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.class, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + randomSubsetSize_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma build() { + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma result = + new com.google.bigtable.v2.LoadBalancingOptions.PeakEwma(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.randomSubsetSize_ = randomSubsetSize_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance()) + return this; + if (other.getRandomSubsetSize() != 0L) { + setRandomSubsetSize(other.getRandomSubsetSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + randomSubsetSize_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long randomSubsetSize_; + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to compare costs
+       * over. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return The randomSubsetSize. + */ + @java.lang.Override + public long getRandomSubsetSize() { + return randomSubsetSize_; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to compare costs
+       * over. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @param value The randomSubsetSize to set. + * @return This builder for chaining. + */ + public Builder setRandomSubsetSize(long value) { + + randomSubsetSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Of all connected AFEs, the size of the random subset to compare costs
+       * over. Zero implies all connected AFEs.
+       * 
+ * + * int64 random_subset_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearRandomSubsetSize() { + bitField0_ = (bitField0_ & ~0x00000001); + randomSubsetSize_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions.PeakEwma) + private static final com.google.bigtable.v2.LoadBalancingOptions.PeakEwma DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions.PeakEwma(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PeakEwma parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RandomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions.Random) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+   * Balances vRPCs over backends, by randomly selecting a backend.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.Random} + */ + public static final class Random extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.LoadBalancingOptions.Random) + RandomOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Random"); + } + + // Use Random.newBuilder() to construct. + private Random(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Random() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.Random.class, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.LoadBalancingOptions.Random)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions.Random other = + (com.google.bigtable.v2.LoadBalancingOptions.Random) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random 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.v2.LoadBalancingOptions.Random parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random 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.v2.LoadBalancingOptions.Random parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.LoadBalancingOptions.Random prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Balances vRPCs over backends, by randomly selecting a backend.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions.Random} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions.Random) + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.Random.class, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.Random.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random build() { + com.google.bigtable.v2.LoadBalancingOptions.Random result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions.Random result = + new com.google.bigtable.v2.LoadBalancingOptions.Random(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions.Random) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions.Random) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions.Random other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions.Random) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions.Random) + private static final com.google.bigtable.v2.LoadBalancingOptions.Random DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions.Random(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions.Random getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Random parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int loadBalancingStrategyCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object loadBalancingStrategy_; + + public enum LoadBalancingStrategyCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LEAST_IN_FLIGHT(1), + PEAK_EWMA(2), + RANDOM(4), + LOADBALANCINGSTRATEGY_NOT_SET(0); + private final int value; + + private LoadBalancingStrategyCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LoadBalancingStrategyCase valueOf(int value) { + return forNumber(value); + } + + public static LoadBalancingStrategyCase forNumber(int value) { + switch (value) { + case 1: + return LEAST_IN_FLIGHT; + case 2: + return PEAK_EWMA; + case 4: + return RANDOM; + case 0: + return LOADBALANCINGSTRATEGY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LoadBalancingStrategyCase getLoadBalancingStrategyCase() { + return LoadBalancingStrategyCase.forNumber(loadBalancingStrategyCase_); + } + + public static final int LEAST_IN_FLIGHT_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return Whether the leastInFlight field is set. + */ + @java.lang.Override + public boolean hasLeastInFlight() { + return loadBalancingStrategyCase_ == 1; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return The leastInFlight. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getLeastInFlight() { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder + getLeastInFlightOrBuilder() { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + + public static final int PEAK_EWMA_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return Whether the peakEwma field is set. + */ + @java.lang.Override + public boolean hasPeakEwma() { + return loadBalancingStrategyCase_ == 2; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return The peakEwma. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getPeakEwma() { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder getPeakEwmaOrBuilder() { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + + public static final int RANDOM_FIELD_NUMBER = 4; + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return Whether the random field is set. + */ + @java.lang.Override + public boolean hasRandom() { + return loadBalancingStrategyCase_ == 4; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return The random. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random getRandom() { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder getRandomOrBuilder() { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (loadBalancingStrategyCase_ == 1) { + output.writeMessage( + 1, (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 4) { + output.writeMessage( + 4, (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (loadBalancingStrategyCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_); + } + if (loadBalancingStrategyCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.LoadBalancingOptions)) { + return super.equals(obj); + } + com.google.bigtable.v2.LoadBalancingOptions other = + (com.google.bigtable.v2.LoadBalancingOptions) obj; + + if (!getLoadBalancingStrategyCase().equals(other.getLoadBalancingStrategyCase())) return false; + switch (loadBalancingStrategyCase_) { + case 1: + if (!getLeastInFlight().equals(other.getLeastInFlight())) return false; + break; + case 2: + if (!getPeakEwma().equals(other.getPeakEwma())) return false; + break; + case 4: + if (!getRandom().equals(other.getRandom())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (loadBalancingStrategyCase_) { + case 1: + hash = (37 * hash) + LEAST_IN_FLIGHT_FIELD_NUMBER; + hash = (53 * hash) + getLeastInFlight().hashCode(); + break; + case 2: + hash = (37 * hash) + PEAK_EWMA_FIELD_NUMBER; + hash = (53 * hash) + getPeakEwma().hashCode(); + break; + case 4: + hash = (37 * hash) + RANDOM_FIELD_NUMBER; + hash = (53 * hash) + getRandom().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions 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.v2.LoadBalancingOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions 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.v2.LoadBalancingOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.LoadBalancingOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.LoadBalancingOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Configuration for how to balance vRPCs over sessions. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.LoadBalancingOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.LoadBalancingOptions) + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.LoadBalancingOptions.class, + com.google.bigtable.v2.LoadBalancingOptions.Builder.class); + } + + // Construct using com.google.bigtable.v2.LoadBalancingOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (leastInFlightBuilder_ != null) { + leastInFlightBuilder_.clear(); + } + if (peakEwmaBuilder_ != null) { + peakEwmaBuilder_.clear(); + } + if (randomBuilder_ != null) { + randomBuilder_.clear(); + } + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions getDefaultInstanceForType() { + return com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions build() { + com.google.bigtable.v2.LoadBalancingOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions buildPartial() { + com.google.bigtable.v2.LoadBalancingOptions result = + new com.google.bigtable.v2.LoadBalancingOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.LoadBalancingOptions result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.LoadBalancingOptions result) { + result.loadBalancingStrategyCase_ = loadBalancingStrategyCase_; + result.loadBalancingStrategy_ = this.loadBalancingStrategy_; + if (loadBalancingStrategyCase_ == 1 && leastInFlightBuilder_ != null) { + result.loadBalancingStrategy_ = leastInFlightBuilder_.build(); + } + if (loadBalancingStrategyCase_ == 2 && peakEwmaBuilder_ != null) { + result.loadBalancingStrategy_ = peakEwmaBuilder_.build(); + } + if (loadBalancingStrategyCase_ == 4 && randomBuilder_ != null) { + result.loadBalancingStrategy_ = randomBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.LoadBalancingOptions) { + return mergeFrom((com.google.bigtable.v2.LoadBalancingOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.LoadBalancingOptions other) { + if (other == com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance()) return this; + switch (other.getLoadBalancingStrategyCase()) { + case LEAST_IN_FLIGHT: + { + mergeLeastInFlight(other.getLeastInFlight()); + break; + } + case PEAK_EWMA: + { + mergePeakEwma(other.getPeakEwma()); + break; + } + case RANDOM: + { + mergeRandom(other.getRandom()); + break; + } + case LOADBALANCINGSTRATEGY_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetLeastInFlightFieldBuilder().getBuilder(), extensionRegistry); + loadBalancingStrategyCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetPeakEwmaFieldBuilder().getBuilder(), extensionRegistry); + loadBalancingStrategyCase_ = 2; + break; + } // case 18 + case 34: + { + input.readMessage(internalGetRandomFieldBuilder().getBuilder(), extensionRegistry); + loadBalancingStrategyCase_ = 4; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int loadBalancingStrategyCase_ = 0; + private java.lang.Object loadBalancingStrategy_; + + public LoadBalancingStrategyCase getLoadBalancingStrategyCase() { + return LoadBalancingStrategyCase.forNumber(loadBalancingStrategyCase_); + } + + public Builder clearLoadBalancingStrategy() { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder> + leastInFlightBuilder_; + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return Whether the leastInFlight field is set. + */ + @java.lang.Override + public boolean hasLeastInFlight() { + return loadBalancingStrategyCase_ == 1; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return The leastInFlight. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getLeastInFlight() { + if (leastInFlightBuilder_ == null) { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } else { + if (loadBalancingStrategyCase_ == 1) { + return leastInFlightBuilder_.getMessage(); + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder setLeastInFlight( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight value) { + if (leastInFlightBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingStrategy_ = value; + onChanged(); + } else { + leastInFlightBuilder_.setMessage(value); + } + loadBalancingStrategyCase_ = 1; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder setLeastInFlight( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder builderForValue) { + if (leastInFlightBuilder_ == null) { + loadBalancingStrategy_ = builderForValue.build(); + onChanged(); + } else { + leastInFlightBuilder_.setMessage(builderForValue.build()); + } + loadBalancingStrategyCase_ = 1; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder mergeLeastInFlight( + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight value) { + if (leastInFlightBuilder_ == null) { + if (loadBalancingStrategyCase_ == 1 + && loadBalancingStrategy_ + != com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance()) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.newBuilder( + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) + loadBalancingStrategy_) + .mergeFrom(value) + .buildPartial(); + } else { + loadBalancingStrategy_ = value; + } + onChanged(); + } else { + if (loadBalancingStrategyCase_ == 1) { + leastInFlightBuilder_.mergeFrom(value); + } else { + leastInFlightBuilder_.setMessage(value); + } + } + loadBalancingStrategyCase_ = 1; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public Builder clearLeastInFlight() { + if (leastInFlightBuilder_ == null) { + if (loadBalancingStrategyCase_ == 1) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + } + } else { + if (loadBalancingStrategyCase_ == 1) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + } + leastInFlightBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder + getLeastInFlightBuilder() { + return internalGetLeastInFlightFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder + getLeastInFlightOrBuilder() { + if ((loadBalancingStrategyCase_ == 1) && (leastInFlightBuilder_ != null)) { + return leastInFlightBuilder_.getMessageOrBuilder(); + } else { + if (loadBalancingStrategyCase_ == 1) { + return (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder> + internalGetLeastInFlightFieldBuilder() { + if (leastInFlightBuilder_ == null) { + if (!(loadBalancingStrategyCase_ == 1)) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.getDefaultInstance(); + } + leastInFlightBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight.Builder, + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder>( + (com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight) loadBalancingStrategy_, + getParentForChildren(), + isClean()); + loadBalancingStrategy_ = null; + } + loadBalancingStrategyCase_ = 1; + onChanged(); + return leastInFlightBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder> + peakEwmaBuilder_; + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return Whether the peakEwma field is set. + */ + @java.lang.Override + public boolean hasPeakEwma() { + return loadBalancingStrategyCase_ == 2; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return The peakEwma. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getPeakEwma() { + if (peakEwmaBuilder_ == null) { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } else { + if (loadBalancingStrategyCase_ == 2) { + return peakEwmaBuilder_.getMessage(); + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder setPeakEwma(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma value) { + if (peakEwmaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingStrategy_ = value; + onChanged(); + } else { + peakEwmaBuilder_.setMessage(value); + } + loadBalancingStrategyCase_ = 2; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder setPeakEwma( + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder builderForValue) { + if (peakEwmaBuilder_ == null) { + loadBalancingStrategy_ = builderForValue.build(); + onChanged(); + } else { + peakEwmaBuilder_.setMessage(builderForValue.build()); + } + loadBalancingStrategyCase_ = 2; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder mergePeakEwma(com.google.bigtable.v2.LoadBalancingOptions.PeakEwma value) { + if (peakEwmaBuilder_ == null) { + if (loadBalancingStrategyCase_ == 2 + && loadBalancingStrategy_ + != com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance()) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.newBuilder( + (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_) + .mergeFrom(value) + .buildPartial(); + } else { + loadBalancingStrategy_ = value; + } + onChanged(); + } else { + if (loadBalancingStrategyCase_ == 2) { + peakEwmaBuilder_.mergeFrom(value); + } else { + peakEwmaBuilder_.setMessage(value); + } + } + loadBalancingStrategyCase_ = 2; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public Builder clearPeakEwma() { + if (peakEwmaBuilder_ == null) { + if (loadBalancingStrategyCase_ == 2) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + } + } else { + if (loadBalancingStrategyCase_ == 2) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + } + peakEwmaBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder getPeakEwmaBuilder() { + return internalGetPeakEwmaFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder getPeakEwmaOrBuilder() { + if ((loadBalancingStrategyCase_ == 2) && (peakEwmaBuilder_ != null)) { + return peakEwmaBuilder_.getMessageOrBuilder(); + } else { + if (loadBalancingStrategyCase_ == 2) { + return (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder> + internalGetPeakEwmaFieldBuilder() { + if (peakEwmaBuilder_ == null) { + if (!(loadBalancingStrategyCase_ == 2)) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.getDefaultInstance(); + } + peakEwmaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma.Builder, + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder>( + (com.google.bigtable.v2.LoadBalancingOptions.PeakEwma) loadBalancingStrategy_, + getParentForChildren(), + isClean()); + loadBalancingStrategy_ = null; + } + loadBalancingStrategyCase_ = 2; + onChanged(); + return peakEwmaBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.Random, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder, + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder> + randomBuilder_; + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return Whether the random field is set. + */ + @java.lang.Override + public boolean hasRandom() { + return loadBalancingStrategyCase_ == 4; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return The random. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.Random getRandom() { + if (randomBuilder_ == null) { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } else { + if (loadBalancingStrategyCase_ == 4) { + return randomBuilder_.getMessage(); + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder setRandom(com.google.bigtable.v2.LoadBalancingOptions.Random value) { + if (randomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingStrategy_ = value; + onChanged(); + } else { + randomBuilder_.setMessage(value); + } + loadBalancingStrategyCase_ = 4; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder setRandom( + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder builderForValue) { + if (randomBuilder_ == null) { + loadBalancingStrategy_ = builderForValue.build(); + onChanged(); + } else { + randomBuilder_.setMessage(builderForValue.build()); + } + loadBalancingStrategyCase_ = 4; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder mergeRandom(com.google.bigtable.v2.LoadBalancingOptions.Random value) { + if (randomBuilder_ == null) { + if (loadBalancingStrategyCase_ == 4 + && loadBalancingStrategy_ + != com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance()) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.Random.newBuilder( + (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_) + .mergeFrom(value) + .buildPartial(); + } else { + loadBalancingStrategy_ = value; + } + onChanged(); + } else { + if (loadBalancingStrategyCase_ == 4) { + randomBuilder_.mergeFrom(value); + } else { + randomBuilder_.setMessage(value); + } + } + loadBalancingStrategyCase_ = 4; + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public Builder clearRandom() { + if (randomBuilder_ == null) { + if (loadBalancingStrategyCase_ == 4) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + onChanged(); + } + } else { + if (loadBalancingStrategyCase_ == 4) { + loadBalancingStrategyCase_ = 0; + loadBalancingStrategy_ = null; + } + randomBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + public com.google.bigtable.v2.LoadBalancingOptions.Random.Builder getRandomBuilder() { + return internalGetRandomFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder getRandomOrBuilder() { + if ((loadBalancingStrategyCase_ == 4) && (randomBuilder_ != null)) { + return randomBuilder_.getMessageOrBuilder(); + } else { + if (loadBalancingStrategyCase_ == 4) { + return (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_; + } + return com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.Random, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder, + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder> + internalGetRandomFieldBuilder() { + if (randomBuilder_ == null) { + if (!(loadBalancingStrategyCase_ == 4)) { + loadBalancingStrategy_ = + com.google.bigtable.v2.LoadBalancingOptions.Random.getDefaultInstance(); + } + randomBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions.Random, + com.google.bigtable.v2.LoadBalancingOptions.Random.Builder, + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder>( + (com.google.bigtable.v2.LoadBalancingOptions.Random) loadBalancingStrategy_, + getParentForChildren(), + isClean()); + loadBalancingStrategy_ = null; + } + loadBalancingStrategyCase_ = 4; + onChanged(); + return randomBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.LoadBalancingOptions) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.LoadBalancingOptions) + private static final com.google.bigtable.v2.LoadBalancingOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.LoadBalancingOptions(); + } + + public static com.google.bigtable.v2.LoadBalancingOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LoadBalancingOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptionsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptionsOrBuilder.java new file mode 100644 index 000000000000..5d2b6f2fa4a5 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/LoadBalancingOptionsOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface LoadBalancingOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.LoadBalancingOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return Whether the leastInFlight field is set. + */ + boolean hasLeastInFlight(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; + * + * @return The leastInFlight. + */ + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlight getLeastInFlight(); + + /** .google.bigtable.v2.LoadBalancingOptions.LeastInFlight least_in_flight = 1; */ + com.google.bigtable.v2.LoadBalancingOptions.LeastInFlightOrBuilder getLeastInFlightOrBuilder(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return Whether the peakEwma field is set. + */ + boolean hasPeakEwma(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; + * + * @return The peakEwma. + */ + com.google.bigtable.v2.LoadBalancingOptions.PeakEwma getPeakEwma(); + + /** .google.bigtable.v2.LoadBalancingOptions.PeakEwma peak_ewma = 2; */ + com.google.bigtable.v2.LoadBalancingOptions.PeakEwmaOrBuilder getPeakEwmaOrBuilder(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return Whether the random field is set. + */ + boolean hasRandom(); + + /** + * .google.bigtable.v2.LoadBalancingOptions.Random random = 4; + * + * @return The random. + */ + com.google.bigtable.v2.LoadBalancingOptions.Random getRandom(); + + /** .google.bigtable.v2.LoadBalancingOptions.Random random = 4; */ + com.google.bigtable.v2.LoadBalancingOptions.RandomOrBuilder getRandomOrBuilder(); + + com.google.bigtable.v2.LoadBalancingOptions.LoadBalancingStrategyCase + getLoadBalancingStrategyCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequest.java new file mode 100644 index 000000000000..af602741d475 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequest.java @@ -0,0 +1,705 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A request wrapper for operations on a materialized view. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class MaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MaterializedViewRequest) + MaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MaterializedViewRequest"); + } + + // Use MaterializedViewRequest.newBuilder() to construct. + private MaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MaterializedViewRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewRequest.class, + com.google.bigtable.v2.MaterializedViewRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.MaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.MaterializedViewRequest other = + (com.google.bigtable.v2.MaterializedViewRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewRequest 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.v2.MaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewRequest 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.v2.MaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.MaterializedViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A request wrapper for operations on a materialized view. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MaterializedViewRequest) + com.google.bigtable.v2.MaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewRequest.class, + com.google.bigtable.v2.MaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.MaterializedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.MaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewRequest build() { + com.google.bigtable.v2.MaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewRequest buildPartial() { + com.google.bigtable.v2.MaterializedViewRequest result = + new com.google.bigtable.v2.MaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.MaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.MaterializedViewRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MaterializedViewRequest) { + return mergeFrom((com.google.bigtable.v2.MaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MaterializedViewRequest other) { + if (other == com.google.bigtable.v2.MaterializedViewRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowRequest.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowRequest.newBuilder( + (com.google.bigtable.v2.SessionReadRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowRequest.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionReadRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MaterializedViewRequest) + private static final com.google.bigtable.v2.MaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MaterializedViewRequest(); + } + + public static com.google.bigtable.v2.MaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..09d0c7e81d2a --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewRequestOrBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowRequest getReadRow(); + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder(); + + com.google.bigtable.v2.MaterializedViewRequest.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponse.java new file mode 100644 index 000000000000..8bfc871eaf41 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponse.java @@ -0,0 +1,708 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * A response wrapper for operations on a materialized view. Internal usage
+ * only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewResponse} + */ +@com.google.protobuf.Generated +public final class MaterializedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.MaterializedViewResponse) + MaterializedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MaterializedViewResponse"); + } + + // Use MaterializedViewResponse.newBuilder() to construct. + private MaterializedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MaterializedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewResponse.class, + com.google.bigtable.v2.MaterializedViewResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.MaterializedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.MaterializedViewResponse other = + (com.google.bigtable.v2.MaterializedViewResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewResponse 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.v2.MaterializedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewResponse 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.v2.MaterializedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.MaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.MaterializedViewResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A response wrapper for operations on a materialized view. Internal usage
+   * only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.MaterializedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.MaterializedViewResponse) + com.google.bigtable.v2.MaterializedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.MaterializedViewResponse.class, + com.google.bigtable.v2.MaterializedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.MaterializedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.MaterializedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewResponse build() { + com.google.bigtable.v2.MaterializedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewResponse buildPartial() { + com.google.bigtable.v2.MaterializedViewResponse result = + new com.google.bigtable.v2.MaterializedViewResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.MaterializedViewResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.MaterializedViewResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.MaterializedViewResponse) { + return mergeFrom((com.google.bigtable.v2.MaterializedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.MaterializedViewResponse other) { + if (other == com.google.bigtable.v2.MaterializedViewResponse.getDefaultInstance()) + return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowResponse.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowResponse.newBuilder( + (com.google.bigtable.v2.SessionReadRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowResponse.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionReadRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MaterializedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.MaterializedViewResponse) + private static final com.google.bigtable.v2.MaterializedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.MaterializedViewResponse(); + } + + public static com.google.bigtable.v2.MaterializedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaterializedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.MaterializedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponseOrBuilder.java new file mode 100644 index 000000000000..ab9241e6de6b --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewResponseOrBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface MaterializedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.MaterializedViewResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowResponse getReadRow(); + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder(); + + com.google.bigtable.v2.MaterializedViewResponse.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequest.java new file mode 100644 index 000000000000..57b67a81a5e5 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequest.java @@ -0,0 +1,1076 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Open sessions for an AuthorizedView. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewRequest} + */ +@com.google.protobuf.Generated +public final class OpenAuthorizedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenAuthorizedViewRequest) + OpenAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenAuthorizedViewRequest"); + } + + // Use OpenAuthorizedViewRequest.newBuilder() to construct. + private OpenAuthorizedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenAuthorizedViewRequest() { + authorizedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewRequest.class, + com.google.bigtable.v2.OpenAuthorizedViewRequest.Builder.class); + } + + /** Protobuf enum {@code google.bigtable.v2.OpenAuthorizedViewRequest.Permission} */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** PERMISSION_UNSET = 0; */ + PERMISSION_UNSET(0), + /** PERMISSION_READ = 1; */ + PERMISSION_READ(1), + /** PERMISSION_WRITE = 2; */ + PERMISSION_WRITE(2), + /** PERMISSION_READ_WRITE = 3; */ + PERMISSION_READ_WRITE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Permission"); + } + + /** PERMISSION_UNSET = 0; */ + public static final int PERMISSION_UNSET_VALUE = 0; + + /** PERMISSION_READ = 1; */ + public static final int PERMISSION_READ_VALUE = 1; + + /** PERMISSION_WRITE = 2; */ + public static final int PERMISSION_WRITE_VALUE = 2; + + /** PERMISSION_READ_WRITE = 3; */ + public static final int PERMISSION_READ_WRITE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSET; + case 1: + return PERMISSION_READ; + case 2: + return PERMISSION_WRITE; + case 3: + return PERMISSION_READ_WRITE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Permission findValueByNumber(int number) { + return Permission.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.OpenAuthorizedViewRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.OpenAuthorizedViewRequest.Permission) + } + + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + 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(); + authorizedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + @java.lang.Override + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + 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(); + appProfileId_ = s; + return s; + } + } + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PERMISSION_FIELD_NUMBER = 3; + private int permission_ = 0; + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission result = + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + output.writeEnum(3, permission_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, authorizedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, permission_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenAuthorizedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenAuthorizedViewRequest other = + (com.google.bigtable.v2.OpenAuthorizedViewRequest) obj; + + if (!getAuthorizedViewName().equals(other.getAuthorizedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (permission_ != other.permission_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AUTHORIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + permission_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest 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.v2.OpenAuthorizedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest 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.v2.OpenAuthorizedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenAuthorizedViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Open sessions for an AuthorizedView. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenAuthorizedViewRequest) + com.google.bigtable.v2.OpenAuthorizedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewRequest.class, + com.google.bigtable.v2.OpenAuthorizedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenAuthorizedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + authorizedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenAuthorizedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest build() { + com.google.bigtable.v2.OpenAuthorizedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest buildPartial() { + com.google.bigtable.v2.OpenAuthorizedViewRequest result = + new com.google.bigtable.v2.OpenAuthorizedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenAuthorizedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.authorizedViewName_ = authorizedViewName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.permission_ = permission_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenAuthorizedViewRequest) { + return mergeFrom((com.google.bigtable.v2.OpenAuthorizedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenAuthorizedViewRequest other) { + if (other == com.google.bigtable.v2.OpenAuthorizedViewRequest.getDefaultInstance()) + return this; + if (!other.getAuthorizedViewName().isEmpty()) { + authorizedViewName_ = other.authorizedViewName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.permission_ != 0) { + setPermissionValue(other.getPermissionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + authorizedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + permission_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object authorizedViewName_ = ""; + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Authorized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+     * 
+ * + * string authorized_view_name = 1; + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appProfileId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @param value The appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the authorized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @param value The bytes for appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int permission_ = 0; + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @param value The enum numeric value on the wire for permission to set. + * @return This builder for chaining. + */ + public Builder setPermissionValue(int value) { + permission_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission result = + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @param value The permission to set. + * @return This builder for chaining. + */ + public Builder setPermission( + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + permission_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return This builder for chaining. + */ + public Builder clearPermission() { + bitField0_ = (bitField0_ & ~0x00000004); + permission_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenAuthorizedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenAuthorizedViewRequest) + private static final com.google.bigtable.v2.OpenAuthorizedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenAuthorizedViewRequest(); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenAuthorizedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequestOrBuilder.java new file mode 100644 index 000000000000..1844ca34fb51 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenAuthorizedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenAuthorizedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The authorizedViewName. + */ + java.lang.String getAuthorizedViewName(); + + /** + * + * + *
+   * The Authorized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
+   * 
+ * + * string authorized_view_name = 1; + * + * @return The bytes for authorizedViewName. + */ + com.google.protobuf.ByteString getAuthorizedViewNameBytes(); + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * The app profile id to use for the authorized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + int getPermissionValue(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenAuthorizedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + com.google.bigtable.v2.OpenAuthorizedViewRequest.Permission getPermission(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponse.java new file mode 100644 index 000000000000..a9aa9e13818e --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponse.java @@ -0,0 +1,396 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewResponse} + */ +@com.google.protobuf.Generated +public final class OpenAuthorizedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenAuthorizedViewResponse) + OpenAuthorizedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenAuthorizedViewResponse"); + } + + // Use OpenAuthorizedViewResponse.newBuilder() to construct. + private OpenAuthorizedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenAuthorizedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewResponse.class, + com.google.bigtable.v2.OpenAuthorizedViewResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenAuthorizedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenAuthorizedViewResponse other = + (com.google.bigtable.v2.OpenAuthorizedViewResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse 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.v2.OpenAuthorizedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse 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.v2.OpenAuthorizedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenAuthorizedViewResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenAuthorizedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenAuthorizedViewResponse) + com.google.bigtable.v2.OpenAuthorizedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenAuthorizedViewResponse.class, + com.google.bigtable.v2.OpenAuthorizedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenAuthorizedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenAuthorizedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewResponse build() { + com.google.bigtable.v2.OpenAuthorizedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewResponse buildPartial() { + com.google.bigtable.v2.OpenAuthorizedViewResponse result = + new com.google.bigtable.v2.OpenAuthorizedViewResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenAuthorizedViewResponse) { + return mergeFrom((com.google.bigtable.v2.OpenAuthorizedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenAuthorizedViewResponse other) { + if (other == com.google.bigtable.v2.OpenAuthorizedViewResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenAuthorizedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenAuthorizedViewResponse) + private static final com.google.bigtable.v2.OpenAuthorizedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenAuthorizedViewResponse(); + } + + public static com.google.bigtable.v2.OpenAuthorizedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenAuthorizedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenAuthorizedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponseOrBuilder.java new file mode 100644 index 000000000000..41487837a96d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenAuthorizedViewResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenAuthorizedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenAuthorizedViewResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequest.java new file mode 100644 index 000000000000..46af0c122736 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequest.java @@ -0,0 +1,1064 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Open sessions for a MaterializedView. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewRequest} + */ +@com.google.protobuf.Generated +public final class OpenMaterializedViewRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenMaterializedViewRequest) + OpenMaterializedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenMaterializedViewRequest"); + } + + // Use OpenMaterializedViewRequest.newBuilder() to construct. + private OpenMaterializedViewRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenMaterializedViewRequest() { + materializedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewRequest.class, + com.google.bigtable.v2.OpenMaterializedViewRequest.Builder.class); + } + + /** Protobuf enum {@code google.bigtable.v2.OpenMaterializedViewRequest.Permission} */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** PERMISSION_UNSET = 0; */ + PERMISSION_UNSET(0), + /** PERMISSION_READ = 1; */ + PERMISSION_READ(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Permission"); + } + + /** PERMISSION_UNSET = 0; */ + public static final int PERMISSION_UNSET_VALUE = 0; + + /** PERMISSION_READ = 1; */ + public static final int PERMISSION_READ_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSET; + case 1: + return PERMISSION_READ; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Permission findValueByNumber(int number) { + return Permission.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.OpenMaterializedViewRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.OpenMaterializedViewRequest.Permission) + } + + public static final int MATERIALIZED_VIEW_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The materializedViewName. + */ + @java.lang.Override + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + 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(); + materializedViewName_ = s; + return s; + } + } + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The bytes for materializedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + @java.lang.Override + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + 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(); + appProfileId_ = s; + return s; + } + } + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PERMISSION_FIELD_NUMBER = 3; + private int permission_ = 0; + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission result = + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, materializedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + output.writeEnum(3, permission_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, materializedViewName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.PERMISSION_UNSET + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, permission_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenMaterializedViewRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenMaterializedViewRequest other = + (com.google.bigtable.v2.OpenMaterializedViewRequest) obj; + + if (!getMaterializedViewName().equals(other.getMaterializedViewName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (permission_ != other.permission_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MATERIALIZED_VIEW_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaterializedViewName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + permission_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest 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.v2.OpenMaterializedViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest 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.v2.OpenMaterializedViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenMaterializedViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Open sessions for a MaterializedView. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenMaterializedViewRequest) + com.google.bigtable.v2.OpenMaterializedViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewRequest.class, + com.google.bigtable.v2.OpenMaterializedViewRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenMaterializedViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + materializedViewName_ = ""; + appProfileId_ = ""; + permission_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenMaterializedViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest build() { + com.google.bigtable.v2.OpenMaterializedViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest buildPartial() { + com.google.bigtable.v2.OpenMaterializedViewRequest result = + new com.google.bigtable.v2.OpenMaterializedViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenMaterializedViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.materializedViewName_ = materializedViewName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.permission_ = permission_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenMaterializedViewRequest) { + return mergeFrom((com.google.bigtable.v2.OpenMaterializedViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenMaterializedViewRequest other) { + if (other == com.google.bigtable.v2.OpenMaterializedViewRequest.getDefaultInstance()) + return this; + if (!other.getMaterializedViewName().isEmpty()) { + materializedViewName_ = other.materializedViewName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.permission_ != 0) { + setPermissionValue(other.getPermissionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + materializedViewName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + permission_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object materializedViewName_ = ""; + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @return The materializedViewName. + */ + public java.lang.String getMaterializedViewName() { + java.lang.Object ref = materializedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + materializedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @return The bytes for materializedViewName. + */ + public com.google.protobuf.ByteString getMaterializedViewNameBytes() { + java.lang.Object ref = materializedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + materializedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @param value The materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + materializedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaterializedViewName() { + materializedViewName_ = getDefaultInstance().getMaterializedViewName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Materialized view name to read and write from. Values are of the form
+     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+     * 
+ * + * string materialized_view_name = 1; + * + * @param value The bytes for materializedViewName to set. + * @return This builder for chaining. + */ + public Builder setMaterializedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + materializedViewName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appProfileId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @param value The appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The app profile id to use for the materialized view sessions.
+     * 
+ * + * string app_profile_id = 2; + * + * @param value The bytes for appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int permission_ = 0; + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @param value The enum numeric value on the wire for permission to set. + * @return This builder for chaining. + */ + public Builder setPermissionValue(int value) { + permission_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest.Permission getPermission() { + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission result = + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenMaterializedViewRequest.Permission.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @param value The permission to set. + * @return This builder for chaining. + */ + public Builder setPermission( + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + permission_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Permission for the session.
+     * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return This builder for chaining. + */ + public Builder clearPermission() { + bitField0_ = (bitField0_ & ~0x00000004); + permission_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenMaterializedViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenMaterializedViewRequest) + private static final com.google.bigtable.v2.OpenMaterializedViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenMaterializedViewRequest(); + } + + public static com.google.bigtable.v2.OpenMaterializedViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenMaterializedViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequestOrBuilder.java new file mode 100644 index 000000000000..e020a78e4615 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenMaterializedViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenMaterializedViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The materializedViewName. + */ + java.lang.String getMaterializedViewName(); + + /** + * + * + *
+   * The Materialized view name to read and write from. Values are of the form
+   * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
+   * 
+ * + * string materialized_view_name = 1; + * + * @return The bytes for materializedViewName. + */ + com.google.protobuf.ByteString getMaterializedViewNameBytes(); + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * + * + *
+   * The app profile id to use for the materialized view sessions.
+   * 
+ * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + int getPermissionValue(); + + /** + * + * + *
+   * Permission for the session.
+   * 
+ * + * .google.bigtable.v2.OpenMaterializedViewRequest.Permission permission = 3; + * + * @return The permission. + */ + com.google.bigtable.v2.OpenMaterializedViewRequest.Permission getPermission(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponse.java new file mode 100644 index 000000000000..37d6086066ea --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponse.java @@ -0,0 +1,396 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewResponse} + */ +@com.google.protobuf.Generated +public final class OpenMaterializedViewResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenMaterializedViewResponse) + OpenMaterializedViewResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenMaterializedViewResponse"); + } + + // Use OpenMaterializedViewResponse.newBuilder() to construct. + private OpenMaterializedViewResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenMaterializedViewResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewResponse.class, + com.google.bigtable.v2.OpenMaterializedViewResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenMaterializedViewResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenMaterializedViewResponse other = + (com.google.bigtable.v2.OpenMaterializedViewResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse 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.v2.OpenMaterializedViewResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse 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.v2.OpenMaterializedViewResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenMaterializedViewResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenMaterializedViewResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenMaterializedViewResponse) + com.google.bigtable.v2.OpenMaterializedViewResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenMaterializedViewResponse.class, + com.google.bigtable.v2.OpenMaterializedViewResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenMaterializedViewResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenMaterializedViewResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewResponse build() { + com.google.bigtable.v2.OpenMaterializedViewResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewResponse buildPartial() { + com.google.bigtable.v2.OpenMaterializedViewResponse result = + new com.google.bigtable.v2.OpenMaterializedViewResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenMaterializedViewResponse) { + return mergeFrom((com.google.bigtable.v2.OpenMaterializedViewResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenMaterializedViewResponse other) { + if (other == com.google.bigtable.v2.OpenMaterializedViewResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenMaterializedViewResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenMaterializedViewResponse) + private static final com.google.bigtable.v2.OpenMaterializedViewResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenMaterializedViewResponse(); + } + + public static com.google.bigtable.v2.OpenMaterializedViewResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenMaterializedViewResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenMaterializedViewResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponseOrBuilder.java new file mode 100644 index 000000000000..f37e4cd2a843 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenMaterializedViewResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenMaterializedViewResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenMaterializedViewResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequest.java new file mode 100644 index 000000000000..1b7374f77b08 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequest.java @@ -0,0 +1,1108 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionRequest} + */ +@com.google.protobuf.Generated +public final class OpenSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenSessionRequest) + OpenSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenSessionRequest"); + } + + // Use OpenSessionRequest.newBuilder() to construct. + private OpenSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenSessionRequest() { + routingCookie_ = com.google.protobuf.ByteString.EMPTY; + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionRequest.class, + com.google.bigtable.v2.OpenSessionRequest.Builder.class); + } + + private int bitField0_; + public static final int PROTOCOL_VERSION_FIELD_NUMBER = 1; + private long protocolVersion_ = 0L; + + /** + * + * + *
+   * A version indicator from the client stating its understanding of the
+   * protocol. This is to disambiguate client behavior amidst changes in
+   * semantic usage of the API, e.g. if the structure remains the same but
+   * behavior changes.
+   * 
+ * + * int64 protocol_version = 1; + * + * @return The protocolVersion. + */ + @java.lang.Override + public long getProtocolVersion() { + return protocolVersion_; + } + + public static final int FLAGS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.FeatureFlags flags_; + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return Whether the flags field is set. + */ + @java.lang.Override + public boolean hasFlags() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return The flags. + */ + @java.lang.Override + public com.google.bigtable.v2.FeatureFlags getFlags() { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.FeatureFlagsOrBuilder getFlagsOrBuilder() { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } + + public static final int CONSECUTIVE_FAILED_CONNECTION_ATTEMPTS_FIELD_NUMBER = 3; + private long consecutiveFailedConnectionAttempts_ = 0L; + + /** + * + * + *
+   * Used for serverside observability.
+   * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return The consecutiveFailedConnectionAttempts. + */ + @java.lang.Override + public long getConsecutiveFailedConnectionAttempts() { + return consecutiveFailedConnectionAttempts_; + } + + public static final int ROUTING_COOKIE_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString routingCookie_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * How the request should be routed (if presented as part of a GOAWAY
+   * from a previous session). Post V1.
+   * 
+ * + * bytes routing_cookie = 4; + * + * @return The routingCookie. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingCookie() { + return routingCookie_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+   * (or in post-V1, PrepareSqlQueryRequest)
+   * 
+ * + * bytes payload = 5; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (protocolVersion_ != 0L) { + output.writeInt64(1, protocolVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFlags()); + } + if (consecutiveFailedConnectionAttempts_ != 0L) { + output.writeInt64(3, consecutiveFailedConnectionAttempts_); + } + if (!routingCookie_.isEmpty()) { + output.writeBytes(4, routingCookie_); + } + if (!payload_.isEmpty()) { + output.writeBytes(5, payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (protocolVersion_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, protocolVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFlags()); + } + if (consecutiveFailedConnectionAttempts_ != 0L) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 3, consecutiveFailedConnectionAttempts_); + } + if (!routingCookie_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, routingCookie_); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenSessionRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenSessionRequest other = + (com.google.bigtable.v2.OpenSessionRequest) obj; + + if (getProtocolVersion() != other.getProtocolVersion()) return false; + if (hasFlags() != other.hasFlags()) return false; + if (hasFlags()) { + if (!getFlags().equals(other.getFlags())) return false; + } + if (getConsecutiveFailedConnectionAttempts() != other.getConsecutiveFailedConnectionAttempts()) + return false; + if (!getRoutingCookie().equals(other.getRoutingCookie())) return false; + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROTOCOL_VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getProtocolVersion()); + if (hasFlags()) { + hash = (37 * hash) + FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getFlags().hashCode(); + } + hash = (37 * hash) + CONSECUTIVE_FAILED_CONNECTION_ATTEMPTS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(getConsecutiveFailedConnectionAttempts()); + hash = (37 * hash) + ROUTING_COOKIE_FIELD_NUMBER; + hash = (53 * hash) + getRoutingCookie().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionRequest 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.v2.OpenSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionRequest 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.v2.OpenSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenSessionRequest) + com.google.bigtable.v2.OpenSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionRequest.class, + com.google.bigtable.v2.OpenSessionRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFlagsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + protocolVersion_ = 0L; + flags_ = null; + if (flagsBuilder_ != null) { + flagsBuilder_.dispose(); + flagsBuilder_ = null; + } + consecutiveFailedConnectionAttempts_ = 0L; + routingCookie_ = com.google.protobuf.ByteString.EMPTY; + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest build() { + com.google.bigtable.v2.OpenSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest buildPartial() { + com.google.bigtable.v2.OpenSessionRequest result = + new com.google.bigtable.v2.OpenSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.protocolVersion_ = protocolVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.flags_ = flagsBuilder_ == null ? flags_ : flagsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.consecutiveFailedConnectionAttempts_ = consecutiveFailedConnectionAttempts_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.routingCookie_ = routingCookie_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenSessionRequest) { + return mergeFrom((com.google.bigtable.v2.OpenSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenSessionRequest other) { + if (other == com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance()) return this; + if (other.getProtocolVersion() != 0L) { + setProtocolVersion(other.getProtocolVersion()); + } + if (other.hasFlags()) { + mergeFlags(other.getFlags()); + } + if (other.getConsecutiveFailedConnectionAttempts() != 0L) { + setConsecutiveFailedConnectionAttempts(other.getConsecutiveFailedConnectionAttempts()); + } + if (!other.getRoutingCookie().isEmpty()) { + setRoutingCookie(other.getRoutingCookie()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + protocolVersion_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(internalGetFlagsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + consecutiveFailedConnectionAttempts_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + routingCookie_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long protocolVersion_; + + /** + * + * + *
+     * A version indicator from the client stating its understanding of the
+     * protocol. This is to disambiguate client behavior amidst changes in
+     * semantic usage of the API, e.g. if the structure remains the same but
+     * behavior changes.
+     * 
+ * + * int64 protocol_version = 1; + * + * @return The protocolVersion. + */ + @java.lang.Override + public long getProtocolVersion() { + return protocolVersion_; + } + + /** + * + * + *
+     * A version indicator from the client stating its understanding of the
+     * protocol. This is to disambiguate client behavior amidst changes in
+     * semantic usage of the API, e.g. if the structure remains the same but
+     * behavior changes.
+     * 
+ * + * int64 protocol_version = 1; + * + * @param value The protocolVersion to set. + * @return This builder for chaining. + */ + public Builder setProtocolVersion(long value) { + + protocolVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A version indicator from the client stating its understanding of the
+     * protocol. This is to disambiguate client behavior amidst changes in
+     * semantic usage of the API, e.g. if the structure remains the same but
+     * behavior changes.
+     * 
+ * + * int64 protocol_version = 1; + * + * @return This builder for chaining. + */ + public Builder clearProtocolVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + protocolVersion_ = 0L; + onChanged(); + return this; + } + + private com.google.bigtable.v2.FeatureFlags flags_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FeatureFlags, + com.google.bigtable.v2.FeatureFlags.Builder, + com.google.bigtable.v2.FeatureFlagsOrBuilder> + flagsBuilder_; + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return Whether the flags field is set. + */ + public boolean hasFlags() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return The flags. + */ + public com.google.bigtable.v2.FeatureFlags getFlags() { + if (flagsBuilder_ == null) { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } else { + return flagsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder setFlags(com.google.bigtable.v2.FeatureFlags value) { + if (flagsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flags_ = value; + } else { + flagsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder setFlags(com.google.bigtable.v2.FeatureFlags.Builder builderForValue) { + if (flagsBuilder_ == null) { + flags_ = builderForValue.build(); + } else { + flagsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder mergeFlags(com.google.bigtable.v2.FeatureFlags value) { + if (flagsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && flags_ != null + && flags_ != com.google.bigtable.v2.FeatureFlags.getDefaultInstance()) { + getFlagsBuilder().mergeFrom(value); + } else { + flags_ = value; + } + } else { + flagsBuilder_.mergeFrom(value); + } + if (flags_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public Builder clearFlags() { + bitField0_ = (bitField0_ & ~0x00000002); + flags_ = null; + if (flagsBuilder_ != null) { + flagsBuilder_.dispose(); + flagsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public com.google.bigtable.v2.FeatureFlags.Builder getFlagsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFlagsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + public com.google.bigtable.v2.FeatureFlagsOrBuilder getFlagsOrBuilder() { + if (flagsBuilder_ != null) { + return flagsBuilder_.getMessageOrBuilder(); + } else { + return flags_ == null ? com.google.bigtable.v2.FeatureFlags.getDefaultInstance() : flags_; + } + } + + /** + * + * + *
+     * Client settings, including a record of
+     * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FeatureFlags, + com.google.bigtable.v2.FeatureFlags.Builder, + com.google.bigtable.v2.FeatureFlagsOrBuilder> + internalGetFlagsFieldBuilder() { + if (flagsBuilder_ == null) { + flagsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.FeatureFlags, + com.google.bigtable.v2.FeatureFlags.Builder, + com.google.bigtable.v2.FeatureFlagsOrBuilder>( + getFlags(), getParentForChildren(), isClean()); + flags_ = null; + } + return flagsBuilder_; + } + + private long consecutiveFailedConnectionAttempts_; + + /** + * + * + *
+     * Used for serverside observability.
+     * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return The consecutiveFailedConnectionAttempts. + */ + @java.lang.Override + public long getConsecutiveFailedConnectionAttempts() { + return consecutiveFailedConnectionAttempts_; + } + + /** + * + * + *
+     * Used for serverside observability.
+     * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @param value The consecutiveFailedConnectionAttempts to set. + * @return This builder for chaining. + */ + public Builder setConsecutiveFailedConnectionAttempts(long value) { + + consecutiveFailedConnectionAttempts_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Used for serverside observability.
+     * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return This builder for chaining. + */ + public Builder clearConsecutiveFailedConnectionAttempts() { + bitField0_ = (bitField0_ & ~0x00000004); + consecutiveFailedConnectionAttempts_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString routingCookie_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * How the request should be routed (if presented as part of a GOAWAY
+     * from a previous session). Post V1.
+     * 
+ * + * bytes routing_cookie = 4; + * + * @return The routingCookie. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoutingCookie() { + return routingCookie_; + } + + /** + * + * + *
+     * How the request should be routed (if presented as part of a GOAWAY
+     * from a previous session). Post V1.
+     * 
+ * + * bytes routing_cookie = 4; + * + * @param value The routingCookie to set. + * @return This builder for chaining. + */ + public Builder setRoutingCookie(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + routingCookie_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * How the request should be routed (if presented as part of a GOAWAY
+     * from a previous session). Post V1.
+     * 
+ * + * bytes routing_cookie = 4; + * + * @return This builder for chaining. + */ + public Builder clearRoutingCookie() { + bitField0_ = (bitField0_ & ~0x00000008); + routingCookie_ = getDefaultInstance().getRoutingCookie(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+     * (or in post-V1, PrepareSqlQueryRequest)
+     * 
+ * + * bytes payload = 5; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+     * (or in post-V1, PrepareSqlQueryRequest)
+     * 
+ * + * bytes payload = 5; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+     * (or in post-V1, PrepareSqlQueryRequest)
+     * 
+ * + * bytes payload = 5; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000010); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenSessionRequest) + private static final com.google.bigtable.v2.OpenSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenSessionRequest(); + } + + public static com.google.bigtable.v2.OpenSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequestOrBuilder.java new file mode 100644 index 000000000000..0ec579f66c5b --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A version indicator from the client stating its understanding of the
+   * protocol. This is to disambiguate client behavior amidst changes in
+   * semantic usage of the API, e.g. if the structure remains the same but
+   * behavior changes.
+   * 
+ * + * int64 protocol_version = 1; + * + * @return The protocolVersion. + */ + long getProtocolVersion(); + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return Whether the flags field is set. + */ + boolean hasFlags(); + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + * + * @return The flags. + */ + com.google.bigtable.v2.FeatureFlags getFlags(); + + /** + * + * + *
+   * Client settings, including a record of
+   * 
+ * + * .google.bigtable.v2.FeatureFlags flags = 2; + */ + com.google.bigtable.v2.FeatureFlagsOrBuilder getFlagsOrBuilder(); + + /** + * + * + *
+   * Used for serverside observability.
+   * 
+ * + * int64 consecutive_failed_connection_attempts = 3; + * + * @return The consecutiveFailedConnectionAttempts. + */ + long getConsecutiveFailedConnectionAttempts(); + + /** + * + * + *
+   * How the request should be routed (if presented as part of a GOAWAY
+   * from a previous session). Post V1.
+   * 
+ * + * bytes routing_cookie = 4; + * + * @return The routingCookie. + */ + com.google.protobuf.ByteString getRoutingCookie(); + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Request,
+   * (or in post-V1, PrepareSqlQueryRequest)
+   * 
+ * + * bytes payload = 5; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponse.java new file mode 100644 index 000000000000..241c47f12a7c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponse.java @@ -0,0 +1,801 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionResponse} + */ +@com.google.protobuf.Generated +public final class OpenSessionResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenSessionResponse) + OpenSessionResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenSessionResponse"); + } + + // Use OpenSessionResponse.newBuilder() to construct. + private OpenSessionResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenSessionResponse() { + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionResponse.class, + com.google.bigtable.v2.OpenSessionResponse.Builder.class); + } + + private int bitField0_; + public static final int BACKEND_FIELD_NUMBER = 2; + private com.google.bigtable.v2.BackendIdentifier backend_; + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return Whether the backend field is set. + */ + @java.lang.Override + public boolean hasBackend() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return The backend. + */ + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifier getBackend() { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.BackendIdentifierOrBuilder getBackendOrBuilder() { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+   * (or in post-V1, PrepareSqlQueryResponse)
+   * 
+ * + * bytes payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!payload_.isEmpty()) { + output.writeBytes(1, payload_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getBackend()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, payload_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBackend()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenSessionResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenSessionResponse other = + (com.google.bigtable.v2.OpenSessionResponse) obj; + + if (hasBackend() != other.hasBackend()) return false; + if (hasBackend()) { + if (!getBackend().equals(other.getBackend())) return false; + } + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackend()) { + hash = (37 * hash) + BACKEND_FIELD_NUMBER; + hash = (53 * hash) + getBackend().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionResponse 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.v2.OpenSessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionResponse 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.v2.OpenSessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenSessionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenSessionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenSessionResponse) + com.google.bigtable.v2.OpenSessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenSessionResponse.class, + com.google.bigtable.v2.OpenSessionResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenSessionResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackendFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backend_ = null; + if (backendBuilder_ != null) { + backendBuilder_.dispose(); + backendBuilder_ = null; + } + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse build() { + com.google.bigtable.v2.OpenSessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse buildPartial() { + com.google.bigtable.v2.OpenSessionResponse result = + new com.google.bigtable.v2.OpenSessionResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenSessionResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backend_ = backendBuilder_ == null ? backend_ : backendBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenSessionResponse) { + return mergeFrom((com.google.bigtable.v2.OpenSessionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenSessionResponse other) { + if (other == com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance()) return this; + if (other.hasBackend()) { + mergeBackend(other.getBackend()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetBackendFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.BackendIdentifier backend_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.BackendIdentifier, + com.google.bigtable.v2.BackendIdentifier.Builder, + com.google.bigtable.v2.BackendIdentifierOrBuilder> + backendBuilder_; + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return Whether the backend field is set. + */ + public boolean hasBackend() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return The backend. + */ + public com.google.bigtable.v2.BackendIdentifier getBackend() { + if (backendBuilder_ == null) { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } else { + return backendBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder setBackend(com.google.bigtable.v2.BackendIdentifier value) { + if (backendBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backend_ = value; + } else { + backendBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder setBackend(com.google.bigtable.v2.BackendIdentifier.Builder builderForValue) { + if (backendBuilder_ == null) { + backend_ = builderForValue.build(); + } else { + backendBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder mergeBackend(com.google.bigtable.v2.BackendIdentifier value) { + if (backendBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backend_ != null + && backend_ != com.google.bigtable.v2.BackendIdentifier.getDefaultInstance()) { + getBackendBuilder().mergeFrom(value); + } else { + backend_ = value; + } + } else { + backendBuilder_.mergeFrom(value); + } + if (backend_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public Builder clearBackend() { + bitField0_ = (bitField0_ & ~0x00000001); + backend_ = null; + if (backendBuilder_ != null) { + backendBuilder_.dispose(); + backendBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public com.google.bigtable.v2.BackendIdentifier.Builder getBackendBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackendFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + public com.google.bigtable.v2.BackendIdentifierOrBuilder getBackendOrBuilder() { + if (backendBuilder_ != null) { + return backendBuilder_.getMessageOrBuilder(); + } else { + return backend_ == null + ? com.google.bigtable.v2.BackendIdentifier.getDefaultInstance() + : backend_; + } + } + + /** + * + * + *
+     * Information on the backend(s) that are hosting this session.
+     * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.BackendIdentifier, + com.google.bigtable.v2.BackendIdentifier.Builder, + com.google.bigtable.v2.BackendIdentifierOrBuilder> + internalGetBackendFieldBuilder() { + if (backendBuilder_ == null) { + backendBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.BackendIdentifier, + com.google.bigtable.v2.BackendIdentifier.Builder, + com.google.bigtable.v2.BackendIdentifierOrBuilder>( + getBackend(), getParentForChildren(), isClean()); + backend_ = null; + } + return backendBuilder_; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+     * (or in post-V1, PrepareSqlQueryResponse)
+     * 
+ * + * bytes payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+     * (or in post-V1, PrepareSqlQueryResponse)
+     * 
+ * + * bytes payload = 1; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+     * (or in post-V1, PrepareSqlQueryResponse)
+     * 
+ * + * bytes payload = 1; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000002); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenSessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenSessionResponse) + private static final com.google.bigtable.v2.OpenSessionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenSessionResponse(); + } + + public static com.google.bigtable.v2.OpenSessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenSessionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponseOrBuilder.java new file mode 100644 index 000000000000..c27747a34028 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenSessionResponseOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenSessionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenSessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return Whether the backend field is set. + */ + boolean hasBackend(); + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + * + * @return The backend. + */ + com.google.bigtable.v2.BackendIdentifier getBackend(); + + /** + * + * + *
+   * Information on the backend(s) that are hosting this session.
+   * 
+ * + * .google.bigtable.v2.BackendIdentifier backend = 2; + */ + com.google.bigtable.v2.BackendIdentifierOrBuilder getBackendOrBuilder(); + + /** + * + * + *
+   * Can be Open{Table,AuthorizedView,MaterializedView}Response,
+   * (or in post-V1, PrepareSqlQueryResponse)
+   * 
+ * + * bytes payload = 1; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequest.java new file mode 100644 index 000000000000..924a7926f468 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequest.java @@ -0,0 +1,938 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableRequest} + */ +@com.google.protobuf.Generated +public final class OpenTableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenTableRequest) + OpenTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenTableRequest"); + } + + // Use OpenTableRequest.newBuilder() to construct. + private OpenTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenTableRequest() { + tableName_ = ""; + appProfileId_ = ""; + permission_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableRequest.class, + com.google.bigtable.v2.OpenTableRequest.Builder.class); + } + + /** Protobuf enum {@code google.bigtable.v2.OpenTableRequest.Permission} */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** PERMISSION_UNSET = 0; */ + PERMISSION_UNSET(0), + /** PERMISSION_READ = 1; */ + PERMISSION_READ(1), + /** PERMISSION_WRITE = 2; */ + PERMISSION_WRITE(2), + /** PERMISSION_READ_WRITE = 3; */ + PERMISSION_READ_WRITE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Permission"); + } + + /** PERMISSION_UNSET = 0; */ + public static final int PERMISSION_UNSET_VALUE = 0; + + /** PERMISSION_READ = 1; */ + public static final int PERMISSION_READ_VALUE = 1; + + /** PERMISSION_WRITE = 2; */ + public static final int PERMISSION_WRITE_VALUE = 2; + + /** PERMISSION_READ_WRITE = 3; */ + public static final int PERMISSION_READ_WRITE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSET; + case 1: + return PERMISSION_READ; + case 2: + return PERMISSION_WRITE; + case 3: + return PERMISSION_READ_WRITE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Permission findValueByNumber(int number) { + return Permission.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.OpenTableRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.OpenTableRequest.Permission) + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + + /** + * string table_name = 1; + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + 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(); + tableName_ = s; + return s; + } + } + + /** + * string table_name = 1; + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + + /** + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + @java.lang.Override + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + 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(); + appProfileId_ = s; + return s; + } + } + + /** + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PERMISSION_FIELD_NUMBER = 3; + private int permission_ = 0; + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest.Permission getPermission() { + com.google.bigtable.v2.OpenTableRequest.Permission result = + com.google.bigtable.v2.OpenTableRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenTableRequest.Permission.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenTableRequest.Permission.PERMISSION_UNSET.getNumber()) { + output.writeEnum(3, permission_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); + } + if (permission_ + != com.google.bigtable.v2.OpenTableRequest.Permission.PERMISSION_UNSET.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, permission_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenTableRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenTableRequest other = (com.google.bigtable.v2.OpenTableRequest) obj; + + if (!getTableName().equals(other.getTableName())) return false; + if (!getAppProfileId().equals(other.getAppProfileId())) return false; + if (permission_ != other.permission_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + hash = (37 * hash) + APP_PROFILE_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppProfileId().hashCode(); + hash = (37 * hash) + PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + permission_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableRequest 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.v2.OpenTableRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableRequest 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.v2.OpenTableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenTableRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenTableRequest) + com.google.bigtable.v2.OpenTableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableRequest.class, + com.google.bigtable.v2.OpenTableRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenTableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tableName_ = ""; + appProfileId_ = ""; + permission_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenTableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest build() { + com.google.bigtable.v2.OpenTableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest buildPartial() { + com.google.bigtable.v2.OpenTableRequest result = + new com.google.bigtable.v2.OpenTableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.OpenTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tableName_ = tableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.permission_ = permission_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenTableRequest) { + return mergeFrom((com.google.bigtable.v2.OpenTableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenTableRequest other) { + if (other == com.google.bigtable.v2.OpenTableRequest.getDefaultInstance()) return this; + if (!other.getTableName().isEmpty()) { + tableName_ = other.tableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAppProfileId().isEmpty()) { + appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.permission_ != 0) { + setPermissionValue(other.getPermissionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + tableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + permission_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object tableName_ = ""; + + /** + * string table_name = 1; + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = tableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string table_name = 1; + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = tableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string table_name = 1; + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string table_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string table_name = 1; + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object appProfileId_ = ""; + + /** + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + public java.lang.String getAppProfileId() { + java.lang.Object ref = appProfileId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appProfileId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + public com.google.protobuf.ByteString getAppProfileIdBytes() { + java.lang.Object ref = appProfileId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appProfileId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string app_profile_id = 2; + * + * @param value The appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string app_profile_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppProfileId() { + appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string app_profile_id = 2; + * + * @param value The bytes for appProfileId to set. + * @return This builder for chaining. + */ + public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + appProfileId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int permission_ = 0; + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + @java.lang.Override + public int getPermissionValue() { + return permission_; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @param value The enum numeric value on the wire for permission to set. + * @return This builder for chaining. + */ + public Builder setPermissionValue(int value) { + permission_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The permission. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest.Permission getPermission() { + com.google.bigtable.v2.OpenTableRequest.Permission result = + com.google.bigtable.v2.OpenTableRequest.Permission.forNumber(permission_); + return result == null + ? com.google.bigtable.v2.OpenTableRequest.Permission.UNRECOGNIZED + : result; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @param value The permission to set. + * @return This builder for chaining. + */ + public Builder setPermission(com.google.bigtable.v2.OpenTableRequest.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + permission_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return This builder for chaining. + */ + public Builder clearPermission() { + bitField0_ = (bitField0_ & ~0x00000004); + permission_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenTableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenTableRequest) + private static final com.google.bigtable.v2.OpenTableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenTableRequest(); + } + + public static com.google.bigtable.v2.OpenTableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenTableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequestOrBuilder.java new file mode 100644 index 000000000000..968dc3a1dbad --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableRequestOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenTableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenTableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string table_name = 1; + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * string table_name = 1; + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + + /** + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The enum numeric value on the wire for permission. + */ + int getPermissionValue(); + + /** + * .google.bigtable.v2.OpenTableRequest.Permission permission = 3; + * + * @return The permission. + */ + com.google.bigtable.v2.OpenTableRequest.Permission getPermission(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponse.java new file mode 100644 index 000000000000..a738487aefaf --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponse.java @@ -0,0 +1,394 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableResponse} + */ +@com.google.protobuf.Generated +public final class OpenTableResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.OpenTableResponse) + OpenTableResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OpenTableResponse"); + } + + // Use OpenTableResponse.newBuilder() to construct. + private OpenTableResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OpenTableResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableResponse.class, + com.google.bigtable.v2.OpenTableResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.OpenTableResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.OpenTableResponse other = (com.google.bigtable.v2.OpenTableResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableResponse 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.v2.OpenTableResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableResponse 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.v2.OpenTableResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.OpenTableResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.OpenTableResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.OpenTableResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.OpenTableResponse) + com.google.bigtable.v2.OpenTableResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.OpenTableResponse.class, + com.google.bigtable.v2.OpenTableResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.OpenTableResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.OpenTableResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableResponse build() { + com.google.bigtable.v2.OpenTableResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableResponse buildPartial() { + com.google.bigtable.v2.OpenTableResponse result = + new com.google.bigtable.v2.OpenTableResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.OpenTableResponse) { + return mergeFrom((com.google.bigtable.v2.OpenTableResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.OpenTableResponse other) { + if (other == com.google.bigtable.v2.OpenTableResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.OpenTableResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.OpenTableResponse) + private static final com.google.bigtable.v2.OpenTableResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.OpenTableResponse(); + } + + public static com.google.bigtable.v2.OpenTableResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenTableResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.OpenTableResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponseOrBuilder.java new file mode 100644 index 000000000000..2f872a59f996 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/OpenTableResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface OpenTableResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.OpenTableResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java index 55fdd628c2bc..60d7fd2655e1 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java @@ -53,6 +53,7 @@ private PeerInfo(com.google.protobuf.GeneratedMessage.Builder builder) { } private PeerInfo() { + applicationFrontendRegion_ = ""; applicationFrontendZone_ = ""; applicationFrontendSubzone_ = ""; transportType_ = 0; @@ -404,6 +405,59 @@ public long getApplicationFrontendId() { return applicationFrontendId_; } + public static final int APPLICATION_FRONTEND_REGION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object applicationFrontendRegion_ = ""; + + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The applicationFrontendRegion. + */ + @java.lang.Override + public java.lang.String getApplicationFrontendRegion() { + java.lang.Object ref = applicationFrontendRegion_; + 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(); + applicationFrontendRegion_ = s; + return s; + } + } + + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The bytes for applicationFrontendRegion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationFrontendRegionBytes() { + java.lang.Object ref = applicationFrontendRegion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int APPLICATION_FRONTEND_ZONE_FIELD_NUMBER = 3; @SuppressWarnings("serial") @@ -416,11 +470,14 @@ public long getApplicationFrontendId() { * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @return The applicationFrontendZone. */ @java.lang.Override + @java.lang.Deprecated public java.lang.String getApplicationFrontendZone() { java.lang.Object ref = applicationFrontendZone_; if (ref instanceof java.lang.String) { @@ -440,11 +497,14 @@ public java.lang.String getApplicationFrontendZone() { * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @return The bytes for applicationFrontendZone. */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { java.lang.Object ref = applicationFrontendZone_; if (ref instanceof java.lang.String) { @@ -467,7 +527,8 @@ public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { * *
    * The subzone of the application frontend that served this request, e.g. an
-   * identifier for where within the zone the application frontend is.
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
    * 
* * string application_frontend_subzone = 4; @@ -492,7 +553,8 @@ public java.lang.String getApplicationFrontendSubzone() { * *
    * The subzone of the application frontend that served this request, e.g. an
-   * identifier for where within the zone the application frontend is.
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
    * 
* * string application_frontend_subzone = 4; @@ -567,6 +629,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.bigtable.v2.PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN.getNumber()) { output.writeEnum(5, transportType_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendRegion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, applicationFrontendRegion_); + } getUnknownFields().writeTo(output); } @@ -593,6 +658,9 @@ public int getSerializedSize() { != com.google.bigtable.v2.PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, transportType_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(applicationFrontendRegion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, applicationFrontendRegion_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -610,6 +678,7 @@ public boolean equals(final java.lang.Object obj) { if (getGoogleFrontendId() != other.getGoogleFrontendId()) return false; if (getApplicationFrontendId() != other.getApplicationFrontendId()) return false; + if (!getApplicationFrontendRegion().equals(other.getApplicationFrontendRegion())) return false; if (!getApplicationFrontendZone().equals(other.getApplicationFrontendZone())) return false; if (!getApplicationFrontendSubzone().equals(other.getApplicationFrontendSubzone())) return false; @@ -629,6 +698,8 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGoogleFrontendId()); hash = (37 * hash) + APPLICATION_FRONTEND_ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getApplicationFrontendId()); + hash = (37 * hash) + APPLICATION_FRONTEND_REGION_FIELD_NUMBER; + hash = (53 * hash) + getApplicationFrontendRegion().hashCode(); hash = (37 * hash) + APPLICATION_FRONTEND_ZONE_FIELD_NUMBER; hash = (53 * hash) + getApplicationFrontendZone().hashCode(); hash = (37 * hash) + APPLICATION_FRONTEND_SUBZONE_FIELD_NUMBER; @@ -776,6 +847,7 @@ public Builder clear() { bitField0_ = 0; googleFrontendId_ = 0L; applicationFrontendId_ = 0L; + applicationFrontendRegion_ = ""; applicationFrontendZone_ = ""; applicationFrontendSubzone_ = ""; transportType_ = 0; @@ -821,12 +893,15 @@ private void buildPartial0(com.google.bigtable.v2.PeerInfo result) { result.applicationFrontendId_ = applicationFrontendId_; } if (((from_bitField0_ & 0x00000004) != 0)) { - result.applicationFrontendZone_ = applicationFrontendZone_; + result.applicationFrontendRegion_ = applicationFrontendRegion_; } if (((from_bitField0_ & 0x00000008) != 0)) { - result.applicationFrontendSubzone_ = applicationFrontendSubzone_; + result.applicationFrontendZone_ = applicationFrontendZone_; } if (((from_bitField0_ & 0x00000010) != 0)) { + result.applicationFrontendSubzone_ = applicationFrontendSubzone_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { result.transportType_ = transportType_; } } @@ -849,14 +924,19 @@ public Builder mergeFrom(com.google.bigtable.v2.PeerInfo other) { if (other.getApplicationFrontendId() != 0L) { setApplicationFrontendId(other.getApplicationFrontendId()); } + if (!other.getApplicationFrontendRegion().isEmpty()) { + applicationFrontendRegion_ = other.applicationFrontendRegion_; + bitField0_ |= 0x00000004; + onChanged(); + } if (!other.getApplicationFrontendZone().isEmpty()) { applicationFrontendZone_ = other.applicationFrontendZone_; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getApplicationFrontendSubzone().isEmpty()) { applicationFrontendSubzone_ = other.applicationFrontendSubzone_; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); } if (other.transportType_ != 0) { @@ -903,21 +983,27 @@ public Builder mergeFrom( case 26: { applicationFrontendZone_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; break; } // case 26 case 34: { applicationFrontendSubzone_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; break; } // case 34 case 40: { transportType_ = input.readEnum(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; break; } // case 40 + case 50: + { + applicationFrontendRegion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1055,6 +1141,117 @@ public Builder clearApplicationFrontendId() { return this; } + private java.lang.Object applicationFrontendRegion_ = ""; + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @return The applicationFrontendRegion. + */ + public java.lang.String getApplicationFrontendRegion() { + java.lang.Object ref = applicationFrontendRegion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + applicationFrontendRegion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @return The bytes for applicationFrontendRegion. + */ + public com.google.protobuf.ByteString getApplicationFrontendRegionBytes() { + java.lang.Object ref = applicationFrontendRegion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + applicationFrontendRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @param value The applicationFrontendRegion to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + applicationFrontendRegion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendRegion() { + applicationFrontendRegion_ = getDefaultInstance().getApplicationFrontendRegion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Cloud region of the application frontend that served this request.
+     * 
+ * + * string application_frontend_region = 6; + * + * @param value The bytes for applicationFrontendRegion to set. + * @return This builder for chaining. + */ + public Builder setApplicationFrontendRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + applicationFrontendRegion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + private java.lang.Object applicationFrontendZone_ = ""; /** @@ -1064,10 +1261,13 @@ public Builder clearApplicationFrontendId() { * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @return The applicationFrontendZone. */ + @java.lang.Deprecated public java.lang.String getApplicationFrontendZone() { java.lang.Object ref = applicationFrontendZone_; if (!(ref instanceof java.lang.String)) { @@ -1087,10 +1287,13 @@ public java.lang.String getApplicationFrontendZone() { * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @return The bytes for applicationFrontendZone. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { java.lang.Object ref = applicationFrontendZone_; if (ref instanceof String) { @@ -1110,17 +1313,20 @@ public com.google.protobuf.ByteString getApplicationFrontendZoneBytes() { * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @param value The applicationFrontendZone to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setApplicationFrontendZone(java.lang.String value) { if (value == null) { throw new NullPointerException(); } applicationFrontendZone_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1132,13 +1338,16 @@ public Builder setApplicationFrontendZone(java.lang.String value) { * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearApplicationFrontendZone() { applicationFrontendZone_ = getDefaultInstance().getApplicationFrontendZone(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } @@ -1150,18 +1359,21 @@ public Builder clearApplicationFrontendZone() { * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @param value The bytes for applicationFrontendZone to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setApplicationFrontendZoneBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); applicationFrontendZone_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1173,7 +1385,8 @@ public Builder setApplicationFrontendZoneBytes(com.google.protobuf.ByteString va * *
      * The subzone of the application frontend that served this request, e.g. an
-     * identifier for where within the zone the application frontend is.
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
      * 
* * string application_frontend_subzone = 4; @@ -1197,7 +1410,8 @@ public java.lang.String getApplicationFrontendSubzone() { * *
      * The subzone of the application frontend that served this request, e.g. an
-     * identifier for where within the zone the application frontend is.
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
      * 
* * string application_frontend_subzone = 4; @@ -1221,7 +1435,8 @@ public com.google.protobuf.ByteString getApplicationFrontendSubzoneBytes() { * *
      * The subzone of the application frontend that served this request, e.g. an
-     * identifier for where within the zone the application frontend is.
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
      * 
* * string application_frontend_subzone = 4; @@ -1234,7 +1449,7 @@ public Builder setApplicationFrontendSubzone(java.lang.String value) { throw new NullPointerException(); } applicationFrontendSubzone_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1244,7 +1459,8 @@ public Builder setApplicationFrontendSubzone(java.lang.String value) { * *
      * The subzone of the application frontend that served this request, e.g. an
-     * identifier for where within the zone the application frontend is.
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
      * 
* * string application_frontend_subzone = 4; @@ -1253,7 +1469,7 @@ public Builder setApplicationFrontendSubzone(java.lang.String value) { */ public Builder clearApplicationFrontendSubzone() { applicationFrontendSubzone_ = getDefaultInstance().getApplicationFrontendSubzone(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } @@ -1263,7 +1479,8 @@ public Builder clearApplicationFrontendSubzone() { * *
      * The subzone of the application frontend that served this request, e.g. an
-     * identifier for where within the zone the application frontend is.
+     * identifier for where within a zone (within the reported region) the
+     * application frontend is.
      * 
* * string application_frontend_subzone = 4; @@ -1277,7 +1494,7 @@ public Builder setApplicationFrontendSubzoneBytes(com.google.protobuf.ByteString } checkByteStringIsUtf8(value); applicationFrontendSubzone_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1302,7 +1519,7 @@ public int getTransportTypeValue() { */ public Builder setTransportTypeValue(int value) { transportType_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1329,7 +1546,7 @@ public Builder setTransportType(com.google.bigtable.v2.PeerInfo.TransportType va if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; transportType_ = value.getNumber(); onChanged(); return this; @@ -1341,7 +1558,7 @@ public Builder setTransportType(com.google.bigtable.v2.PeerInfo.TransportType va * @return This builder for chaining. */ public Builder clearTransportType() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000020); transportType_ = 0; onChanged(); return this; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java index b5d5121c68f7..3819533d0a14 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java @@ -54,6 +54,32 @@ public interface PeerInfoOrBuilder */ long getApplicationFrontendId(); + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The applicationFrontendRegion. + */ + java.lang.String getApplicationFrontendRegion(); + + /** + * + * + *
+   * The Cloud region of the application frontend that served this request.
+   * 
+ * + * string application_frontend_region = 6; + * + * @return The bytes for applicationFrontendRegion. + */ + com.google.protobuf.ByteString getApplicationFrontendRegionBytes(); + /** * * @@ -61,10 +87,13 @@ public interface PeerInfoOrBuilder * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @return The applicationFrontendZone. */ + @java.lang.Deprecated java.lang.String getApplicationFrontendZone(); /** @@ -74,10 +103,13 @@ public interface PeerInfoOrBuilder * The Cloud zone of the application frontend that served this request. * * - * string application_frontend_zone = 3; + * string application_frontend_zone = 3 [deprecated = true]; * + * @deprecated google.bigtable.v2.PeerInfo.application_frontend_zone is deprecated. See + * google/bigtable/v2/peer_info.proto;l=72 * @return The bytes for applicationFrontendZone. */ + @java.lang.Deprecated com.google.protobuf.ByteString getApplicationFrontendZoneBytes(); /** @@ -85,7 +117,8 @@ public interface PeerInfoOrBuilder * *
    * The subzone of the application frontend that served this request, e.g. an
-   * identifier for where within the zone the application frontend is.
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
    * 
* * string application_frontend_subzone = 4; @@ -99,7 +132,8 @@ public interface PeerInfoOrBuilder * *
    * The subzone of the application frontend that served this request, e.g. an
-   * identifier for where within the zone the application frontend is.
+   * identifier for where within a zone (within the reported region) the
+   * application frontend is.
    * 
* * string application_frontend_subzone = 4; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java index 79838d76c82d..70745c4ef99f 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java @@ -54,24 +54,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\"google/bigtable/v2/peer_info.proto\022\022go" - + "ogle.bigtable.v2\"\372\003\n\010PeerInfo\022\032\n\022google_" + + "ogle.bigtable.v2\"\243\004\n\010PeerInfo\022\032\n\022google_" + "frontend_id\030\001 \001(\003\022\037\n\027application_fronten" - + "d_id\030\002 \001(\003\022!\n\031application_frontend_zone\030" - + "\003 \001(\t\022$\n\034application_frontend_subzone\030\004 " - + "\001(\t\022B\n\016transport_type\030\005 \001(\0162*.google.big" - + "table.v2.PeerInfo.TransportType\"\243\002\n\rTran" - + "sportType\022\032\n\026TRANSPORT_TYPE_UNKNOWN\020\000\022\033\n" - + "\027TRANSPORT_TYPE_EXTERNAL\020\001\022\035\n\031TRANSPORT_" - + "TYPE_CLOUD_PATH\020\002\022 \n\034TRANSPORT_TYPE_DIRE" - + "CT_ACCESS\020\003\022\"\n\036TRANSPORT_TYPE_SESSION_UN" - + "KNOWN\020\004\022#\n\037TRANSPORT_TYPE_SESSION_EXTERN" - + "AL\020\005\022%\n!TRANSPORT_TYPE_SESSION_CLOUD_PAT" - + "H\020\006\022(\n$TRANSPORT_TYPE_SESSION_DIRECT_ACC" - + "ESS\020\007B\267\001\n\026com.google.bigtable.v2B\rPeerIn" - + "foProtoP\001Z8cloud.google.com/go/bigtable/" - + "apiv2/bigtablepb;bigtablepb\252\002\030Google.Clo" - + "ud.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\V" - + "2\352\002\033Google::Cloud::Bigtable::V2b\006proto3" + + "d_id\030\002 \001(\003\022#\n\033application_frontend_regio" + + "n\030\006 \001(\t\022%\n\031application_frontend_zone\030\003 \001" + + "(\tB\002\030\001\022$\n\034application_frontend_subzone\030\004" + + " \001(\t\022B\n\016transport_type\030\005 \001(\0162*.google.bi" + + "gtable.v2.PeerInfo.TransportType\"\243\002\n\rTra" + + "nsportType\022\032\n\026TRANSPORT_TYPE_UNKNOWN\020\000\022\033" + + "\n\027TRANSPORT_TYPE_EXTERNAL\020\001\022\035\n\031TRANSPORT" + + "_TYPE_CLOUD_PATH\020\002\022 \n\034TRANSPORT_TYPE_DIR" + + "ECT_ACCESS\020\003\022\"\n\036TRANSPORT_TYPE_SESSION_U" + + "NKNOWN\020\004\022#\n\037TRANSPORT_TYPE_SESSION_EXTER" + + "NAL\020\005\022%\n!TRANSPORT_TYPE_SESSION_CLOUD_PA" + + "TH\020\006\022(\n$TRANSPORT_TYPE_SESSION_DIRECT_AC" + + "CESS\020\007B\267\001\n\026com.google.bigtable.v2B\rPeerI" + + "nfoProtoP\001Z8cloud.google.com/go/bigtable" + + "/apiv2/bigtablepb;bigtablepb\252\002\030Google.Cl" + + "oud.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\" + + "V2\352\002\033Google::Cloud::Bigtable::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -83,6 +84,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "GoogleFrontendId", "ApplicationFrontendId", + "ApplicationFrontendRegion", "ApplicationFrontendZone", "ApplicationFrontendSubzone", "TransportType", diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfiguration.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfiguration.java new file mode 100644 index 000000000000..36d01b61f516 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfiguration.java @@ -0,0 +1,7243 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Configuration for the Session API. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration} + */ +@com.google.protobuf.Generated +public final class SessionClientConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration) + SessionClientConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionClientConfiguration"); + } + + // Use SessionClientConfiguration.newBuilder() to construct. + private SessionClientConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionClientConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.Builder.class); + } + + public interface ChannelPoolConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The minimum number of distcint servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at least this many
+     * distinct servers, but may have multiple channels connected to the same
+     * server (e.g. the client may have M channels on N machines, where M > N).
+     * 
+ * + * int32 min_server_count = 1; + * + * @return The minServerCount. + */ + int getMinServerCount(); + + /** + * + * + *
+     * The maximum number of distinct servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at most this many
+     * distinct servers.
+     * 
+ * + * int32 max_server_count = 2; + * + * @return The maxServerCount. + */ + int getMaxServerCount(); + + /** + * + * + *
+     * Soft maximum for how many sessions are allowed per server. Normally, the
+     * client will ensure that it does not host more than this count of sessions
+     * per server, unless there are other limits encountered (e.g. the connected
+     * servers is already at max_servers).
+     * 
+ * + * int32 per_server_session_count = 3; + * + * @return The perServerSessionCount. + */ + int getPerServerSessionCount(); + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return Whether the directAccessWithFallback field is set. + */ + boolean hasDirectAccessWithFallback(); + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return The directAccessWithFallback. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDirectAccessWithFallback(); + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder + getDirectAccessWithFallbackOrBuilder(); + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return Whether the directAccessOnly field is set. + */ + boolean hasDirectAccessOnly(); + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return The directAccessOnly. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly + getDirectAccessOnly(); + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder + getDirectAccessOnlyOrBuilder(); + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return Whether the cloudPathOnly field is set. + */ + boolean hasCloudPathOnly(); + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return The cloudPathOnly. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + getCloudPathOnly(); + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder + getCloudPathOnlyOrBuilder(); + + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.ModeCase + getModeCase(); + } + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration} + */ + public static final class ChannelPoolConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + ChannelPoolConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ChannelPoolConfiguration"); + } + + // Use ChannelPoolConfiguration.newBuilder() to construct. + private ChannelPoolConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ChannelPoolConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + .class); + } + + public interface DirectAccessWithFallbackOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+       * The error rate is calculated based on a count of vRPCs with errors
+       * divided by a total count of vRPCs, over a rolling window of the past
+       * check_interval. If this ratio exceeds this threshold, the fallback to
+       * CloudPath is triggered. [0, 1].
+       * 
+ * + * float error_rate_threshold = 1; + * + * @return The errorRateThreshold. + */ + float getErrorRateThreshold(); + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return Whether the checkInterval field is set. + */ + boolean hasCheckInterval(); + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return The checkInterval. + */ + com.google.protobuf.Duration getCheckInterval(); + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + com.google.protobuf.DurationOrBuilder getCheckIntervalOrBuilder(); + } + + /** + * + * + *
+     * A channel mode which allows DirectAccess with a fallback to CloudPath if
+     * DirectAccess is unavailable.
+     * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback} + */ + public static final class DirectAccessWithFallback extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + DirectAccessWithFallbackOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DirectAccessWithFallback"); + } + + // Use DirectAccessWithFallback.newBuilder() to construct. + private DirectAccessWithFallback(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DirectAccessWithFallback() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder.class); + } + + private int bitField0_; + public static final int ERROR_RATE_THRESHOLD_FIELD_NUMBER = 1; + private float errorRateThreshold_ = 0F; + + /** + * + * + *
+       * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+       * The error rate is calculated based on a count of vRPCs with errors
+       * divided by a total count of vRPCs, over a rolling window of the past
+       * check_interval. If this ratio exceeds this threshold, the fallback to
+       * CloudPath is triggered. [0, 1].
+       * 
+ * + * float error_rate_threshold = 1; + * + * @return The errorRateThreshold. + */ + @java.lang.Override + public float getErrorRateThreshold() { + return errorRateThreshold_; + } + + public static final int CHECK_INTERVAL_FIELD_NUMBER = 2; + private com.google.protobuf.Duration checkInterval_; + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return Whether the checkInterval field is set. + */ + @java.lang.Override + public boolean hasCheckInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return The checkInterval. + */ + @java.lang.Override + public com.google.protobuf.Duration getCheckInterval() { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } + + /** + * + * + *
+       * The interval to check the error rate over.
+       * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getCheckIntervalOrBuilder() { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(errorRateThreshold_) != 0) { + output.writeFloat(1, errorRateThreshold_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getCheckInterval()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(errorRateThreshold_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, errorRateThreshold_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCheckInterval()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + obj; + + if (java.lang.Float.floatToIntBits(getErrorRateThreshold()) + != java.lang.Float.floatToIntBits(other.getErrorRateThreshold())) return false; + if (hasCheckInterval() != other.hasCheckInterval()) return false; + if (hasCheckInterval()) { + if (!getCheckInterval().equals(other.getCheckInterval())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ERROR_RATE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getErrorRateThreshold()); + if (hasCheckInterval()) { + hash = (37 * hash) + CHECK_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getCheckInterval().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A channel mode which allows DirectAccess with a fallback to CloudPath if
+       * DirectAccess is unavailable.
+       * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCheckIntervalFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + errorRateThreshold_ = 0F; + checkInterval_ = null; + if (checkIntervalBuilder_ != null) { + checkIntervalBuilder_.dispose(); + checkIntervalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.errorRateThreshold_ = errorRateThreshold_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.checkInterval_ = + checkIntervalBuilder_ == null ? checkInterval_ : checkIntervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance()) return this; + if (java.lang.Float.floatToRawIntBits(other.getErrorRateThreshold()) != 0) { + setErrorRateThreshold(other.getErrorRateThreshold()); + } + if (other.hasCheckInterval()) { + mergeCheckInterval(other.getCheckInterval()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + errorRateThreshold_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: + { + input.readMessage( + internalGetCheckIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float errorRateThreshold_; + + /** + * + * + *
+         * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+         * The error rate is calculated based on a count of vRPCs with errors
+         * divided by a total count of vRPCs, over a rolling window of the past
+         * check_interval. If this ratio exceeds this threshold, the fallback to
+         * CloudPath is triggered. [0, 1].
+         * 
+ * + * float error_rate_threshold = 1; + * + * @return The errorRateThreshold. + */ + @java.lang.Override + public float getErrorRateThreshold() { + return errorRateThreshold_; + } + + /** + * + * + *
+         * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+         * The error rate is calculated based on a count of vRPCs with errors
+         * divided by a total count of vRPCs, over a rolling window of the past
+         * check_interval. If this ratio exceeds this threshold, the fallback to
+         * CloudPath is triggered. [0, 1].
+         * 
+ * + * float error_rate_threshold = 1; + * + * @param value The errorRateThreshold to set. + * @return This builder for chaining. + */ + public Builder setErrorRateThreshold(float value) { + + errorRateThreshold_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+         * The threshold for errors on DirectAccess to trigger CloudPath fallback.
+         * The error rate is calculated based on a count of vRPCs with errors
+         * divided by a total count of vRPCs, over a rolling window of the past
+         * check_interval. If this ratio exceeds this threshold, the fallback to
+         * CloudPath is triggered. [0, 1].
+         * 
+ * + * float error_rate_threshold = 1; + * + * @return This builder for chaining. + */ + public Builder clearErrorRateThreshold() { + bitField0_ = (bitField0_ & ~0x00000001); + errorRateThreshold_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Duration checkInterval_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + checkIntervalBuilder_; + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return Whether the checkInterval field is set. + */ + public boolean hasCheckInterval() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + * + * @return The checkInterval. + */ + public com.google.protobuf.Duration getCheckInterval() { + if (checkIntervalBuilder_ == null) { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } else { + return checkIntervalBuilder_.getMessage(); + } + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder setCheckInterval(com.google.protobuf.Duration value) { + if (checkIntervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + checkInterval_ = value; + } else { + checkIntervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder setCheckInterval(com.google.protobuf.Duration.Builder builderForValue) { + if (checkIntervalBuilder_ == null) { + checkInterval_ = builderForValue.build(); + } else { + checkIntervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder mergeCheckInterval(com.google.protobuf.Duration value) { + if (checkIntervalBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && checkInterval_ != null + && checkInterval_ != com.google.protobuf.Duration.getDefaultInstance()) { + getCheckIntervalBuilder().mergeFrom(value); + } else { + checkInterval_ = value; + } + } else { + checkIntervalBuilder_.mergeFrom(value); + } + if (checkInterval_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public Builder clearCheckInterval() { + bitField0_ = (bitField0_ & ~0x00000002); + checkInterval_ = null; + if (checkIntervalBuilder_ != null) { + checkIntervalBuilder_.dispose(); + checkIntervalBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public com.google.protobuf.Duration.Builder getCheckIntervalBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetCheckIntervalFieldBuilder().getBuilder(); + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + public com.google.protobuf.DurationOrBuilder getCheckIntervalOrBuilder() { + if (checkIntervalBuilder_ != null) { + return checkIntervalBuilder_.getMessageOrBuilder(); + } else { + return checkInterval_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : checkInterval_; + } + } + + /** + * + * + *
+         * The interval to check the error rate over.
+         * 
+ * + * .google.protobuf.Duration check_interval = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetCheckIntervalFieldBuilder() { + if (checkIntervalBuilder_ == null) { + checkIntervalBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCheckInterval(), getParentForChildren(), isClean()); + checkInterval_ = null; + } + return checkIntervalBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback) + private static final com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfiguration.DirectAccessWithFallback + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectAccessWithFallback parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DirectAccessOnlyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * A channel mode which only allows DirectAccess.
+     * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly} + */ + public static final class DirectAccessOnly extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + DirectAccessOnlyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DirectAccessOnly"); + } + + // Use DirectAccessOnly.newBuilder() to construct. + private DirectAccessOnly(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DirectAccessOnly() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly + other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A channel mode which only allows DirectAccess.
+       * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly) + private static final com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfiguration.DirectAccessOnly + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DirectAccessOnly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CloudPathOnlyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + com.google.protobuf.MessageOrBuilder {} + + /** + * + * + *
+     * A channel mode which only allows CloudPath.
+     * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly} + */ + public static final class CloudPathOnly extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + CloudPathOnlyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CloudPathOnly"); + } + + // Use CloudPathOnly.newBuilder() to construct. + private CloudPathOnly(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CloudPathOnly() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * A channel mode which only allows CloudPath.
+       * 
+ * + * Protobuf type {@code + * google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder.class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly) + private static final com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfiguration.CloudPathOnly + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudPathOnly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int modeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object mode_; + + public enum ModeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DIRECT_ACCESS_WITH_FALLBACK(4), + DIRECT_ACCESS_ONLY(5), + CLOUD_PATH_ONLY(6), + MODE_NOT_SET(0); + private final int value; + + private ModeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModeCase valueOf(int value) { + return forNumber(value); + } + + public static ModeCase forNumber(int value) { + switch (value) { + case 4: + return DIRECT_ACCESS_WITH_FALLBACK; + case 5: + return DIRECT_ACCESS_ONLY; + case 6: + return CLOUD_PATH_ONLY; + case 0: + return MODE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public static final int MIN_SERVER_COUNT_FIELD_NUMBER = 1; + private int minServerCount_ = 0; + + /** + * + * + *
+     * The minimum number of distcint servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at least this many
+     * distinct servers, but may have multiple channels connected to the same
+     * server (e.g. the client may have M channels on N machines, where M > N).
+     * 
+ * + * int32 min_server_count = 1; + * + * @return The minServerCount. + */ + @java.lang.Override + public int getMinServerCount() { + return minServerCount_; + } + + public static final int MAX_SERVER_COUNT_FIELD_NUMBER = 2; + private int maxServerCount_ = 0; + + /** + * + * + *
+     * The maximum number of distinct servers to connect to in the channel pool.
+     * The client will ensure that the channel pool will have at most this many
+     * distinct servers.
+     * 
+ * + * int32 max_server_count = 2; + * + * @return The maxServerCount. + */ + @java.lang.Override + public int getMaxServerCount() { + return maxServerCount_; + } + + public static final int PER_SERVER_SESSION_COUNT_FIELD_NUMBER = 3; + private int perServerSessionCount_ = 0; + + /** + * + * + *
+     * Soft maximum for how many sessions are allowed per server. Normally, the
+     * client will ensure that it does not host more than this count of sessions
+     * per server, unless there are other limits encountered (e.g. the connected
+     * servers is already at max_servers).
+     * 
+ * + * int32 per_server_session_count = 3; + * + * @return The perServerSessionCount. + */ + @java.lang.Override + public int getPerServerSessionCount() { + return perServerSessionCount_; + } + + public static final int DIRECT_ACCESS_WITH_FALLBACK_FIELD_NUMBER = 4; + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return Whether the directAccessWithFallback field is set. + */ + @java.lang.Override + public boolean hasDirectAccessWithFallback() { + return modeCase_ == 4; + } + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return The directAccessWithFallback. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDirectAccessWithFallback() { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + + /** + * + * + *
+     * DirectAccess with a fallback to CloudPath.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder + getDirectAccessWithFallbackOrBuilder() { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + + public static final int DIRECT_ACCESS_ONLY_FIELD_NUMBER = 5; + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return Whether the directAccessOnly field is set. + */ + @java.lang.Override + public boolean hasDirectAccessOnly() { + return modeCase_ == 5; + } + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return The directAccessOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDirectAccessOnly() { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + + /** + * + * + *
+     * DirectAccess only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder + getDirectAccessOnlyOrBuilder() { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + + public static final int CLOUD_PATH_ONLY_FIELD_NUMBER = 6; + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return Whether the cloudPathOnly field is set. + */ + @java.lang.Override + public boolean hasCloudPathOnly() { + return modeCase_ == 6; + } + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return The cloudPathOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + getCloudPathOnly() { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + + /** + * + * + *
+     * CloudPath only.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder + getCloudPathOnlyOrBuilder() { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (minServerCount_ != 0) { + output.writeInt32(1, minServerCount_); + } + if (maxServerCount_ != 0) { + output.writeInt32(2, maxServerCount_); + } + if (perServerSessionCount_ != 0) { + output.writeInt32(3, perServerSessionCount_); + } + if (modeCase_ == 4) { + output.writeMessage( + 4, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_); + } + if (modeCase_ == 5) { + output.writeMessage( + 5, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_); + } + if (modeCase_ == 6) { + output.writeMessage( + 6, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minServerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, minServerCount_); + } + if (maxServerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxServerCount_); + } + if (perServerSessionCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, perServerSessionCount_); + } + if (modeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_); + } + if (modeCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_); + } + if (modeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration other = + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) obj; + + if (getMinServerCount() != other.getMinServerCount()) return false; + if (getMaxServerCount() != other.getMaxServerCount()) return false; + if (getPerServerSessionCount() != other.getPerServerSessionCount()) return false; + if (!getModeCase().equals(other.getModeCase())) return false; + switch (modeCase_) { + case 4: + if (!getDirectAccessWithFallback().equals(other.getDirectAccessWithFallback())) + return false; + break; + case 5: + if (!getDirectAccessOnly().equals(other.getDirectAccessOnly())) return false; + break; + case 6: + if (!getCloudPathOnly().equals(other.getCloudPathOnly())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIN_SERVER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinServerCount(); + hash = (37 * hash) + MAX_SERVER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxServerCount(); + hash = (37 * hash) + PER_SERVER_SESSION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPerServerSessionCount(); + switch (modeCase_) { + case 4: + hash = (37 * hash) + DIRECT_ACCESS_WITH_FALLBACK_FIELD_NUMBER; + hash = (53 * hash) + getDirectAccessWithFallback().hashCode(); + break; + case 5: + hash = (37 * hash) + DIRECT_ACCESS_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getDirectAccessOnly().hashCode(); + break; + case 6: + hash = (37 * hash) + CLOUD_PATH_ONLY_FIELD_NUMBER; + hash = (53 * hash) + getCloudPathOnly().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + 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.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + .class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minServerCount_ = 0; + maxServerCount_ = 0; + perServerSessionCount_ = 0; + if (directAccessWithFallbackBuilder_ != null) { + directAccessWithFallbackBuilder_.clear(); + } + if (directAccessOnlyBuilder_ != null) { + directAccessOnlyBuilder_.clear(); + } + if (cloudPathOnlyBuilder_ != null) { + cloudPathOnlyBuilder_.clear(); + } + modeCase_ = 0; + mode_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration build() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.minServerCount_ = minServerCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxServerCount_ = maxServerCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.perServerSessionCount_ = perServerSessionCount_; + } + } + + private void buildPartialOneofs( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration result) { + result.modeCase_ = modeCase_; + result.mode_ = this.mode_; + if (modeCase_ == 4 && directAccessWithFallbackBuilder_ != null) { + result.mode_ = directAccessWithFallbackBuilder_.build(); + } + if (modeCase_ == 5 && directAccessOnlyBuilder_ != null) { + result.mode_ = directAccessOnlyBuilder_.build(); + } + if (modeCase_ == 6 && cloudPathOnlyBuilder_ != null) { + result.mode_ = cloudPathOnlyBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance()) return this; + if (other.getMinServerCount() != 0) { + setMinServerCount(other.getMinServerCount()); + } + if (other.getMaxServerCount() != 0) { + setMaxServerCount(other.getMaxServerCount()); + } + if (other.getPerServerSessionCount() != 0) { + setPerServerSessionCount(other.getPerServerSessionCount()); + } + switch (other.getModeCase()) { + case DIRECT_ACCESS_WITH_FALLBACK: + { + mergeDirectAccessWithFallback(other.getDirectAccessWithFallback()); + break; + } + case DIRECT_ACCESS_ONLY: + { + mergeDirectAccessOnly(other.getDirectAccessOnly()); + break; + } + case CLOUD_PATH_ONLY: + { + mergeCloudPathOnly(other.getCloudPathOnly()); + break; + } + case MODE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + minServerCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + maxServerCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + perServerSessionCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + internalGetDirectAccessWithFallbackFieldBuilder().getBuilder(), + extensionRegistry); + modeCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetDirectAccessOnlyFieldBuilder().getBuilder(), extensionRegistry); + modeCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetCloudPathOnlyFieldBuilder().getBuilder(), extensionRegistry); + modeCase_ = 6; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int modeCase_ = 0; + private java.lang.Object mode_; + + public ModeCase getModeCase() { + return ModeCase.forNumber(modeCase_); + } + + public Builder clearMode() { + modeCase_ = 0; + mode_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int minServerCount_; + + /** + * + * + *
+       * The minimum number of distcint servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at least this many
+       * distinct servers, but may have multiple channels connected to the same
+       * server (e.g. the client may have M channels on N machines, where M > N).
+       * 
+ * + * int32 min_server_count = 1; + * + * @return The minServerCount. + */ + @java.lang.Override + public int getMinServerCount() { + return minServerCount_; + } + + /** + * + * + *
+       * The minimum number of distcint servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at least this many
+       * distinct servers, but may have multiple channels connected to the same
+       * server (e.g. the client may have M channels on N machines, where M > N).
+       * 
+ * + * int32 min_server_count = 1; + * + * @param value The minServerCount to set. + * @return This builder for chaining. + */ + public Builder setMinServerCount(int value) { + + minServerCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum number of distcint servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at least this many
+       * distinct servers, but may have multiple channels connected to the same
+       * server (e.g. the client may have M channels on N machines, where M > N).
+       * 
+ * + * int32 min_server_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearMinServerCount() { + bitField0_ = (bitField0_ & ~0x00000001); + minServerCount_ = 0; + onChanged(); + return this; + } + + private int maxServerCount_; + + /** + * + * + *
+       * The maximum number of distinct servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at most this many
+       * distinct servers.
+       * 
+ * + * int32 max_server_count = 2; + * + * @return The maxServerCount. + */ + @java.lang.Override + public int getMaxServerCount() { + return maxServerCount_; + } + + /** + * + * + *
+       * The maximum number of distinct servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at most this many
+       * distinct servers.
+       * 
+ * + * int32 max_server_count = 2; + * + * @param value The maxServerCount to set. + * @return This builder for chaining. + */ + public Builder setMaxServerCount(int value) { + + maxServerCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The maximum number of distinct servers to connect to in the channel pool.
+       * The client will ensure that the channel pool will have at most this many
+       * distinct servers.
+       * 
+ * + * int32 max_server_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxServerCount() { + bitField0_ = (bitField0_ & ~0x00000002); + maxServerCount_ = 0; + onChanged(); + return this; + } + + private int perServerSessionCount_; + + /** + * + * + *
+       * Soft maximum for how many sessions are allowed per server. Normally, the
+       * client will ensure that it does not host more than this count of sessions
+       * per server, unless there are other limits encountered (e.g. the connected
+       * servers is already at max_servers).
+       * 
+ * + * int32 per_server_session_count = 3; + * + * @return The perServerSessionCount. + */ + @java.lang.Override + public int getPerServerSessionCount() { + return perServerSessionCount_; + } + + /** + * + * + *
+       * Soft maximum for how many sessions are allowed per server. Normally, the
+       * client will ensure that it does not host more than this count of sessions
+       * per server, unless there are other limits encountered (e.g. the connected
+       * servers is already at max_servers).
+       * 
+ * + * int32 per_server_session_count = 3; + * + * @param value The perServerSessionCount to set. + * @return This builder for chaining. + */ + public Builder setPerServerSessionCount(int value) { + + perServerSessionCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Soft maximum for how many sessions are allowed per server. Normally, the
+       * client will ensure that it does not host more than this count of sessions
+       * per server, unless there are other limits encountered (e.g. the connected
+       * servers is already at max_servers).
+       * 
+ * + * int32 per_server_session_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearPerServerSessionCount() { + bitField0_ = (bitField0_ & ~0x00000004); + perServerSessionCount_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder> + directAccessWithFallbackBuilder_; + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return Whether the directAccessWithFallback field is set. + */ + @java.lang.Override + public boolean hasDirectAccessWithFallback() { + return modeCase_ == 4; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + * + * @return The directAccessWithFallback. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + getDirectAccessWithFallback() { + if (directAccessWithFallbackBuilder_ == null) { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } else { + if (modeCase_ == 4) { + return directAccessWithFallbackBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder setDirectAccessWithFallback( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + value) { + if (directAccessWithFallbackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + directAccessWithFallbackBuilder_.setMessage(value); + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder setDirectAccessWithFallback( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder + builderForValue) { + if (directAccessWithFallbackBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + directAccessWithFallbackBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder mergeDirectAccessWithFallback( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback + value) { + if (directAccessWithFallbackBuilder_ == null) { + if (modeCase_ == 4 + && mode_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance()) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.newBuilder( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 4) { + directAccessWithFallbackBuilder_.mergeFrom(value); + } else { + directAccessWithFallbackBuilder_.setMessage(value); + } + } + modeCase_ = 4; + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public Builder clearDirectAccessWithFallback() { + if (directAccessWithFallbackBuilder_ == null) { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + } + directAccessWithFallbackBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder + getDirectAccessWithFallbackBuilder() { + return internalGetDirectAccessWithFallbackFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder + getDirectAccessWithFallbackOrBuilder() { + if ((modeCase_ == 4) && (directAccessWithFallbackBuilder_ != null)) { + return directAccessWithFallbackBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 4) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess with a fallback to CloudPath.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder> + internalGetDirectAccessWithFallbackFieldBuilder() { + if (directAccessWithFallbackBuilder_ == null) { + if (!(modeCase_ == 4)) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.getDefaultInstance(); + } + directAccessWithFallbackBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallbackOrBuilder>( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessWithFallback) + mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 4; + onChanged(); + return directAccessWithFallbackBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder> + directAccessOnlyBuilder_; + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return Whether the directAccessOnly field is set. + */ + @java.lang.Override + public boolean hasDirectAccessOnly() { + return modeCase_ == 5; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + * + * @return The directAccessOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + getDirectAccessOnly() { + if (directAccessOnlyBuilder_ == null) { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } else { + if (modeCase_ == 5) { + return directAccessOnlyBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder setDirectAccessOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + value) { + if (directAccessOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + directAccessOnlyBuilder_.setMessage(value); + } + modeCase_ = 5; + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder setDirectAccessOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder + builderForValue) { + if (directAccessOnlyBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + directAccessOnlyBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 5; + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder mergeDirectAccessOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly + value) { + if (directAccessOnlyBuilder_ == null) { + if (modeCase_ == 5 + && mode_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance()) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.newBuilder( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 5) { + directAccessOnlyBuilder_.mergeFrom(value); + } else { + directAccessOnlyBuilder_.setMessage(value); + } + } + modeCase_ = 5; + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public Builder clearDirectAccessOnly() { + if (directAccessOnlyBuilder_ == null) { + if (modeCase_ == 5) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 5) { + modeCase_ = 0; + mode_ = null; + } + directAccessOnlyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder + getDirectAccessOnlyBuilder() { + return internalGetDirectAccessOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder + getDirectAccessOnlyOrBuilder() { + if ((modeCase_ == 5) && (directAccessOnlyBuilder_ != null)) { + return directAccessOnlyBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 5) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * DirectAccess only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder> + internalGetDirectAccessOnlyFieldBuilder() { + if (directAccessOnlyBuilder_ == null) { + if (!(modeCase_ == 5)) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.getDefaultInstance(); + } + directAccessOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnlyOrBuilder>( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .DirectAccessOnly) + mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 5; + onChanged(); + return directAccessOnlyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder> + cloudPathOnlyBuilder_; + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return Whether the cloudPathOnly field is set. + */ + @java.lang.Override + public boolean hasCloudPathOnly() { + return modeCase_ == 6; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + * + * @return The cloudPathOnly. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly + getCloudPathOnly() { + if (cloudPathOnlyBuilder_ == null) { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } else { + if (modeCase_ == 6) { + return cloudPathOnlyBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder setCloudPathOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + value) { + if (cloudPathOnlyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + cloudPathOnlyBuilder_.setMessage(value); + } + modeCase_ = 6; + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder setCloudPathOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + .Builder + builderForValue) { + if (cloudPathOnlyBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + cloudPathOnlyBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 6; + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder mergeCloudPathOnly( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly + value) { + if (cloudPathOnlyBuilder_ == null) { + if (modeCase_ == 6 + && mode_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance()) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.newBuilder( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 6) { + cloudPathOnlyBuilder_.mergeFrom(value); + } else { + cloudPathOnlyBuilder_.setMessage(value); + } + } + modeCase_ = 6; + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public Builder clearCloudPathOnly() { + if (cloudPathOnlyBuilder_ == null) { + if (modeCase_ == 6) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 6) { + modeCase_ = 0; + mode_ = null; + } + cloudPathOnlyBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder + getCloudPathOnlyBuilder() { + return internalGetCloudPathOnlyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder + getCloudPathOnlyOrBuilder() { + if ((modeCase_ == 6) && (cloudPathOnlyBuilder_ != null)) { + return cloudPathOnlyBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 6) { + return (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_; + } + return com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + } + + /** + * + * + *
+       * CloudPath only.
+       * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder> + internalGetCloudPathOnlyFieldBuilder() { + if (cloudPathOnlyBuilder_ == null) { + if (!(modeCase_ == 6)) { + mode_ = + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.getDefaultInstance(); + } + cloudPathOnlyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnlyOrBuilder>( + (com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .CloudPathOnly) + mode_, + getParentForChildren(), + isClean()); + mode_ = null; + } + modeCase_ = 6; + onChanged(); + return cloudPathOnlyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration) + private static final com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChannelPoolConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SessionPoolConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Fraction of idle sessions to keep in order to manage an increase in
+     * requests-in-flight. For example, a headroom of 0.5 will keep enough
+     * sessions to deal with a 50% increase in QPS.
+     * 
+ * + * float headroom = 1; + * + * @return The headroom. + */ + float getHeadroom(); + + /** + * + * + *
+     * The minimum number of sessions for a given scope.
+     * 
+ * + * int32 min_session_count = 2; + * + * @return The minSessionCount. + */ + int getMinSessionCount(); + + /** + * + * + *
+     * The maximum number of sessions for a given scope.
+     * 
+ * + * int32 max_session_count = 3; + * + * @return The maxSessionCount. + */ + int getMaxSessionCount(); + + /** + * + * + *
+     * Number of vRPCs that can be queued per starting session.
+     * 
+ * + * int32 new_session_queue_length = 4; + * + * @return The newSessionQueueLength. + */ + int getNewSessionQueueLength(); + + /** + * + * + *
+     * How many concurrent session establishments are allowed. The client will
+     * hold onto a count against this budget whenever it is establishing a new
+     * session, and release that count once the session is successfully
+     * established or failed to establish.
+     * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return The newSessionCreationBudget. + */ + int getNewSessionCreationBudget(); + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return Whether the newSessionCreationPenalty field is set. + */ + boolean hasNewSessionCreationPenalty(); + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return The newSessionCreationPenalty. + */ + com.google.protobuf.Duration getNewSessionCreationPenalty(); + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + com.google.protobuf.DurationOrBuilder getNewSessionCreationPenaltyOrBuilder(); + + /** + * + * + *
+     * A threshold for cancelling all pending vRPCs based on how many
+     * consecutive session establishment errors have been observed. The client
+     * will eagerly cancel queued vRPCs after this threshold is met to avoid
+     * them waiting their entire deadlines before terminating (while waiting for
+     * any session to establish to actually send the vRPC).
+     * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return The consecutiveSessionFailureThreshold. + */ + int getConsecutiveSessionFailureThreshold(); + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return Whether the loadBalancingOptions field is set. + */ + boolean hasLoadBalancingOptions(); + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return The loadBalancingOptions. + */ + com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions(); + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder(); + } + + /** + * + * + *
+   * Configuration for the session pools. Session pools are tied to a scope
+   * like a table, an app profile, and a permission.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration} + */ + public static final class SessionPoolConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + SessionPoolConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionPoolConfiguration"); + } + + // Use SessionPoolConfiguration.newBuilder() to construct. + private SessionPoolConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionPoolConfiguration() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + .class); + } + + private int bitField0_; + public static final int HEADROOM_FIELD_NUMBER = 1; + private float headroom_ = 0F; + + /** + * + * + *
+     * Fraction of idle sessions to keep in order to manage an increase in
+     * requests-in-flight. For example, a headroom of 0.5 will keep enough
+     * sessions to deal with a 50% increase in QPS.
+     * 
+ * + * float headroom = 1; + * + * @return The headroom. + */ + @java.lang.Override + public float getHeadroom() { + return headroom_; + } + + public static final int MIN_SESSION_COUNT_FIELD_NUMBER = 2; + private int minSessionCount_ = 0; + + /** + * + * + *
+     * The minimum number of sessions for a given scope.
+     * 
+ * + * int32 min_session_count = 2; + * + * @return The minSessionCount. + */ + @java.lang.Override + public int getMinSessionCount() { + return minSessionCount_; + } + + public static final int MAX_SESSION_COUNT_FIELD_NUMBER = 3; + private int maxSessionCount_ = 0; + + /** + * + * + *
+     * The maximum number of sessions for a given scope.
+     * 
+ * + * int32 max_session_count = 3; + * + * @return The maxSessionCount. + */ + @java.lang.Override + public int getMaxSessionCount() { + return maxSessionCount_; + } + + public static final int NEW_SESSION_QUEUE_LENGTH_FIELD_NUMBER = 4; + private int newSessionQueueLength_ = 0; + + /** + * + * + *
+     * Number of vRPCs that can be queued per starting session.
+     * 
+ * + * int32 new_session_queue_length = 4; + * + * @return The newSessionQueueLength. + */ + @java.lang.Override + public int getNewSessionQueueLength() { + return newSessionQueueLength_; + } + + public static final int NEW_SESSION_CREATION_BUDGET_FIELD_NUMBER = 5; + private int newSessionCreationBudget_ = 0; + + /** + * + * + *
+     * How many concurrent session establishments are allowed. The client will
+     * hold onto a count against this budget whenever it is establishing a new
+     * session, and release that count once the session is successfully
+     * established or failed to establish.
+     * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return The newSessionCreationBudget. + */ + @java.lang.Override + public int getNewSessionCreationBudget() { + return newSessionCreationBudget_; + } + + public static final int NEW_SESSION_CREATION_PENALTY_FIELD_NUMBER = 6; + private com.google.protobuf.Duration newSessionCreationPenalty_; + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return Whether the newSessionCreationPenalty field is set. + */ + @java.lang.Override + public boolean hasNewSessionCreationPenalty() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return The newSessionCreationPenalty. + */ + @java.lang.Override + public com.google.protobuf.Duration getNewSessionCreationPenalty() { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } + + /** + * + * + *
+     * How long to penalize the creation budget for a failed session creation
+     * attempt.
+     * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getNewSessionCreationPenaltyOrBuilder() { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } + + public static final int CONSECUTIVE_SESSION_FAILURE_THRESHOLD_FIELD_NUMBER = 8; + private int consecutiveSessionFailureThreshold_ = 0; + + /** + * + * + *
+     * A threshold for cancelling all pending vRPCs based on how many
+     * consecutive session establishment errors have been observed. The client
+     * will eagerly cancel queued vRPCs after this threshold is met to avoid
+     * them waiting their entire deadlines before terminating (while waiting for
+     * any session to establish to actually send the vRPC).
+     * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return The consecutiveSessionFailureThreshold. + */ + @java.lang.Override + public int getConsecutiveSessionFailureThreshold() { + return consecutiveSessionFailureThreshold_; + } + + public static final int LOAD_BALANCING_OPTIONS_FIELD_NUMBER = 9; + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Override + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return The loadBalancingOptions. + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + /** + * + * + *
+     * How to balance vRPC load over connections to AFEs.
+     * Set only if session_load > 0.
+     * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + @java.lang.Override + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(headroom_) != 0) { + output.writeFloat(1, headroom_); + } + if (minSessionCount_ != 0) { + output.writeInt32(2, minSessionCount_); + } + if (maxSessionCount_ != 0) { + output.writeInt32(3, maxSessionCount_); + } + if (newSessionQueueLength_ != 0) { + output.writeInt32(4, newSessionQueueLength_); + } + if (newSessionCreationBudget_ != 0) { + output.writeInt32(5, newSessionCreationBudget_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getNewSessionCreationPenalty()); + } + if (consecutiveSessionFailureThreshold_ != 0) { + output.writeInt32(8, consecutiveSessionFailureThreshold_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(9, getLoadBalancingOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(headroom_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, headroom_); + } + if (minSessionCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, minSessionCount_); + } + if (maxSessionCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxSessionCount_); + } + if (newSessionQueueLength_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, newSessionQueueLength_); + } + if (newSessionCreationBudget_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(5, newSessionCreationBudget_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, getNewSessionCreationPenalty()); + } + if (consecutiveSessionFailureThreshold_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 8, consecutiveSessionFailureThreshold_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getLoadBalancingOptions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration other = + (com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) obj; + + if (java.lang.Float.floatToIntBits(getHeadroom()) + != java.lang.Float.floatToIntBits(other.getHeadroom())) return false; + if (getMinSessionCount() != other.getMinSessionCount()) return false; + if (getMaxSessionCount() != other.getMaxSessionCount()) return false; + if (getNewSessionQueueLength() != other.getNewSessionQueueLength()) return false; + if (getNewSessionCreationBudget() != other.getNewSessionCreationBudget()) return false; + if (hasNewSessionCreationPenalty() != other.hasNewSessionCreationPenalty()) return false; + if (hasNewSessionCreationPenalty()) { + if (!getNewSessionCreationPenalty().equals(other.getNewSessionCreationPenalty())) + return false; + } + if (getConsecutiveSessionFailureThreshold() != other.getConsecutiveSessionFailureThreshold()) + return false; + if (hasLoadBalancingOptions() != other.hasLoadBalancingOptions()) return false; + if (hasLoadBalancingOptions()) { + if (!getLoadBalancingOptions().equals(other.getLoadBalancingOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HEADROOM_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getHeadroom()); + hash = (37 * hash) + MIN_SESSION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinSessionCount(); + hash = (37 * hash) + MAX_SESSION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxSessionCount(); + hash = (37 * hash) + NEW_SESSION_QUEUE_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getNewSessionQueueLength(); + hash = (37 * hash) + NEW_SESSION_CREATION_BUDGET_FIELD_NUMBER; + hash = (53 * hash) + getNewSessionCreationBudget(); + if (hasNewSessionCreationPenalty()) { + hash = (37 * hash) + NEW_SESSION_CREATION_PENALTY_FIELD_NUMBER; + hash = (53 * hash) + getNewSessionCreationPenalty().hashCode(); + } + hash = (37 * hash) + CONSECUTIVE_SESSION_FAILURE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getConsecutiveSessionFailureThreshold(); + if (hasLoadBalancingOptions()) { + hash = (37 * hash) + LOAD_BALANCING_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getLoadBalancingOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + 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.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + 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.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Configuration for the session pools. Session pools are tied to a scope
+     * like a table, an app profile, and a permission.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + .class); + } + + // Construct using + // com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetNewSessionCreationPenaltyFieldBuilder(); + internalGetLoadBalancingOptionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + headroom_ = 0F; + minSessionCount_ = 0; + maxSessionCount_ = 0; + newSessionQueueLength_ = 0; + newSessionCreationBudget_ = 0; + newSessionCreationPenalty_ = null; + if (newSessionCreationPenaltyBuilder_ != null) { + newSessionCreationPenaltyBuilder_.dispose(); + newSessionCreationPenaltyBuilder_ = null; + } + consecutiveSessionFailureThreshold_ = 0; + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration build() { + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration result = + new com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.headroom_ = headroom_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minSessionCount_ = minSessionCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxSessionCount_ = maxSessionCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.newSessionQueueLength_ = newSessionQueueLength_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.newSessionCreationBudget_ = newSessionCreationBudget_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.newSessionCreationPenalty_ = + newSessionCreationPenaltyBuilder_ == null + ? newSessionCreationPenalty_ + : newSessionCreationPenaltyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.consecutiveSessionFailureThreshold_ = consecutiveSessionFailureThreshold_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.loadBalancingOptions_ = + loadBalancingOptionsBuilder_ == null + ? loadBalancingOptions_ + : loadBalancingOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) { + return mergeFrom( + (com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration other) { + if (other + == com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance()) return this; + if (java.lang.Float.floatToRawIntBits(other.getHeadroom()) != 0) { + setHeadroom(other.getHeadroom()); + } + if (other.getMinSessionCount() != 0) { + setMinSessionCount(other.getMinSessionCount()); + } + if (other.getMaxSessionCount() != 0) { + setMaxSessionCount(other.getMaxSessionCount()); + } + if (other.getNewSessionQueueLength() != 0) { + setNewSessionQueueLength(other.getNewSessionQueueLength()); + } + if (other.getNewSessionCreationBudget() != 0) { + setNewSessionCreationBudget(other.getNewSessionCreationBudget()); + } + if (other.hasNewSessionCreationPenalty()) { + mergeNewSessionCreationPenalty(other.getNewSessionCreationPenalty()); + } + if (other.getConsecutiveSessionFailureThreshold() != 0) { + setConsecutiveSessionFailureThreshold(other.getConsecutiveSessionFailureThreshold()); + } + if (other.hasLoadBalancingOptions()) { + mergeLoadBalancingOptions(other.getLoadBalancingOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + headroom_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 16: + { + minSessionCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + maxSessionCount_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + newSessionQueueLength_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + newSessionCreationBudget_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + input.readMessage( + internalGetNewSessionCreationPenaltyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 64: + { + consecutiveSessionFailureThreshold_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 74: + { + input.readMessage( + internalGetLoadBalancingOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float headroom_; + + /** + * + * + *
+       * Fraction of idle sessions to keep in order to manage an increase in
+       * requests-in-flight. For example, a headroom of 0.5 will keep enough
+       * sessions to deal with a 50% increase in QPS.
+       * 
+ * + * float headroom = 1; + * + * @return The headroom. + */ + @java.lang.Override + public float getHeadroom() { + return headroom_; + } + + /** + * + * + *
+       * Fraction of idle sessions to keep in order to manage an increase in
+       * requests-in-flight. For example, a headroom of 0.5 will keep enough
+       * sessions to deal with a 50% increase in QPS.
+       * 
+ * + * float headroom = 1; + * + * @param value The headroom to set. + * @return This builder for chaining. + */ + public Builder setHeadroom(float value) { + + headroom_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Fraction of idle sessions to keep in order to manage an increase in
+       * requests-in-flight. For example, a headroom of 0.5 will keep enough
+       * sessions to deal with a 50% increase in QPS.
+       * 
+ * + * float headroom = 1; + * + * @return This builder for chaining. + */ + public Builder clearHeadroom() { + bitField0_ = (bitField0_ & ~0x00000001); + headroom_ = 0F; + onChanged(); + return this; + } + + private int minSessionCount_; + + /** + * + * + *
+       * The minimum number of sessions for a given scope.
+       * 
+ * + * int32 min_session_count = 2; + * + * @return The minSessionCount. + */ + @java.lang.Override + public int getMinSessionCount() { + return minSessionCount_; + } + + /** + * + * + *
+       * The minimum number of sessions for a given scope.
+       * 
+ * + * int32 min_session_count = 2; + * + * @param value The minSessionCount to set. + * @return This builder for chaining. + */ + public Builder setMinSessionCount(int value) { + + minSessionCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The minimum number of sessions for a given scope.
+       * 
+ * + * int32 min_session_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearMinSessionCount() { + bitField0_ = (bitField0_ & ~0x00000002); + minSessionCount_ = 0; + onChanged(); + return this; + } + + private int maxSessionCount_; + + /** + * + * + *
+       * The maximum number of sessions for a given scope.
+       * 
+ * + * int32 max_session_count = 3; + * + * @return The maxSessionCount. + */ + @java.lang.Override + public int getMaxSessionCount() { + return maxSessionCount_; + } + + /** + * + * + *
+       * The maximum number of sessions for a given scope.
+       * 
+ * + * int32 max_session_count = 3; + * + * @param value The maxSessionCount to set. + * @return This builder for chaining. + */ + public Builder setMaxSessionCount(int value) { + + maxSessionCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The maximum number of sessions for a given scope.
+       * 
+ * + * int32 max_session_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxSessionCount() { + bitField0_ = (bitField0_ & ~0x00000004); + maxSessionCount_ = 0; + onChanged(); + return this; + } + + private int newSessionQueueLength_; + + /** + * + * + *
+       * Number of vRPCs that can be queued per starting session.
+       * 
+ * + * int32 new_session_queue_length = 4; + * + * @return The newSessionQueueLength. + */ + @java.lang.Override + public int getNewSessionQueueLength() { + return newSessionQueueLength_; + } + + /** + * + * + *
+       * Number of vRPCs that can be queued per starting session.
+       * 
+ * + * int32 new_session_queue_length = 4; + * + * @param value The newSessionQueueLength to set. + * @return This builder for chaining. + */ + public Builder setNewSessionQueueLength(int value) { + + newSessionQueueLength_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Number of vRPCs that can be queued per starting session.
+       * 
+ * + * int32 new_session_queue_length = 4; + * + * @return This builder for chaining. + */ + public Builder clearNewSessionQueueLength() { + bitField0_ = (bitField0_ & ~0x00000008); + newSessionQueueLength_ = 0; + onChanged(); + return this; + } + + private int newSessionCreationBudget_; + + /** + * + * + *
+       * How many concurrent session establishments are allowed. The client will
+       * hold onto a count against this budget whenever it is establishing a new
+       * session, and release that count once the session is successfully
+       * established or failed to establish.
+       * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return The newSessionCreationBudget. + */ + @java.lang.Override + public int getNewSessionCreationBudget() { + return newSessionCreationBudget_; + } + + /** + * + * + *
+       * How many concurrent session establishments are allowed. The client will
+       * hold onto a count against this budget whenever it is establishing a new
+       * session, and release that count once the session is successfully
+       * established or failed to establish.
+       * 
+ * + * int32 new_session_creation_budget = 5; + * + * @param value The newSessionCreationBudget to set. + * @return This builder for chaining. + */ + public Builder setNewSessionCreationBudget(int value) { + + newSessionCreationBudget_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * How many concurrent session establishments are allowed. The client will
+       * hold onto a count against this budget whenever it is establishing a new
+       * session, and release that count once the session is successfully
+       * established or failed to establish.
+       * 
+ * + * int32 new_session_creation_budget = 5; + * + * @return This builder for chaining. + */ + public Builder clearNewSessionCreationBudget() { + bitField0_ = (bitField0_ & ~0x00000010); + newSessionCreationBudget_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration newSessionCreationPenalty_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + newSessionCreationPenaltyBuilder_; + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return Whether the newSessionCreationPenalty field is set. + */ + public boolean hasNewSessionCreationPenalty() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + * + * @return The newSessionCreationPenalty. + */ + public com.google.protobuf.Duration getNewSessionCreationPenalty() { + if (newSessionCreationPenaltyBuilder_ == null) { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } else { + return newSessionCreationPenaltyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder setNewSessionCreationPenalty(com.google.protobuf.Duration value) { + if (newSessionCreationPenaltyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + newSessionCreationPenalty_ = value; + } else { + newSessionCreationPenaltyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder setNewSessionCreationPenalty( + com.google.protobuf.Duration.Builder builderForValue) { + if (newSessionCreationPenaltyBuilder_ == null) { + newSessionCreationPenalty_ = builderForValue.build(); + } else { + newSessionCreationPenaltyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder mergeNewSessionCreationPenalty(com.google.protobuf.Duration value) { + if (newSessionCreationPenaltyBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && newSessionCreationPenalty_ != null + && newSessionCreationPenalty_ != com.google.protobuf.Duration.getDefaultInstance()) { + getNewSessionCreationPenaltyBuilder().mergeFrom(value); + } else { + newSessionCreationPenalty_ = value; + } + } else { + newSessionCreationPenaltyBuilder_.mergeFrom(value); + } + if (newSessionCreationPenalty_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public Builder clearNewSessionCreationPenalty() { + bitField0_ = (bitField0_ & ~0x00000020); + newSessionCreationPenalty_ = null; + if (newSessionCreationPenaltyBuilder_ != null) { + newSessionCreationPenaltyBuilder_.dispose(); + newSessionCreationPenaltyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public com.google.protobuf.Duration.Builder getNewSessionCreationPenaltyBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetNewSessionCreationPenaltyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + public com.google.protobuf.DurationOrBuilder getNewSessionCreationPenaltyOrBuilder() { + if (newSessionCreationPenaltyBuilder_ != null) { + return newSessionCreationPenaltyBuilder_.getMessageOrBuilder(); + } else { + return newSessionCreationPenalty_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : newSessionCreationPenalty_; + } + } + + /** + * + * + *
+       * How long to penalize the creation budget for a failed session creation
+       * attempt.
+       * 
+ * + * .google.protobuf.Duration new_session_creation_penalty = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetNewSessionCreationPenaltyFieldBuilder() { + if (newSessionCreationPenaltyBuilder_ == null) { + newSessionCreationPenaltyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getNewSessionCreationPenalty(), getParentForChildren(), isClean()); + newSessionCreationPenalty_ = null; + } + return newSessionCreationPenaltyBuilder_; + } + + private int consecutiveSessionFailureThreshold_; + + /** + * + * + *
+       * A threshold for cancelling all pending vRPCs based on how many
+       * consecutive session establishment errors have been observed. The client
+       * will eagerly cancel queued vRPCs after this threshold is met to avoid
+       * them waiting their entire deadlines before terminating (while waiting for
+       * any session to establish to actually send the vRPC).
+       * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return The consecutiveSessionFailureThreshold. + */ + @java.lang.Override + public int getConsecutiveSessionFailureThreshold() { + return consecutiveSessionFailureThreshold_; + } + + /** + * + * + *
+       * A threshold for cancelling all pending vRPCs based on how many
+       * consecutive session establishment errors have been observed. The client
+       * will eagerly cancel queued vRPCs after this threshold is met to avoid
+       * them waiting their entire deadlines before terminating (while waiting for
+       * any session to establish to actually send the vRPC).
+       * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @param value The consecutiveSessionFailureThreshold to set. + * @return This builder for chaining. + */ + public Builder setConsecutiveSessionFailureThreshold(int value) { + + consecutiveSessionFailureThreshold_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * A threshold for cancelling all pending vRPCs based on how many
+       * consecutive session establishment errors have been observed. The client
+       * will eagerly cancel queued vRPCs after this threshold is met to avoid
+       * them waiting their entire deadlines before terminating (while waiting for
+       * any session to establish to actually send the vRPC).
+       * 
+ * + * int32 consecutive_session_failure_threshold = 8; + * + * @return This builder for chaining. + */ + public Builder clearConsecutiveSessionFailureThreshold() { + bitField0_ = (bitField0_ & ~0x00000040); + consecutiveSessionFailureThreshold_ = 0; + onChanged(); + return this; + } + + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + loadBalancingOptionsBuilder_; + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return Whether the loadBalancingOptions field is set. + */ + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + * + * @return The loadBalancingOptions. + */ + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + if (loadBalancingOptionsBuilder_ == null) { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } else { + return loadBalancingOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder setLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingOptions_ = value; + } else { + loadBalancingOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder setLoadBalancingOptions( + com.google.bigtable.v2.LoadBalancingOptions.Builder builderForValue) { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptions_ = builderForValue.build(); + } else { + loadBalancingOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder mergeLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && loadBalancingOptions_ != null + && loadBalancingOptions_ + != com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance()) { + getLoadBalancingOptionsBuilder().mergeFrom(value); + } else { + loadBalancingOptions_ = value; + } + } else { + loadBalancingOptionsBuilder_.mergeFrom(value); + } + if (loadBalancingOptions_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public Builder clearLoadBalancingOptions() { + bitField0_ = (bitField0_ & ~0x00000080); + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public com.google.bigtable.v2.LoadBalancingOptions.Builder getLoadBalancingOptionsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetLoadBalancingOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder + getLoadBalancingOptionsOrBuilder() { + if (loadBalancingOptionsBuilder_ != null) { + return loadBalancingOptionsBuilder_.getMessageOrBuilder(); + } else { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + } + + /** + * + * + *
+       * How to balance vRPC load over connections to AFEs.
+       * Set only if session_load > 0.
+       * 
+ * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + internalGetLoadBalancingOptionsFieldBuilder() { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder>( + getLoadBalancingOptions(), getParentForChildren(), isClean()); + loadBalancingOptions_ = null; + } + return loadBalancingOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration) + private static final com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionPoolConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int SESSION_LOAD_FIELD_NUMBER = 1; + private float sessionLoad_ = 0F; + + /** + * + * + *
+   * What share of requests should operate on a session, [0, 1]. The rest
+   * should operate on the old-style API.
+   * 
+ * + * float session_load = 1; + * + * @return The sessionLoad. + */ + @java.lang.Override + public float getSessionLoad() { + return sessionLoad_; + } + + public static final int LOAD_BALANCING_OPTIONS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return The loadBalancingOptions. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder() { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + + public static final int CHANNEL_CONFIGURATION_FIELD_NUMBER = 3; + private com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + channelConfiguration_; + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return Whether the channelConfiguration field is set. + */ + @java.lang.Override + public boolean hasChannelConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return The channelConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getChannelConfiguration() { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder + getChannelConfigurationOrBuilder() { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } + + public static final int SESSION_POOL_CONFIGURATION_FIELD_NUMBER = 4; + private com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + sessionPoolConfiguration_; + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return Whether the sessionPoolConfiguration field is set. + */ + @java.lang.Override + public boolean hasSessionPoolConfiguration() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return The sessionPoolConfiguration. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getSessionPoolConfiguration() { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder + getSessionPoolConfigurationOrBuilder() { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(sessionLoad_) != 0) { + output.writeFloat(1, sessionLoad_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getLoadBalancingOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getChannelConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getSessionPoolConfiguration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(sessionLoad_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, sessionLoad_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLoadBalancingOptions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getChannelConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, getSessionPoolConfiguration()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionClientConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionClientConfiguration other = + (com.google.bigtable.v2.SessionClientConfiguration) obj; + + if (java.lang.Float.floatToIntBits(getSessionLoad()) + != java.lang.Float.floatToIntBits(other.getSessionLoad())) return false; + if (hasLoadBalancingOptions() != other.hasLoadBalancingOptions()) return false; + if (hasLoadBalancingOptions()) { + if (!getLoadBalancingOptions().equals(other.getLoadBalancingOptions())) return false; + } + if (hasChannelConfiguration() != other.hasChannelConfiguration()) return false; + if (hasChannelConfiguration()) { + if (!getChannelConfiguration().equals(other.getChannelConfiguration())) return false; + } + if (hasSessionPoolConfiguration() != other.hasSessionPoolConfiguration()) return false; + if (hasSessionPoolConfiguration()) { + if (!getSessionPoolConfiguration().equals(other.getSessionPoolConfiguration())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SESSION_LOAD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getSessionLoad()); + if (hasLoadBalancingOptions()) { + hash = (37 * hash) + LOAD_BALANCING_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getLoadBalancingOptions().hashCode(); + } + if (hasChannelConfiguration()) { + hash = (37 * hash) + CHANNEL_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getChannelConfiguration().hashCode(); + } + if (hasSessionPoolConfiguration()) { + hash = (37 * hash) + SESSION_POOL_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getSessionPoolConfiguration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration 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.v2.SessionClientConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration 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.v2.SessionClientConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionClientConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionClientConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Configuration for the Session API. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionClientConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionClientConfiguration) + com.google.bigtable.v2.SessionClientConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionClientConfiguration.class, + com.google.bigtable.v2.SessionClientConfiguration.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionClientConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLoadBalancingOptionsFieldBuilder(); + internalGetChannelConfigurationFieldBuilder(); + internalGetSessionPoolConfigurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sessionLoad_ = 0F; + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + channelConfiguration_ = null; + if (channelConfigurationBuilder_ != null) { + channelConfigurationBuilder_.dispose(); + channelConfigurationBuilder_ = null; + } + sessionPoolConfiguration_ = null; + if (sessionPoolConfigurationBuilder_ != null) { + sessionPoolConfigurationBuilder_.dispose(); + sessionPoolConfigurationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration build() { + com.google.bigtable.v2.SessionClientConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration buildPartial() { + com.google.bigtable.v2.SessionClientConfiguration result = + new com.google.bigtable.v2.SessionClientConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionClientConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sessionLoad_ = sessionLoad_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.loadBalancingOptions_ = + loadBalancingOptionsBuilder_ == null + ? loadBalancingOptions_ + : loadBalancingOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.channelConfiguration_ = + channelConfigurationBuilder_ == null + ? channelConfiguration_ + : channelConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sessionPoolConfiguration_ = + sessionPoolConfigurationBuilder_ == null + ? sessionPoolConfiguration_ + : sessionPoolConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionClientConfiguration) { + return mergeFrom((com.google.bigtable.v2.SessionClientConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionClientConfiguration other) { + if (other == com.google.bigtable.v2.SessionClientConfiguration.getDefaultInstance()) + return this; + if (java.lang.Float.floatToRawIntBits(other.getSessionLoad()) != 0) { + setSessionLoad(other.getSessionLoad()); + } + if (other.hasLoadBalancingOptions()) { + mergeLoadBalancingOptions(other.getLoadBalancingOptions()); + } + if (other.hasChannelConfiguration()) { + mergeChannelConfiguration(other.getChannelConfiguration()); + } + if (other.hasSessionPoolConfiguration()) { + mergeSessionPoolConfiguration(other.getSessionPoolConfiguration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + sessionLoad_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: + { + input.readMessage( + internalGetLoadBalancingOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetChannelConfigurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetSessionPoolConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float sessionLoad_; + + /** + * + * + *
+     * What share of requests should operate on a session, [0, 1]. The rest
+     * should operate on the old-style API.
+     * 
+ * + * float session_load = 1; + * + * @return The sessionLoad. + */ + @java.lang.Override + public float getSessionLoad() { + return sessionLoad_; + } + + /** + * + * + *
+     * What share of requests should operate on a session, [0, 1]. The rest
+     * should operate on the old-style API.
+     * 
+ * + * float session_load = 1; + * + * @param value The sessionLoad to set. + * @return This builder for chaining. + */ + public Builder setSessionLoad(float value) { + + sessionLoad_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * What share of requests should operate on a session, [0, 1]. The rest
+     * should operate on the old-style API.
+     * 
+ * + * float session_load = 1; + * + * @return This builder for chaining. + */ + public Builder clearSessionLoad() { + bitField0_ = (bitField0_ & ~0x00000001); + sessionLoad_ = 0F; + onChanged(); + return this; + } + + private com.google.bigtable.v2.LoadBalancingOptions loadBalancingOptions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + loadBalancingOptionsBuilder_; + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is + * deprecated. See google/bigtable/v2/session.proto;l=220 + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Deprecated + public boolean hasLoadBalancingOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is + * deprecated. See google/bigtable/v2/session.proto;l=220 + * @return The loadBalancingOptions. + */ + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions() { + if (loadBalancingOptionsBuilder_ == null) { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } else { + return loadBalancingOptionsBuilder_.getMessage(); + } + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + loadBalancingOptions_ = value; + } else { + loadBalancingOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setLoadBalancingOptions( + com.google.bigtable.v2.LoadBalancingOptions.Builder builderForValue) { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptions_ = builderForValue.build(); + } else { + loadBalancingOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder mergeLoadBalancingOptions(com.google.bigtable.v2.LoadBalancingOptions value) { + if (loadBalancingOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && loadBalancingOptions_ != null + && loadBalancingOptions_ + != com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance()) { + getLoadBalancingOptionsBuilder().mergeFrom(value); + } else { + loadBalancingOptions_ = value; + } + } else { + loadBalancingOptionsBuilder_.mergeFrom(value); + } + if (loadBalancingOptions_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearLoadBalancingOptions() { + bitField0_ = (bitField0_ & ~0x00000002); + loadBalancingOptions_ = null; + if (loadBalancingOptionsBuilder_ != null) { + loadBalancingOptionsBuilder_.dispose(); + loadBalancingOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptions.Builder getLoadBalancingOptionsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetLoadBalancingOptionsFieldBuilder().getBuilder(); + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder() { + if (loadBalancingOptionsBuilder_ != null) { + return loadBalancingOptionsBuilder_.getMessageOrBuilder(); + } else { + return loadBalancingOptions_ == null + ? com.google.bigtable.v2.LoadBalancingOptions.getDefaultInstance() + : loadBalancingOptions_; + } + } + + /** + * + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder> + internalGetLoadBalancingOptionsFieldBuilder() { + if (loadBalancingOptionsBuilder_ == null) { + loadBalancingOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.LoadBalancingOptions, + com.google.bigtable.v2.LoadBalancingOptions.Builder, + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder>( + getLoadBalancingOptions(), getParentForChildren(), isClean()); + loadBalancingOptions_ = null; + } + return loadBalancingOptionsBuilder_; + } + + private com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + channelConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder> + channelConfigurationBuilder_; + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return Whether the channelConfiguration field is set. + */ + public boolean hasChannelConfiguration() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return The channelConfiguration. + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getChannelConfiguration() { + if (channelConfigurationBuilder_ == null) { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } else { + return channelConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder setChannelConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration value) { + if (channelConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + channelConfiguration_ = value; + } else { + channelConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder setChannelConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + builderForValue) { + if (channelConfigurationBuilder_ == null) { + channelConfiguration_ = builderForValue.build(); + } else { + channelConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder mergeChannelConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration value) { + if (channelConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && channelConfiguration_ != null + && channelConfiguration_ + != com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance()) { + getChannelConfigurationBuilder().mergeFrom(value); + } else { + channelConfiguration_ = value; + } + } else { + channelConfigurationBuilder_.mergeFrom(value); + } + if (channelConfiguration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public Builder clearChannelConfiguration() { + bitField0_ = (bitField0_ & ~0x00000004); + channelConfiguration_ = null; + if (channelConfigurationBuilder_ != null) { + channelConfigurationBuilder_.dispose(); + channelConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder + getChannelConfigurationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetChannelConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder + getChannelConfigurationOrBuilder() { + if (channelConfigurationBuilder_ != null) { + return channelConfigurationBuilder_.getMessageOrBuilder(); + } else { + return channelConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + .getDefaultInstance() + : channelConfiguration_; + } + } + + /** + * + * + *
+     * Configuration for the channel pool.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder> + internalGetChannelConfigurationFieldBuilder() { + if (channelConfigurationBuilder_ == null) { + channelConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration + .ChannelPoolConfigurationOrBuilder>( + getChannelConfiguration(), getParentForChildren(), isClean()); + channelConfiguration_ = null; + } + return channelConfigurationBuilder_; + } + + private com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + sessionPoolConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder> + sessionPoolConfigurationBuilder_; + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return Whether the sessionPoolConfiguration field is set. + */ + public boolean hasSessionPoolConfiguration() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return The sessionPoolConfiguration. + */ + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getSessionPoolConfiguration() { + if (sessionPoolConfigurationBuilder_ == null) { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } else { + return sessionPoolConfigurationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder setSessionPoolConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration value) { + if (sessionPoolConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionPoolConfiguration_ = value; + } else { + sessionPoolConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder setSessionPoolConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + builderForValue) { + if (sessionPoolConfigurationBuilder_ == null) { + sessionPoolConfiguration_ = builderForValue.build(); + } else { + sessionPoolConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder mergeSessionPoolConfiguration( + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration value) { + if (sessionPoolConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && sessionPoolConfiguration_ != null + && sessionPoolConfiguration_ + != com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance()) { + getSessionPoolConfigurationBuilder().mergeFrom(value); + } else { + sessionPoolConfiguration_ = value; + } + } else { + sessionPoolConfigurationBuilder_.mergeFrom(value); + } + if (sessionPoolConfiguration_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public Builder clearSessionPoolConfiguration() { + bitField0_ = (bitField0_ & ~0x00000008); + sessionPoolConfiguration_ = null; + if (sessionPoolConfigurationBuilder_ != null) { + sessionPoolConfigurationBuilder_.dispose(); + sessionPoolConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder + getSessionPoolConfigurationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetSessionPoolConfigurationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + public com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder + getSessionPoolConfigurationOrBuilder() { + if (sessionPoolConfigurationBuilder_ != null) { + return sessionPoolConfigurationBuilder_.getMessageOrBuilder(); + } else { + return sessionPoolConfiguration_ == null + ? com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + .getDefaultInstance() + : sessionPoolConfiguration_; + } + } + + /** + * + * + *
+     * Configuration for the session pools.
+     * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder> + internalGetSessionPoolConfigurationFieldBuilder() { + if (sessionPoolConfigurationBuilder_ == null) { + sessionPoolConfigurationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration, + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration.Builder, + com.google.bigtable.v2.SessionClientConfiguration + .SessionPoolConfigurationOrBuilder>( + getSessionPoolConfiguration(), getParentForChildren(), isClean()); + sessionPoolConfiguration_ = null; + } + return sessionPoolConfigurationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionClientConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionClientConfiguration) + private static final com.google.bigtable.v2.SessionClientConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionClientConfiguration(); + } + + public static com.google.bigtable.v2.SessionClientConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionClientConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionClientConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfigurationOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfigurationOrBuilder.java new file mode 100644 index 000000000000..aca5739fdfbe --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionClientConfigurationOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionClientConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionClientConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * What share of requests should operate on a session, [0, 1]. The rest
+   * should operate on the old-style API.
+   * 
+ * + * float session_load = 1; + * + * @return The sessionLoad. + */ + float getSessionLoad(); + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return Whether the loadBalancingOptions field is set. + */ + @java.lang.Deprecated + boolean hasLoadBalancingOptions(); + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + * + * @deprecated google.bigtable.v2.SessionClientConfiguration.load_balancing_options is deprecated. + * See google/bigtable/v2/session.proto;l=220 + * @return The loadBalancingOptions. + */ + @java.lang.Deprecated + com.google.bigtable.v2.LoadBalancingOptions getLoadBalancingOptions(); + + /** + * .google.bigtable.v2.LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.bigtable.v2.LoadBalancingOptionsOrBuilder getLoadBalancingOptionsOrBuilder(); + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return Whether the channelConfiguration field is set. + */ + boolean hasChannelConfiguration(); + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + * + * @return The channelConfiguration. + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration + getChannelConfiguration(); + + /** + * + * + *
+   * Configuration for the channel pool.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration channel_configuration = 3; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfigurationOrBuilder + getChannelConfigurationOrBuilder(); + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return Whether the sessionPoolConfiguration field is set. + */ + boolean hasSessionPoolConfiguration(); + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + * + * @return The sessionPoolConfiguration. + */ + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration + getSessionPoolConfiguration(); + + /** + * + * + *
+   * Configuration for the session pools.
+   * 
+ * + * + * .google.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration session_pool_configuration = 4; + * + */ + com.google.bigtable.v2.SessionClientConfiguration.SessionPoolConfigurationOrBuilder + getSessionPoolConfigurationOrBuilder(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequest.java new file mode 100644 index 000000000000..5dffbcbfa991 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequest.java @@ -0,0 +1,810 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowRequest} + */ +@com.google.protobuf.Generated +public final class SessionMutateRowRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionMutateRowRequest) + SessionMutateRowRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionMutateRowRequest"); + } + + // Use SessionMutateRowRequest.newBuilder() to construct. + private SessionMutateRowRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionMutateRowRequest() { + key_ = com.google.protobuf.ByteString.EMPTY; + mutations_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowRequest.class, + com.google.bigtable.v2.SessionMutateRowRequest.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + public static final int MUTATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List mutations_; + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public java.util.List getMutationsList() { + return mutations_; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public java.util.List + getMutationsOrBuilderList() { + return mutations_; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public int getMutationsCount() { + return mutations_.size(); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public com.google.bigtable.v2.Mutation getMutations(int index) { + return mutations_.get(index); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + @java.lang.Override + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + return mutations_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!key_.isEmpty()) { + output.writeBytes(1, key_); + } + for (int i = 0; i < mutations_.size(); i++) { + output.writeMessage(2, mutations_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!key_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, key_); + } + for (int i = 0; i < mutations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, mutations_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionMutateRowRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionMutateRowRequest other = + (com.google.bigtable.v2.SessionMutateRowRequest) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getMutationsList().equals(other.getMutationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getMutationsCount() > 0) { + hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getMutationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest 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.v2.SessionMutateRowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest 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.v2.SessionMutateRowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionMutateRowRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionMutateRowRequest) + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowRequest.class, + com.google.bigtable.v2.SessionMutateRowRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionMutateRowRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = com.google.protobuf.ByteString.EMPTY; + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + } else { + mutations_ = null; + mutationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest build() { + com.google.bigtable.v2.SessionMutateRowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest buildPartial() { + com.google.bigtable.v2.SessionMutateRowRequest result = + new com.google.bigtable.v2.SessionMutateRowRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.SessionMutateRowRequest result) { + if (mutationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + mutations_ = java.util.Collections.unmodifiableList(mutations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.mutations_ = mutations_; + } else { + result.mutations_ = mutationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.SessionMutateRowRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionMutateRowRequest) { + return mergeFrom((com.google.bigtable.v2.SessionMutateRowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionMutateRowRequest other) { + if (other == com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + setKey(other.getKey()); + } + if (mutationsBuilder_ == null) { + if (!other.mutations_.isEmpty()) { + if (mutations_.isEmpty()) { + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMutationsIsMutable(); + mutations_.addAll(other.mutations_); + } + onChanged(); + } + } else { + if (!other.mutations_.isEmpty()) { + if (mutationsBuilder_.isEmpty()) { + mutationsBuilder_.dispose(); + mutationsBuilder_ = null; + mutations_ = other.mutations_; + bitField0_ = (bitField0_ & ~0x00000002); + mutationsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMutationsFieldBuilder() + : null; + } else { + mutationsBuilder_.addAllMessages(other.mutations_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.Mutation m = + input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry); + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(m); + } else { + mutationsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + /** + * bytes key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * bytes key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + private java.util.List mutations_ = + java.util.Collections.emptyList(); + + private void ensureMutationsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + mutations_ = new java.util.ArrayList(mutations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + mutationsBuilder_; + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public java.util.List getMutationsList() { + if (mutationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(mutations_); + } else { + return mutationsBuilder_.getMessageList(); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public int getMutationsCount() { + if (mutationsBuilder_ == null) { + return mutations_.size(); + } else { + return mutationsBuilder_.getCount(); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation getMutations(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessage(index); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder setMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.set(index, value); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder setMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.set(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations(com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(value); + onChanged(); + } else { + mutationsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations(int index, com.google.bigtable.v2.Mutation value) { + if (mutationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMutationsIsMutable(); + mutations_.add(index, value); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addMutations( + int index, com.google.bigtable.v2.Mutation.Builder builderForValue) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.add(index, builderForValue.build()); + onChanged(); + } else { + mutationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder addAllMutations( + java.lang.Iterable values) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mutations_); + onChanged(); + } else { + mutationsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder clearMutations() { + if (mutationsBuilder_ == null) { + mutations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + mutationsBuilder_.clear(); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public Builder removeMutations(int index) { + if (mutationsBuilder_ == null) { + ensureMutationsIsMutable(); + mutations_.remove(index); + onChanged(); + } else { + mutationsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder().getBuilder(index); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) { + if (mutationsBuilder_ == null) { + return mutations_.get(index); + } else { + return mutationsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public java.util.List + getMutationsOrBuilderList() { + if (mutationsBuilder_ != null) { + return mutationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mutations_); + } + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { + return internalGetMutationsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { + return internalGetMutationsFieldBuilder() + .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); + } + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + public java.util.List getMutationsBuilderList() { + return internalGetMutationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + internalGetMutationsFieldBuilder() { + if (mutationsBuilder_ == null) { + mutationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + mutations_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + mutations_ = null; + } + return mutationsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionMutateRowRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionMutateRowRequest) + private static final com.google.bigtable.v2.SessionMutateRowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionMutateRowRequest(); + } + + public static com.google.bigtable.v2.SessionMutateRowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionMutateRowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequestOrBuilder.java new file mode 100644 index 000000000000..c7f81edb4734 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowRequestOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionMutateRowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionMutateRowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes key = 1; + * + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + java.util.List getMutationsList(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + com.google.bigtable.v2.Mutation getMutations(int index); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + int getMutationsCount(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + java.util.List getMutationsOrBuilderList(); + + /** repeated .google.bigtable.v2.Mutation mutations = 2; */ + com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponse.java new file mode 100644 index 000000000000..24953a9d987e --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponse.java @@ -0,0 +1,396 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowResponse} + */ +@com.google.protobuf.Generated +public final class SessionMutateRowResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionMutateRowResponse) + SessionMutateRowResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionMutateRowResponse"); + } + + // Use SessionMutateRowResponse.newBuilder() to construct. + private SessionMutateRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionMutateRowResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowResponse.class, + com.google.bigtable.v2.SessionMutateRowResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionMutateRowResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionMutateRowResponse other = + (com.google.bigtable.v2.SessionMutateRowResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse 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.v2.SessionMutateRowResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse 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.v2.SessionMutateRowResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionMutateRowResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionMutateRowResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionMutateRowResponse) + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionMutateRowResponse.class, + com.google.bigtable.v2.SessionMutateRowResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionMutateRowResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse build() { + com.google.bigtable.v2.SessionMutateRowResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse buildPartial() { + com.google.bigtable.v2.SessionMutateRowResponse result = + new com.google.bigtable.v2.SessionMutateRowResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionMutateRowResponse) { + return mergeFrom((com.google.bigtable.v2.SessionMutateRowResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionMutateRowResponse other) { + if (other == com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionMutateRowResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionMutateRowResponse) + private static final com.google.bigtable.v2.SessionMutateRowResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionMutateRowResponse(); + } + + public static com.google.bigtable.v2.SessionMutateRowResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionMutateRowResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponseOrBuilder.java new file mode 100644 index 000000000000..398282c8fa5d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionMutateRowResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionMutateRowResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionMutateRowResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponse.java new file mode 100644 index 000000000000..885a9c69bd78 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponse.java @@ -0,0 +1,750 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionParametersResponse} + */ +@com.google.protobuf.Generated +public final class SessionParametersResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionParametersResponse) + SessionParametersResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionParametersResponse"); + } + + // Use SessionParametersResponse.newBuilder() to construct. + private SessionParametersResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionParametersResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionParametersResponse.class, + com.google.bigtable.v2.SessionParametersResponse.Builder.class); + } + + private int bitField0_; + public static final int KEEP_ALIVE_FIELD_NUMBER = 1; + private com.google.protobuf.Duration keepAlive_; + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return Whether the keepAlive field is set. + */ + @java.lang.Override + public boolean hasKeepAlive() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return The keepAlive. + */ + @java.lang.Override + public com.google.protobuf.Duration getKeepAlive() { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getKeepAliveOrBuilder() { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getKeepAlive()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKeepAlive()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionParametersResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionParametersResponse other = + (com.google.bigtable.v2.SessionParametersResponse) obj; + + if (hasKeepAlive() != other.hasKeepAlive()) return false; + if (hasKeepAlive()) { + if (!getKeepAlive().equals(other.getKeepAlive())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasKeepAlive()) { + hash = (37 * hash) + KEEP_ALIVE_FIELD_NUMBER; + hash = (53 * hash) + getKeepAlive().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionParametersResponse 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.v2.SessionParametersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionParametersResponse 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.v2.SessionParametersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionParametersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionParametersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionParametersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionParametersResponse) + com.google.bigtable.v2.SessionParametersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionParametersResponse.class, + com.google.bigtable.v2.SessionParametersResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionParametersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetKeepAliveFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + keepAlive_ = null; + if (keepAliveBuilder_ != null) { + keepAliveBuilder_.dispose(); + keepAliveBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse build() { + com.google.bigtable.v2.SessionParametersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse buildPartial() { + com.google.bigtable.v2.SessionParametersResponse result = + new com.google.bigtable.v2.SessionParametersResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionParametersResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.keepAlive_ = keepAliveBuilder_ == null ? keepAlive_ : keepAliveBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionParametersResponse) { + return mergeFrom((com.google.bigtable.v2.SessionParametersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionParametersResponse other) { + if (other == com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance()) + return this; + if (other.hasKeepAlive()) { + mergeKeepAlive(other.getKeepAlive()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetKeepAliveFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration keepAlive_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + keepAliveBuilder_; + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return Whether the keepAlive field is set. + */ + public boolean hasKeepAlive() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return The keepAlive. + */ + public com.google.protobuf.Duration getKeepAlive() { + if (keepAliveBuilder_ == null) { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } else { + return keepAliveBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder setKeepAlive(com.google.protobuf.Duration value) { + if (keepAliveBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + keepAlive_ = value; + } else { + keepAliveBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder setKeepAlive(com.google.protobuf.Duration.Builder builderForValue) { + if (keepAliveBuilder_ == null) { + keepAlive_ = builderForValue.build(); + } else { + keepAliveBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder mergeKeepAlive(com.google.protobuf.Duration value) { + if (keepAliveBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && keepAlive_ != null + && keepAlive_ != com.google.protobuf.Duration.getDefaultInstance()) { + getKeepAliveBuilder().mergeFrom(value); + } else { + keepAlive_ = value; + } + } else { + keepAliveBuilder_.mergeFrom(value); + } + if (keepAlive_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public Builder clearKeepAlive() { + bitField0_ = (bitField0_ & ~0x00000001); + keepAlive_ = null; + if (keepAliveBuilder_ != null) { + keepAliveBuilder_.dispose(); + keepAliveBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public com.google.protobuf.Duration.Builder getKeepAliveBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetKeepAliveFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + public com.google.protobuf.DurationOrBuilder getKeepAliveOrBuilder() { + if (keepAliveBuilder_ != null) { + return keepAliveBuilder_.getMessageOrBuilder(); + } else { + return keepAlive_ == null ? com.google.protobuf.Duration.getDefaultInstance() : keepAlive_; + } + } + + /** + * + * + *
+     * Maximum time between messages that the AFE will send to the client. The
+     * client may use this information to determine its control-flow in relation
+     * to pruning black-holed or otherwise non-responsive sessions. Must be set
+     * and positive.
+     *
+     * See also Heartbeats.
+     * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetKeepAliveFieldBuilder() { + if (keepAliveBuilder_ == null) { + keepAliveBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getKeepAlive(), getParentForChildren(), isClean()); + keepAlive_ = null; + } + return keepAliveBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionParametersResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionParametersResponse) + private static final com.google.bigtable.v2.SessionParametersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionParametersResponse(); + } + + public static com.google.bigtable.v2.SessionParametersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionParametersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponseOrBuilder.java new file mode 100644 index 000000000000..9dae3f5fd2ca --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionParametersResponseOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionParametersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionParametersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return Whether the keepAlive field is set. + */ + boolean hasKeepAlive(); + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + * + * @return The keepAlive. + */ + com.google.protobuf.Duration getKeepAlive(); + + /** + * + * + *
+   * Maximum time between messages that the AFE will send to the client. The
+   * client may use this information to determine its control-flow in relation
+   * to pruning black-holed or otherwise non-responsive sessions. Must be set
+   * and positive.
+   *
+   * See also Heartbeats.
+   * 
+ * + * .google.protobuf.Duration keep_alive = 1; + */ + com.google.protobuf.DurationOrBuilder getKeepAliveOrBuilder(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionProto.java new file mode 100644 index 000000000000..c059d690e5a9 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionProto.java @@ -0,0 +1,997 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public final class SessionProto extends com.google.protobuf.GeneratedFile { + private SessionProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.bigtable.v2.SessionProto.openSessionType); + registry.add(com.google.bigtable.v2.SessionProto.vrpcSessionType); + registry.add(com.google.bigtable.v2.SessionProto.rpcSessionType); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int OPEN_SESSION_TYPE_FIELD_NUMBER = 138898474; + + /** + * + * + *
+   * Only OpenSessionRequest.payload's with a type matching rpc_session_type are
+   * accepted by the server, and only OpenSessionResponse.payload's with a type
+   * matching rpc_session_type are accepted by the client.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, com.google.bigtable.v2.SessionType> + openSessionType = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.bigtable.v2.SessionType.class, null); + + public static final int VRPC_SESSION_TYPE_FIELD_NUMBER = 138899157; + + /** + * + * + *
+   * Only VirtualRpcRequest.payload's with a type matching rpc_session_type are
+   * accepted by the server, and only VirtualRpcResponse.payload's with a type
+   * matching rpc_session_type are accepted by the client.
+   * 
+ * + * extend .google.protobuf.MessageOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, + java.util.List> + vrpcSessionType = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.bigtable.v2.SessionType.class, null); + + public static final int RPC_SESSION_TYPE_FIELD_NUMBER = 137964804; + + /** + * + * + *
+   * All session service methods must set this option to indicate which
+   * messages are permissible within the generic envelope.
+   * 
+ * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, com.google.bigtable.v2.SessionType> + rpcSessionType = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.bigtable.v2.SessionType.class, null); + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ClientConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_BackendIdentifier_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenSessionResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_CloseSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenTableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenTableResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ClusterInformation_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_ErrorResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_TableRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_TableResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionParametersResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_HeartbeatResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_GoAwayResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + " google/bigtable/v2/session.proto\022\022goog" + + "le.bigtable.v2\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\032\035goog" + + "le/bigtable/v2/data.proto\032&google/bigtab" + + "le/v2/feature_flags.proto\032&google/bigtable/v2/request_stats.proto\032 google/protob" + + "uf/descriptor.proto\032\036google/protobuf/dur" + + "ation.proto\032\037google/protobuf/timestamp.p" + + "roto\032\036google/rpc/error_details.proto\032\027google/rpc/status.proto\"\202\001\n" + + "\035GetClientConfigurationRequest\022D\n\r" + + "instance_name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%bigtableadmin.googleapis.com/Instance\022\033\n" + + "\016app_profile_id\030\002 \001(\tB\003\340A\001\"\356\002\n" + + "\024LoadBalancingOptions\022Q\n" + + "\017least_in_flight\030\001" + + " \001(\01326.google.bigtable.v2.LoadBalancingOptions.LeastInFlightH\000\022F\n" + + "\tpeak_ewma\030\002 \001(" + + "\01321.google.bigtable.v2.LoadBalancingOptions.PeakEwmaH\000\022A\n" + + "\006random\030\004 \001(\0132/.google." + + "bigtable.v2.LoadBalancingOptions.RandomH\000\032+\n\r" + + "LeastInFlight\022\032\n" + + "\022random_subset_size\030\001 \001(\003\032&\n" + + "\010PeakEwma\022\032\n" + + "\022random_subset_size\030\001 \001(\003\032\010\n" + + "\006RandomB\031\n" + + "\027load_balancing_strategy\"\274\n\n" + + "\032SessionClientConfiguration\022\024\n" + + "\014session_load\030\001 \001(\002\022L\n" + + "\026load_balancing_options\030\002" + + " \001(\0132(.google.bigtable.v2.LoadBalancingOptionsB\002\030\001\022f\n" + + "\025channel_configuration\030\003 \001(\0132G.google.bigtable.v2.SessionClient" + + "Configuration.ChannelPoolConfiguration\022k\n" + + "\032session_pool_configuration\030\004 \001(\0132G.goo" + + "gle.bigtable.v2.SessionClientConfiguration.SessionPoolConfiguration\032\376\004\n" + + "\030ChannelPoolConfiguration\022\030\n" + + "\020min_server_count\030\001 \001(\005\022\030\n" + + "\020max_server_count\030\002 \001(\005\022 \n" + + "\030per_server_session_count\030\003 \001(\005\022\207\001\n" + + "\033direct_access_with_fallback\030\004 \001(\0132`.google.bigtable.v" + + "2.SessionClientConfiguration.ChannelPool" + + "Configuration.DirectAccessWithFallbackH\000\022v\n" + + "\022direct_access_only\030\005 \001(\0132X.google.bi" + + "gtable.v2.SessionClientConfiguration.Cha" + + "nnelPoolConfiguration.DirectAccessOnlyH\000\022p\n" + + "\017cloud_path_only\030\006 \001(\0132U.google.bigta" + + "ble.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnlyH\000\032k\n" + + "\030DirectAccessWithFallback\022\034\n" + + "\024error_rate_threshold\030\001 \001(\002\0221\n" + + "\016check_interval\030\002 \001(\0132\031.google.protobuf.Duration\032\022\n" + + "\020DirectAccessOnly\032\017\n\r" + + "CloudPathOnlyB\006\n" + + "\004mode\032\343\002\n" + + "\030SessionPoolConfiguration\022\020\n" + + "\010headroom\030\001 \001(\002\022\031\n" + + "\021min_session_count\030\002 \001(\005\022\031\n" + + "\021max_session_count\030\003 \001(\005\022 \n" + + "\030new_session_queue_length\030\004 \001(\005\022#\n" + + "\033new_session_creation_budget\030\005 \001(\005\022?\n" + + "\034new_session_creation_penalty\030\006" + + " \001(\0132\031.google.protobuf.Duration\022-\n" + + "%consecutive_session_failure_threshold\030\010 \001(\005\022H\n" + + "\026load_balancing_options\030\t" + + " \001(\0132(.google.bigtable.v2.LoadBalancingOptions\"\255\001\n" + + "\026TelemetryConfiguration\022I\n" + + "\017debug_tag_level\030\001 \001(\01620" + + ".google.bigtable.v2.TelemetryConfiguration.Level\"H\n" + + "\005Level\022\025\n" + + "\021LEVEL_UNSPECIFIED\020\000\022\t\n" + + "\005DEBUG\020\001\022\010\n" + + "\004INFO\020\002\022\010\n" + + "\004WARN\020\003\022\t\n" + + "\005ERROR\020\004\"\217\004\n" + + "\023ClientConfiguration\022M\n" + + "\025session_configuration\030\002" + + " \001(\0132..google.bigtable.v2.SessionClientConfiguration\022\026\n" + + "\014stop_polling\030\003 \001(\010H\000\0229\n" + + "\020polling_interval\030\004" + + " \001(\0132\031.google.protobuf.DurationB\002\030\001H\000\022]\n" + + "\025polling_configuration\030\005 \001(\0132<.google.bigtable.v2" + + ".ClientConfiguration.PollingConfigurationH\000\022K\n" + + "\027telemetry_configuration\030\006 \001(\0132*.g" + + "oogle.bigtable.v2.TelemetryConfiguration\032\236\001\n" + + "\024PollingConfiguration\0223\n" + + "\020polling_interval\030\001 \001(\0132\031.google.protobuf.Duration\0224\n" + + "\021validity_duration\030\002 \001(\0132\031.google.protobuf.Duration\022\033\n" + + "\023max_rpc_retry_count\030\006 \001(\005B\t\n" + + "\007polling\"\333\001\n" + + "\016SessionRequest\022>\n" + + "\014open_session\030\001" + + " \001(\0132&.google.bigtable.v2.OpenSessionRequestH\000\022@\n\r" + + "close_session\030\002 \001(\0132\'.google.bigtable.v2.CloseSessionRequestH\000\022<\n" + + "\013virtual_rpc\030\003 \001(\0132%.google.bigtable.v2.VirtualRpcRequestH\000B\t\n" + + "\007payload\"\334\003\n" + + "\017SessionResponse\022?\n" + + "\014open_session\030\001 \001(\0132\'.g" + + "oogle.bigtable.v2.OpenSessionResponseH\000\022=\n" + + "\013virtual_rpc\030\002 \001(\0132&.google.bigtable.v2.VirtualRpcResponseH\000\0222\n" + + "\005error\030\003 \001(\0132!.google.bigtable.v2.ErrorResponseH\000\022K\n" + + "\022session_parameters\030\004" + + " \001(\0132-.google.bigtable.v2.SessionParametersResponseH\000\022:\n" + + "\theartbeat\030\005 \001(\0132%.google.bigtable.v2.HeartbeatResponseH\000\0225\n" + + "\007go_away\030\006 \001(\0132\".google.bigtable.v2.GoAwayResponseH\000\022J\n" + + "\026session_refresh_config\030\007" + + " \001(\0132(.google.bigtable.v2.SessionRefreshConfigH\000B\t\n" + + "\007payload\"\270\001\n" + + "\022OpenSessionRequest\022\030\n" + + "\020protocol_version\030\001 \001(\003\022/\n" + + "\005flags\030\002 \001(\0132 .google.bigtable.v2.FeatureFlags\022.\n" + + "&consecutive_failed_connection_attempts\030\003 \001(\003\022\026\n" + + "\016routing_cookie\030\004 \001(\014\022\017\n" + + "\007payload\030\005 \001(\014\"s\n" + + "\021BackendIdentifier\022\032\n" + + "\022google_frontend_id\030\001 \001(\003\022\037\n" + + "\027application_frontend_id\030\002 \001(\003\022!\n" + + "\031application_frontend_zone\030\003 \001(\t\"^\n" + + "\023OpenSessionResponse\0226\n" + + "\007backend\030\002 \001(\0132%.google.bigtable.v2.BackendIdentifier\022\017\n" + + "\007payload\030\001 \001(\014\"\333\002\n" + + "\023CloseSessionRequest\022J\n" + + "\006reason\030\001 \001(\0162:.goog" + + "le.bigtable.v2.CloseSessionRequest.CloseSessionReason\022\023\n" + + "\013description\030\002 \001(\t\"\342\001\n" + + "\022CloseSessionReason\022\036\n" + + "\032CLOSE_SESSION_REASON_UNSET\020\000\022\037\n" + + "\033CLOSE_SESSION_REASON_GOAWAY\020\001\022\036\n" + + "\032CLOSE_SESSION_REASON_ERROR\020\002\022\035\n" + + "\031CLOSE_SESSION_REASON_USER\020\003\022!\n" + + "\035CLOSE_SESSION_REASON_DOWNSIZE\020\004\022)\n" + + "%CLOSE_SESSION_REASON_MISSED_HEARTBEAT\020\005\"\365\001\n" + + "\020OpenTableRequest\022\022\n\n" + + "table_name\030\001 \001(\t\022\026\n" + + "\016app_profile_id\030\002 \001(\t\022C\n\n" + + "permission\030\003 \001(\0162/.google.bigtable.v2.OpenTableRequest.Permission\"h\n" + + "\n" + + "Permission\022\024\n" + + "\020PERMISSION_UNSET\020\000\022\023\n" + + "\017PERMISSION_READ\020\001\022\024\n" + + "\020PERMISSION_WRITE\020\002\022\031\n" + + "\025PERMISSION_READ_WRITE\020\003:\006\320\302\355\221\004\001\"\033\n" + + "\021OpenTableResponse:\006\320\302\355\221\004\001\"\221\002\n" + + "\031OpenAuthorizedViewRequest\022\034\n" + + "\024authorized_view_name\030\001 \001(\t\022\026\n" + + "\016app_profile_id\030\002 \001(\t\022L\n\n" + + "permission\030\003" + + " \001(\01628.google.bigtable.v2.OpenAuthorizedViewRequest.Permission\"h\n\n" + + "Permission\022\024\n" + + "\020PERMISSION_UNSET\020\000\022\023\n" + + "\017PERMISSION_READ\020\001\022\024\n" + + "\020PERMISSION_WRITE\020\002\022\031\n" + + "\025PERMISSION_READ_WRITE\020\003:\006\320\302\355\221\004\002\"$\n" + + "\032OpenAuthorizedViewResponse:\006\320\302\355\221\004\002\"\346\001\n" + + "\033OpenMaterializedViewRequest\022\036\n" + + "\026materialized_view_name\030\001 \001(\t\022\026\n" + + "\016app_profile_id\030\002 \001(\t\022N\n\n" + + "permission\030\003 \001" + + "(\0162:.google.bigtable.v2.OpenMaterializedViewRequest.Permission\"7\n\n" + + "Permission\022\024\n" + + "\020PERMISSION_UNSET\020\000\022\023\n" + + "\017PERMISSION_READ\020\001:\006\320\302\355\221\004\003\"&\n" + + "\034OpenMaterializedViewResponse:\006\320\302\355\221\004\003\"\217\002\n" + + "\021VirtualRpcRequest\022\016\n" + + "\006rpc_id\030\001 \001(\003\022+\n" + + "\010deadline\030\002 \001(\0132\031.google.protobuf.Duration\022@\n" + + "\010metadata\030\003" + + " \001(\0132..google.bigtable.v2.VirtualRpcRequest.Metadata\022\017\n" + + "\007payload\030\004 \001(\014\032j\n" + + "\010Metadata\022\026\n" + + "\016attempt_number\030\001 \001(\003\0221\n\r" + + "attempt_start\030\002 \001(\0132\032.google.protobuf.Timestamp\022\023\n" + + "\013traceparent\030\003 \001(\t\"9\n" + + "\022ClusterInformation\022\022\n\n" + + "cluster_id\030\001 \001(\t\022\017\n" + + "\007zone_id\030\002 \001(\t\"I\n" + + "\023SessionRequestStats\0222\n" + + "\017backend_latency\030\001 \001(\0132\031.google.protobuf.Duration\"\253\001\n" + + "\022VirtualRpcResponse\022\016\n" + + "\006rpc_id\030\001 \001(\003\022<\n" + + "\014cluster_info\030\002 \001(\0132&.google.bigtable.v2.ClusterInformation\0226\n" + + "\005stats\030\004 \001(\0132\'.google.bigtable.v2.SessionRequestStats\022\017\n" + + "\007payload\030\003 \001(\014\"\254\001\n\r" + + "ErrorResponse\022\016\n" + + "\006rpc_id\030\001 \001(\003\022<\n" + + "\014cluster_info\030\002 \001(\0132&.google.bigtable.v2.ClusterInformation\022\"\n" + + "\006status\030\003 \001(\0132\022.google.rpc.Status\022)\n\n" + + "retry_info\030\004 \001(\0132\025.google.rpc.RetryInfo\"\244\001\n" + + "\014TableRequest\022=\n" + + "\010read_row\030\001 \001(\0132" + + ").google.bigtable.v2.SessionReadRowRequestH\000\022A\n\n" + + "mutate_row\030\002 \001(\0132+.google.bigtab" + + "le.v2.SessionMutateRowRequestH\000:\007\252\355\355\221\004\001\001B\t\n" + + "\007payload\"\247\001\n\r" + + "TableResponse\022>\n" + + "\010read_row\030\001" + + " \001(\0132*.google.bigtable.v2.SessionReadRowResponseH\000\022B\n\n" + + "mutate_row\030\002 \001(\0132,.goog" + + "le.bigtable.v2.SessionMutateRowResponseH\000:\007\252\355\355\221\004\001\001B\t\n" + + "\007payload\"\255\001\n" + + "\025AuthorizedViewRequest\022=\n" + + "\010read_row\030\001" + + " \001(\0132).google.bigtable.v2.SessionReadRowRequestH\000\022A\n\n" + + "mutate_row\030\002" + + " \001(\0132+.google.bigtable.v2.SessionMutateRowRequestH\000:\007\252\355\355\221\004\001\002B" + + "\t\n" + + "\007payload\"\260\001\n" + + "\026AuthorizedViewResponse\022>\n" + + "\010read_row\030\001 \001" + + "(\0132*.google.bigtable.v2.SessionReadRowResponseH\000\022B\n\n" + + "mutate_row\030\002 \001(\0132,.google.bi" + + "gtable.v2.SessionMutateRowResponseH\000:\007\252\355\355\221\004\001\002B\t\n" + + "\007payload\"l\n" + + "\027MaterializedViewRequest\022=\n" + + "\010read_row\030\001" + + " \001(\0132).google.bigtable.v2.SessionReadRowRequestH\000:\007\252\355\355\221\004\001\003B" + + "\t\n" + + "\007payload\"n\n" + + "\030MaterializedViewResponse\022>\n" + + "\010read_row\030\001" + + " \001(\0132*.google.bigtable.v2.SessionReadRowResponseH\000:\007\252\355\355\221\004\001\003B" + + "\t\n" + + "\007payload\"S\n" + + "\025SessionReadRowRequest\022\013\n" + + "\003key\030\001 \001(\014\022-\n" + + "\006filter\030\002 \001(\0132\035.google.bigtable.v2.RowFilter\"o\n" + + "\026SessionReadRowResponse\022$\n" + + "\003row\030\001 \001(\0132\027.google.bigtable.v2.Row\022/\n" + + "\005stats\030\002 \001(\0132 .google.bigtable.v2.RequestStats\"W\n" + + "\027SessionMutateRowRequest\022\013\n" + + "\003key\030\001 \001(\014\022/\n" + + "\tmutations\030\002 \003(\0132\034.google.bigtable.v2.Mutation\"\032\n" + + "\030SessionMutateRowResponse\"J\n" + + "\031SessionParametersResponse\022-\n\n" + + "keep_alive\030\001 \001(\0132\031.google.protobuf.Duration\"\023\n" + + "\021HeartbeatResponse\"S\n" + + "\016GoAwayResponse\022\016\n" + + "\006reason\030\001 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\022\034\n" + + "\024last_rpc_id_admitted\030\003 \001(\003\"\332\001\n" + + "\024SessionRefreshConfig\022F\n" + + "\026optimized_open_request\030\001" + + " \001(\0132&.google.bigtable.v2.OpenSessionRequest\022H\n" + + "\010metadata\030\002" + + " \003(\01321.google.bigtable.v2.SessionRefreshConfig.MetadataB\003\340A\003\0320\n" + + "\010Metadata\022\020\n" + + "\003key\030\001 \001(\tB\003\340A\003\022\022\n" + + "\005value\030\002 \001(\014B\003\340A\003*\243\001\n" + + "\013SessionType\022\026\n" + + "\022SESSION_TYPE_UNSET\020\000\022\026\n" + + "\022SESSION_TYPE_TABLE\020\001\022 \n" + + "\034SESSION_TYPE_AUTHORIZED_VIEW\020\002\022\"\n" + + "\036SESSION_TYPE_MATERIALIZED_VIEW\020\003\022\036\n" + + "\021SESSION_TYPE_TEST\020\377\377\377\377\377\377\377\377\377\001:^\n" + + "\021open_session_type\022\037.google.protobuf.MessageOptions\030\252\330\235B" + + " \001(\0162\037.google.bigtable.v2.SessionType:^\n" + + "\021vrpc_session_type\022\037.google.protobuf.MessageOptions\030\325\335\235B" + + " \003(\0162\037.google.bigtable.v2.SessionType:\\\n" + + "\020rpc_session_type\022\036.google.protobuf.MethodOptions\030\204\332\344A" + + " \001(\0162\037.google.bigtable.v2.SessionTypeB\266\001\n" + + "\026com.google.bigtable.v2B\014SessionProtoP\001Z8cloud.google.com/go/bigtabl" + + "e/apiv2/bigtablepb;bigtablepb\252\002\030Google.C" + + "loud.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable" + + "\\V2\352\002\033Google::Cloud::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.bigtable.v2.DataProto.getDescriptor(), + com.google.bigtable.v2.FeatureFlagsProto.getDescriptor(), + com.google.bigtable.v2.RequestStatsProto.getDescriptor(), + com.google.protobuf.DescriptorProtos.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.ErrorDetailsProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_bigtable_v2_GetClientConfigurationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_GetClientConfigurationRequest_descriptor, + new java.lang.String[] { + "InstanceName", "AppProfileId", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_bigtable_v2_LoadBalancingOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor, + new java.lang.String[] { + "LeastInFlight", "PeakEwma", "Random", "LoadBalancingStrategy", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor = + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_LeastInFlight_descriptor, + new java.lang.String[] { + "RandomSubsetSize", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor = + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_PeakEwma_descriptor, + new java.lang.String[] { + "RandomSubsetSize", + }); + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor = + internal_static_google_bigtable_v2_LoadBalancingOptions_descriptor.getNestedType(2); + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_LoadBalancingOptions_Random_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_bigtable_v2_SessionClientConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor, + new java.lang.String[] { + "SessionLoad", + "LoadBalancingOptions", + "ChannelConfiguration", + "SessionPoolConfiguration", + }); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor, + new java.lang.String[] { + "MinServerCount", + "MaxServerCount", + "PerServerSessionCount", + "DirectAccessWithFallback", + "DirectAccessOnly", + "CloudPathOnly", + "Mode", + }); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor + .getNestedType(0); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessWithFallback_descriptor, + new java.lang.String[] { + "ErrorRateThreshold", "CheckInterval", + }); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor + .getNestedType(1); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_DirectAccessOnly_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_descriptor + .getNestedType(2); + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_ChannelPoolConfiguration_CloudPathOnly_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor = + internal_static_google_bigtable_v2_SessionClientConfiguration_descriptor.getNestedType(1); + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionClientConfiguration_SessionPoolConfiguration_descriptor, + new java.lang.String[] { + "Headroom", + "MinSessionCount", + "MaxSessionCount", + "NewSessionQueueLength", + "NewSessionCreationBudget", + "NewSessionCreationPenalty", + "ConsecutiveSessionFailureThreshold", + "LoadBalancingOptions", + }); + internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor, + new java.lang.String[] { + "DebugTagLevel", + }); + internal_static_google_bigtable_v2_ClientConfiguration_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_bigtable_v2_ClientConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ClientConfiguration_descriptor, + new java.lang.String[] { + "SessionConfiguration", + "StopPolling", + "PollingInterval", + "PollingConfiguration", + "TelemetryConfiguration", + "Polling", + }); + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor = + internal_static_google_bigtable_v2_ClientConfiguration_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ClientConfiguration_PollingConfiguration_descriptor, + new java.lang.String[] { + "PollingInterval", "ValidityDuration", "MaxRpcRetryCount", + }); + internal_static_google_bigtable_v2_SessionRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRequest_descriptor, + new java.lang.String[] { + "OpenSession", "CloseSession", "VirtualRpc", "Payload", + }); + internal_static_google_bigtable_v2_SessionResponse_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionResponse_descriptor, + new java.lang.String[] { + "OpenSession", + "VirtualRpc", + "Error", + "SessionParameters", + "Heartbeat", + "GoAway", + "SessionRefreshConfig", + "Payload", + }); + internal_static_google_bigtable_v2_OpenSessionRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_bigtable_v2_OpenSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenSessionRequest_descriptor, + new java.lang.String[] { + "ProtocolVersion", + "Flags", + "ConsecutiveFailedConnectionAttempts", + "RoutingCookie", + "Payload", + }); + internal_static_google_bigtable_v2_BackendIdentifier_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_bigtable_v2_BackendIdentifier_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_BackendIdentifier_descriptor, + new java.lang.String[] { + "GoogleFrontendId", "ApplicationFrontendId", "ApplicationFrontendZone", + }); + internal_static_google_bigtable_v2_OpenSessionResponse_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_bigtable_v2_OpenSessionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenSessionResponse_descriptor, + new java.lang.String[] { + "Backend", "Payload", + }); + internal_static_google_bigtable_v2_CloseSessionRequest_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_bigtable_v2_CloseSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_CloseSessionRequest_descriptor, + new java.lang.String[] { + "Reason", "Description", + }); + internal_static_google_bigtable_v2_OpenTableRequest_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_bigtable_v2_OpenTableRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenTableRequest_descriptor, + new java.lang.String[] { + "TableName", "AppProfileId", "Permission", + }); + internal_static_google_bigtable_v2_OpenTableResponse_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_bigtable_v2_OpenTableResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenTableResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenAuthorizedViewRequest_descriptor, + new java.lang.String[] { + "AuthorizedViewName", "AppProfileId", "Permission", + }); + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenAuthorizedViewResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenMaterializedViewRequest_descriptor, + new java.lang.String[] { + "MaterializedViewName", "AppProfileId", "Permission", + }); + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_OpenMaterializedViewResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor, + new java.lang.String[] { + "RpcId", "Deadline", "Metadata", "Payload", + }); + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor = + internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor, + new java.lang.String[] { + "AttemptNumber", "AttemptStart", "Traceparent", + }); + internal_static_google_bigtable_v2_ClusterInformation_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_bigtable_v2_ClusterInformation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ClusterInformation_descriptor, + new java.lang.String[] { + "ClusterId", "ZoneId", + }); + internal_static_google_bigtable_v2_SessionRequestStats_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRequestStats_descriptor, + new java.lang.String[] { + "BackendLatency", + }); + internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor, + new java.lang.String[] { + "RpcId", "ClusterInfo", "Stats", "Payload", + }); + internal_static_google_bigtable_v2_ErrorResponse_descriptor = + getDescriptor().getMessageType(21); + internal_static_google_bigtable_v2_ErrorResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_ErrorResponse_descriptor, + new java.lang.String[] { + "RpcId", "ClusterInfo", "Status", "RetryInfo", + }); + internal_static_google_bigtable_v2_TableRequest_descriptor = getDescriptor().getMessageType(22); + internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_TableRequest_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_TableResponse_descriptor = + getDescriptor().getMessageType(23); + internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_TableResponse_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor = + getDescriptor().getMessageType(24); + internal_static_google_bigtable_v2_AuthorizedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_AuthorizedViewRequest_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor = + getDescriptor().getMessageType(25); + internal_static_google_bigtable_v2_AuthorizedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_AuthorizedViewResponse_descriptor, + new java.lang.String[] { + "ReadRow", "MutateRow", "Payload", + }); + internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor = + getDescriptor().getMessageType(26); + internal_static_google_bigtable_v2_MaterializedViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MaterializedViewRequest_descriptor, + new java.lang.String[] { + "ReadRow", "Payload", + }); + internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor = + getDescriptor().getMessageType(27); + internal_static_google_bigtable_v2_MaterializedViewResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_MaterializedViewResponse_descriptor, + new java.lang.String[] { + "ReadRow", "Payload", + }); + internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor = + getDescriptor().getMessageType(28); + internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor, + new java.lang.String[] { + "Key", "Filter", + }); + internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor = + getDescriptor().getMessageType(29); + internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor, + new java.lang.String[] { + "Row", "Stats", + }); + internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor = + getDescriptor().getMessageType(30); + internal_static_google_bigtable_v2_SessionMutateRowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionMutateRowRequest_descriptor, + new java.lang.String[] { + "Key", "Mutations", + }); + internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor = + getDescriptor().getMessageType(31); + internal_static_google_bigtable_v2_SessionMutateRowResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionMutateRowResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_SessionParametersResponse_descriptor = + getDescriptor().getMessageType(32); + internal_static_google_bigtable_v2_SessionParametersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionParametersResponse_descriptor, + new java.lang.String[] { + "KeepAlive", + }); + internal_static_google_bigtable_v2_HeartbeatResponse_descriptor = + getDescriptor().getMessageType(33); + internal_static_google_bigtable_v2_HeartbeatResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_HeartbeatResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_GoAwayResponse_descriptor = + getDescriptor().getMessageType(34); + internal_static_google_bigtable_v2_GoAwayResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_GoAwayResponse_descriptor, + new java.lang.String[] { + "Reason", "Description", "LastRpcIdAdmitted", + }); + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor = + getDescriptor().getMessageType(35); + internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor, + new java.lang.String[] { + "OptimizedOpenRequest", "Metadata", + }); + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor = + internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor.getNestedType(0); + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + openSessionType.internalInit(descriptor.getExtension(0)); + vrpcSessionType.internalInit(descriptor.getExtension(1)); + rpcSessionType.internalInit(descriptor.getExtension(2)); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.bigtable.v2.DataProto.getDescriptor(); + com.google.bigtable.v2.FeatureFlagsProto.getDescriptor(); + com.google.bigtable.v2.RequestStatsProto.getDescriptor(); + com.google.protobuf.DescriptorProtos.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.ErrorDetailsProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.bigtable.v2.SessionProto.openSessionType); + registry.add(com.google.bigtable.v2.SessionProto.vrpcSessionType); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequest.java new file mode 100644 index 000000000000..1d9d877fc829 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequest.java @@ -0,0 +1,677 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowRequest} + */ +@com.google.protobuf.Generated +public final class SessionReadRowRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionReadRowRequest) + SessionReadRowRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionReadRowRequest"); + } + + // Use SessionReadRowRequest.newBuilder() to construct. + private SessionReadRowRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionReadRowRequest() { + key_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowRequest.class, + com.google.bigtable.v2.SessionReadRowRequest.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + public static final int FILTER_FIELD_NUMBER = 2; + private com.google.bigtable.v2.RowFilter filter_; + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return Whether the filter field is set. + */ + @java.lang.Override + public boolean hasFilter() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public com.google.bigtable.v2.RowFilter getFilter() { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + @java.lang.Override + public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!key_.isEmpty()) { + output.writeBytes(1, key_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFilter()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!key_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, key_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFilter()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionReadRowRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionReadRowRequest other = + (com.google.bigtable.v2.SessionReadRowRequest) obj; + + if (!getKey().equals(other.getKey())) return false; + if (hasFilter() != other.hasFilter()) return false; + if (hasFilter()) { + if (!getFilter().equals(other.getFilter())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (hasFilter()) { + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowRequest 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.v2.SessionReadRowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowRequest 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.v2.SessionReadRowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionReadRowRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionReadRowRequest) + com.google.bigtable.v2.SessionReadRowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowRequest.class, + com.google.bigtable.v2.SessionReadRowRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionReadRowRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFilterFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = com.google.protobuf.ByteString.EMPTY; + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest build() { + com.google.bigtable.v2.SessionReadRowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest buildPartial() { + com.google.bigtable.v2.SessionReadRowRequest result = + new com.google.bigtable.v2.SessionReadRowRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionReadRowRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filterBuilder_ == null ? filter_ : filterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionReadRowRequest) { + return mergeFrom((com.google.bigtable.v2.SessionReadRowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionReadRowRequest other) { + if (other == com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + setKey(other.getKey()); + } + if (other.hasFilter()) { + mergeFilter(other.getFilter()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes key = 1; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + /** + * bytes key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * bytes key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + private com.google.bigtable.v2.RowFilter filter_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + filterBuilder_; + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return Whether the filter field is set. + */ + public boolean hasFilter() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return The filter. + */ + public com.google.bigtable.v2.RowFilter getFilter() { + if (filterBuilder_ == null) { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } else { + return filterBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder setFilter(com.google.bigtable.v2.RowFilter value) { + if (filterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + } else { + filterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder setFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { + if (filterBuilder_ == null) { + filter_ = builderForValue.build(); + } else { + filterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder mergeFilter(com.google.bigtable.v2.RowFilter value) { + if (filterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && filter_ != null + && filter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getFilterBuilder().mergeFrom(value); + } else { + filter_ = value; + } + } else { + filterBuilder_.mergeFrom(value); + } + if (filter_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public Builder clearFilter() { + bitField0_ = (bitField0_ & ~0x00000002); + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); + filterBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public com.google.bigtable.v2.RowFilter.Builder getFilterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFilterFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { + if (filterBuilder_ != null) { + return filterBuilder_.getMessageOrBuilder(); + } else { + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; + } + } + + /** .google.bigtable.v2.RowFilter filter = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder> + internalGetFilterFieldBuilder() { + if (filterBuilder_ == null) { + filterBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RowFilter, + com.google.bigtable.v2.RowFilter.Builder, + com.google.bigtable.v2.RowFilterOrBuilder>( + getFilter(), getParentForChildren(), isClean()); + filter_ = null; + } + return filterBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionReadRowRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionReadRowRequest) + private static final com.google.bigtable.v2.SessionReadRowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionReadRowRequest(); + } + + public static com.google.bigtable.v2.SessionReadRowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionReadRowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequestOrBuilder.java new file mode 100644 index 000000000000..a540f77d715b --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionReadRowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionReadRowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes key = 1; + * + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return Whether the filter field is set. + */ + boolean hasFilter(); + + /** + * .google.bigtable.v2.RowFilter filter = 2; + * + * @return The filter. + */ + com.google.bigtable.v2.RowFilter getFilter(); + + /** .google.bigtable.v2.RowFilter filter = 2; */ + com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponse.java new file mode 100644 index 000000000000..3c2570fec454 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponse.java @@ -0,0 +1,783 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowResponse} + */ +@com.google.protobuf.Generated +public final class SessionReadRowResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionReadRowResponse) + SessionReadRowResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionReadRowResponse"); + } + + // Use SessionReadRowResponse.newBuilder() to construct. + private SessionReadRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionReadRowResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowResponse.class, + com.google.bigtable.v2.SessionReadRowResponse.Builder.class); + } + + private int bitField0_; + public static final int ROW_FIELD_NUMBER = 1; + private com.google.bigtable.v2.Row row_; + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + @java.lang.Override + public boolean hasRow() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + @java.lang.Override + public com.google.bigtable.v2.Row getRow() { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + + /** .google.bigtable.v2.Row row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + + public static final int STATS_FIELD_NUMBER = 2; + private com.google.bigtable.v2.RequestStats stats_; + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return The stats. + */ + @java.lang.Override + public com.google.bigtable.v2.RequestStats getStats() { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + @java.lang.Override + public com.google.bigtable.v2.RequestStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRow()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRow()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStats()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionReadRowResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionReadRowResponse other = + (com.google.bigtable.v2.SessionReadRowResponse) obj; + + if (hasRow() != other.hasRow()) return false; + if (hasRow()) { + if (!getRow().equals(other.getRow())) return false; + } + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRow()) { + hash = (37 * hash) + ROW_FIELD_NUMBER; + hash = (53 * hash) + getRow().hashCode(); + } + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowResponse 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.v2.SessionReadRowResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowResponse 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.v2.SessionReadRowResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionReadRowResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionReadRowResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionReadRowResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionReadRowResponse) + com.google.bigtable.v2.SessionReadRowResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionReadRowResponse.class, + com.google.bigtable.v2.SessionReadRowResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionReadRowResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRowFieldBuilder(); + internalGetStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); + rowBuilder_ = null; + } + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionReadRowResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse build() { + com.google.bigtable.v2.SessionReadRowResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse buildPartial() { + com.google.bigtable.v2.SessionReadRowResponse result = + new com.google.bigtable.v2.SessionReadRowResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionReadRowResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.row_ = rowBuilder_ == null ? row_ : rowBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionReadRowResponse) { + return mergeFrom((com.google.bigtable.v2.SessionReadRowResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionReadRowResponse other) { + if (other == com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) return this; + if (other.hasRow()) { + mergeRow(other.getRow()); + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetRowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.Row row_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder> + rowBuilder_; + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + public boolean hasRow() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + public com.google.bigtable.v2.Row getRow() { + if (rowBuilder_ == null) { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } else { + return rowBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder setRow(com.google.bigtable.v2.Row value) { + if (rowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + row_ = value; + } else { + rowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder setRow(com.google.bigtable.v2.Row.Builder builderForValue) { + if (rowBuilder_ == null) { + row_ = builderForValue.build(); + } else { + rowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder mergeRow(com.google.bigtable.v2.Row value) { + if (rowBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && row_ != null + && row_ != com.google.bigtable.v2.Row.getDefaultInstance()) { + getRowBuilder().mergeFrom(value); + } else { + row_ = value; + } + } else { + rowBuilder_.mergeFrom(value); + } + if (row_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public Builder clearRow() { + bitField0_ = (bitField0_ & ~0x00000001); + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); + rowBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.Row row = 1; */ + public com.google.bigtable.v2.Row.Builder getRowBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.Row row = 1; */ + public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { + if (rowBuilder_ != null) { + return rowBuilder_.getMessageOrBuilder(); + } else { + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; + } + } + + /** .google.bigtable.v2.Row row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder> + internalGetRowFieldBuilder() { + if (rowBuilder_ == null) { + rowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.Row, + com.google.bigtable.v2.Row.Builder, + com.google.bigtable.v2.RowOrBuilder>(getRow(), getParentForChildren(), isClean()); + row_ = null; + } + return rowBuilder_; + } + + private com.google.bigtable.v2.RequestStats stats_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + statsBuilder_; + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return The stats. + */ + public com.google.bigtable.v2.RequestStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder setStats(com.google.bigtable.v2.RequestStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder setStats(com.google.bigtable.v2.RequestStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder mergeStats(com.google.bigtable.v2.RequestStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && stats_ != null + && stats_ != com.google.bigtable.v2.RequestStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + if (stats_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000002); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public com.google.bigtable.v2.RequestStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStatsFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + public com.google.bigtable.v2.RequestStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null ? com.google.bigtable.v2.RequestStats.getDefaultInstance() : stats_; + } + } + + /** .google.bigtable.v2.RequestStats stats = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + internalGetStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionReadRowResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionReadRowResponse) + private static final com.google.bigtable.v2.SessionReadRowResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionReadRowResponse(); + } + + public static com.google.bigtable.v2.SessionReadRowResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionReadRowResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponseOrBuilder.java new file mode 100644 index 000000000000..b0ca2bf894eb --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionReadRowResponseOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionReadRowResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionReadRowResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return Whether the row field is set. + */ + boolean hasRow(); + + /** + * .google.bigtable.v2.Row row = 1; + * + * @return The row. + */ + com.google.bigtable.v2.Row getRow(); + + /** .google.bigtable.v2.Row row = 1; */ + com.google.bigtable.v2.RowOrBuilder getRowOrBuilder(); + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + + /** + * .google.bigtable.v2.RequestStats stats = 2; + * + * @return The stats. + */ + com.google.bigtable.v2.RequestStats getStats(); + + /** .google.bigtable.v2.RequestStats stats = 2; */ + com.google.bigtable.v2.RequestStatsOrBuilder getStatsOrBuilder(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfig.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfig.java new file mode 100644 index 000000000000..1cf129d259d1 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfig.java @@ -0,0 +1,2023 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig} + */ +@com.google.protobuf.Generated +public final class SessionRefreshConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRefreshConfig) + SessionRefreshConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionRefreshConfig"); + } + + // Use SessionRefreshConfig.newBuilder() to construct. + private SessionRefreshConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionRefreshConfig() { + metadata_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.class, + com.google.bigtable.v2.SessionRefreshConfig.Builder.class); + } + + public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRefreshConfig.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The key. + */ + java.lang.String getKey(); + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * Output only. The value for the metadata entry.
+     * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + } + + /** + * + * + *
+   * Any additional metadata to include when reconnecting. Not a `map<>` type as
+   * this can be a multimap.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig.Metadata} + */ + public static final class Metadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRefreshConfig.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Metadata"); + } + + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Metadata() { + key_ = ""; + value_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.class, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The key for the metadata entry.
+     * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Output only. The value for the metadata entry.
+     * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, key_); + } + if (!value_.isEmpty()) { + output.writeBytes(2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_); + } + if (!value_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionRefreshConfig.Metadata)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRefreshConfig.Metadata other = + (com.google.bigtable.v2.SessionRefreshConfig.Metadata) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata 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.v2.SessionRefreshConfig.Metadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata 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.v2.SessionRefreshConfig.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.SessionRefreshConfig.Metadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Any additional metadata to include when reconnecting. Not a `map<>` type as
+     * this can be a multimap.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig.Metadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRefreshConfig.Metadata) + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.class, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRefreshConfig.Metadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + value_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_Metadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata build() { + com.google.bigtable.v2.SessionRefreshConfig.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata buildPartial() { + com.google.bigtable.v2.SessionRefreshConfig.Metadata result = + new com.google.bigtable.v2.SessionRefreshConfig.Metadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionRefreshConfig.Metadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRefreshConfig.Metadata) { + return mergeFrom((com.google.bigtable.v2.SessionRefreshConfig.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRefreshConfig.Metadata other) { + if (other == com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + value_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The key for the metadata entry.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * Output only. The value for the metadata entry.
+       * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + /** + * + * + *
+       * Output only. The value for the metadata entry.
+       * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The value for the metadata entry.
+       * 
+ * + * bytes value = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRefreshConfig.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRefreshConfig.Metadata) + private static final com.google.bigtable.v2.SessionRefreshConfig.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRefreshConfig.Metadata(); + } + + public static com.google.bigtable.v2.SessionRefreshConfig.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int OPTIMIZED_OPEN_REQUEST_FIELD_NUMBER = 1; + private com.google.bigtable.v2.OpenSessionRequest optimizedOpenRequest_; + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return Whether the optimizedOpenRequest field is set. + */ + @java.lang.Override + public boolean hasOptimizedOpenRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return The optimizedOpenRequest. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getOptimizedOpenRequest() { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOptimizedOpenRequestOrBuilder() { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } + + public static final int METADATA_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List metadata_; + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getMetadataList() { + return metadata_; + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getMetadataOrBuilderList() { + return metadata_; + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getMetadataCount() { + return metadata_.size(); + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.Metadata getMetadata(int index) { + return metadata_.get(index); + } + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder getMetadataOrBuilder( + int index) { + return metadata_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOptimizedOpenRequest()); + } + for (int i = 0; i < metadata_.size(); i++) { + output.writeMessage(2, metadata_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOptimizedOpenRequest()); + } + for (int i = 0; i < metadata_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionRefreshConfig)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRefreshConfig other = + (com.google.bigtable.v2.SessionRefreshConfig) obj; + + if (hasOptimizedOpenRequest() != other.hasOptimizedOpenRequest()) return false; + if (hasOptimizedOpenRequest()) { + if (!getOptimizedOpenRequest().equals(other.getOptimizedOpenRequest())) return false; + } + if (!getMetadataList().equals(other.getMetadataList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOptimizedOpenRequest()) { + hash = (37 * hash) + OPTIMIZED_OPEN_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getOptimizedOpenRequest().hashCode(); + } + if (getMetadataCount() > 0) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadataList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig 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.v2.SessionRefreshConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig 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.v2.SessionRefreshConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRefreshConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionRefreshConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRefreshConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRefreshConfig) + com.google.bigtable.v2.SessionRefreshConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRefreshConfig.class, + com.google.bigtable.v2.SessionRefreshConfig.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRefreshConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOptimizedOpenRequestFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + optimizedOpenRequest_ = null; + if (optimizedOpenRequestBuilder_ != null) { + optimizedOpenRequestBuilder_.dispose(); + optimizedOpenRequestBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = java.util.Collections.emptyList(); + } else { + metadata_ = null; + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRefreshConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig build() { + com.google.bigtable.v2.SessionRefreshConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig buildPartial() { + com.google.bigtable.v2.SessionRefreshConfig result = + new com.google.bigtable.v2.SessionRefreshConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.SessionRefreshConfig result) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + metadata_ = java.util.Collections.unmodifiableList(metadata_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + } + + private void buildPartial0(com.google.bigtable.v2.SessionRefreshConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.optimizedOpenRequest_ = + optimizedOpenRequestBuilder_ == null + ? optimizedOpenRequest_ + : optimizedOpenRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRefreshConfig) { + return mergeFrom((com.google.bigtable.v2.SessionRefreshConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRefreshConfig other) { + if (other == com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance()) return this; + if (other.hasOptimizedOpenRequest()) { + mergeOptimizedOpenRequest(other.getOptimizedOpenRequest()); + } + if (metadataBuilder_ == null) { + if (!other.metadata_.isEmpty()) { + if (metadata_.isEmpty()) { + metadata_ = other.metadata_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMetadataIsMutable(); + metadata_.addAll(other.metadata_); + } + onChanged(); + } + } else { + if (!other.metadata_.isEmpty()) { + if (metadataBuilder_.isEmpty()) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + metadata_ = other.metadata_; + bitField0_ = (bitField0_ & ~0x00000002); + metadataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMetadataFieldBuilder() + : null; + } else { + metadataBuilder_.addAllMessages(other.metadata_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOptimizedOpenRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.bigtable.v2.SessionRefreshConfig.Metadata m = + input.readMessage( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.parser(), + extensionRegistry); + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(m); + } else { + metadataBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.bigtable.v2.OpenSessionRequest optimizedOpenRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + optimizedOpenRequestBuilder_; + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return Whether the optimizedOpenRequest field is set. + */ + public boolean hasOptimizedOpenRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return The optimizedOpenRequest. + */ + public com.google.bigtable.v2.OpenSessionRequest getOptimizedOpenRequest() { + if (optimizedOpenRequestBuilder_ == null) { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } else { + return optimizedOpenRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder setOptimizedOpenRequest(com.google.bigtable.v2.OpenSessionRequest value) { + if (optimizedOpenRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + optimizedOpenRequest_ = value; + } else { + optimizedOpenRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder setOptimizedOpenRequest( + com.google.bigtable.v2.OpenSessionRequest.Builder builderForValue) { + if (optimizedOpenRequestBuilder_ == null) { + optimizedOpenRequest_ = builderForValue.build(); + } else { + optimizedOpenRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder mergeOptimizedOpenRequest(com.google.bigtable.v2.OpenSessionRequest value) { + if (optimizedOpenRequestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && optimizedOpenRequest_ != null + && optimizedOpenRequest_ + != com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance()) { + getOptimizedOpenRequestBuilder().mergeFrom(value); + } else { + optimizedOpenRequest_ = value; + } + } else { + optimizedOpenRequestBuilder_.mergeFrom(value); + } + if (optimizedOpenRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public Builder clearOptimizedOpenRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + optimizedOpenRequest_ = null; + if (optimizedOpenRequestBuilder_ != null) { + optimizedOpenRequestBuilder_.dispose(); + optimizedOpenRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public com.google.bigtable.v2.OpenSessionRequest.Builder getOptimizedOpenRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetOptimizedOpenRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOptimizedOpenRequestOrBuilder() { + if (optimizedOpenRequestBuilder_ != null) { + return optimizedOpenRequestBuilder_.getMessageOrBuilder(); + } else { + return optimizedOpenRequest_ == null + ? com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance() + : optimizedOpenRequest_; + } + } + + /** + * + * + *
+     * An optimized Open request that the session may use on a retry when
+     * establishing this session again. This can be sent from the AFE to
+     * avoid certain work e.g. encoding a query plan for BTQL.
+     * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + internalGetOptimizedOpenRequestFieldBuilder() { + if (optimizedOpenRequestBuilder_ == null) { + optimizedOpenRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder>( + getOptimizedOpenRequest(), getParentForChildren(), isClean()); + optimizedOpenRequest_ = null; + } + return optimizedOpenRequestBuilder_; + } + + private java.util.List metadata_ = + java.util.Collections.emptyList(); + + private void ensureMetadataIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + metadata_ = + new java.util.ArrayList( + metadata_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig.Metadata, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder, + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getMetadataList() { + if (metadataBuilder_ == null) { + return java.util.Collections.unmodifiableList(metadata_); + } else { + return metadataBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getMetadataCount() { + if (metadataBuilder_ == null) { + return metadata_.size(); + } else { + return metadataBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata getMetadata(int index) { + if (metadataBuilder_ == null) { + return metadata_.get(index); + } else { + return metadataBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.set(index, value); + onChanged(); + } else { + metadataBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.set(index, builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata(com.google.bigtable.v2.SessionRefreshConfig.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.add(value); + onChanged(); + } else { + metadataBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.add(index, value); + onChanged(); + } else { + metadataBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata( + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMetadata( + int index, com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(index, builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllMetadata( + java.lang.Iterable values) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metadata_); + onChanged(); + } else { + metadataBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + metadataBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeMetadata(int index) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.remove(index); + onChanged(); + } else { + metadataBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder getMetadataBuilder( + int index) { + return internalGetMetadataFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder getMetadataOrBuilder( + int index) { + if (metadataBuilder_ == null) { + return metadata_.get(index); + } else { + return metadataBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMetadataOrBuilderList() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metadata_); + } + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder addMetadataBuilder() { + return internalGetMetadataFieldBuilder() + .addBuilder(com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder addMetadataBuilder( + int index) { + return internalGetMetadataFieldBuilder() + .addBuilder( + index, com.google.bigtable.v2.SessionRefreshConfig.Metadata.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Any additional metadata to include when reconnecting.
+     * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMetadataBuilderList() { + return internalGetMetadataFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig.Metadata, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder, + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig.Metadata, + com.google.bigtable.v2.SessionRefreshConfig.Metadata.Builder, + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder>( + metadata_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRefreshConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRefreshConfig) + private static final com.google.bigtable.v2.SessionRefreshConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRefreshConfig(); + } + + public static com.google.bigtable.v2.SessionRefreshConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionRefreshConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfigOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfigOrBuilder.java new file mode 100644 index 000000000000..52d3a5f80368 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRefreshConfigOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionRefreshConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRefreshConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return Whether the optimizedOpenRequest field is set. + */ + boolean hasOptimizedOpenRequest(); + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + * + * @return The optimizedOpenRequest. + */ + com.google.bigtable.v2.OpenSessionRequest getOptimizedOpenRequest(); + + /** + * + * + *
+   * An optimized Open request that the session may use on a retry when
+   * establishing this session again. This can be sent from the AFE to
+   * avoid certain work e.g. encoding a query plan for BTQL.
+   * 
+ * + * .google.bigtable.v2.OpenSessionRequest optimized_open_request = 1; + */ + com.google.bigtable.v2.OpenSessionRequestOrBuilder getOptimizedOpenRequestOrBuilder(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getMetadataList(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.v2.SessionRefreshConfig.Metadata getMetadata(int index); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getMetadataCount(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getMetadataOrBuilderList(); + + /** + * + * + *
+   * Output only. Any additional metadata to include when reconnecting.
+   * 
+ * + * + * repeated .google.bigtable.v2.SessionRefreshConfig.Metadata metadata = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.v2.SessionRefreshConfig.MetadataOrBuilder getMetadataOrBuilder(int index); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequest.java new file mode 100644 index 000000000000..1c625a325cae --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequest.java @@ -0,0 +1,1143 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequest} + */ +@com.google.protobuf.Generated +public final class SessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRequest) + SessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionRequest"); + } + + // Use SessionRequest.newBuilder() to construct. + private SessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequest.class, + com.google.bigtable.v2.SessionRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OPEN_SESSION(1), + CLOSE_SESSION(2), + VIRTUAL_RPC(3), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return OPEN_SESSION; + case 2: + return CLOSE_SESSION; + case 3: + return VIRTUAL_RPC; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int OPEN_SESSION_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getOpenSession() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOpenSessionOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + + public static final int CLOSE_SESSION_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return Whether the closeSession field is set. + */ + @java.lang.Override + public boolean hasCloseSession() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return The closeSession. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest getCloseSession() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequestOrBuilder getCloseSessionOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + + public static final int VIRTUAL_RPC_FIELD_NUMBER = 3; + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest getVirtualRpc() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequestOrBuilder getVirtualRpcOrBuilder() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.OpenSessionRequest) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.CloseSessionRequest) payload_); + } + if (payloadCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.VirtualRpcRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.OpenSessionRequest) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.CloseSessionRequest) payload_); + } + if (payloadCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.VirtualRpcRequest) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRequest other = (com.google.bigtable.v2.SessionRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getOpenSession().equals(other.getOpenSession())) return false; + break; + case 2: + if (!getCloseSession().equals(other.getCloseSession())) return false; + break; + case 3: + if (!getVirtualRpc().equals(other.getVirtualRpc())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + OPEN_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getOpenSession().hashCode(); + break; + case 2: + hash = (37 * hash) + CLOSE_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getCloseSession().hashCode(); + break; + case 3: + hash = (37 * hash) + VIRTUAL_RPC_FIELD_NUMBER; + hash = (53 * hash) + getVirtualRpc().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequest 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.v2.SessionRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequest 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.v2.SessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRequest) + com.google.bigtable.v2.SessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequest.class, + com.google.bigtable.v2.SessionRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (openSessionBuilder_ != null) { + openSessionBuilder_.clear(); + } + if (closeSessionBuilder_ != null) { + closeSessionBuilder_.clear(); + } + if (virtualRpcBuilder_ != null) { + virtualRpcBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequest build() { + com.google.bigtable.v2.SessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequest buildPartial() { + com.google.bigtable.v2.SessionRequest result = + new com.google.bigtable.v2.SessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.SessionRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && openSessionBuilder_ != null) { + result.payload_ = openSessionBuilder_.build(); + } + if (payloadCase_ == 2 && closeSessionBuilder_ != null) { + result.payload_ = closeSessionBuilder_.build(); + } + if (payloadCase_ == 3 && virtualRpcBuilder_ != null) { + result.payload_ = virtualRpcBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRequest) { + return mergeFrom((com.google.bigtable.v2.SessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRequest other) { + if (other == com.google.bigtable.v2.SessionRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case OPEN_SESSION: + { + mergeOpenSession(other.getOpenSession()); + break; + } + case CLOSE_SESSION: + { + mergeCloseSession(other.getCloseSession()); + break; + } + case VIRTUAL_RPC: + { + mergeVirtualRpc(other.getVirtualRpc()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOpenSessionFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetCloseSessionFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetVirtualRpcFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + openSessionBuilder_; + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequest getOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return openSessionBuilder_.getMessage(); + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder setOpenSession(com.google.bigtable.v2.OpenSessionRequest value) { + if (openSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + openSessionBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder setOpenSession( + com.google.bigtable.v2.OpenSessionRequest.Builder builderForValue) { + if (openSessionBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + openSessionBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder mergeOpenSession(com.google.bigtable.v2.OpenSessionRequest value) { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.OpenSessionRequest.newBuilder( + (com.google.bigtable.v2.OpenSessionRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + openSessionBuilder_.mergeFrom(value); + } else { + openSessionBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public Builder clearOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + openSessionBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + public com.google.bigtable.v2.OpenSessionRequest.Builder getOpenSessionBuilder() { + return internalGetOpenSessionFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionRequestOrBuilder getOpenSessionOrBuilder() { + if ((payloadCase_ == 1) && (openSessionBuilder_ != null)) { + return openSessionBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionRequest) payload_; + } + return com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder> + internalGetOpenSessionFieldBuilder() { + if (openSessionBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.OpenSessionRequest.getDefaultInstance(); + } + openSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionRequest, + com.google.bigtable.v2.OpenSessionRequest.Builder, + com.google.bigtable.v2.OpenSessionRequestOrBuilder>( + (com.google.bigtable.v2.OpenSessionRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return openSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.CloseSessionRequest, + com.google.bigtable.v2.CloseSessionRequest.Builder, + com.google.bigtable.v2.CloseSessionRequestOrBuilder> + closeSessionBuilder_; + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return Whether the closeSession field is set. + */ + @java.lang.Override + public boolean hasCloseSession() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return The closeSession. + */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequest getCloseSession() { + if (closeSessionBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return closeSessionBuilder_.getMessage(); + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder setCloseSession(com.google.bigtable.v2.CloseSessionRequest value) { + if (closeSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + closeSessionBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder setCloseSession( + com.google.bigtable.v2.CloseSessionRequest.Builder builderForValue) { + if (closeSessionBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + closeSessionBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder mergeCloseSession(com.google.bigtable.v2.CloseSessionRequest value) { + if (closeSessionBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.CloseSessionRequest.newBuilder( + (com.google.bigtable.v2.CloseSessionRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + closeSessionBuilder_.mergeFrom(value); + } else { + closeSessionBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public Builder clearCloseSession() { + if (closeSessionBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + closeSessionBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + public com.google.bigtable.v2.CloseSessionRequest.Builder getCloseSessionBuilder() { + return internalGetCloseSessionFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + @java.lang.Override + public com.google.bigtable.v2.CloseSessionRequestOrBuilder getCloseSessionOrBuilder() { + if ((payloadCase_ == 2) && (closeSessionBuilder_ != null)) { + return closeSessionBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.CloseSessionRequest) payload_; + } + return com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.CloseSessionRequest, + com.google.bigtable.v2.CloseSessionRequest.Builder, + com.google.bigtable.v2.CloseSessionRequestOrBuilder> + internalGetCloseSessionFieldBuilder() { + if (closeSessionBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.CloseSessionRequest.getDefaultInstance(); + } + closeSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.CloseSessionRequest, + com.google.bigtable.v2.CloseSessionRequest.Builder, + com.google.bigtable.v2.CloseSessionRequestOrBuilder>( + (com.google.bigtable.v2.CloseSessionRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return closeSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest, + com.google.bigtable.v2.VirtualRpcRequest.Builder, + com.google.bigtable.v2.VirtualRpcRequestOrBuilder> + virtualRpcBuilder_; + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest getVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 3) { + return virtualRpcBuilder_.getMessage(); + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder setVirtualRpc(com.google.bigtable.v2.VirtualRpcRequest value) { + if (virtualRpcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + virtualRpcBuilder_.setMessage(value); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder setVirtualRpc(com.google.bigtable.v2.VirtualRpcRequest.Builder builderForValue) { + if (virtualRpcBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + virtualRpcBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder mergeVirtualRpc(com.google.bigtable.v2.VirtualRpcRequest value) { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 3 + && payload_ != com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.VirtualRpcRequest.newBuilder( + (com.google.bigtable.v2.VirtualRpcRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 3) { + virtualRpcBuilder_.mergeFrom(value); + } else { + virtualRpcBuilder_.setMessage(value); + } + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public Builder clearVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + } + virtualRpcBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + public com.google.bigtable.v2.VirtualRpcRequest.Builder getVirtualRpcBuilder() { + return internalGetVirtualRpcFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequestOrBuilder getVirtualRpcOrBuilder() { + if ((payloadCase_ == 3) && (virtualRpcBuilder_ != null)) { + return virtualRpcBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.VirtualRpcRequest) payload_; + } + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest, + com.google.bigtable.v2.VirtualRpcRequest.Builder, + com.google.bigtable.v2.VirtualRpcRequestOrBuilder> + internalGetVirtualRpcFieldBuilder() { + if (virtualRpcBuilder_ == null) { + if (!(payloadCase_ == 3)) { + payload_ = com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + virtualRpcBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest, + com.google.bigtable.v2.VirtualRpcRequest.Builder, + com.google.bigtable.v2.VirtualRpcRequestOrBuilder>( + (com.google.bigtable.v2.VirtualRpcRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 3; + onChanged(); + return virtualRpcBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRequest) + private static final com.google.bigtable.v2.SessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRequest(); + } + + public static com.google.bigtable.v2.SessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestOrBuilder.java new file mode 100644 index 000000000000..ed05d333fba7 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return Whether the openSession field is set. + */ + boolean hasOpenSession(); + + /** + * .google.bigtable.v2.OpenSessionRequest open_session = 1; + * + * @return The openSession. + */ + com.google.bigtable.v2.OpenSessionRequest getOpenSession(); + + /** .google.bigtable.v2.OpenSessionRequest open_session = 1; */ + com.google.bigtable.v2.OpenSessionRequestOrBuilder getOpenSessionOrBuilder(); + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return Whether the closeSession field is set. + */ + boolean hasCloseSession(); + + /** + * .google.bigtable.v2.CloseSessionRequest close_session = 2; + * + * @return The closeSession. + */ + com.google.bigtable.v2.CloseSessionRequest getCloseSession(); + + /** .google.bigtable.v2.CloseSessionRequest close_session = 2; */ + com.google.bigtable.v2.CloseSessionRequestOrBuilder getCloseSessionOrBuilder(); + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return Whether the virtualRpc field is set. + */ + boolean hasVirtualRpc(); + + /** + * .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; + * + * @return The virtualRpc. + */ + com.google.bigtable.v2.VirtualRpcRequest getVirtualRpc(); + + /** .google.bigtable.v2.VirtualRpcRequest virtual_rpc = 3; */ + com.google.bigtable.v2.VirtualRpcRequestOrBuilder getVirtualRpcOrBuilder(); + + com.google.bigtable.v2.SessionRequest.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStats.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStats.java new file mode 100644 index 000000000000..7c0c962d5e0a --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStats.java @@ -0,0 +1,698 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequestStats} + */ +@com.google.protobuf.Generated +public final class SessionRequestStats extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionRequestStats) + SessionRequestStatsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionRequestStats"); + } + + // Use SessionRequestStats.newBuilder() to construct. + private SessionRequestStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionRequestStats() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequestStats.class, + com.google.bigtable.v2.SessionRequestStats.Builder.class); + } + + private int bitField0_; + public static final int BACKEND_LATENCY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration backendLatency_; + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return Whether the backendLatency field is set. + */ + @java.lang.Override + public boolean hasBackendLatency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return The backendLatency. + */ + @java.lang.Override + public com.google.protobuf.Duration getBackendLatency() { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBackendLatency()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackendLatency()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionRequestStats)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionRequestStats other = + (com.google.bigtable.v2.SessionRequestStats) obj; + + if (hasBackendLatency() != other.hasBackendLatency()) return false; + if (hasBackendLatency()) { + if (!getBackendLatency().equals(other.getBackendLatency())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBackendLatency()) { + hash = (37 * hash) + BACKEND_LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getBackendLatency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequestStats 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.v2.SessionRequestStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequestStats 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.v2.SessionRequestStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequestStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequestStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionRequestStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionRequestStats prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionRequestStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionRequestStats) + com.google.bigtable.v2.SessionRequestStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionRequestStats.class, + com.google.bigtable.v2.SessionRequestStats.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionRequestStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackendLatencyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + backendLatency_ = null; + if (backendLatencyBuilder_ != null) { + backendLatencyBuilder_.dispose(); + backendLatencyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionRequestStats_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionRequestStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats build() { + com.google.bigtable.v2.SessionRequestStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats buildPartial() { + com.google.bigtable.v2.SessionRequestStats result = + new com.google.bigtable.v2.SessionRequestStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionRequestStats result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backendLatency_ = + backendLatencyBuilder_ == null ? backendLatency_ : backendLatencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionRequestStats) { + return mergeFrom((com.google.bigtable.v2.SessionRequestStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionRequestStats other) { + if (other == com.google.bigtable.v2.SessionRequestStats.getDefaultInstance()) return this; + if (other.hasBackendLatency()) { + mergeBackendLatency(other.getBackendLatency()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetBackendLatencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration backendLatency_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + backendLatencyBuilder_; + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return Whether the backendLatency field is set. + */ + public boolean hasBackendLatency() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return The backendLatency. + */ + public com.google.protobuf.Duration getBackendLatency() { + if (backendLatencyBuilder_ == null) { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } else { + return backendLatencyBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder setBackendLatency(com.google.protobuf.Duration value) { + if (backendLatencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + backendLatency_ = value; + } else { + backendLatencyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder setBackendLatency(com.google.protobuf.Duration.Builder builderForValue) { + if (backendLatencyBuilder_ == null) { + backendLatency_ = builderForValue.build(); + } else { + backendLatencyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder mergeBackendLatency(com.google.protobuf.Duration value) { + if (backendLatencyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && backendLatency_ != null + && backendLatency_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBackendLatencyBuilder().mergeFrom(value); + } else { + backendLatency_ = value; + } + } else { + backendLatencyBuilder_.mergeFrom(value); + } + if (backendLatency_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public Builder clearBackendLatency() { + bitField0_ = (bitField0_ & ~0x00000001); + backendLatency_ = null; + if (backendLatencyBuilder_ != null) { + backendLatencyBuilder_.dispose(); + backendLatencyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public com.google.protobuf.Duration.Builder getBackendLatencyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBackendLatencyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() { + if (backendLatencyBuilder_ != null) { + return backendLatencyBuilder_.getMessageOrBuilder(); + } else { + return backendLatency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : backendLatency_; + } + } + + /** + * + * + *
+     * Backend (critical section) latency for the request.
+     * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetBackendLatencyFieldBuilder() { + if (backendLatencyBuilder_ == null) { + backendLatencyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBackendLatency(), getParentForChildren(), isClean()); + backendLatency_ = null; + } + return backendLatencyBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionRequestStats) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionRequestStats) + private static final com.google.bigtable.v2.SessionRequestStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionRequestStats(); + } + + public static com.google.bigtable.v2.SessionRequestStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionRequestStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStatsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStatsOrBuilder.java new file mode 100644 index 000000000000..728993cf71ee --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionRequestStatsOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionRequestStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionRequestStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return Whether the backendLatency field is set. + */ + boolean hasBackendLatency(); + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + * + * @return The backendLatency. + */ + com.google.protobuf.Duration getBackendLatency(); + + /** + * + * + *
+   * Backend (critical section) latency for the request.
+   * 
+ * + * .google.protobuf.Duration backend_latency = 1; + */ + com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponse.java new file mode 100644 index 000000000000..9c4dfe078f60 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponse.java @@ -0,0 +1,2131 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionResponse} + */ +@com.google.protobuf.Generated +public final class SessionResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.SessionResponse) + SessionResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionResponse"); + } + + // Use SessionResponse.newBuilder() to construct. + private SessionResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionResponse.class, + com.google.bigtable.v2.SessionResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OPEN_SESSION(1), + VIRTUAL_RPC(2), + ERROR(3), + SESSION_PARAMETERS(4), + HEARTBEAT(5), + GO_AWAY(6), + SESSION_REFRESH_CONFIG(7), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return OPEN_SESSION; + case 2: + return VIRTUAL_RPC; + case 3: + return ERROR; + case 4: + return SESSION_PARAMETERS; + case 5: + return HEARTBEAT; + case 6: + return GO_AWAY; + case 7: + return SESSION_REFRESH_CONFIG; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int OPEN_SESSION_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse getOpenSession() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponseOrBuilder getOpenSessionOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + + public static final int VIRTUAL_RPC_FIELD_NUMBER = 2; + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 2; + } + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse getVirtualRpc() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponseOrBuilder getVirtualRpcOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + + public static final int ERROR_FIELD_NUMBER = 3; + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return The error. + */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse getError() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponseOrBuilder getErrorOrBuilder() { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + + public static final int SESSION_PARAMETERS_FIELD_NUMBER = 4; + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return Whether the sessionParameters field is set. + */ + @java.lang.Override + public boolean hasSessionParameters() { + return payloadCase_ == 4; + } + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return The sessionParameters. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse getSessionParameters() { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponseOrBuilder getSessionParametersOrBuilder() { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + + public static final int HEARTBEAT_FIELD_NUMBER = 5; + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return Whether the heartbeat field is set. + */ + @java.lang.Override + public boolean hasHeartbeat() { + return payloadCase_ == 5; + } + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return The heartbeat. + */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse getHeartbeat() { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponseOrBuilder getHeartbeatOrBuilder() { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + + public static final int GO_AWAY_FIELD_NUMBER = 6; + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return Whether the goAway field is set. + */ + @java.lang.Override + public boolean hasGoAway() { + return payloadCase_ == 6; + } + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return The goAway. + */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse getGoAway() { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponseOrBuilder getGoAwayOrBuilder() { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + + public static final int SESSION_REFRESH_CONFIG_FIELD_NUMBER = 7; + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return Whether the sessionRefreshConfig field is set. + */ + @java.lang.Override + public boolean hasSessionRefreshConfig() { + return payloadCase_ == 7; + } + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return The sessionRefreshConfig. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig getSessionRefreshConfig() { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfigOrBuilder getSessionRefreshConfigOrBuilder() { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.OpenSessionResponse) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.VirtualRpcResponse) payload_); + } + if (payloadCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.v2.ErrorResponse) payload_); + } + if (payloadCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.SessionParametersResponse) payload_); + } + if (payloadCase_ == 5) { + output.writeMessage(5, (com.google.bigtable.v2.HeartbeatResponse) payload_); + } + if (payloadCase_ == 6) { + output.writeMessage(6, (com.google.bigtable.v2.GoAwayResponse) payload_); + } + if (payloadCase_ == 7) { + output.writeMessage(7, (com.google.bigtable.v2.SessionRefreshConfig) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.OpenSessionResponse) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.VirtualRpcResponse) payload_); + } + if (payloadCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.v2.ErrorResponse) payload_); + } + if (payloadCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.v2.SessionParametersResponse) payload_); + } + if (payloadCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.bigtable.v2.HeartbeatResponse) payload_); + } + if (payloadCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.bigtable.v2.GoAwayResponse) payload_); + } + if (payloadCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.bigtable.v2.SessionRefreshConfig) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.SessionResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.SessionResponse other = (com.google.bigtable.v2.SessionResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getOpenSession().equals(other.getOpenSession())) return false; + break; + case 2: + if (!getVirtualRpc().equals(other.getVirtualRpc())) return false; + break; + case 3: + if (!getError().equals(other.getError())) return false; + break; + case 4: + if (!getSessionParameters().equals(other.getSessionParameters())) return false; + break; + case 5: + if (!getHeartbeat().equals(other.getHeartbeat())) return false; + break; + case 6: + if (!getGoAway().equals(other.getGoAway())) return false; + break; + case 7: + if (!getSessionRefreshConfig().equals(other.getSessionRefreshConfig())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + OPEN_SESSION_FIELD_NUMBER; + hash = (53 * hash) + getOpenSession().hashCode(); + break; + case 2: + hash = (37 * hash) + VIRTUAL_RPC_FIELD_NUMBER; + hash = (53 * hash) + getVirtualRpc().hashCode(); + break; + case 3: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 4: + hash = (37 * hash) + SESSION_PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getSessionParameters().hashCode(); + break; + case 5: + hash = (37 * hash) + HEARTBEAT_FIELD_NUMBER; + hash = (53 * hash) + getHeartbeat().hashCode(); + break; + case 6: + hash = (37 * hash) + GO_AWAY_FIELD_NUMBER; + hash = (53 * hash) + getGoAway().hashCode(); + break; + case 7: + hash = (37 * hash) + SESSION_REFRESH_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSessionRefreshConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.SessionResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionResponse 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.v2.SessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionResponse 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.v2.SessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.SessionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.SessionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.SessionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.SessionResponse) + com.google.bigtable.v2.SessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.SessionResponse.class, + com.google.bigtable.v2.SessionResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.SessionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (openSessionBuilder_ != null) { + openSessionBuilder_.clear(); + } + if (virtualRpcBuilder_ != null) { + virtualRpcBuilder_.clear(); + } + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + if (sessionParametersBuilder_ != null) { + sessionParametersBuilder_.clear(); + } + if (heartbeatBuilder_ != null) { + heartbeatBuilder_.clear(); + } + if (goAwayBuilder_ != null) { + goAwayBuilder_.clear(); + } + if (sessionRefreshConfigBuilder_ != null) { + sessionRefreshConfigBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_SessionResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.SessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.SessionResponse build() { + com.google.bigtable.v2.SessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionResponse buildPartial() { + com.google.bigtable.v2.SessionResponse result = + new com.google.bigtable.v2.SessionResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.SessionResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.SessionResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && openSessionBuilder_ != null) { + result.payload_ = openSessionBuilder_.build(); + } + if (payloadCase_ == 2 && virtualRpcBuilder_ != null) { + result.payload_ = virtualRpcBuilder_.build(); + } + if (payloadCase_ == 3 && errorBuilder_ != null) { + result.payload_ = errorBuilder_.build(); + } + if (payloadCase_ == 4 && sessionParametersBuilder_ != null) { + result.payload_ = sessionParametersBuilder_.build(); + } + if (payloadCase_ == 5 && heartbeatBuilder_ != null) { + result.payload_ = heartbeatBuilder_.build(); + } + if (payloadCase_ == 6 && goAwayBuilder_ != null) { + result.payload_ = goAwayBuilder_.build(); + } + if (payloadCase_ == 7 && sessionRefreshConfigBuilder_ != null) { + result.payload_ = sessionRefreshConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.SessionResponse) { + return mergeFrom((com.google.bigtable.v2.SessionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.SessionResponse other) { + if (other == com.google.bigtable.v2.SessionResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case OPEN_SESSION: + { + mergeOpenSession(other.getOpenSession()); + break; + } + case VIRTUAL_RPC: + { + mergeVirtualRpc(other.getVirtualRpc()); + break; + } + case ERROR: + { + mergeError(other.getError()); + break; + } + case SESSION_PARAMETERS: + { + mergeSessionParameters(other.getSessionParameters()); + break; + } + case HEARTBEAT: + { + mergeHeartbeat(other.getHeartbeat()); + break; + } + case GO_AWAY: + { + mergeGoAway(other.getGoAway()); + break; + } + case SESSION_REFRESH_CONFIG: + { + mergeSessionRefreshConfig(other.getSessionRefreshConfig()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetOpenSessionFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetVirtualRpcFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetSessionParametersFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetHeartbeatFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetGoAwayFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetSessionRefreshConfigFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 7; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionResponse, + com.google.bigtable.v2.OpenSessionResponse.Builder, + com.google.bigtable.v2.OpenSessionResponseOrBuilder> + openSessionBuilder_; + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return Whether the openSession field is set. + */ + @java.lang.Override + public boolean hasOpenSession() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return The openSession. + */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponse getOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return openSessionBuilder_.getMessage(); + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder setOpenSession(com.google.bigtable.v2.OpenSessionResponse value) { + if (openSessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + openSessionBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder setOpenSession( + com.google.bigtable.v2.OpenSessionResponse.Builder builderForValue) { + if (openSessionBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + openSessionBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder mergeOpenSession(com.google.bigtable.v2.OpenSessionResponse value) { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.OpenSessionResponse.newBuilder( + (com.google.bigtable.v2.OpenSessionResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + openSessionBuilder_.mergeFrom(value); + } else { + openSessionBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public Builder clearOpenSession() { + if (openSessionBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + openSessionBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + public com.google.bigtable.v2.OpenSessionResponse.Builder getOpenSessionBuilder() { + return internalGetOpenSessionFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + @java.lang.Override + public com.google.bigtable.v2.OpenSessionResponseOrBuilder getOpenSessionOrBuilder() { + if ((payloadCase_ == 1) && (openSessionBuilder_ != null)) { + return openSessionBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.OpenSessionResponse) payload_; + } + return com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionResponse, + com.google.bigtable.v2.OpenSessionResponse.Builder, + com.google.bigtable.v2.OpenSessionResponseOrBuilder> + internalGetOpenSessionFieldBuilder() { + if (openSessionBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.OpenSessionResponse.getDefaultInstance(); + } + openSessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.OpenSessionResponse, + com.google.bigtable.v2.OpenSessionResponse.Builder, + com.google.bigtable.v2.OpenSessionResponseOrBuilder>( + (com.google.bigtable.v2.OpenSessionResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return openSessionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcResponse, + com.google.bigtable.v2.VirtualRpcResponse.Builder, + com.google.bigtable.v2.VirtualRpcResponseOrBuilder> + virtualRpcBuilder_; + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return Whether the virtualRpc field is set. + */ + @java.lang.Override + public boolean hasVirtualRpc() { + return payloadCase_ == 2; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return The virtualRpc. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse getVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return virtualRpcBuilder_.getMessage(); + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder setVirtualRpc(com.google.bigtable.v2.VirtualRpcResponse value) { + if (virtualRpcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + virtualRpcBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder setVirtualRpc( + com.google.bigtable.v2.VirtualRpcResponse.Builder builderForValue) { + if (virtualRpcBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + virtualRpcBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder mergeVirtualRpc(com.google.bigtable.v2.VirtualRpcResponse value) { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.VirtualRpcResponse.newBuilder( + (com.google.bigtable.v2.VirtualRpcResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + virtualRpcBuilder_.mergeFrom(value); + } else { + virtualRpcBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public Builder clearVirtualRpc() { + if (virtualRpcBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + virtualRpcBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + public com.google.bigtable.v2.VirtualRpcResponse.Builder getVirtualRpcBuilder() { + return internalGetVirtualRpcFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponseOrBuilder getVirtualRpcOrBuilder() { + if ((payloadCase_ == 2) && (virtualRpcBuilder_ != null)) { + return virtualRpcBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.VirtualRpcResponse) payload_; + } + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + } + + /** + * + * + *
+     * A vRPC can result in either a successful result or an error.
+     * Error results are separate to allow for multiple vRPC responses,
+     * e.g. for streaming calls like scans (post-V1). See Flow Control.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcResponse, + com.google.bigtable.v2.VirtualRpcResponse.Builder, + com.google.bigtable.v2.VirtualRpcResponseOrBuilder> + internalGetVirtualRpcFieldBuilder() { + if (virtualRpcBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + virtualRpcBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcResponse, + com.google.bigtable.v2.VirtualRpcResponse.Builder, + com.google.bigtable.v2.VirtualRpcResponseOrBuilder>( + (com.google.bigtable.v2.VirtualRpcResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return virtualRpcBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ErrorResponse, + com.google.bigtable.v2.ErrorResponse.Builder, + com.google.bigtable.v2.ErrorResponseOrBuilder> + errorBuilder_; + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return payloadCase_ == 3; + } + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return The error. + */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponse getError() { + if (errorBuilder_ == null) { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 3) { + return errorBuilder_.getMessage(); + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder setError(com.google.bigtable.v2.ErrorResponse value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder setError(com.google.bigtable.v2.ErrorResponse.Builder builderForValue) { + if (errorBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder mergeError(com.google.bigtable.v2.ErrorResponse value) { + if (errorBuilder_ == null) { + if (payloadCase_ == 3 + && payload_ != com.google.bigtable.v2.ErrorResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.ErrorResponse.newBuilder( + (com.google.bigtable.v2.ErrorResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 3) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + payloadCase_ = 3; + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + public com.google.bigtable.v2.ErrorResponse.Builder getErrorBuilder() { + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + @java.lang.Override + public com.google.bigtable.v2.ErrorResponseOrBuilder getErrorOrBuilder() { + if ((payloadCase_ == 3) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 3) { + return (com.google.bigtable.v2.ErrorResponse) payload_; + } + return com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ErrorResponse, + com.google.bigtable.v2.ErrorResponse.Builder, + com.google.bigtable.v2.ErrorResponseOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(payloadCase_ == 3)) { + payload_ = com.google.bigtable.v2.ErrorResponse.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ErrorResponse, + com.google.bigtable.v2.ErrorResponse.Builder, + com.google.bigtable.v2.ErrorResponseOrBuilder>( + (com.google.bigtable.v2.ErrorResponse) payload_, getParentForChildren(), isClean()); + payload_ = null; + } + payloadCase_ = 3; + onChanged(); + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionParametersResponse, + com.google.bigtable.v2.SessionParametersResponse.Builder, + com.google.bigtable.v2.SessionParametersResponseOrBuilder> + sessionParametersBuilder_; + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return Whether the sessionParameters field is set. + */ + @java.lang.Override + public boolean hasSessionParameters() { + return payloadCase_ == 4; + } + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return The sessionParameters. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponse getSessionParameters() { + if (sessionParametersBuilder_ == null) { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 4) { + return sessionParametersBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder setSessionParameters(com.google.bigtable.v2.SessionParametersResponse value) { + if (sessionParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + sessionParametersBuilder_.setMessage(value); + } + payloadCase_ = 4; + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder setSessionParameters( + com.google.bigtable.v2.SessionParametersResponse.Builder builderForValue) { + if (sessionParametersBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + sessionParametersBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 4; + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder mergeSessionParameters(com.google.bigtable.v2.SessionParametersResponse value) { + if (sessionParametersBuilder_ == null) { + if (payloadCase_ == 4 + && payload_ != com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionParametersResponse.newBuilder( + (com.google.bigtable.v2.SessionParametersResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 4) { + sessionParametersBuilder_.mergeFrom(value); + } else { + sessionParametersBuilder_.setMessage(value); + } + } + payloadCase_ = 4; + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public Builder clearSessionParameters() { + if (sessionParametersBuilder_ == null) { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + } + sessionParametersBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + public com.google.bigtable.v2.SessionParametersResponse.Builder getSessionParametersBuilder() { + return internalGetSessionParametersFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + @java.lang.Override + public com.google.bigtable.v2.SessionParametersResponseOrBuilder + getSessionParametersOrBuilder() { + if ((payloadCase_ == 4) && (sessionParametersBuilder_ != null)) { + return sessionParametersBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 4) { + return (com.google.bigtable.v2.SessionParametersResponse) payload_; + } + return com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionParametersResponse, + com.google.bigtable.v2.SessionParametersResponse.Builder, + com.google.bigtable.v2.SessionParametersResponseOrBuilder> + internalGetSessionParametersFieldBuilder() { + if (sessionParametersBuilder_ == null) { + if (!(payloadCase_ == 4)) { + payload_ = com.google.bigtable.v2.SessionParametersResponse.getDefaultInstance(); + } + sessionParametersBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionParametersResponse, + com.google.bigtable.v2.SessionParametersResponse.Builder, + com.google.bigtable.v2.SessionParametersResponseOrBuilder>( + (com.google.bigtable.v2.SessionParametersResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 4; + onChanged(); + return sessionParametersBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.HeartbeatResponse, + com.google.bigtable.v2.HeartbeatResponse.Builder, + com.google.bigtable.v2.HeartbeatResponseOrBuilder> + heartbeatBuilder_; + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return Whether the heartbeat field is set. + */ + @java.lang.Override + public boolean hasHeartbeat() { + return payloadCase_ == 5; + } + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return The heartbeat. + */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponse getHeartbeat() { + if (heartbeatBuilder_ == null) { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 5) { + return heartbeatBuilder_.getMessage(); + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder setHeartbeat(com.google.bigtable.v2.HeartbeatResponse value) { + if (heartbeatBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + heartbeatBuilder_.setMessage(value); + } + payloadCase_ = 5; + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder setHeartbeat(com.google.bigtable.v2.HeartbeatResponse.Builder builderForValue) { + if (heartbeatBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + heartbeatBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 5; + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder mergeHeartbeat(com.google.bigtable.v2.HeartbeatResponse value) { + if (heartbeatBuilder_ == null) { + if (payloadCase_ == 5 + && payload_ != com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.HeartbeatResponse.newBuilder( + (com.google.bigtable.v2.HeartbeatResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 5) { + heartbeatBuilder_.mergeFrom(value); + } else { + heartbeatBuilder_.setMessage(value); + } + } + payloadCase_ = 5; + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public Builder clearHeartbeat() { + if (heartbeatBuilder_ == null) { + if (payloadCase_ == 5) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 5) { + payloadCase_ = 0; + payload_ = null; + } + heartbeatBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + public com.google.bigtable.v2.HeartbeatResponse.Builder getHeartbeatBuilder() { + return internalGetHeartbeatFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + @java.lang.Override + public com.google.bigtable.v2.HeartbeatResponseOrBuilder getHeartbeatOrBuilder() { + if ((payloadCase_ == 5) && (heartbeatBuilder_ != null)) { + return heartbeatBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 5) { + return (com.google.bigtable.v2.HeartbeatResponse) payload_; + } + return com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.HeartbeatResponse, + com.google.bigtable.v2.HeartbeatResponse.Builder, + com.google.bigtable.v2.HeartbeatResponseOrBuilder> + internalGetHeartbeatFieldBuilder() { + if (heartbeatBuilder_ == null) { + if (!(payloadCase_ == 5)) { + payload_ = com.google.bigtable.v2.HeartbeatResponse.getDefaultInstance(); + } + heartbeatBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.HeartbeatResponse, + com.google.bigtable.v2.HeartbeatResponse.Builder, + com.google.bigtable.v2.HeartbeatResponseOrBuilder>( + (com.google.bigtable.v2.HeartbeatResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 5; + onChanged(); + return heartbeatBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.GoAwayResponse, + com.google.bigtable.v2.GoAwayResponse.Builder, + com.google.bigtable.v2.GoAwayResponseOrBuilder> + goAwayBuilder_; + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return Whether the goAway field is set. + */ + @java.lang.Override + public boolean hasGoAway() { + return payloadCase_ == 6; + } + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return The goAway. + */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponse getGoAway() { + if (goAwayBuilder_ == null) { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 6) { + return goAwayBuilder_.getMessage(); + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder setGoAway(com.google.bigtable.v2.GoAwayResponse value) { + if (goAwayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + goAwayBuilder_.setMessage(value); + } + payloadCase_ = 6; + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder setGoAway(com.google.bigtable.v2.GoAwayResponse.Builder builderForValue) { + if (goAwayBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + goAwayBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 6; + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder mergeGoAway(com.google.bigtable.v2.GoAwayResponse value) { + if (goAwayBuilder_ == null) { + if (payloadCase_ == 6 + && payload_ != com.google.bigtable.v2.GoAwayResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.GoAwayResponse.newBuilder( + (com.google.bigtable.v2.GoAwayResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 6) { + goAwayBuilder_.mergeFrom(value); + } else { + goAwayBuilder_.setMessage(value); + } + } + payloadCase_ = 6; + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public Builder clearGoAway() { + if (goAwayBuilder_ == null) { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + } + goAwayBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + public com.google.bigtable.v2.GoAwayResponse.Builder getGoAwayBuilder() { + return internalGetGoAwayFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + @java.lang.Override + public com.google.bigtable.v2.GoAwayResponseOrBuilder getGoAwayOrBuilder() { + if ((payloadCase_ == 6) && (goAwayBuilder_ != null)) { + return goAwayBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 6) { + return (com.google.bigtable.v2.GoAwayResponse) payload_; + } + return com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.GoAwayResponse, + com.google.bigtable.v2.GoAwayResponse.Builder, + com.google.bigtable.v2.GoAwayResponseOrBuilder> + internalGetGoAwayFieldBuilder() { + if (goAwayBuilder_ == null) { + if (!(payloadCase_ == 6)) { + payload_ = com.google.bigtable.v2.GoAwayResponse.getDefaultInstance(); + } + goAwayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.GoAwayResponse, + com.google.bigtable.v2.GoAwayResponse.Builder, + com.google.bigtable.v2.GoAwayResponseOrBuilder>( + (com.google.bigtable.v2.GoAwayResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 6; + onChanged(); + return goAwayBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig, + com.google.bigtable.v2.SessionRefreshConfig.Builder, + com.google.bigtable.v2.SessionRefreshConfigOrBuilder> + sessionRefreshConfigBuilder_; + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return Whether the sessionRefreshConfig field is set. + */ + @java.lang.Override + public boolean hasSessionRefreshConfig() { + return payloadCase_ == 7; + } + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return The sessionRefreshConfig. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfig getSessionRefreshConfig() { + if (sessionRefreshConfigBuilder_ == null) { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } else { + if (payloadCase_ == 7) { + return sessionRefreshConfigBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder setSessionRefreshConfig(com.google.bigtable.v2.SessionRefreshConfig value) { + if (sessionRefreshConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + sessionRefreshConfigBuilder_.setMessage(value); + } + payloadCase_ = 7; + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder setSessionRefreshConfig( + com.google.bigtable.v2.SessionRefreshConfig.Builder builderForValue) { + if (sessionRefreshConfigBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + sessionRefreshConfigBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 7; + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder mergeSessionRefreshConfig(com.google.bigtable.v2.SessionRefreshConfig value) { + if (sessionRefreshConfigBuilder_ == null) { + if (payloadCase_ == 7 + && payload_ != com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionRefreshConfig.newBuilder( + (com.google.bigtable.v2.SessionRefreshConfig) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 7) { + sessionRefreshConfigBuilder_.mergeFrom(value); + } else { + sessionRefreshConfigBuilder_.setMessage(value); + } + } + payloadCase_ = 7; + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public Builder clearSessionRefreshConfig() { + if (sessionRefreshConfigBuilder_ == null) { + if (payloadCase_ == 7) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 7) { + payloadCase_ = 0; + payload_ = null; + } + sessionRefreshConfigBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + public com.google.bigtable.v2.SessionRefreshConfig.Builder getSessionRefreshConfigBuilder() { + return internalGetSessionRefreshConfigFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + @java.lang.Override + public com.google.bigtable.v2.SessionRefreshConfigOrBuilder getSessionRefreshConfigOrBuilder() { + if ((payloadCase_ == 7) && (sessionRefreshConfigBuilder_ != null)) { + return sessionRefreshConfigBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 7) { + return (com.google.bigtable.v2.SessionRefreshConfig) payload_; + } + return com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig, + com.google.bigtable.v2.SessionRefreshConfig.Builder, + com.google.bigtable.v2.SessionRefreshConfigOrBuilder> + internalGetSessionRefreshConfigFieldBuilder() { + if (sessionRefreshConfigBuilder_ == null) { + if (!(payloadCase_ == 7)) { + payload_ = com.google.bigtable.v2.SessionRefreshConfig.getDefaultInstance(); + } + sessionRefreshConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRefreshConfig, + com.google.bigtable.v2.SessionRefreshConfig.Builder, + com.google.bigtable.v2.SessionRefreshConfigOrBuilder>( + (com.google.bigtable.v2.SessionRefreshConfig) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 7; + onChanged(); + return sessionRefreshConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.SessionResponse) + private static final com.google.bigtable.v2.SessionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.SessionResponse(); + } + + public static com.google.bigtable.v2.SessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.SessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponseOrBuilder.java new file mode 100644 index 000000000000..492e52d89338 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionResponseOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface SessionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.SessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return Whether the openSession field is set. + */ + boolean hasOpenSession(); + + /** + * .google.bigtable.v2.OpenSessionResponse open_session = 1; + * + * @return The openSession. + */ + com.google.bigtable.v2.OpenSessionResponse getOpenSession(); + + /** .google.bigtable.v2.OpenSessionResponse open_session = 1; */ + com.google.bigtable.v2.OpenSessionResponseOrBuilder getOpenSessionOrBuilder(); + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return Whether the virtualRpc field is set. + */ + boolean hasVirtualRpc(); + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + * + * @return The virtualRpc. + */ + com.google.bigtable.v2.VirtualRpcResponse getVirtualRpc(); + + /** + * + * + *
+   * A vRPC can result in either a successful result or an error.
+   * Error results are separate to allow for multiple vRPC responses,
+   * e.g. for streaming calls like scans (post-V1). See Flow Control.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcResponse virtual_rpc = 2; + */ + com.google.bigtable.v2.VirtualRpcResponseOrBuilder getVirtualRpcOrBuilder(); + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.bigtable.v2.ErrorResponse error = 3; + * + * @return The error. + */ + com.google.bigtable.v2.ErrorResponse getError(); + + /** .google.bigtable.v2.ErrorResponse error = 3; */ + com.google.bigtable.v2.ErrorResponseOrBuilder getErrorOrBuilder(); + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return Whether the sessionParameters field is set. + */ + boolean hasSessionParameters(); + + /** + * .google.bigtable.v2.SessionParametersResponse session_parameters = 4; + * + * @return The sessionParameters. + */ + com.google.bigtable.v2.SessionParametersResponse getSessionParameters(); + + /** .google.bigtable.v2.SessionParametersResponse session_parameters = 4; */ + com.google.bigtable.v2.SessionParametersResponseOrBuilder getSessionParametersOrBuilder(); + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return Whether the heartbeat field is set. + */ + boolean hasHeartbeat(); + + /** + * .google.bigtable.v2.HeartbeatResponse heartbeat = 5; + * + * @return The heartbeat. + */ + com.google.bigtable.v2.HeartbeatResponse getHeartbeat(); + + /** .google.bigtable.v2.HeartbeatResponse heartbeat = 5; */ + com.google.bigtable.v2.HeartbeatResponseOrBuilder getHeartbeatOrBuilder(); + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return Whether the goAway field is set. + */ + boolean hasGoAway(); + + /** + * .google.bigtable.v2.GoAwayResponse go_away = 6; + * + * @return The goAway. + */ + com.google.bigtable.v2.GoAwayResponse getGoAway(); + + /** .google.bigtable.v2.GoAwayResponse go_away = 6; */ + com.google.bigtable.v2.GoAwayResponseOrBuilder getGoAwayOrBuilder(); + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return Whether the sessionRefreshConfig field is set. + */ + boolean hasSessionRefreshConfig(); + + /** + * .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; + * + * @return The sessionRefreshConfig. + */ + com.google.bigtable.v2.SessionRefreshConfig getSessionRefreshConfig(); + + /** .google.bigtable.v2.SessionRefreshConfig session_refresh_config = 7; */ + com.google.bigtable.v2.SessionRefreshConfigOrBuilder getSessionRefreshConfigOrBuilder(); + + com.google.bigtable.v2.SessionResponse.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionType.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionType.java new file mode 100644 index 000000000000..83bcbae51a94 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SessionType.java @@ -0,0 +1,173 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Supported session types.
+ * 
+ * + * Protobuf enum {@code google.bigtable.v2.SessionType} + */ +@com.google.protobuf.Generated +public enum SessionType implements com.google.protobuf.ProtocolMessageEnum { + /** SESSION_TYPE_UNSET = 0; */ + SESSION_TYPE_UNSET(0), + /** SESSION_TYPE_TABLE = 1; */ + SESSION_TYPE_TABLE(1), + /** SESSION_TYPE_AUTHORIZED_VIEW = 2; */ + SESSION_TYPE_AUTHORIZED_VIEW(2), + /** SESSION_TYPE_MATERIALIZED_VIEW = 3; */ + SESSION_TYPE_MATERIALIZED_VIEW(3), + /** + * + * + *
+   * For internal protocol testing only.
+   * 
+ * + * SESSION_TYPE_TEST = -1; + */ + SESSION_TYPE_TEST(-1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionType"); + } + + /** SESSION_TYPE_UNSET = 0; */ + public static final int SESSION_TYPE_UNSET_VALUE = 0; + + /** SESSION_TYPE_TABLE = 1; */ + public static final int SESSION_TYPE_TABLE_VALUE = 1; + + /** SESSION_TYPE_AUTHORIZED_VIEW = 2; */ + public static final int SESSION_TYPE_AUTHORIZED_VIEW_VALUE = 2; + + /** SESSION_TYPE_MATERIALIZED_VIEW = 3; */ + public static final int SESSION_TYPE_MATERIALIZED_VIEW_VALUE = 3; + + /** + * + * + *
+   * For internal protocol testing only.
+   * 
+ * + * SESSION_TYPE_TEST = -1; + */ + public static final int SESSION_TYPE_TEST_VALUE = -1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SessionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SessionType forNumber(int value) { + switch (value) { + case 0: + return SESSION_TYPE_UNSET; + case 1: + return SESSION_TYPE_TABLE; + case 2: + return SESSION_TYPE_AUTHORIZED_VIEW; + case 3: + return SESSION_TYPE_MATERIALIZED_VIEW; + case -1: + return SESSION_TYPE_TEST; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SessionType findValueByNumber(int number) { + return SessionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SessionType[] VALUES = values(); + + public static SessionType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SessionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.SessionType) +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequest.java new file mode 100644 index 000000000000..a79a31a44354 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequest.java @@ -0,0 +1,922 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.TableRequest} + */ +@com.google.protobuf.Generated +public final class TableRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.TableRequest) + TableRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TableRequest"); + } + + // Use TableRequest.newBuilder() to construct. + private TableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TableRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableRequest.class, + com.google.bigtable.v2.TableRequest.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowRequest) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowRequest) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.TableRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.TableRequest other = (com.google.bigtable.v2.TableRequest) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.TableRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableRequest 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.v2.TableRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableRequest 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.v2.TableRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.TableRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.TableRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.TableRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.TableRequest) + com.google.bigtable.v2.TableRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableRequest.class, + com.google.bigtable.v2.TableRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.TableRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.TableRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.TableRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.TableRequest build() { + com.google.bigtable.v2.TableRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.TableRequest buildPartial() { + com.google.bigtable.v2.TableRequest result = new com.google.bigtable.v2.TableRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.TableRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.TableRequest result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.TableRequest) { + return mergeFrom((com.google.bigtable.v2.TableRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.TableRequest other) { + if (other == com.google.bigtable.v2.TableRequest.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequest getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowRequest.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowRequest value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowRequest.newBuilder( + (com.google.bigtable.v2.SessionReadRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowRequest.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowRequest) payload_; + } + return com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowRequest.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowRequest, + com.google.bigtable.v2.SessionReadRowRequest.Builder, + com.google.bigtable.v2.SessionReadRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionReadRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequest getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowRequest.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowRequest value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowRequest.newBuilder( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowRequest.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowRequest) payload_; + } + return com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowRequest.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowRequest, + com.google.bigtable.v2.SessionMutateRowRequest.Builder, + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowRequest) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TableRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.TableRequest) + private static final com.google.bigtable.v2.TableRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.TableRequest(); + } + + public static com.google.bigtable.v2.TableRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TableRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.TableRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequestOrBuilder.java new file mode 100644 index 000000000000..46dd37288e9c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TableRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.TableRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowRequest read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowRequest getReadRow(); + + /** .google.bigtable.v2.SessionReadRowRequest read_row = 1; */ + com.google.bigtable.v2.SessionReadRowRequestOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowRequest getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowRequest mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowRequestOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.TableRequest.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponse.java new file mode 100644 index 000000000000..376919490ec6 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponse.java @@ -0,0 +1,922 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.TableResponse} + */ +@com.google.protobuf.Generated +public final class TableResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.TableResponse) + TableResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TableResponse"); + } + + // Use TableResponse.newBuilder() to construct. + private TableResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TableResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableResponse.class, + com.google.bigtable.v2.TableResponse.Builder.class); + } + + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object payload_; + + public enum PayloadCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + READ_ROW(1), + MUTATE_ROW(2), + PAYLOAD_NOT_SET(0); + private final int value; + + private PayloadCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: + return READ_ROW; + case 2: + return MUTATE_ROW; + case 0: + return PAYLOAD_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public static final int READ_ROW_FIELD_NUMBER = 1; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + + public static final int MUTATE_ROW_FIELD_NUMBER = 2; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (payloadCase_ == 1) { + output.writeMessage(1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.bigtable.v2.SessionReadRowResponse) payload_); + } + if (payloadCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.bigtable.v2.SessionMutateRowResponse) payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.TableResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.TableResponse other = (com.google.bigtable.v2.TableResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getReadRow().equals(other.getReadRow())) return false; + break; + case 2: + if (!getMutateRow().equals(other.getMutateRow())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + READ_ROW_FIELD_NUMBER; + hash = (53 * hash) + getReadRow().hashCode(); + break; + case 2: + hash = (37 * hash) + MUTATE_ROW_FIELD_NUMBER; + hash = (53 * hash) + getMutateRow().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.TableResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableResponse 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.v2.TableResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableResponse 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.v2.TableResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.TableResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TableResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.TableResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.TableResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.TableResponse) + com.google.bigtable.v2.TableResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TableResponse.class, + com.google.bigtable.v2.TableResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.TableResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (readRowBuilder_ != null) { + readRowBuilder_.clear(); + } + if (mutateRowBuilder_ != null) { + mutateRowBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TableResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.TableResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.TableResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.TableResponse build() { + com.google.bigtable.v2.TableResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.TableResponse buildPartial() { + com.google.bigtable.v2.TableResponse result = new com.google.bigtable.v2.TableResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.TableResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.TableResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && readRowBuilder_ != null) { + result.payload_ = readRowBuilder_.build(); + } + if (payloadCase_ == 2 && mutateRowBuilder_ != null) { + result.payload_ = mutateRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.TableResponse) { + return mergeFrom((com.google.bigtable.v2.TableResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.TableResponse other) { + if (other == com.google.bigtable.v2.TableResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case READ_ROW: + { + mergeReadRow(other.getReadRow()); + break; + } + case MUTATE_ROW: + { + mergeMutateRow(other.getMutateRow()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetReadRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMutateRowFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int payloadCase_ = 0; + private java.lang.Object payload_; + + public PayloadCase getPayloadCase() { + return PayloadCase.forNumber(payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + readRowBuilder_; + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + @java.lang.Override + public boolean hasReadRow() { + return payloadCase_ == 1; + } + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponse getReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return readRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + readRowBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder setReadRow( + com.google.bigtable.v2.SessionReadRowResponse.Builder builderForValue) { + if (readRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + readRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder mergeReadRow(com.google.bigtable.v2.SessionReadRowResponse value) { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1 + && payload_ != com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionReadRowResponse.newBuilder( + (com.google.bigtable.v2.SessionReadRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + readRowBuilder_.mergeFrom(value); + } else { + readRowBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public Builder clearReadRow() { + if (readRowBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + readRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + public com.google.bigtable.v2.SessionReadRowResponse.Builder getReadRowBuilder() { + return internalGetReadRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + @java.lang.Override + public com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder() { + if ((payloadCase_ == 1) && (readRowBuilder_ != null)) { + return readRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (com.google.bigtable.v2.SessionReadRowResponse) payload_; + } + return com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder> + internalGetReadRowFieldBuilder() { + if (readRowBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = com.google.bigtable.v2.SessionReadRowResponse.getDefaultInstance(); + } + readRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionReadRowResponse, + com.google.bigtable.v2.SessionReadRowResponse.Builder, + com.google.bigtable.v2.SessionReadRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionReadRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return readRowBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + mutateRowBuilder_; + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + @java.lang.Override + public boolean hasMutateRow() { + return payloadCase_ == 2; + } + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponse getMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return mutateRowBuilder_.getMessage(); + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + mutateRowBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder setMutateRow( + com.google.bigtable.v2.SessionMutateRowResponse.Builder builderForValue) { + if (mutateRowBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + mutateRowBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder mergeMutateRow(com.google.bigtable.v2.SessionMutateRowResponse value) { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2 + && payload_ != com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance()) { + payload_ = + com.google.bigtable.v2.SessionMutateRowResponse.newBuilder( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_) + .mergeFrom(value) + .buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + mutateRowBuilder_.mergeFrom(value); + } else { + mutateRowBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public Builder clearMutateRow() { + if (mutateRowBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + mutateRowBuilder_.clear(); + } + return this; + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + public com.google.bigtable.v2.SessionMutateRowResponse.Builder getMutateRowBuilder() { + return internalGetMutateRowFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + @java.lang.Override + public com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder() { + if ((payloadCase_ == 2) && (mutateRowBuilder_ != null)) { + return mutateRowBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (com.google.bigtable.v2.SessionMutateRowResponse) payload_; + } + return com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + } + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder> + internalGetMutateRowFieldBuilder() { + if (mutateRowBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = com.google.bigtable.v2.SessionMutateRowResponse.getDefaultInstance(); + } + mutateRowBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionMutateRowResponse, + com.google.bigtable.v2.SessionMutateRowResponse.Builder, + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder>( + (com.google.bigtable.v2.SessionMutateRowResponse) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return mutateRowBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TableResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.TableResponse) + private static final com.google.bigtable.v2.TableResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.TableResponse(); + } + + public static com.google.bigtable.v2.TableResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TableResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.TableResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponseOrBuilder.java new file mode 100644 index 000000000000..e1b61b9d7141 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableResponseOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TableResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.TableResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return Whether the readRow field is set. + */ + boolean hasReadRow(); + + /** + * .google.bigtable.v2.SessionReadRowResponse read_row = 1; + * + * @return The readRow. + */ + com.google.bigtable.v2.SessionReadRowResponse getReadRow(); + + /** .google.bigtable.v2.SessionReadRowResponse read_row = 1; */ + com.google.bigtable.v2.SessionReadRowResponseOrBuilder getReadRowOrBuilder(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return Whether the mutateRow field is set. + */ + boolean hasMutateRow(); + + /** + * .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; + * + * @return The mutateRow. + */ + com.google.bigtable.v2.SessionMutateRowResponse getMutateRow(); + + /** .google.bigtable.v2.SessionMutateRowResponse mutate_row = 2; */ + com.google.bigtable.v2.SessionMutateRowResponseOrBuilder getMutateRowOrBuilder(); + + com.google.bigtable.v2.TableResponse.PayloadCase getPayloadCase(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfiguration.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfiguration.java new file mode 100644 index 000000000000..43fe07eeb18d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfiguration.java @@ -0,0 +1,784 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Server provided instructions for enabling finer grained observability on
+ * the client to help diagnose customer issues. Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.TelemetryConfiguration} + */ +@com.google.protobuf.Generated +public final class TelemetryConfiguration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.TelemetryConfiguration) + TelemetryConfigurationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TelemetryConfiguration"); + } + + // Use TelemetryConfiguration.newBuilder() to construct. + private TelemetryConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TelemetryConfiguration() { + debugTagLevel_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TelemetryConfiguration.class, + com.google.bigtable.v2.TelemetryConfiguration.Builder.class); + } + + /** + * + * + *
+   * The level of detail of telemetry to be sent from the client.
+   * 
+ * + * Protobuf enum {@code google.bigtable.v2.TelemetryConfiguration.Level} + */ + public enum Level implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Server did not specify a level. Should disable all debug tag counters.
+     * 
+ * + * LEVEL_UNSPECIFIED = 0; + */ + LEVEL_UNSPECIFIED(0), + /** + * + * + *
+     * Enables all debug tag counter levels.
+     * 
+ * + * DEBUG = 1; + */ + DEBUG(1), + /** + * + * + *
+     * Eables all debug tag counters except for DEBUG.
+     * 
+ * + * INFO = 2; + */ + INFO(2), + /** + * + * + *
+     * Enables all debug tag counters except for DEBUG and INFO.
+     * 
+ * + * WARN = 3; + */ + WARN(3), + /** + * + * + *
+     * Enables only error debug tag counters.
+     * 
+ * + * ERROR = 4; + */ + ERROR(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Level"); + } + + /** + * + * + *
+     * Server did not specify a level. Should disable all debug tag counters.
+     * 
+ * + * LEVEL_UNSPECIFIED = 0; + */ + public static final int LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Enables all debug tag counter levels.
+     * 
+ * + * DEBUG = 1; + */ + public static final int DEBUG_VALUE = 1; + + /** + * + * + *
+     * Eables all debug tag counters except for DEBUG.
+     * 
+ * + * INFO = 2; + */ + public static final int INFO_VALUE = 2; + + /** + * + * + *
+     * Enables all debug tag counters except for DEBUG and INFO.
+     * 
+ * + * WARN = 3; + */ + public static final int WARN_VALUE = 3; + + /** + * + * + *
+     * Enables only error debug tag counters.
+     * 
+ * + * ERROR = 4; + */ + public static final int ERROR_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Level valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Level forNumber(int value) { + switch (value) { + case 0: + return LEVEL_UNSPECIFIED; + case 1: + return DEBUG; + case 2: + return INFO; + case 3: + return WARN; + case 4: + return ERROR; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Level findValueByNumber(int number) { + return Level.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.v2.TelemetryConfiguration.getDescriptor().getEnumTypes().get(0); + } + + private static final Level[] VALUES = values(); + + public static Level valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Level(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.v2.TelemetryConfiguration.Level) + } + + public static final int DEBUG_TAG_LEVEL_FIELD_NUMBER = 1; + private int debugTagLevel_ = 0; + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The enum numeric value on the wire for debugTagLevel. + */ + @java.lang.Override + public int getDebugTagLevelValue() { + return debugTagLevel_; + } + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The debugTagLevel. + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration.Level getDebugTagLevel() { + com.google.bigtable.v2.TelemetryConfiguration.Level result = + com.google.bigtable.v2.TelemetryConfiguration.Level.forNumber(debugTagLevel_); + return result == null + ? com.google.bigtable.v2.TelemetryConfiguration.Level.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (debugTagLevel_ + != com.google.bigtable.v2.TelemetryConfiguration.Level.LEVEL_UNSPECIFIED.getNumber()) { + output.writeEnum(1, debugTagLevel_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (debugTagLevel_ + != com.google.bigtable.v2.TelemetryConfiguration.Level.LEVEL_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, debugTagLevel_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.TelemetryConfiguration)) { + return super.equals(obj); + } + com.google.bigtable.v2.TelemetryConfiguration other = + (com.google.bigtable.v2.TelemetryConfiguration) obj; + + if (debugTagLevel_ != other.debugTagLevel_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DEBUG_TAG_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + debugTagLevel_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TelemetryConfiguration 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.v2.TelemetryConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TelemetryConfiguration 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.v2.TelemetryConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.TelemetryConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.TelemetryConfiguration prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Server provided instructions for enabling finer grained observability on
+   * the client to help diagnose customer issues. Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.TelemetryConfiguration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.TelemetryConfiguration) + com.google.bigtable.v2.TelemetryConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.TelemetryConfiguration.class, + com.google.bigtable.v2.TelemetryConfiguration.Builder.class); + } + + // Construct using com.google.bigtable.v2.TelemetryConfiguration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + debugTagLevel_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_TelemetryConfiguration_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration getDefaultInstanceForType() { + return com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration build() { + com.google.bigtable.v2.TelemetryConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration buildPartial() { + com.google.bigtable.v2.TelemetryConfiguration result = + new com.google.bigtable.v2.TelemetryConfiguration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.TelemetryConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.debugTagLevel_ = debugTagLevel_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.TelemetryConfiguration) { + return mergeFrom((com.google.bigtable.v2.TelemetryConfiguration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.TelemetryConfiguration other) { + if (other == com.google.bigtable.v2.TelemetryConfiguration.getDefaultInstance()) return this; + if (other.debugTagLevel_ != 0) { + setDebugTagLevelValue(other.getDebugTagLevelValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + debugTagLevel_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int debugTagLevel_ = 0; + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The enum numeric value on the wire for debugTagLevel. + */ + @java.lang.Override + public int getDebugTagLevelValue() { + return debugTagLevel_; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @param value The enum numeric value on the wire for debugTagLevel to set. + * @return This builder for chaining. + */ + public Builder setDebugTagLevelValue(int value) { + debugTagLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The debugTagLevel. + */ + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration.Level getDebugTagLevel() { + com.google.bigtable.v2.TelemetryConfiguration.Level result = + com.google.bigtable.v2.TelemetryConfiguration.Level.forNumber(debugTagLevel_); + return result == null + ? com.google.bigtable.v2.TelemetryConfiguration.Level.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @param value The debugTagLevel to set. + * @return This builder for chaining. + */ + public Builder setDebugTagLevel(com.google.bigtable.v2.TelemetryConfiguration.Level value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + debugTagLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Selector for the debug counters that should be uploaded.
+     * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return This builder for chaining. + */ + public Builder clearDebugTagLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + debugTagLevel_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TelemetryConfiguration) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.TelemetryConfiguration) + private static final com.google.bigtable.v2.TelemetryConfiguration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.TelemetryConfiguration(); + } + + public static com.google.bigtable.v2.TelemetryConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TelemetryConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.TelemetryConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfigurationOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfigurationOrBuilder.java new file mode 100644 index 000000000000..457c8e594c37 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TelemetryConfigurationOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface TelemetryConfigurationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.TelemetryConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The enum numeric value on the wire for debugTagLevel. + */ + int getDebugTagLevelValue(); + + /** + * + * + *
+   * Selector for the debug counters that should be uploaded.
+   * 
+ * + * .google.bigtable.v2.TelemetryConfiguration.Level debug_tag_level = 1; + * + * @return The debugTagLevel. + */ + com.google.bigtable.v2.TelemetryConfiguration.Level getDebugTagLevel(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequest.java new file mode 100644 index 000000000000..da34767643e3 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequest.java @@ -0,0 +1,2298 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest} + */ +@com.google.protobuf.Generated +public final class VirtualRpcRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.VirtualRpcRequest) + VirtualRpcRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VirtualRpcRequest"); + } + + // Use VirtualRpcRequest.newBuilder() to construct. + private VirtualRpcRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private VirtualRpcRequest() { + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.class, + com.google.bigtable.v2.VirtualRpcRequest.Builder.class); + } + + public interface MetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.VirtualRpcRequest.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Track retry attempts for this vRPC at the AFE.
+     * 
+ * + * int64 attempt_number = 1; + * + * @return The attemptNumber. + */ + long getAttemptNumber(); + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return Whether the attemptStart field is set. + */ + boolean hasAttemptStart(); + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return The attemptStart. + */ + com.google.protobuf.Timestamp getAttemptStart(); + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptStartOrBuilder(); + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The traceparent. + */ + java.lang.String getTraceparent(); + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The bytes for traceparent. + */ + com.google.protobuf.ByteString getTraceparentBytes(); + } + + /** + * + * + *
+   * Container for all vRPC Metadata.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest.Metadata} + */ + public static final class Metadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.VirtualRpcRequest.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Metadata"); + } + + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Metadata() { + traceparent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.Metadata.class, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder.class); + } + + private int bitField0_; + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private long attemptNumber_ = 0L; + + /** + * + * + *
+     * Track retry attempts for this vRPC at the AFE.
+     * 
+ * + * int64 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public long getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_START_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptStart_; + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return Whether the attemptStart field is set. + */ + @java.lang.Override + public boolean hasAttemptStart() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return The attemptStart. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptStart() { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } + + /** + * + * + *
+     * Track the client's known start time for the attempt. This is likely not
+     * easily compared with the server's time due to clock skew.
+     * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptStartOrBuilder() { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } + + public static final int TRACEPARENT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object traceparent_ = ""; + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The traceparent. + */ + @java.lang.Override + public java.lang.String getTraceparent() { + java.lang.Object ref = traceparent_; + 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(); + traceparent_ = s; + return s; + } + } + + /** + * + * + *
+     * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+     * attempts together for the same logical operation (e.g. in logs / traces).
+     *
+     * Note, this may not be needed for V1, TBD.
+     * 
+ * + * string traceparent = 3; + * + * @return The bytes for traceparent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTraceparentBytes() { + java.lang.Object ref = traceparent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceparent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (attemptNumber_ != 0L) { + output.writeInt64(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttemptStart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(traceparent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, traceparent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptStart()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(traceparent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, traceparent_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.VirtualRpcRequest.Metadata)) { + return super.equals(obj); + } + com.google.bigtable.v2.VirtualRpcRequest.Metadata other = + (com.google.bigtable.v2.VirtualRpcRequest.Metadata) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptStart() != other.hasAttemptStart()) return false; + if (hasAttemptStart()) { + if (!getAttemptStart().equals(other.getAttemptStart())) return false; + } + if (!getTraceparent().equals(other.getTraceparent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAttemptNumber()); + if (hasAttemptStart()) { + hash = (37 * hash) + ATTEMPT_START_FIELD_NUMBER; + hash = (53 * hash) + getAttemptStart().hashCode(); + } + hash = (37 * hash) + TRACEPARENT_FIELD_NUMBER; + hash = (53 * hash) + getTraceparent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata 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.v2.VirtualRpcRequest.Metadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata 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.v2.VirtualRpcRequest.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.VirtualRpcRequest.Metadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Container for all vRPC Metadata.
+     * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest.Metadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.VirtualRpcRequest.Metadata) + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.Metadata.class, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder.class); + } + + // Construct using com.google.bigtable.v2.VirtualRpcRequest.Metadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAttemptStartFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attemptNumber_ = 0L; + attemptStart_ = null; + if (attemptStartBuilder_ != null) { + attemptStartBuilder_.dispose(); + attemptStartBuilder_ = null; + } + traceparent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_Metadata_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata getDefaultInstanceForType() { + return com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata build() { + com.google.bigtable.v2.VirtualRpcRequest.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata buildPartial() { + com.google.bigtable.v2.VirtualRpcRequest.Metadata result = + new com.google.bigtable.v2.VirtualRpcRequest.Metadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.VirtualRpcRequest.Metadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attemptNumber_ = attemptNumber_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attemptStart_ = + attemptStartBuilder_ == null ? attemptStart_ : attemptStartBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.traceparent_ = traceparent_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.VirtualRpcRequest.Metadata) { + return mergeFrom((com.google.bigtable.v2.VirtualRpcRequest.Metadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.VirtualRpcRequest.Metadata other) { + if (other == com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0L) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptStart()) { + mergeAttemptStart(other.getAttemptStart()); + } + if (!other.getTraceparent().isEmpty()) { + traceparent_ = other.traceparent_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + attemptNumber_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetAttemptStartFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + traceparent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long attemptNumber_; + + /** + * + * + *
+       * Track retry attempts for this vRPC at the AFE.
+       * 
+ * + * int64 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public long getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
+       * Track retry attempts for this vRPC at the AFE.
+       * 
+ * + * int64 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(long value) { + + attemptNumber_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Track retry attempts for this vRPC at the AFE.
+       * 
+ * + * int64 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + attemptNumber_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptStart_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptStartBuilder_; + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return Whether the attemptStart field is set. + */ + public boolean hasAttemptStart() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + * + * @return The attemptStart. + */ + public com.google.protobuf.Timestamp getAttemptStart() { + if (attemptStartBuilder_ == null) { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } else { + return attemptStartBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder setAttemptStart(com.google.protobuf.Timestamp value) { + if (attemptStartBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptStart_ = value; + } else { + attemptStartBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder setAttemptStart(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptStartBuilder_ == null) { + attemptStart_ = builderForValue.build(); + } else { + attemptStartBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder mergeAttemptStart(com.google.protobuf.Timestamp value) { + if (attemptStartBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attemptStart_ != null + && attemptStart_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getAttemptStartBuilder().mergeFrom(value); + } else { + attemptStart_ = value; + } + } else { + attemptStartBuilder_.mergeFrom(value); + } + if (attemptStart_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public Builder clearAttemptStart() { + bitField0_ = (bitField0_ & ~0x00000002); + attemptStart_ = null; + if (attemptStartBuilder_ != null) { + attemptStartBuilder_.dispose(); + attemptStartBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptStartBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetAttemptStartFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptStartOrBuilder() { + if (attemptStartBuilder_ != null) { + return attemptStartBuilder_.getMessageOrBuilder(); + } else { + return attemptStart_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptStart_; + } + } + + /** + * + * + *
+       * Track the client's known start time for the attempt. This is likely not
+       * easily compared with the server's time due to clock skew.
+       * 
+ * + * .google.protobuf.Timestamp attempt_start = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetAttemptStartFieldBuilder() { + if (attemptStartBuilder_ == null) { + attemptStartBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptStart(), getParentForChildren(), isClean()); + attemptStart_ = null; + } + return attemptStartBuilder_; + } + + private java.lang.Object traceparent_ = ""; + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @return The traceparent. + */ + public java.lang.String getTraceparent() { + java.lang.Object ref = traceparent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceparent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @return The bytes for traceparent. + */ + public com.google.protobuf.ByteString getTraceparentBytes() { + java.lang.Object ref = traceparent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceparent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @param value The traceparent to set. + * @return This builder for chaining. + */ + public Builder setTraceparent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + traceparent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @return This builder for chaining. + */ + public Builder clearTraceparent() { + traceparent_ = getDefaultInstance().getTraceparent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Link OpenTelemetry traces (e.g. Tapper). This can be used to link
+       * attempts together for the same logical operation (e.g. in logs / traces).
+       *
+       * Note, this may not be needed for V1, TBD.
+       * 
+ * + * string traceparent = 3; + * + * @param value The bytes for traceparent to set. + * @return This builder for chaining. + */ + public Builder setTraceparentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + traceparent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.VirtualRpcRequest.Metadata) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.VirtualRpcRequest.Metadata) + private static final com.google.bigtable.v2.VirtualRpcRequest.Metadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.VirtualRpcRequest.Metadata(); + } + + public static com.google.bigtable.v2.VirtualRpcRequest.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int RPC_ID_FIELD_NUMBER = 1; + private long rpcId_ = 0L; + + /** + * + * + *
+   * Client chosen, monotonically increasing identifier for the request.
+   * Must be unique within a session.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + public static final int DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Duration deadline_; + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return Whether the deadline field is set. + */ + @java.lang.Override + public boolean hasDeadline() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return The deadline. + */ + @java.lang.Override + public com.google.protobuf.Duration getDeadline() { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDeadlineOrBuilder() { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.bigtable.v2.VirtualRpcRequest.Metadata metadata_; + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.Metadata getMetadata() { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder getMetadataOrBuilder() { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Could be TableRequest (or in post-V1, SqlRequest)
+   * 
+ * + * bytes payload = 4; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (rpcId_ != 0L) { + output.writeInt64(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getMetadata()); + } + if (!payload_.isEmpty()) { + output.writeBytes(4, payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rpcId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, payload_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.VirtualRpcRequest)) { + return super.equals(obj); + } + com.google.bigtable.v2.VirtualRpcRequest other = (com.google.bigtable.v2.VirtualRpcRequest) obj; + + if (getRpcId() != other.getRpcId()) return false; + if (hasDeadline() != other.hasDeadline()) return false; + if (hasDeadline()) { + if (!getDeadline().equals(other.getDeadline())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) return false; + } + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RPC_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRpcId()); + if (hasDeadline()) { + hash = (37 * hash) + DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getDeadline().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest 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.v2.VirtualRpcRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest 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.v2.VirtualRpcRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.VirtualRpcRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.VirtualRpcRequest) + com.google.bigtable.v2.VirtualRpcRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcRequest.class, + com.google.bigtable.v2.VirtualRpcRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.VirtualRpcRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDeadlineFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rpcId_ = 0L; + deadline_ = null; + if (deadlineBuilder_ != null) { + deadlineBuilder_.dispose(); + deadlineBuilder_ = null; + } + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcRequest_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest getDefaultInstanceForType() { + return com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest build() { + com.google.bigtable.v2.VirtualRpcRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest buildPartial() { + com.google.bigtable.v2.VirtualRpcRequest result = + new com.google.bigtable.v2.VirtualRpcRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.VirtualRpcRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rpcId_ = rpcId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deadline_ = deadlineBuilder_ == null ? deadline_ : deadlineBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.VirtualRpcRequest) { + return mergeFrom((com.google.bigtable.v2.VirtualRpcRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.VirtualRpcRequest other) { + if (other == com.google.bigtable.v2.VirtualRpcRequest.getDefaultInstance()) return this; + if (other.getRpcId() != 0L) { + setRpcId(other.getRpcId()); + } + if (other.hasDeadline()) { + mergeDeadline(other.getDeadline()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rpcId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetDeadlineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long rpcId_; + + /** + * + * + *
+     * Client chosen, monotonically increasing identifier for the request.
+     * Must be unique within a session.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + /** + * + * + *
+     * Client chosen, monotonically increasing identifier for the request.
+     * Must be unique within a session.
+     * 
+ * + * int64 rpc_id = 1; + * + * @param value The rpcId to set. + * @return This builder for chaining. + */ + public Builder setRpcId(long value) { + + rpcId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Client chosen, monotonically increasing identifier for the request.
+     * Must be unique within a session.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRpcId() { + bitField0_ = (bitField0_ & ~0x00000001); + rpcId_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Duration deadline_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + deadlineBuilder_; + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return Whether the deadline field is set. + */ + public boolean hasDeadline() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return The deadline. + */ + public com.google.protobuf.Duration getDeadline() { + if (deadlineBuilder_ == null) { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } else { + return deadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder setDeadline(com.google.protobuf.Duration value) { + if (deadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deadline_ = value; + } else { + deadlineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder setDeadline(com.google.protobuf.Duration.Builder builderForValue) { + if (deadlineBuilder_ == null) { + deadline_ = builderForValue.build(); + } else { + deadlineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder mergeDeadline(com.google.protobuf.Duration value) { + if (deadlineBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && deadline_ != null + && deadline_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDeadlineBuilder().mergeFrom(value); + } else { + deadline_ = value; + } + } else { + deadlineBuilder_.mergeFrom(value); + } + if (deadline_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public Builder clearDeadline() { + bitField0_ = (bitField0_ & ~0x00000002); + deadline_ = null; + if (deadlineBuilder_ != null) { + deadlineBuilder_.dispose(); + deadlineBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public com.google.protobuf.Duration.Builder getDeadlineBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + public com.google.protobuf.DurationOrBuilder getDeadlineOrBuilder() { + if (deadlineBuilder_ != null) { + return deadlineBuilder_.getMessageOrBuilder(); + } else { + return deadline_ == null ? com.google.protobuf.Duration.getDefaultInstance() : deadline_; + } + } + + /** + * + * + *
+     * Attempt deadline.
+     *
+     * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+     * deadline).
+     * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDeadlineFieldBuilder() { + if (deadlineBuilder_ == null) { + deadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDeadline(), getParentForChildren(), isClean()); + deadline_ = null; + } + return deadlineBuilder_; + } + + private com.google.bigtable.v2.VirtualRpcRequest.Metadata metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest.Metadata, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder, + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder> + metadataBuilder_; + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return The metadata. + */ + public com.google.bigtable.v2.VirtualRpcRequest.Metadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder setMetadata(com.google.bigtable.v2.VirtualRpcRequest.Metadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder setMetadata( + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder mergeMetadata(com.google.bigtable.v2.VirtualRpcRequest.Metadata value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && metadata_ != null + && metadata_ + != com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000004); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder getMetadataBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + public com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null + ? com.google.bigtable.v2.VirtualRpcRequest.Metadata.getDefaultInstance() + : metadata_; + } + } + + /** + * + * + *
+     * vRPC metadata.
+     * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest.Metadata, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder, + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.VirtualRpcRequest.Metadata, + com.google.bigtable.v2.VirtualRpcRequest.Metadata.Builder, + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Could be TableRequest (or in post-V1, SqlRequest)
+     * 
+ * + * bytes payload = 4; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Could be TableRequest (or in post-V1, SqlRequest)
+     * 
+ * + * bytes payload = 4; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Could be TableRequest (or in post-V1, SqlRequest)
+     * 
+ * + * bytes payload = 4; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000008); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.VirtualRpcRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.VirtualRpcRequest) + private static final com.google.bigtable.v2.VirtualRpcRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.VirtualRpcRequest(); + } + + public static com.google.bigtable.v2.VirtualRpcRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VirtualRpcRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequestOrBuilder.java new file mode 100644 index 000000000000..2d18771f315c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcRequestOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface VirtualRpcRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.VirtualRpcRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Client chosen, monotonically increasing identifier for the request.
+   * Must be unique within a session.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + long getRpcId(); + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return Whether the deadline field is set. + */ + boolean hasDeadline(); + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + * + * @return The deadline. + */ + com.google.protobuf.Duration getDeadline(); + + /** + * + * + *
+   * Attempt deadline.
+   *
+   * Note, this may not be needed for V1, TBD (e.g. operation vs attempt
+   * deadline).
+   * 
+ * + * .google.protobuf.Duration deadline = 2; + */ + com.google.protobuf.DurationOrBuilder getDeadlineOrBuilder(); + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + * + * @return The metadata. + */ + com.google.bigtable.v2.VirtualRpcRequest.Metadata getMetadata(); + + /** + * + * + *
+   * vRPC metadata.
+   * 
+ * + * .google.bigtable.v2.VirtualRpcRequest.Metadata metadata = 3; + */ + com.google.bigtable.v2.VirtualRpcRequest.MetadataOrBuilder getMetadataOrBuilder(); + + /** + * + * + *
+   * Could be TableRequest (or in post-V1, SqlRequest)
+   * 
+ * + * bytes payload = 4; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponse.java new file mode 100644 index 000000000000..c7a7d7e56acb --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponse.java @@ -0,0 +1,1001 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +/** + * + * + *
+ * Internal usage only.
+ * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcResponse} + */ +@com.google.protobuf.Generated +public final class VirtualRpcResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.VirtualRpcResponse) + VirtualRpcResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VirtualRpcResponse"); + } + + // Use VirtualRpcResponse.newBuilder() to construct. + private VirtualRpcResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private VirtualRpcResponse() { + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcResponse.class, + com.google.bigtable.v2.VirtualRpcResponse.Builder.class); + } + + private int bitField0_; + public static final int RPC_ID_FIELD_NUMBER = 1; + private long rpcId_ = 0L; + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + public static final int CLUSTER_INFO_FIELD_NUMBER = 2; + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + @java.lang.Override + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + @java.lang.Override + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + + public static final int STATS_FIELD_NUMBER = 4; + private com.google.bigtable.v2.SessionRequestStats stats_; + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return The stats. + */ + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStats getStats() { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + @java.lang.Override + public com.google.bigtable.v2.SessionRequestStatsOrBuilder getStatsOrBuilder() { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * Could be TableResponse (or in post-V1, SqlResponse)
+   * 
+ * + * bytes payload = 3; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (rpcId_ != 0L) { + output.writeInt64(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getClusterInfo()); + } + if (!payload_.isEmpty()) { + output.writeBytes(3, payload_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rpcId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, rpcId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getClusterInfo()); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, payload_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStats()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.v2.VirtualRpcResponse)) { + return super.equals(obj); + } + com.google.bigtable.v2.VirtualRpcResponse other = + (com.google.bigtable.v2.VirtualRpcResponse) obj; + + if (getRpcId() != other.getRpcId()) return false; + if (hasClusterInfo() != other.hasClusterInfo()) return false; + if (hasClusterInfo()) { + if (!getClusterInfo().equals(other.getClusterInfo())) return false; + } + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } + if (!getPayload().equals(other.getPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RPC_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRpcId()); + if (hasClusterInfo()) { + hash = (37 * hash) + CLUSTER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getClusterInfo().hashCode(); + } + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcResponse 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.v2.VirtualRpcResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcResponse 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.v2.VirtualRpcResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.VirtualRpcResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.VirtualRpcResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Internal usage only.
+   * 
+ * + * Protobuf type {@code google.bigtable.v2.VirtualRpcResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.VirtualRpcResponse) + com.google.bigtable.v2.VirtualRpcResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.VirtualRpcResponse.class, + com.google.bigtable.v2.VirtualRpcResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.VirtualRpcResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterInfoFieldBuilder(); + internalGetStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rpcId_ = 0L; + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + payload_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.SessionProto + .internal_static_google_bigtable_v2_VirtualRpcResponse_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse getDefaultInstanceForType() { + return com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse build() { + com.google.bigtable.v2.VirtualRpcResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse buildPartial() { + com.google.bigtable.v2.VirtualRpcResponse result = + new com.google.bigtable.v2.VirtualRpcResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.VirtualRpcResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rpcId_ = rpcId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterInfo_ = + clusterInfoBuilder_ == null ? clusterInfo_ : clusterInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.payload_ = payload_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.VirtualRpcResponse) { + return mergeFrom((com.google.bigtable.v2.VirtualRpcResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.VirtualRpcResponse other) { + if (other == com.google.bigtable.v2.VirtualRpcResponse.getDefaultInstance()) return this; + if (other.getRpcId() != 0L) { + setRpcId(other.getRpcId()); + } + if (other.hasClusterInfo()) { + mergeClusterInfo(other.getClusterInfo()); + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + if (!other.getPayload().isEmpty()) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + rpcId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetClusterInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long rpcId_; + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + @java.lang.Override + public long getRpcId() { + return rpcId_; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @param value The rpcId to set. + * @return This builder for chaining. + */ + public Builder setRpcId(long value) { + + rpcId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Which vRPC this response is for.
+     * 
+ * + * int64 rpc_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearRpcId() { + bitField0_ = (bitField0_ & ~0x00000001); + rpcId_ = 0L; + onChanged(); + return this; + } + + private com.google.bigtable.v2.ClusterInformation clusterInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + clusterInfoBuilder_; + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + public boolean hasClusterInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + public com.google.bigtable.v2.ClusterInformation getClusterInfo() { + if (clusterInfoBuilder_ == null) { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } else { + return clusterInfoBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterInfo_ = value; + } else { + clusterInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder setClusterInfo( + com.google.bigtable.v2.ClusterInformation.Builder builderForValue) { + if (clusterInfoBuilder_ == null) { + clusterInfo_ = builderForValue.build(); + } else { + clusterInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder mergeClusterInfo(com.google.bigtable.v2.ClusterInformation value) { + if (clusterInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && clusterInfo_ != null + && clusterInfo_ != com.google.bigtable.v2.ClusterInformation.getDefaultInstance()) { + getClusterInfoBuilder().mergeFrom(value); + } else { + clusterInfo_ = value; + } + } else { + clusterInfoBuilder_.mergeFrom(value); + } + if (clusterInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public Builder clearClusterInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + clusterInfo_ = null; + if (clusterInfoBuilder_ != null) { + clusterInfoBuilder_.dispose(); + clusterInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformation.Builder getClusterInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetClusterInfoFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + public com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder() { + if (clusterInfoBuilder_ != null) { + return clusterInfoBuilder_.getMessageOrBuilder(); + } else { + return clusterInfo_ == null + ? com.google.bigtable.v2.ClusterInformation.getDefaultInstance() + : clusterInfo_; + } + } + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder> + internalGetClusterInfoFieldBuilder() { + if (clusterInfoBuilder_ == null) { + clusterInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.ClusterInformation, + com.google.bigtable.v2.ClusterInformation.Builder, + com.google.bigtable.v2.ClusterInformationOrBuilder>( + getClusterInfo(), getParentForChildren(), isClean()); + clusterInfo_ = null; + } + return clusterInfoBuilder_; + } + + private com.google.bigtable.v2.SessionRequestStats stats_; + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRequestStats, + com.google.bigtable.v2.SessionRequestStats.Builder, + com.google.bigtable.v2.SessionRequestStatsOrBuilder> + statsBuilder_; + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return The stats. + */ + public com.google.bigtable.v2.SessionRequestStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder setStats(com.google.bigtable.v2.SessionRequestStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder setStats(com.google.bigtable.v2.SessionRequestStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder mergeStats(com.google.bigtable.v2.SessionRequestStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && stats_ != null + && stats_ != com.google.bigtable.v2.SessionRequestStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + if (stats_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000004); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public com.google.bigtable.v2.SessionRequestStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStatsFieldBuilder().getBuilder(); + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + public com.google.bigtable.v2.SessionRequestStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.bigtable.v2.SessionRequestStats.getDefaultInstance() + : stats_; + } + } + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRequestStats, + com.google.bigtable.v2.SessionRequestStats.Builder, + com.google.bigtable.v2.SessionRequestStatsOrBuilder> + internalGetStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.bigtable.v2.SessionRequestStats, + com.google.bigtable.v2.SessionRequestStats.Builder, + com.google.bigtable.v2.SessionRequestStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * Could be TableResponse (or in post-V1, SqlResponse)
+     * 
+ * + * bytes payload = 3; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + /** + * + * + *
+     * Could be TableResponse (or in post-V1, SqlResponse)
+     * 
+ * + * bytes payload = 3; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Could be TableResponse (or in post-V1, SqlResponse)
+     * 
+ * + * bytes payload = 3; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000008); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.VirtualRpcResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.VirtualRpcResponse) + private static final com.google.bigtable.v2.VirtualRpcResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.VirtualRpcResponse(); + } + + public static com.google.bigtable.v2.VirtualRpcResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VirtualRpcResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.VirtualRpcResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponseOrBuilder.java new file mode 100644 index 000000000000..a4619c1118ba --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/VirtualRpcResponseOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/bigtable/v2/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.bigtable.v2; + +@com.google.protobuf.Generated +public interface VirtualRpcResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.VirtualRpcResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Which vRPC this response is for.
+   * 
+ * + * int64 rpc_id = 1; + * + * @return The rpcId. + */ + long getRpcId(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return Whether the clusterInfo field is set. + */ + boolean hasClusterInfo(); + + /** + * .google.bigtable.v2.ClusterInformation cluster_info = 2; + * + * @return The clusterInfo. + */ + com.google.bigtable.v2.ClusterInformation getClusterInfo(); + + /** .google.bigtable.v2.ClusterInformation cluster_info = 2; */ + com.google.bigtable.v2.ClusterInformationOrBuilder getClusterInfoOrBuilder(); + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + + /** + * .google.bigtable.v2.SessionRequestStats stats = 4; + * + * @return The stats. + */ + com.google.bigtable.v2.SessionRequestStats getStats(); + + /** .google.bigtable.v2.SessionRequestStats stats = 4; */ + com.google.bigtable.v2.SessionRequestStatsOrBuilder getStatsOrBuilder(); + + /** + * + * + *
+   * Could be TableResponse (or in post-V1, SqlResponse)
+   * 
+ * + * bytes payload = 3; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto index 66536293e366..1a2bb37cccc4 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/api/routing.proto"; import "google/bigtable/v2/data.proto"; import "google/bigtable/v2/request_stats.proto"; +import "google/bigtable/v2/session.proto"; import "google/bigtable/v2/types.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; @@ -328,6 +329,36 @@ service Bigtable { option (google.api.method_signature) = "instance_name,query"; option (google.api.method_signature) = "instance_name,query,app_profile_id"; } + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc GetClientConfiguration(GetClientConfigurationRequest) + returns (ClientConfiguration) {} + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc OpenTable(stream SessionRequest) returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = SESSION_TYPE_TABLE; + } + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc OpenAuthorizedView(stream SessionRequest) + returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + } + + // This RPC is only intended to be used by the official Cloud Bigtable client + // libraries to implement the Bigtable Session based protocol. It is subject + // to change without notice. + rpc OpenMaterializedView(stream SessionRequest) + returns (stream SessionResponse) { + option (google.bigtable.v2.rpc_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + } } // Request message for Bigtable.ReadRows. diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto index 9bf078e6e86e..6cf9ca5b81ac 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -70,4 +70,10 @@ message FeatureFlags { // If the client can support using BigtablePeerInfo. bool peer_info = 11; + + // Indicates whether the client supports the Bigtable Sessions API. + bool sessions_compatible = 12; + + // Internal flag to force sessions for internal projects. + bool sessions_required = 13; } diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto index 357af8216baa..6a89fbf9ed59 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -66,11 +66,15 @@ message PeerInfo { // request. int64 application_frontend_id = 2; + // The Cloud region of the application frontend that served this request. + string application_frontend_region = 6; + // The Cloud zone of the application frontend that served this request. - string application_frontend_zone = 3; + string application_frontend_zone = 3 [deprecated = true]; // The subzone of the application frontend that served this request, e.g. an - // identifier for where within the zone the application frontend is. + // identifier for where within a zone (within the reported region) the + // application frontend is. string application_frontend_subzone = 4; TransportType transport_type = 5; diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto index 0049f8f73e34..bcebc08e65a2 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto index 6eedfdf735dc..9a48e2008f5b 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/session.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/session.proto new file mode 100644 index 000000000000..4a79df1c67d3 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/session.proto @@ -0,0 +1,706 @@ +// Copyright 2026 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 +// +// http://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. + +syntax = "proto3"; + +package google.bigtable.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/bigtable/v2/data.proto"; +import "google/bigtable/v2/feature_flags.proto"; +import "google/bigtable/v2/request_stats.proto"; +import "google/protobuf/descriptor.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/error_details.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Bigtable.V2"; +option go_package = "cloud.google.com/go/bigtable/apiv2/bigtablepb;bigtablepb"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.bigtable.v2"; +option php_namespace = "Google\\Cloud\\Bigtable\\V2"; +option ruby_package = "Google::Cloud::Bigtable::V2"; + +extend google.protobuf.MessageOptions { + // Only OpenSessionRequest.payload's with a type matching rpc_session_type are + // accepted by the server, and only OpenSessionResponse.payload's with a type + // matching rpc_session_type are accepted by the client. + google.bigtable.v2.SessionType open_session_type = 138898474; + + // Only VirtualRpcRequest.payload's with a type matching rpc_session_type are + // accepted by the server, and only VirtualRpcResponse.payload's with a type + // matching rpc_session_type are accepted by the client. + repeated google.bigtable.v2.SessionType vrpc_session_type = 138899157; +} + +extend google.protobuf.MethodOptions { + // All session service methods must set this option to indicate which + // messages are permissible within the generic envelope. + google.bigtable.v2.SessionType rpc_session_type = 137964804; +} + +// Supported session types. +enum SessionType { + SESSION_TYPE_UNSET = 0; + + SESSION_TYPE_TABLE = 1; + + SESSION_TYPE_AUTHORIZED_VIEW = 2; + + SESSION_TYPE_MATERIALIZED_VIEW = 3; + + // For internal protocol testing only. + SESSION_TYPE_TEST = -1; +} + +// See GetClientConfiguration() RPC in bigtable.proto. Internal usage only. +message GetClientConfigurationRequest { + // Required. The unique name of the instance for which the client will target + // with Data API requests. + // + // Values are of the form `projects//instances/` + string instance_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // Optional. The name of the AppProfile which will be used by the client when + // sending requests in the Data API. + // + // If not specified, the `default` application profile will be used. + string app_profile_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for how to balance vRPCs over sessions. Internal usage only. +message LoadBalancingOptions { + // Balances vRPCs over backends, preferring to send new vRPCs to AFEs with the + // least number of active vRPCs. + message LeastInFlight { + // Of all connected AFEs, the size of the random subset to run the algorithm + // on. Zero implies all connected AFEs. + int64 random_subset_size = 1; + } + + // Balances vRPCs over backends, by maintaining a moving average of each AFE's + // round-trip time, weighted by the number of outstanding vRPCs, and + // distribute traffic to AFEs where that cost function is smallest. + // + // See: + // https://linkerd.io/2016/03/16/beyond-round-robin-load-balancing-for-latency + message PeakEwma { + // Of all connected AFEs, the size of the random subset to compare costs + // over. Zero implies all connected AFEs. + int64 random_subset_size = 1; + } + + // Balances vRPCs over backends, by randomly selecting a backend. + message Random {} + + oneof load_balancing_strategy { + LeastInFlight least_in_flight = 1; + + PeakEwma peak_ewma = 2; + + Random random = 4; + } +} + +// Configuration for the Session API. Internal usage only. +message SessionClientConfiguration { + // Configuration for the channel pool. + message ChannelPoolConfiguration { + // A channel mode which allows DirectAccess with a fallback to CloudPath if + // DirectAccess is unavailable. + message DirectAccessWithFallback { + // The threshold for errors on DirectAccess to trigger CloudPath fallback. + // The error rate is calculated based on a count of vRPCs with errors + // divided by a total count of vRPCs, over a rolling window of the past + // check_interval. If this ratio exceeds this threshold, the fallback to + // CloudPath is triggered. [0, 1]. + float error_rate_threshold = 1; + + // The interval to check the error rate over. + google.protobuf.Duration check_interval = 2; + } + + // A channel mode which only allows DirectAccess. + message DirectAccessOnly {} + + // A channel mode which only allows CloudPath. + message CloudPathOnly {} + + // The minimum number of distcint servers to connect to in the channel pool. + // The client will ensure that the channel pool will have at least this many + // distinct servers, but may have multiple channels connected to the same + // server (e.g. the client may have M channels on N machines, where M > N). + int32 min_server_count = 1; + + // The maximum number of distinct servers to connect to in the channel pool. + // The client will ensure that the channel pool will have at most this many + // distinct servers. + int32 max_server_count = 2; + + // Soft maximum for how many sessions are allowed per server. Normally, the + // client will ensure that it does not host more than this count of sessions + // per server, unless there are other limits encountered (e.g. the connected + // servers is already at max_servers). + int32 per_server_session_count = 3; + + // The fallback mode of the channel pool. + oneof mode { + // DirectAccess with a fallback to CloudPath. + DirectAccessWithFallback direct_access_with_fallback = 4; + + // DirectAccess only. + DirectAccessOnly direct_access_only = 5; + + // CloudPath only. + CloudPathOnly cloud_path_only = 6; + } + } + + // Configuration for the session pools. Session pools are tied to a scope + // like a table, an app profile, and a permission. + message SessionPoolConfiguration { + // Fraction of idle sessions to keep in order to manage an increase in + // requests-in-flight. For example, a headroom of 0.5 will keep enough + // sessions to deal with a 50% increase in QPS. + float headroom = 1; + + // The minimum number of sessions for a given scope. + int32 min_session_count = 2; + + // The maximum number of sessions for a given scope. + int32 max_session_count = 3; + + // Number of vRPCs that can be queued per starting session. + int32 new_session_queue_length = 4; + + // How many concurrent session establishments are allowed. The client will + // hold onto a count against this budget whenever it is establishing a new + // session, and release that count once the session is successfully + // established or failed to establish. + int32 new_session_creation_budget = 5; + + // How long to penalize the creation budget for a failed session creation + // attempt. + google.protobuf.Duration new_session_creation_penalty = 6; + + // A threshold for cancelling all pending vRPCs based on how many + // consecutive session establishment errors have been observed. The client + // will eagerly cancel queued vRPCs after this threshold is met to avoid + // them waiting their entire deadlines before terminating (while waiting for + // any session to establish to actually send the vRPC). + int32 consecutive_session_failure_threshold = 8; + + // How to balance vRPC load over connections to AFEs. + // Set only if session_load > 0. + LoadBalancingOptions load_balancing_options = 9; + } + + // What share of requests should operate on a session, [0, 1]. The rest + // should operate on the old-style API. + float session_load = 1; + + LoadBalancingOptions load_balancing_options = 2 [deprecated = true]; + + // Configuration for the channel pool. + ChannelPoolConfiguration channel_configuration = 3; + + // Configuration for the session pools. + SessionPoolConfiguration session_pool_configuration = 4; +} + +// Server provided instructions for enabling finer grained observability on +// the client to help diagnose customer issues. Internal usage only. +message TelemetryConfiguration { + // The level of detail of telemetry to be sent from the client. + enum Level { + // Server did not specify a level. Should disable all debug tag counters. + LEVEL_UNSPECIFIED = 0; + + // Enables all debug tag counter levels. + DEBUG = 1; + + // Eables all debug tag counters except for DEBUG. + INFO = 2; + + // Enables all debug tag counters except for DEBUG and INFO. + WARN = 3; + + // Enables only error debug tag counters. + ERROR = 4; + } + + // Selector for the debug counters that should be uploaded. + Level debug_tag_level = 1; +} + +// Configuration for the Session API. Internal usage only. +message ClientConfiguration { + message PollingConfiguration { + // A duration describing the time between GetClientConfiguration RPCs. + // Only strictly positive values are permissible. + google.protobuf.Duration polling_interval = 1; + + // How long the client should consider the configuration it receives from + // GetClientConfiguration valid for. Once this duration has passed, the + // client should consider the configuration invalid and must either: + // - Get a new configuration from GetClientConfiguration + // - Or if it cannot, use a sane default configuration + // + // This duration will be at least as long as the polling interval. + google.protobuf.Duration validity_duration = 2; + + // Number of times the client should retry a failed + // GetClientConfiguration RPC per polling interval before giving up. + int32 max_rpc_retry_count = 6; + } + + // The configuration for Bigtable Sessions. + SessionClientConfiguration session_configuration = 2; + + // How often the client should refresh this configuration. + oneof polling { + // If the client should cease to check for new configurations, e.g. a + // backstop to prevent excessive GetClientConfiguration RPCs. + bool stop_polling = 3; + + // Deprecated, prerfer polling_configuration. + // + // A duration describing the time between GetClientConfiguration RPCs. + // Only strictly positive values are permissible. + google.protobuf.Duration polling_interval = 4 [deprecated = true]; + + // If the client should continue to check for new configurations. + PollingConfiguration polling_configuration = 5; + } + + // Configuration for telemetry. + TelemetryConfiguration telemetry_configuration = 6; +} + +// Internal usage only. +message SessionRequest { + oneof payload { + OpenSessionRequest open_session = 1; + + CloseSessionRequest close_session = 2; + + VirtualRpcRequest virtual_rpc = 3; + } +} + +// Internal usage only. +message SessionResponse { + oneof payload { + OpenSessionResponse open_session = 1; + + // A vRPC can result in either a successful result or an error. + // Error results are separate to allow for multiple vRPC responses, + // e.g. for streaming calls like scans (post-V1). See Flow Control. + VirtualRpcResponse virtual_rpc = 2; + + ErrorResponse error = 3; + + SessionParametersResponse session_parameters = 4; + + HeartbeatResponse heartbeat = 5; + + GoAwayResponse go_away = 6; + + SessionRefreshConfig session_refresh_config = 7; + } +} + +// Internal usage only. +message OpenSessionRequest { + // A version indicator from the client stating its understanding of the + // protocol. This is to disambiguate client behavior amidst changes in + // semantic usage of the API, e.g. if the structure remains the same but + // behavior changes. + int64 protocol_version = 1; + + // Client settings, including a record of + FeatureFlags flags = 2; + + // Used for serverside observability. + int64 consecutive_failed_connection_attempts = 3; + + // How the request should be routed (if presented as part of a GOAWAY + // from a previous session). Post V1. + bytes routing_cookie = 4; + + // Can be Open{Table,AuthorizedView,MaterializedView}Request, + // (or in post-V1, PrepareSqlQueryRequest) + bytes payload = 5; +} + +// Information about the connected backends from a session client's +// perspective. This information may be used to make choices about session +// re-establishment en-masse for sessions with the same backend identifiers. +// Internal usage only. +message BackendIdentifier { + // An opaque identifier for the Google Frontend which serviced this request. + // Only set when not using DirectAccess. + int64 google_frontend_id = 1; + + // An opaque identifier for the application frontend which serviced this + // request. + int64 application_frontend_id = 2; + + // The zone of the application frontend that served this request. + string application_frontend_zone = 3; +} + +// Internal usage only. +message OpenSessionResponse { + // Information on the backend(s) that are hosting this session. + BackendIdentifier backend = 2; + + // Can be Open{Table,AuthorizedView,MaterializedView}Response, + // (or in post-V1, PrepareSqlQueryResponse) + bytes payload = 1; +} + +// Internal usage only. +message CloseSessionRequest { + // Client-generated reason for terminating the session, including a + // plain-text description of why. + // 'reason' may be used for metrics, while both may be logged (server-side). + enum CloseSessionReason { + CLOSE_SESSION_REASON_UNSET = 0; + + CLOSE_SESSION_REASON_GOAWAY = 1; + + CLOSE_SESSION_REASON_ERROR = 2; + + CLOSE_SESSION_REASON_USER = 3; + + CLOSE_SESSION_REASON_DOWNSIZE = 4; + + CLOSE_SESSION_REASON_MISSED_HEARTBEAT = 5; + } + + CloseSessionReason reason = 1; + + string description = 2; +} + +// Internal usage only. +message OpenTableRequest { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TABLE; + + enum Permission { + PERMISSION_UNSET = 0; + + PERMISSION_READ = 1; + + PERMISSION_WRITE = 2; + + PERMISSION_READ_WRITE = 3; + } + + string table_name = 1; + + string app_profile_id = 2; + + Permission permission = 3; +} + +// Internal usage only. +message OpenTableResponse { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_TABLE; +} + +// Open sessions for an AuthorizedView. Internal usage only. +message OpenAuthorizedViewRequest { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + + enum Permission { + PERMISSION_UNSET = 0; + + PERMISSION_READ = 1; + + PERMISSION_WRITE = 2; + + PERMISSION_READ_WRITE = 3; + } + + // The Authorized view name to read and write from. Values are of the form + // `projects//instances//tables//authorizedViews/`. + string authorized_view_name = 1; + + // The app profile id to use for the authorized view sessions. + string app_profile_id = 2; + + // Permission for the session. + Permission permission = 3; +} + +// Internal usage only. +message OpenAuthorizedViewResponse { + option (google.bigtable.v2.open_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; +} + +// Open sessions for a MaterializedView. Internal usage only. +message OpenMaterializedViewRequest { + option (google.bigtable.v2.open_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + + enum Permission { + PERMISSION_UNSET = 0; + + PERMISSION_READ = 1; + } + + // The Materialized view name to read and write from. Values are of the form + // `projects//instances//materializedViews/`. + string materialized_view_name = 1; + + // The app profile id to use for the materialized view sessions. + string app_profile_id = 2; + + // Permission for the session. + Permission permission = 3; +} + +// Internal usage only. +message OpenMaterializedViewResponse { + option (google.bigtable.v2.open_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; +} + +// Internal usage only. +message VirtualRpcRequest { + // Container for all vRPC Metadata. + message Metadata { + // Track retry attempts for this vRPC at the AFE. + int64 attempt_number = 1; + + // Track the client's known start time for the attempt. This is likely not + // easily compared with the server's time due to clock skew. + google.protobuf.Timestamp attempt_start = 2; + + // Link OpenTelemetry traces (e.g. Tapper). This can be used to link + // attempts together for the same logical operation (e.g. in logs / traces). + // + // Note, this may not be needed for V1, TBD. + string traceparent = 3; + } + + // Client chosen, monotonically increasing identifier for the request. + // Must be unique within a session. + int64 rpc_id = 1; + + // Attempt deadline. + // + // Note, this may not be needed for V1, TBD (e.g. operation vs attempt + // deadline). + google.protobuf.Duration deadline = 2; + + // vRPC metadata. + Metadata metadata = 3; + + // Could be TableRequest (or in post-V1, SqlRequest) + bytes payload = 4; +} + +// Information on which Cluster served a vRPC, e.g. for Client-Side metrics. +// Internal usage only. +message ClusterInformation { + string cluster_id = 1; + + string zone_id = 2; +} + +// Internal usage only. +message SessionRequestStats { + // Backend (critical section) latency for the request. + google.protobuf.Duration backend_latency = 1; +} + +// Internal usage only. +message VirtualRpcResponse { + // Which vRPC this response is for. + int64 rpc_id = 1; + + ClusterInformation cluster_info = 2; + + SessionRequestStats stats = 4; + + // Could be TableResponse (or in post-V1, SqlResponse) + bytes payload = 3; +} + +// Internal usage only. +message ErrorResponse { + // Which vRPC this response is for. + int64 rpc_id = 1; + + ClusterInformation cluster_info = 2; + + // The error from the vRPC and any retry information to consider. + google.rpc.Status status = 3; + + google.rpc.RetryInfo retry_info = 4; +} + +// Internal usage only. +message TableRequest { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TABLE; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowRequest read_row = 1; + + SessionMutateRowRequest mutate_row = 2; + } +} + +// Internal usage only. +message TableResponse { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_TABLE; + + oneof payload { + SessionReadRowResponse read_row = 1; + + SessionMutateRowResponse mutate_row = 2; + } +} + +// A request wrapper for operations on an authorized view. Internal usage only. +message AuthorizedViewRequest { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowRequest read_row = 1; + + SessionMutateRowRequest mutate_row = 2; + } +} + +// A response wrapper for operations on an authorized view. Internal usage only. +message AuthorizedViewResponse { + option (google.bigtable.v2.vrpc_session_type) = SESSION_TYPE_AUTHORIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowResponse read_row = 1; + + SessionMutateRowResponse mutate_row = 2; + } +} + +// A request wrapper for operations on a materialized view. Internal usage only. +message MaterializedViewRequest { + option (google.bigtable.v2.vrpc_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowRequest read_row = 1; + } +} + +// A response wrapper for operations on a materialized view. Internal usage +// only. +message MaterializedViewResponse { + option (google.bigtable.v2.vrpc_session_type) = + SESSION_TYPE_MATERIALIZED_VIEW; + + // Note in V1 we target only pure point operations. + oneof payload { + SessionReadRowResponse read_row = 1; + } +} + +// Internal usage only. +message SessionReadRowRequest { + bytes key = 1; + + RowFilter filter = 2; +} + +// Internal usage only. +message SessionReadRowResponse { + Row row = 1; + + RequestStats stats = 2; +} + +// Internal usage only. +message SessionMutateRowRequest { + bytes key = 1; + + repeated Mutation mutations = 2; +} + +// Internal usage only. +message SessionMutateRowResponse {} + +// Internal usage only. +message SessionParametersResponse { + // Maximum time between messages that the AFE will send to the client. The + // client may use this information to determine its control-flow in relation + // to pruning black-holed or otherwise non-responsive sessions. Must be set + // and positive. + // + // See also Heartbeats. + google.protobuf.Duration keep_alive = 1; +} + +// Internal usage only. +message HeartbeatResponse {} + +// Internal usage only. +message GoAwayResponse { + // Server-generated reason for GOAWAY, including a plain-text description of + // why. 'reason' may be used for CSM, while both may be logged. + string reason = 1; + + string description = 2; + + // The last vRPC which was admitted by the AFE. The client may expect the + // result from the vRPC on the stream before disconnecting, and should + // retry vRPCs beyond this boundary. + int64 last_rpc_id_admitted = 3; +} + +// Internal usage only. +message SessionRefreshConfig { + // Any additional metadata to include when reconnecting. Not a `map<>` type as + // this can be a multimap. + message Metadata { + // Output only. The key for the metadata entry. + string key = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value for the metadata entry. + bytes value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // An optimized Open request that the session may use on a retry when + // establishing this session again. This can be sent from the AFE to + // avoid certain work e.g. encoding a query plan for BTQL. + OpenSessionRequest optimized_open_request = 1; + + // Output only. Any additional metadata to include when reconnecting. + repeated Metadata metadata = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +}