From f8a560373e24d08f3c514861a8dc2d861584e4be Mon Sep 17 00:00:00 2001 From: surbhigarg92 Date: Thu, 5 Dec 2024 18:06:49 +0530 Subject: [PATCH 01/43] feat: Add Metrics host for built in metrics (#3519) This PR allows users to set the custom monitoring host for built in metrics. --- .../clirr-ignored-differences.xml | 7 +++++ .../BuiltInOpenTelemetryMetricsProvider.java | 6 +++-- .../SpannerCloudMonitoringExporter.java | 15 ++++------- .../google/cloud/spanner/SpannerOptions.java | 27 ++++++++++++++++++- .../SpannerCloudMonitoringExporterTest.java | 4 +-- .../cloud/spanner/SpannerOptionsTest.java | 13 +++++++++ 6 files changed, 57 insertions(+), 15 deletions(-) diff --git a/google-cloud-spanner/clirr-ignored-differences.xml b/google-cloud-spanner/clirr-ignored-differences.xml index bae308f2b50..5b84cb4ebc3 100644 --- a/google-cloud-spanner/clirr-ignored-differences.xml +++ b/google-cloud-spanner/clirr-ignored-differences.xml @@ -709,6 +709,13 @@ boolean isEnableBuiltInMetrics() + + + 7012 + com/google/cloud/spanner/SpannerOptions$SpannerEnvironment + java.lang.String getMonitoringHost() + + 7012 diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInOpenTelemetryMetricsProvider.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInOpenTelemetryMetricsProvider.java index 8f4ada6ae57..4aeb98987d1 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInOpenTelemetryMetricsProvider.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInOpenTelemetryMetricsProvider.java @@ -59,12 +59,14 @@ final class BuiltInOpenTelemetryMetricsProvider { private BuiltInOpenTelemetryMetricsProvider() {} - OpenTelemetry getOrCreateOpenTelemetry(String projectId, @Nullable Credentials credentials) { + OpenTelemetry getOrCreateOpenTelemetry( + String projectId, @Nullable Credentials credentials, @Nullable String monitoringHost) { try { if (this.openTelemetry == null) { SdkMeterProviderBuilder sdkMeterProviderBuilder = SdkMeterProvider.builder(); BuiltInOpenTelemetryMetricsView.registerBuiltinMetrics( - SpannerCloudMonitoringExporter.create(projectId, credentials), sdkMeterProviderBuilder); + SpannerCloudMonitoringExporter.create(projectId, credentials, monitoringHost), + sdkMeterProviderBuilder); SdkMeterProvider sdkMeterProvider = sdkMeterProviderBuilder.build(); this.openTelemetry = OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); Runtime.getRuntime().addShutdownHook(new Thread(sdkMeterProvider::close)); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java index 3577c9f7b45..fc101fbcfc3 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java @@ -29,7 +29,6 @@ import com.google.cloud.monitoring.v3.MetricServiceClient; import com.google.cloud.monitoring.v3.MetricServiceSettings; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.MoreObjects; import com.google.common.collect.Iterables; import com.google.common.util.concurrent.MoreExecutors; import com.google.monitoring.v3.CreateTimeSeriesRequest; @@ -63,13 +62,6 @@ class SpannerCloudMonitoringExporter implements MetricExporter { private static final Logger logger = Logger.getLogger(SpannerCloudMonitoringExporter.class.getName()); - // This system property can be used to override the monitoring endpoint - // to a different environment. It's meant for internal testing only. - private static final String MONITORING_ENDPOINT = - MoreObjects.firstNonNull( - System.getProperty("spanner.test-monitoring-endpoint"), - MetricServiceSettings.getDefaultEndpoint()); - // This the quota limit from Cloud Monitoring. More details in // https://cloud.google.com/monitoring/quotas#custom_metrics_quotas. private static final int EXPORT_BATCH_SIZE_LIMIT = 200; @@ -78,7 +70,8 @@ class SpannerCloudMonitoringExporter implements MetricExporter { private final MetricServiceClient client; private final String spannerProjectId; - static SpannerCloudMonitoringExporter create(String projectId, @Nullable Credentials credentials) + static SpannerCloudMonitoringExporter create( + String projectId, @Nullable Credentials credentials, @Nullable String monitoringHost) throws IOException { MetricServiceSettings.Builder settingsBuilder = MetricServiceSettings.newBuilder(); CredentialsProvider credentialsProvider; @@ -88,7 +81,9 @@ static SpannerCloudMonitoringExporter create(String projectId, @Nullable Credent credentialsProvider = FixedCredentialsProvider.create(credentials); } settingsBuilder.setCredentialsProvider(credentialsProvider); - settingsBuilder.setEndpoint(MONITORING_ENDPOINT); + if (monitoringHost != null) { + settingsBuilder.setEndpoint(monitoringHost); + } org.threeten.bp.Duration timeout = Duration.ofMinutes(1); // TODO: createServiceTimeSeries needs special handling if the request failed. Leaving diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java index af54515e7c6..d85b39c1253 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java @@ -164,6 +164,7 @@ public class SpannerOptions extends ServiceOptions { private final boolean enableBuiltInMetrics; private final boolean enableExtendedTracing; private final boolean enableEndToEndTracing; + private final String monitoringHost; enum TracingFramework { OPEN_CENSUS, @@ -672,6 +673,7 @@ protected SpannerOptions(Builder builder) { enableExtendedTracing = builder.enableExtendedTracing; enableBuiltInMetrics = builder.enableBuiltInMetrics; enableEndToEndTracing = builder.enableEndToEndTracing; + monitoringHost = builder.monitoringHost; } /** @@ -712,6 +714,10 @@ default boolean isEnableBuiltInMetrics() { default boolean isEnableEndToEndTracing() { return false; } + + default String getMonitoringHost() { + return null; + } } /** @@ -728,6 +734,7 @@ private static class SpannerEnvironmentImpl implements SpannerEnvironment { private static final String SPANNER_ENABLE_END_TO_END_TRACING = "SPANNER_ENABLE_END_TO_END_TRACING"; private static final String SPANNER_DISABLE_BUILTIN_METRICS = "SPANNER_DISABLE_BUILTIN_METRICS"; + private static final String SPANNER_MONITORING_HOST = "SPANNER_MONITORING_HOST"; private SpannerEnvironmentImpl() {} @@ -763,6 +770,11 @@ public boolean isEnableBuiltInMetrics() { public boolean isEnableEndToEndTracing() { return Boolean.parseBoolean(System.getenv(SPANNER_ENABLE_END_TO_END_TRACING)); } + + @Override + public String getMonitoringHost() { + return System.getenv(SPANNER_MONITORING_HOST); + } } /** Builder for {@link SpannerOptions} instances. */ @@ -828,6 +840,7 @@ public static class Builder private boolean enableExtendedTracing = SpannerOptions.environment.isEnableExtendedTracing(); private boolean enableEndToEndTracing = SpannerOptions.environment.isEnableEndToEndTracing(); private boolean enableBuiltInMetrics = SpannerOptions.environment.isEnableBuiltInMetrics(); + private String monitoringHost = SpannerOptions.environment.getMonitoringHost(); private static String createCustomClientLibToken(String token) { return token + " " + ServiceOptions.getGoogApiClientLibName(); @@ -895,6 +908,7 @@ protected Builder() { this.enableExtendedTracing = options.enableExtendedTracing; this.enableBuiltInMetrics = options.enableBuiltInMetrics; this.enableEndToEndTracing = options.enableEndToEndTracing; + this.monitoringHost = options.monitoringHost; } @Override @@ -1417,6 +1431,12 @@ public Builder setBuiltInMetricsEnabled(boolean enableBuiltInMetrics) { return this; } + /** Sets the monitoring host to be used for Built-in client side metrics */ + public Builder setMonitoringHost(String monitoringHost) { + this.monitoringHost = monitoringHost; + return this; + } + /** * Sets whether to enable extended OpenTelemetry tracing. Enabling this option will add the * following additional attributes to the traces that are generated by the client: @@ -1727,7 +1747,7 @@ private ApiTracerFactory getDefaultApiTracerFactory() { private ApiTracerFactory createMetricsApiTracerFactory() { OpenTelemetry openTelemetry = this.builtInOpenTelemetryMetricsProvider.getOrCreateOpenTelemetry( - this.getProjectId(), getCredentials()); + this.getProjectId(), getCredentials(), this.monitoringHost); return openTelemetry != null ? new MetricsTracerFactory( @@ -1754,6 +1774,11 @@ public boolean isEnableBuiltInMetrics() { return enableBuiltInMetrics; } + /** Returns the override metrics Host. */ + String getMonitoringHost() { + return monitoringHost; + } + @BetaApi public boolean isUseVirtualThreads() { return useVirtualThreads; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerCloudMonitoringExporterTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerCloudMonitoringExporterTest.java index acb7ae9fa1e..ab30de1ade0 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerCloudMonitoringExporterTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerCloudMonitoringExporterTest.java @@ -337,7 +337,7 @@ public void testExportingSumDataInBatches() { @Test public void getAggregationTemporality() throws IOException { SpannerCloudMonitoringExporter actualExporter = - SpannerCloudMonitoringExporter.create(projectId, null); + SpannerCloudMonitoringExporter.create(projectId, null, null); assertThat(actualExporter.getAggregationTemporality(InstrumentType.COUNTER)) .isEqualTo(AggregationTemporality.CUMULATIVE); } @@ -348,7 +348,7 @@ public void testSkipExportingDataIfMissingInstanceId() throws IOException { Attributes.builder().putAll(attributes).remove(INSTANCE_ID_KEY).build(); SpannerCloudMonitoringExporter actualExporter = - SpannerCloudMonitoringExporter.create(projectId, null); + SpannerCloudMonitoringExporter.create(projectId, null, null); assertThat(actualExporter.getAggregationTemporality(InstrumentType.COUNTER)) .isEqualTo(AggregationTemporality.CUMULATIVE); ArgumentCaptor argumentCaptor = diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java index e8421cd235c..7b891fdb7a9 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java @@ -754,6 +754,19 @@ public void testEndToEndTracingEnablement() { .isEndToEndTracingEnabled()); } + @Test + public void testmonitoringHost() { + String metricsEndpoint = "test-endpoint:443"; + assertNull(SpannerOptions.newBuilder().setProjectId("p").build().getMonitoringHost()); + assertThat( + SpannerOptions.newBuilder() + .setProjectId("p") + .setMonitoringHost(metricsEndpoint) + .build() + .getMonitoringHost()) + .isEqualTo(metricsEndpoint); + } + @Test public void testSetDirectedReadOptions() { final DirectedReadOptions directedReadOptions = From 6a429b14702230f52f4f0ec0cbd035db5ba2febc Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Thu, 5 Dec 2024 12:22:22 -0500 Subject: [PATCH 02/43] feat: introduce java.time variables and methods (#3495) This PR introduces `java.time` alternatives to existing `org.threeten.bp.*` methods, as well as switching internal variables (if any) to `java.time` The main constraint is to keep the changes backwards compatible, so for each existing threeten method "`method1(org.threeten.bp.Duration)`" we will add an alternative with a _Duration_ (or _Timestamp_ when applicable) suffix: "`method1Duration(java.time.Duration)`". For most cases, the implementation will be held in the `java.time` method and the old threeten method will just delegate the call to it. However, for the case of abstract classes, the implementation will be kept in the threeten method to avoid breaking changes (i.e. users that already overloaded the method in their user code). --- google-cloud-spanner-executor/pom.xml | 4 - .../executor/spanner/CloudClientExecutor.java | 14 +- .../java/com/google/cloud/spanner/Clock.java | 2 +- .../google/cloud/spanner/CompositeTracer.java | 10 +- .../cloud/spanner/GrpcStreamIterator.java | 5 +- .../com/google/cloud/spanner/LatencyTest.java | 4 +- .../MultiplexedSessionDatabaseClient.java | 2 +- .../cloud/spanner/OpenTelemetryApiTracer.java | 14 +- .../com/google/cloud/spanner/Operation.java | 8 +- .../spanner/PartitionedDmlTransaction.java | 4 +- .../com/google/cloud/spanner/SessionImpl.java | 4 +- .../com/google/cloud/spanner/SessionPool.java | 6 +- .../cloud/spanner/SessionPoolOptions.java | 54 ++++-- .../cloud/spanner/SessionReference.java | 2 +- .../SpannerCloudMonitoringExporter.java | 6 +- .../com/google/cloud/spanner/SpannerImpl.java | 2 +- .../google/cloud/spanner/SpannerOptions.java | 182 +++++++++++++++--- .../cloud/spanner/SpannerRetryHelper.java | 6 +- .../connection/AbstractBaseUnitOfWork.java | 2 +- .../spanner/connection/ConnectionImpl.java | 2 +- .../connection/LocalConnectionChecker.java | 4 +- .../spanner/connection/StatementExecutor.java | 20 +- .../cloud/spanner/spi/v1/GapicSpannerRpc.java | 19 +- .../cloud/spanner/spi/v1/SpannerRpc.java | 2 +- .../spanner/BatchCreateSessionsSlowTest.java | 11 +- .../CloseSpannerWithOpenResultSetTest.java | 6 +- .../cloud/spanner/CompositeTracerTest.java | 12 +- .../spanner/DatabaseAdminClientTest.java | 44 ++--- .../cloud/spanner/DatabaseAdminGaxTest.java | 22 +-- .../cloud/spanner/DatabaseClientImplTest.java | 52 ++--- .../cloud/spanner/DefaultBenchmark.java | 10 +- .../com/google/cloud/spanner/FakeClock.java | 2 +- .../cloud/spanner/GrpcResultSetTest.java | 4 +- .../cloud/spanner/InstanceAdminGaxTest.java | 22 +-- .../spanner/LongRunningSessionsBenchmark.java | 4 +- .../MockDatabaseAdminServiceImplTest.java | 32 +-- .../cloud/spanner/MockSpannerServiceImpl.java | 2 +- ...edSessionDatabaseClientMockServerTest.java | 2 +- .../MultiplexedSessionDatabaseClientTest.java | 2 +- .../spanner/MultiplexedSessionsBenchmark.java | 8 +- .../spanner/OpenCensusApiTracerTest.java | 12 +- .../spanner/OpenTelemetryApiTracerTest.java | 12 +- ...OpenTelemetryBuiltInMetricsTracerTest.java | 10 +- .../cloud/spanner/OpenTelemetrySpanTest.java | 4 +- .../google/cloud/spanner/OperationTest.java | 10 +- .../PartitionedDmlTransactionTest.java | 2 +- ...yOnDifferentGrpcChannelMockServerTest.java | 16 +- .../cloud/spanner/SamplesMockServerTest.java | 12 +- .../SessionPoolMaintainerBenchmark.java | 4 +- .../SessionPoolMaintainerMockServerTest.java | 4 +- .../cloud/spanner/SessionPoolOptionsTest.java | 19 +- .../google/cloud/spanner/SessionPoolTest.java | 16 +- .../cloud/spanner/SpanExceptionTest.java | 4 +- .../com/google/cloud/spanner/SpanTest.java | 24 +-- .../cloud/spanner/SpannerGaxRetryTest.java | 27 +-- .../cloud/spanner/SpannerOptionsTest.java | 156 +++++++-------- .../connection/StatementTimeoutTest.java | 8 +- .../spanner/it/ITBuiltInMetricsTest.java | 4 +- .../spanner/it/ITCommitTimestampTest.java | 4 +- .../cloud/spanner/it/ITPgJsonbTest.java | 2 +- .../cloud/spanner/it/ITPgNumericTest.java | 2 +- .../spanner/it/ITPitrCreateDatabaseTest.java | 2 +- .../spanner/it/ITPitrUpdateDatabaseTest.java | 2 +- .../spanner/spi/v1/GapicSpannerRpcTest.java | 4 +- 64 files changed, 577 insertions(+), 396 deletions(-) diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index c108b69b1a3..1c45d6915fd 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -145,10 +145,6 @@ com.google.api gax-grpc - - org.threeten - threetenbp - com.google.code.findbugs jsr305 diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index 481d95884ce..69c0d4d3ea9 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -170,6 +170,8 @@ import java.io.Serializable; import java.math.BigDecimal; import java.text.ParseException; +import java.time.Duration; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -186,8 +188,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.apache.commons.io.FileUtils; -import org.threeten.bp.Duration; -import org.threeten.bp.LocalDate; /** * Implementation of the SpannerExecutorProxy gRPC service that proxies action request through the @@ -818,13 +818,13 @@ private synchronized Spanner getClient(long timeoutSeconds, boolean useMultiplex } RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofSeconds(32)) - .setInitialRpcTimeout(rpcTimeout) + .setMaxRetryDelayDuration(Duration.ofSeconds(32)) + .setInitialRpcTimeoutDuration(rpcTimeout) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(rpcTimeout) - .setTotalTimeout(rpcTimeout) + .setMaxRpcTimeoutDuration(rpcTimeout) + .setTotalTimeoutDuration(rpcTimeout) .build(); com.google.cloud.spanner.SessionPoolOptions.Builder poolOptionsBuilder = diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Clock.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Clock.java index 4fbe841cd84..567ccc1a043 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Clock.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Clock.java @@ -16,7 +16,7 @@ package com.google.cloud.spanner; -import org.threeten.bp.Instant; +import java.time.Instant; /** * Wrapper around current time so that we can fake it in tests. TODO(user): Replace with Java 8 diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/CompositeTracer.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/CompositeTracer.java index 050116af8de..60d7081cc1e 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/CompositeTracer.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/CompositeTracer.java @@ -16,15 +16,17 @@ package com.google.cloud.spanner; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + import com.google.api.core.InternalApi; import com.google.api.gax.tracing.ApiTracer; import com.google.api.gax.tracing.BaseApiTracer; import com.google.api.gax.tracing.MetricsTracer; import com.google.common.collect.ImmutableList; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.threeten.bp.Duration; @InternalApi public class CompositeTracer extends BaseApiTracer { @@ -109,14 +111,14 @@ public void attemptCancelled() { } @Override - public void attemptFailed(Throwable error, Duration delay) { + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { for (ApiTracer child : children) { - child.attemptFailed(error, delay); + child.attemptFailedDuration(error, toJavaTimeDuration(delay)); } } @Override - public void attemptFailedDuration(Throwable error, java.time.Duration delay) { + public void attemptFailedDuration(Throwable error, Duration delay) { for (ApiTracer child : children) { child.attemptFailedDuration(error, delay); } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStreamIterator.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStreamIterator.java index 79c02eab58c..60a52b78f25 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStreamIterator.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStreamIterator.java @@ -24,6 +24,7 @@ import com.google.common.collect.AbstractIterator; import com.google.common.util.concurrent.Uninterruptibles; import com.google.spanner.v1.PartialResultSet; +import java.time.Duration; import java.util.Optional; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; @@ -31,7 +32,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** Adapts a streaming read/query call into an iterator over partial result sets. */ @VisibleForTesting @@ -77,7 +77,8 @@ public void setCall(SpannerRpc.StreamingCall call, boolean withBeginTransaction) this.call = call; this.withBeginTransaction = withBeginTransaction; ApiCallContext callContext = call.getCallContext(); - Duration streamWaitTimeout = callContext == null ? null : callContext.getStreamWaitTimeout(); + Duration streamWaitTimeout = + callContext == null ? null : callContext.getStreamWaitTimeoutDuration(); if (streamWaitTimeout != null) { // Determine the timeout unit to use. This reduces the precision to seconds if the timeout // value is more than 1 second, which is lower than the precision that would normally be diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/LatencyTest.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/LatencyTest.java index 4f70c32d2b4..2ba2f8c5a62 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/LatencyTest.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/LatencyTest.java @@ -19,11 +19,11 @@ import com.google.cloud.spanner.SpannerOptions.FixedCloseableExecutorProvider; import java.nio.file.Files; import java.nio.file.Paths; +import java.time.Duration; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadLocalRandom; -import org.threeten.bp.Duration; public class LatencyTest { @@ -42,7 +42,7 @@ public static void main(String[] args) throws Exception { Paths.get("/Users/loite/Downloads/appdev-soda-spanner-staging.json")))) .setSessionPoolOption( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofSeconds(5L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) // .setUseMultiplexedSession(true) .build()) .setUseVirtualThreads(true) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java index 71e364bde83..bd709adbd99 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java @@ -275,7 +275,7 @@ public void onSessionCreateFailure(Throwable t, int createFailureForSessionCount private static void maybeWaitForSessionCreation( SessionPoolOptions sessionPoolOptions, ApiFuture future) { - org.threeten.bp.Duration waitDuration = sessionPoolOptions.getWaitForMinSessions(); + Duration waitDuration = sessionPoolOptions.getWaitForMinSessions(); if (waitDuration != null && !waitDuration.isZero()) { long timeoutMillis = waitDuration.toMillis(); try { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/OpenTelemetryApiTracer.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/OpenTelemetryApiTracer.java index 8d28a4b01ce..863c531de30 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/OpenTelemetryApiTracer.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/OpenTelemetryApiTracer.java @@ -16,6 +16,9 @@ package com.google.cloud.spanner; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + +import com.google.api.core.ObsoleteApi; import com.google.api.gax.tracing.ApiTracer; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; import com.google.common.base.Preconditions; @@ -24,10 +27,10 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.StatusCode; +import java.time.Duration; import java.util.concurrent.atomic.AtomicLong; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * {@link com.google.api.gax.tracing.ApiTracer} for use with OpenTelemetry. Based on {@link @@ -163,8 +166,15 @@ public void attemptCancelled() { lastConnectionId = null; } + /** This method is obsolete. Use {@link #attemptFailedDuration(Throwable, Duration)} instead. */ + @Override + @ObsoleteApi("Use attemptFailedDuration(Throwable, Duration) instead") + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { + attemptFailedDuration(error, toJavaTimeDuration(delay)); + } + @Override - public void attemptFailed(Throwable error, Duration delay) { + public void attemptFailedDuration(Throwable error, Duration delay) { AttributesBuilder builder = baseAttemptAttributesBuilder(); if (delay != null) { builder.put(RETRY_DELAY_KEY, delay.toMillis()); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java index f8f9d1e9779..66b1165f4a9 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java @@ -28,9 +28,9 @@ import com.google.longrunning.Operation.ResultCase; import com.google.protobuf.Any; import com.google.rpc.Status; +import java.time.Duration; import java.util.concurrent.ExecutionException; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * Represents a long-running operation. @@ -43,11 +43,11 @@ public class Operation { private final RetrySettings DEFAULT_OPERATION_WAIT_SETTINGS = RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofHours(12L)) - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setTotalTimeoutDuration(Duration.ofHours(12L)) + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.0) .setJittered(false) - .setMaxRetryDelay(Duration.ofMinutes(500L)) + .setMaxRetryDelayDuration(Duration.ofMinutes(500L)) .build(); interface Parser { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/PartitionedDmlTransaction.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/PartitionedDmlTransaction.java index 82b7f06b7d2..93cebb6333c 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/PartitionedDmlTransaction.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/PartitionedDmlTransaction.java @@ -39,12 +39,12 @@ import com.google.spanner.v1.TransactionOptions; import com.google.spanner.v1.TransactionSelector; import io.grpc.Status; +import java.time.Duration; +import java.time.temporal.ChronoUnit; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; -import org.threeten.bp.Duration; -import org.threeten.bp.temporal.ChronoUnit; @InternalApi public class PartitionedDmlTransaction implements SessionImpl.SessionTransaction { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java index 5bd31603685..2f0d86b6314 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java @@ -45,13 +45,13 @@ import com.google.spanner.v1.RequestOptions; import com.google.spanner.v1.Transaction; import com.google.spanner.v1.TransactionOptions; +import java.time.Instant; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import javax.annotation.Nullable; -import org.threeten.bp.Instant; /** * Implementation of {@link Session}. Sessions are managed internally by the client library, and @@ -203,7 +203,7 @@ public long executePartitionedUpdate(Statement stmt, UpdateOption... options) { PartitionedDmlTransaction txn = new PartitionedDmlTransaction(this, spanner.getRpc(), Ticker.systemTicker()); return txn.executeStreamingPartitionedUpdate( - stmt, spanner.getOptions().getPartitionedDmlTimeout(), options); + stmt, spanner.getOptions().getPartitionedDmlTimeoutDuration(), options); } @Override diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java index cf50fa44c77..aba6aee1db8 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java @@ -91,6 +91,8 @@ import io.opentelemetry.api.metrics.Meter; import java.io.PrintWriter; import java.io.StringWriter; +import java.time.Duration; +import java.time.Instant; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -115,8 +117,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; /** * Maintains a pool of sessions. This class itself is thread safe and is meant to be used @@ -2079,7 +2079,7 @@ private void removeIdleSessions(Instant currTime) { // Determine the minimum last use time for a session to be deemed to still be alive. Remove // all sessions that have a lastUseTime before that time, unless it would cause us to go // below MinSessions. - Instant minLastUseTime = currTime.minus(options.getRemoveInactiveSessionAfter()); + Instant minLastUseTime = currTime.minus(options.getRemoveInactiveSessionAfterDuration()); Iterator iterator = sessions.descendingIterator(); while (iterator.hasNext()) { PooledSession session = iterator.next(); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java index 89de8df3ca9..d4f3e598b11 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java @@ -16,13 +16,17 @@ package com.google.cloud.spanner; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; import com.google.cloud.spanner.SessionPool.Position; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; +import java.time.Duration; import java.util.Locale; import java.util.Objects; -import org.threeten.bp.Duration; /** Options for the session pool used by {@code DatabaseClient}. */ public class SessionPoolOptions { @@ -48,7 +52,7 @@ public class SessionPoolOptions { private final ActionOnExhaustion actionOnExhaustion; private final long loopFrequency; - private final java.time.Duration multiplexedSessionMaintenanceLoopFrequency; + private final Duration multiplexedSessionMaintenanceLoopFrequency; private final int keepAliveIntervalMinutes; private final Duration removeInactiveSessionAfter; private final ActionOnSessionNotFound actionOnSessionNotFound; @@ -81,7 +85,6 @@ public class SessionPoolOptions { private final boolean useMultiplexedSessionForRW; - // TODO: Change to use java.time.Duration. private final Duration multiplexedSessionMaintenanceDuration; private SessionPoolOptions(Builder builder) { @@ -236,7 +239,7 @@ long getLoopFrequency() { return loopFrequency; } - java.time.Duration getMultiplexedSessionMaintenanceLoopFrequency() { + Duration getMultiplexedSessionMaintenanceLoopFrequency() { return this.multiplexedSessionMaintenanceLoopFrequency; } @@ -244,7 +247,13 @@ public int getKeepAliveIntervalMinutes() { return keepAliveIntervalMinutes; } - public Duration getRemoveInactiveSessionAfter() { + /** This method is obsolete. Use {@link #getRemoveInactiveSessionAfterDuration()} instead. */ + @ObsoleteApi("Use getRemoveInactiveSessionAfterDuration() instead") + public org.threeten.bp.Duration getRemoveInactiveSessionAfter() { + return toThreetenDuration(getRemoveInactiveSessionAfterDuration()); + } + + public Duration getRemoveInactiveSessionAfterDuration() { return removeInactiveSessionAfter; } @@ -548,8 +557,7 @@ public static class Builder { private InactiveTransactionRemovalOptions inactiveTransactionRemovalOptions = InactiveTransactionRemovalOptions.newBuilder().build(); private long loopFrequency = 10 * 1000L; - private java.time.Duration multiplexedSessionMaintenanceLoopFrequency = - java.time.Duration.ofMinutes(10); + private Duration multiplexedSessionMaintenanceLoopFrequency = Duration.ofMinutes(10); private int keepAliveIntervalMinutes = 30; private Duration removeInactiveSessionAfter = Duration.ofMinutes(55L); private boolean autoDetectDialect = false; @@ -678,7 +686,7 @@ Builder setLoopFrequency(long loopFrequency) { return this; } - Builder setMultiplexedSessionMaintenanceLoopFrequency(java.time.Duration frequency) { + Builder setMultiplexedSessionMaintenanceLoopFrequency(Duration frequency) { this.multiplexedSessionMaintenanceLoopFrequency = frequency; return this; } @@ -689,7 +697,16 @@ Builder setInactiveTransactionRemovalOptions( return this; } - public Builder setRemoveInactiveSessionAfter(Duration duration) { + /** + * This method is obsolete. Use {@link #setRemoveInactiveSessionAfterDuration(Duration)} + * instead. + */ + @ObsoleteApi("Use setRemoveInactiveSessionAfterDuration(Duration) instead") + public Builder setRemoveInactiveSessionAfter(org.threeten.bp.Duration duration) { + return setRemoveInactiveSessionAfterDuration(toJavaTimeDuration(duration)); + } + + public Builder setRemoveInactiveSessionAfterDuration(Duration duration) { this.removeInactiveSessionAfter = duration; return this; } @@ -720,7 +737,8 @@ public Builder setFailIfPoolExhausted() { * *

By default the requests are blocked for 60s and will fail with a `SpannerException` with * error code `ResourceExhausted` if this timeout is exceeded. If you wish to block for a - * different period use the option {@link Builder#setAcquireSessionTimeout(Duration)} ()} + * different period use the option {@link Builder#setAcquireSessionTimeoutDuration(Duration)} + * ()} */ public Builder setBlockIfPoolExhausted() { this.actionOnExhaustion = ActionOnExhaustion.BLOCK; @@ -908,6 +926,12 @@ public Builder setWriteSessionsFraction(float writeSessionsFraction) { return this; } + /** This method is obsolete. Use {@link #setWaitForMinSessionsDuration(Duration)} instead. */ + @ObsoleteApi("Use setWaitForMinSessionsDuration(Duration) instead") + public Builder setWaitForMinSessions(org.threeten.bp.Duration waitForMinSessions) { + return setWaitForMinSessionsDuration(toJavaTimeDuration(waitForMinSessions)); + } + /** * If greater than zero, waits for the session pool to have at least {@link * SessionPoolOptions#minSessions} before returning the database client to the caller. Note that @@ -918,16 +942,22 @@ public Builder setWriteSessionsFraction(float writeSessionsFraction) { * *

Defaults to zero (initialization is done asynchronously). */ - public Builder setWaitForMinSessions(Duration waitForMinSessions) { + public Builder setWaitForMinSessionsDuration(Duration waitForMinSessions) { this.waitForMinSessions = waitForMinSessions; return this; } + /** This method is obsolete. Use {@link #setAcquireSessionTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use setAcquireSessionTimeoutDuration(Duration) instead") + public Builder setAcquireSessionTimeout(org.threeten.bp.Duration acquireSessionTimeout) { + return setAcquireSessionTimeoutDuration(toJavaTimeDuration(acquireSessionTimeout)); + } + /** * If greater than zero, we wait for said duration when no sessions are available in the {@link * SessionPool}. The default is a 60s timeout. Set the value to null to disable the timeout. */ - public Builder setAcquireSessionTimeout(Duration acquireSessionTimeout) { + public Builder setAcquireSessionTimeoutDuration(Duration acquireSessionTimeout) { try { if (acquireSessionTimeout != null) { Preconditions.checkArgument( diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionReference.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionReference.java index bc12cf8ee77..e96be9effaa 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionReference.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionReference.java @@ -20,9 +20,9 @@ import com.google.cloud.spanner.SessionClient.SessionId; import com.google.cloud.spanner.spi.v1.SpannerRpc; +import java.time.Instant; import java.util.Map; import javax.annotation.Nullable; -import org.threeten.bp.Instant; /** * A {@code Session} can be used to perform transactions that read and/or modify data in a Cloud diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java index fc101fbcfc3..9337d04e531 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerCloudMonitoringExporter.java @@ -41,6 +41,7 @@ import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.export.MetricExporter; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -49,7 +50,6 @@ import java.util.logging.Logger; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * Spanner Cloud Monitoring OpenTelemetry Exporter. @@ -85,10 +85,10 @@ static SpannerCloudMonitoringExporter create( settingsBuilder.setEndpoint(monitoringHost); } - org.threeten.bp.Duration timeout = Duration.ofMinutes(1); + Duration timeout = Duration.ofMinutes(1); // TODO: createServiceTimeSeries needs special handling if the request failed. Leaving // it as not retried for now. - settingsBuilder.createServiceTimeSeriesSettings().setSimpleTimeoutNoRetries(timeout); + settingsBuilder.createServiceTimeSeriesSettings().setSimpleTimeoutNoRetriesDuration(timeout); return new SpannerCloudMonitoringExporter( projectId, MetricServiceClient.create(settingsBuilder.build())); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java index dac1fc2c82b..1348d586e3a 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java @@ -43,6 +43,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import java.io.IOException; +import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -55,7 +56,6 @@ import java.util.logging.Logger; import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; -import org.threeten.bp.Instant; /** Default implementation of the Cloud Spanner interface. */ class SpannerImpl extends BaseService implements Spanner { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java index d85b39c1253..7c232ddaa18 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java @@ -16,6 +16,9 @@ package com.google.cloud.spanner; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; @@ -74,6 +77,7 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -88,7 +92,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; -import org.threeten.bp.Duration; /** Options for the Cloud Spanner service. */ public class SpannerOptions extends ServiceOptions { @@ -380,116 +383,223 @@ public ApiCallContext configure( case BATCH_UPDATE: return batchUpdateTimeout == null ? null - : GrpcCallContext.createDefault().withTimeout(batchUpdateTimeout); + : GrpcCallContext.createDefault().withTimeoutDuration(batchUpdateTimeout); case COMMIT: return commitTimeout == null ? null - : GrpcCallContext.createDefault().withTimeout(commitTimeout); + : GrpcCallContext.createDefault().withTimeoutDuration(commitTimeout); case EXECUTE_QUERY: return executeQueryTimeout == null ? null : GrpcCallContext.createDefault() - .withTimeout(executeQueryTimeout) - .withStreamWaitTimeout(executeQueryTimeout); + .withTimeoutDuration(executeQueryTimeout) + .withStreamWaitTimeoutDuration(executeQueryTimeout); case EXECUTE_UPDATE: return executeUpdateTimeout == null ? null - : GrpcCallContext.createDefault().withTimeout(executeUpdateTimeout); + : GrpcCallContext.createDefault().withTimeoutDuration(executeUpdateTimeout); case PARTITION_QUERY: return partitionQueryTimeout == null ? null - : GrpcCallContext.createDefault().withTimeout(partitionQueryTimeout); + : GrpcCallContext.createDefault().withTimeoutDuration(partitionQueryTimeout); case PARTITION_READ: return partitionReadTimeout == null ? null - : GrpcCallContext.createDefault().withTimeout(partitionReadTimeout); + : GrpcCallContext.createDefault().withTimeoutDuration(partitionReadTimeout); case READ: return readTimeout == null ? null : GrpcCallContext.createDefault() - .withTimeout(readTimeout) - .withStreamWaitTimeout(readTimeout); + .withTimeoutDuration(readTimeout) + .withStreamWaitTimeoutDuration(readTimeout); case ROLLBACK: return rollbackTimeout == null ? null - : GrpcCallContext.createDefault().withTimeout(rollbackTimeout); + : GrpcCallContext.createDefault().withTimeoutDuration(rollbackTimeout); default: } return null; } - public Duration getCommitTimeout() { + /** This method is obsolete. Use {@link #getCommitTimeoutDuration()} instead. */ + @ObsoleteApi("Use getCommitTimeoutDuration() instead.") + public org.threeten.bp.Duration getCommitTimeout() { + return toThreetenDuration(getCommitTimeoutDuration()); + } + + public Duration getCommitTimeoutDuration() { return commitTimeout; } - public SpannerCallContextTimeoutConfigurator withCommitTimeout(Duration commitTimeout) { + /** This method is obsolete. Use {@link #withCommitTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use withCommitTimeoutDuration() instead.") + public SpannerCallContextTimeoutConfigurator withCommitTimeout( + org.threeten.bp.Duration commitTimeout) { + return withCommitTimeoutDuration(toJavaTimeDuration(commitTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withCommitTimeoutDuration(Duration commitTimeout) { this.commitTimeout = commitTimeout; return this; } - public Duration getRollbackTimeout() { + /** This method is obsolete. Use {@link #getRollbackTimeoutDuration()} instead. */ + @ObsoleteApi("Use getRollbackTimeoutDuration() instead.") + public org.threeten.bp.Duration getRollbackTimeout() { + return toThreetenDuration(getRollbackTimeoutDuration()); + } + + public Duration getRollbackTimeoutDuration() { return rollbackTimeout; } - public SpannerCallContextTimeoutConfigurator withRollbackTimeout(Duration rollbackTimeout) { + /** This method is obsolete. Use {@link #withRollbackTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use withRollbackTimeoutDuration() instead.") + public SpannerCallContextTimeoutConfigurator withRollbackTimeout( + org.threeten.bp.Duration rollbackTimeout) { + return withRollbackTimeoutDuration(toJavaTimeDuration(rollbackTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withRollbackTimeoutDuration( + Duration rollbackTimeout) { this.rollbackTimeout = rollbackTimeout; return this; } - public Duration getExecuteQueryTimeout() { + /** This method is obsolete. Use {@link #getExecuteQueryTimeoutDuration()} instead. */ + @ObsoleteApi("Use getExecuteQueryTimeoutDuration() instead.") + public org.threeten.bp.Duration getExecuteQueryTimeout() { + return toThreetenDuration(getExecuteQueryTimeoutDuration()); + } + + public Duration getExecuteQueryTimeoutDuration() { return executeQueryTimeout; } + /** This method is obsolete. Use {@link #withExecuteQueryTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use withExecuteQueryTimeoutDuration() instead") public SpannerCallContextTimeoutConfigurator withExecuteQueryTimeout( + org.threeten.bp.Duration executeQueryTimeout) { + return withExecuteQueryTimeoutDuration(toJavaTimeDuration(executeQueryTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withExecuteQueryTimeoutDuration( Duration executeQueryTimeout) { this.executeQueryTimeout = executeQueryTimeout; return this; } - public Duration getExecuteUpdateTimeout() { + /** This method is obsolete. Use {@link #getExecuteUpdateTimeoutDuration()} instead. */ + @ObsoleteApi("Use getExecuteUpdateTimeoutDuration() instead") + public org.threeten.bp.Duration getExecuteUpdateTimeout() { + return toThreetenDuration(getExecuteUpdateTimeoutDuration()); + } + + public Duration getExecuteUpdateTimeoutDuration() { return executeUpdateTimeout; } + /** This method is obsolete. Use {@link #withExecuteUpdateTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use withExecuteUpdateTimeoutDuration() instead") public SpannerCallContextTimeoutConfigurator withExecuteUpdateTimeout( + org.threeten.bp.Duration executeUpdateTimeout) { + return withExecuteUpdateTimeoutDuration(toJavaTimeDuration(executeUpdateTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withExecuteUpdateTimeoutDuration( Duration executeUpdateTimeout) { this.executeUpdateTimeout = executeUpdateTimeout; return this; } - public Duration getBatchUpdateTimeout() { + /** This method is obsolete. Use {@link #getBatchUpdateTimeoutDuration()} instead. */ + @ObsoleteApi("Use getBatchUpdateTimeoutDuration() instead") + public org.threeten.bp.Duration getBatchUpdateTimeout() { + return toThreetenDuration(getBatchUpdateTimeoutDuration()); + } + + public Duration getBatchUpdateTimeoutDuration() { return batchUpdateTimeout; } + /** This method is obsolete. Use {@link #withBatchUpdateTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use withBatchUpdateTimeoutDuration() instead") public SpannerCallContextTimeoutConfigurator withBatchUpdateTimeout( + org.threeten.bp.Duration batchUpdateTimeout) { + return withBatchUpdateTimeoutDuration(toJavaTimeDuration(batchUpdateTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withBatchUpdateTimeoutDuration( Duration batchUpdateTimeout) { this.batchUpdateTimeout = batchUpdateTimeout; return this; } - public Duration getReadTimeout() { + /** This method is obsolete. Use {@link #getReadTimeoutDuration()} instead. */ + @ObsoleteApi("Use getReadTimeoutDuration() instead") + public org.threeten.bp.Duration getReadTimeout() { + return toThreetenDuration(getReadTimeoutDuration()); + } + + public Duration getReadTimeoutDuration() { return readTimeout; } - public SpannerCallContextTimeoutConfigurator withReadTimeout(Duration readTimeout) { + /** This method is obsolete. Use {@link #withReadTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use withReadTimeoutDuration() instead") + public SpannerCallContextTimeoutConfigurator withReadTimeout( + org.threeten.bp.Duration readTimeout) { + return withReadTimeoutDuration(toJavaTimeDuration(readTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withReadTimeoutDuration(Duration readTimeout) { this.readTimeout = readTimeout; return this; } - public Duration getPartitionQueryTimeout() { + /** This method is obsolete. Use {@link #getPartitionQueryTimeoutDuration()} instead. */ + @ObsoleteApi("Use getPartitionQueryTimeoutDuration() instead") + public org.threeten.bp.Duration getPartitionQueryTimeout() { + return toThreetenDuration(getPartitionQueryTimeoutDuration()); + } + + public Duration getPartitionQueryTimeoutDuration() { return partitionQueryTimeout; } + /** + * This method is obsolete. Use {@link #withPartitionQueryTimeoutDuration(Duration)} instead. + */ + @ObsoleteApi("Use withPartitionQueryTimeoutDuration() instead") public SpannerCallContextTimeoutConfigurator withPartitionQueryTimeout( + org.threeten.bp.Duration partitionQueryTimeout) { + return withPartitionQueryTimeoutDuration(toJavaTimeDuration(partitionQueryTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withPartitionQueryTimeoutDuration( Duration partitionQueryTimeout) { this.partitionQueryTimeout = partitionQueryTimeout; return this; } - public Duration getPartitionReadTimeout() { + /** This method is obsolete. Use {@link #getPartitionReadTimeoutDuration()} instead. */ + @ObsoleteApi("Use getPartitionReadTimeoutDuration() instead") + public org.threeten.bp.Duration getPartitionReadTimeout() { + return toThreetenDuration(getPartitionReadTimeoutDuration()); + } + + public Duration getPartitionReadTimeoutDuration() { return partitionReadTimeout; } + /** This method is obsolete. Use {@link #withPartitionReadTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use withPartitionReadTimeoutDuration() instead") public SpannerCallContextTimeoutConfigurator withPartitionReadTimeout( + org.threeten.bp.Duration partitionReadTimeout) { + return withPartitionReadTimeoutDuration(toJavaTimeDuration(partitionReadTimeout)); + } + + public SpannerCallContextTimeoutConfigurator withPartitionReadTimeoutDuration( Duration partitionReadTimeout) { this.partitionReadTimeout = partitionReadTimeout; return this; @@ -785,9 +895,9 @@ public static class Builder static final DecodeMode DEFAULT_DECODE_MODE = DecodeMode.DIRECT; static final RetrySettings DEFAULT_ADMIN_REQUESTS_LIMIT_EXCEEDED_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofSeconds(5L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(5L)) .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofSeconds(60L)) + .setMaxRetryDelayDuration(Duration.ofSeconds(60L)) .setMaxAttempts(10) .build(); private final ImmutableSet allowedClientLibTokens = @@ -851,13 +961,13 @@ protected Builder() { OperationTimedPollAlgorithm longRunningPollingAlgorithm = OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofSeconds(60L)) - .setMaxRpcTimeout(Duration.ofSeconds(600L)) - .setInitialRetryDelay(Duration.ofSeconds(20L)) - .setMaxRetryDelay(Duration.ofSeconds(45L)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(60L)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(600L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(20L)) + .setMaxRetryDelayDuration(Duration.ofSeconds(45L)) .setRetryDelayMultiplier(1.5) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofHours(48L)) + .setTotalTimeoutDuration(Duration.ofHours(48L)) .build()); databaseAdminStubSettingsBuilder .createDatabaseOperationSettings() @@ -1126,11 +1236,17 @@ public DatabaseAdminStubSettings.Builder getDatabaseAdminStubSettingsBuilder() { return databaseAdminStubSettingsBuilder; } + /** This method is obsolete. Use {@link #setPartitionedDmlTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use setPartitionedDmlTimeoutDuration(Duration) instead") + public Builder setPartitionedDmlTimeout(org.threeten.bp.Duration timeout) { + return setPartitionedDmlTimeoutDuration(toJavaTimeDuration(timeout)); + } + /** * Sets a timeout specifically for Partitioned DML statements executed through {@link * DatabaseClient#executePartitionedUpdate(Statement, UpdateOption...)}. The default is 2 hours. */ - public Builder setPartitionedDmlTimeout(Duration timeout) { + public Builder setPartitionedDmlTimeoutDuration(Duration timeout) { this.partitionedDmlTimeout = timeout; return this; } @@ -1643,7 +1759,11 @@ public DatabaseAdminStubSettings getDatabaseAdminStubSettings() { return databaseAdminStubSettings; } - public Duration getPartitionedDmlTimeout() { + public org.threeten.bp.Duration getPartitionedDmlTimeout() { + return toThreetenDuration(getPartitionedDmlTimeoutDuration()); + } + + public Duration getPartitionedDmlTimeoutDuration() { return partitionedDmlTimeout; } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerRetryHelper.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerRetryHelper.java index a25c706e8a7..5fb35513222 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerRetryHelper.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerRetryHelper.java @@ -30,9 +30,9 @@ import com.google.common.base.Throwables; import com.google.spanner.v1.RollbackRequest; import io.grpc.Context; +import java.time.Duration; import java.util.concurrent.Callable; import java.util.concurrent.CancellationException; -import org.threeten.bp.Duration; /** * Util class for retrying aborted transactions. This class is a wrapper around {@link RetryHelper} @@ -60,7 +60,7 @@ class SpannerRetryHelper { .rollbackSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofHours(24L)) + .setTotalTimeoutDuration(Duration.ofHours(24L)) .setMaxAttempts(0) .build(); @@ -109,7 +109,7 @@ public TimedAttemptSettings createNextAttempt( if (retryDelay > -1L) { return prevSettings .toBuilder() - .setRandomizedRetryDelay(Duration.ofMillis(retryDelay)) + .setRandomizedRetryDelayDuration(Duration.ofMillis(retryDelay)) .build(); } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/AbstractBaseUnitOfWork.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/AbstractBaseUnitOfWork.java index 58143523b65..f04026429f5 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/AbstractBaseUnitOfWork.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/AbstractBaseUnitOfWork.java @@ -368,7 +368,7 @@ public ApiCallContext configure( if (statementTimeout.hasTimeout() && applyStatementTimeoutToMethods.contains(method)) { return GrpcCallContext.createDefault() - .withTimeout(statementTimeout.asDuration()); + .withTimeoutDuration(statementTimeout.asDuration()); } return null; } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java index 0b2d0b6b3a0..1b94702061c 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java @@ -97,6 +97,7 @@ import java.io.FileInputStream; import java.io.InputStream; import java.time.Duration; +import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -114,7 +115,6 @@ import java.util.stream.Collectors; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Instant; /** Implementation for {@link Connection}, the generic Spanner connection API (not JDBC). */ class ConnectionImpl implements Connection { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/LocalConnectionChecker.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/LocalConnectionChecker.java index 4271a8c2f0b..f9a12f5552a 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/LocalConnectionChecker.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/LocalConnectionChecker.java @@ -24,7 +24,7 @@ import com.google.cloud.spanner.admin.instance.v1.stub.GrpcInstanceAdminStub; import com.google.cloud.spanner.admin.instance.v1.stub.InstanceAdminStubSettings; import com.google.spanner.admin.instance.v1.ListInstanceConfigsRequest; -import org.threeten.bp.Duration; +import java.time.Duration; /** * Util class for quickly checking whether a local emulator or test server can be found. A common @@ -66,7 +66,7 @@ void checkLocalConnection(ConnectionOptions options) { .build()); testEmulatorSettings .listInstanceConfigsSettings() - .setSimpleTimeoutNoRetries(Duration.ofSeconds(10L)); + .setSimpleTimeoutNoRetriesDuration(Duration.ofSeconds(10L)); try (GrpcInstanceAdminStub stub = GrpcInstanceAdminStub.create(testEmulatorSettings.build())) { stub.listInstanceConfigsCallable() diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java index a126bd8ff37..b92e575a047 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java @@ -29,6 +29,7 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.Duration; import io.opentelemetry.context.Context; +import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.List; import java.util.concurrent.Callable; @@ -37,7 +38,6 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.threeten.bp.temporal.ChronoUnit; /** * {@link StatementExecutor} is responsible for executing statements on a {@link Connection}. @@ -106,26 +106,26 @@ public boolean hasDuration() { }); } - org.threeten.bp.Duration asDuration() { + java.time.Duration asDuration() { if (!hasTimeout()) { - return org.threeten.bp.Duration.ZERO; + return java.time.Duration.ZERO; } TimeUnit unit = getAppropriateTimeUnit(); switch (unit) { case DAYS: - return org.threeten.bp.Duration.ofDays(getTimeoutValue(unit)); + return java.time.Duration.ofDays(getTimeoutValue(unit)); case HOURS: - return org.threeten.bp.Duration.ofHours(getTimeoutValue(unit)); + return java.time.Duration.ofHours(getTimeoutValue(unit)); case MICROSECONDS: - return org.threeten.bp.Duration.of(getTimeoutValue(unit), ChronoUnit.MICROS); + return java.time.Duration.of(getTimeoutValue(unit), ChronoUnit.MICROS); case MILLISECONDS: - return org.threeten.bp.Duration.ofMillis(getTimeoutValue(unit)); + return java.time.Duration.ofMillis(getTimeoutValue(unit)); case MINUTES: - return org.threeten.bp.Duration.ofMinutes(getTimeoutValue(unit)); + return java.time.Duration.ofMinutes(getTimeoutValue(unit)); case NANOSECONDS: - return org.threeten.bp.Duration.ofNanos(getTimeoutValue(unit)); + return java.time.Duration.ofNanos(getTimeoutValue(unit)); case SECONDS: - return org.threeten.bp.Duration.ofSeconds(getTimeoutValue(unit)); + return java.time.Duration.ofSeconds(getTimeoutValue(unit)); default: throw new IllegalStateException("invalid time unit: " + unit); } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java index fe23b097982..0e540ea7926 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java @@ -192,6 +192,7 @@ import java.net.URLDecoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.util.Comparator; import java.util.HashMap; import java.util.List; @@ -214,7 +215,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** Implementation of Cloud Spanner remote calls using Gapic libraries. */ @InternalApi @@ -347,7 +347,7 @@ public GapicSpannerRpc(final SpannerOptions options) { // Set a keepalive time of 120 seconds to help long running // commit GRPC calls succeed - .setKeepAliveTime(Duration.ofSeconds(GRPC_KEEPALIVE_SECONDS)) + .setKeepAliveTimeDuration(Duration.ofSeconds(GRPC_KEEPALIVE_SECONDS)) // Then check if SpannerOptions provides an InterceptorProvider. Create a default // SpannerInterceptorProvider if none is provided @@ -396,7 +396,7 @@ public GapicSpannerRpc(final SpannerOptions options) { WatchdogProvider watchdogProvider = InstantiatingWatchdogProvider.create() .withExecutor(spannerWatchdog) - .withCheckInterval(checkInterval) + .withCheckIntervalDuration(checkInterval) .withClock(NanoClock.getDefaultClock()); final String emulatorHost = System.getenv("SPANNER_EMULATOR_HOST"); @@ -652,7 +652,7 @@ private static void checkEmulatorConnection( .setCredentialsProvider(credentialsProvider); testEmulatorSettings .listInstanceConfigsSettings() - .setSimpleTimeoutNoRetries(Duration.ofSeconds(10L)); + .setSimpleTimeoutNoRetriesDuration(Duration.ofSeconds(10L)); try (GrpcInstanceAdminStub stub = GrpcInstanceAdminStub.create(testEmulatorSettings.build())) { stub.listInstanceConfigsCallable() @@ -685,9 +685,9 @@ private static boolean isEmulatorEnabled(SpannerOptions options, String emulator private static final RetrySettings ADMIN_REQUESTS_LIMIT_EXCEEDED_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofSeconds(5L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(5L)) .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofSeconds(60L)) + .setMaxRetryDelayDuration(Duration.ofSeconds(60L)) .setMaxAttempts(10) .build(); @@ -1770,7 +1770,7 @@ public ServerStream executeStreamingPartitionedDml( SpannerGrpc.getExecuteStreamingSqlMethod(), true); // Override any timeout settings that might have been set on the call context. - context = context.withTimeout(timeout).withStreamWaitTimeout(timeout); + context = context.withTimeoutDuration(timeout).withStreamWaitTimeoutDuration(timeout); return partitionedDmlStub.executeStreamingSqlCallable().call(request, context); } @@ -2037,7 +2037,10 @@ GrpcCallContext newCallContext( context.withCallOptions(context.getCallOptions().withCallCredentials(callCredentials)); } } - context = context.withStreamWaitTimeout(waitTimeout).withStreamIdleTimeout(idleTimeout); + context = + context + .withStreamWaitTimeoutDuration(waitTimeout) + .withStreamIdleTimeoutDuration(idleTimeout); CallContextConfigurator configurator = SpannerOptions.CALL_CONTEXT_CONFIGURATOR_KEY.get(); ApiCallContext apiCallContextFromContext = null; if (configurator != null) { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java index 0b040df4197..9ad94204743 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerRpc.java @@ -56,11 +56,11 @@ import com.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata; import com.google.spanner.admin.instance.v1.UpdateInstanceMetadata; import com.google.spanner.v1.*; +import java.time.Duration; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * Abstracts remote calls to the Cloud Spanner service. Typically end-consumer code will never use diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java index 4bcc5d07401..72d04d94614 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java @@ -33,6 +33,7 @@ import io.grpc.Server; import io.grpc.inprocess.InProcessServerBuilder; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Executors; @@ -46,7 +47,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(SlowTest.class) @RunWith(JUnit4.class) @@ -127,7 +127,7 @@ public void testBatchCreateSessionsTimesOut_whenDeadlineExceeded() throws Except builder .getSpannerStubSettingsBuilder() .batchCreateSessionsSettings() - .setSimpleTimeoutNoRetries(Duration.ofMillis(100)); + .setSimpleTimeoutNoRetriesDuration(Duration.ofMillis(100)); try (Spanner spanner = builder.build().getService()) { DatabaseId databaseId = DatabaseId.of("my-project", "my-instance", "my-database"); @@ -168,7 +168,9 @@ public void testBatchCreateSessionsTimesOut_whenResourceExhausted() throws Excep // Add a timeout for the max amount of time (60ms) that a request waits when a session is // unavailable. SessionPoolOptions sessionPoolOptions = - SessionPoolOptions.newBuilder().setAcquireSessionTimeout(Duration.ofMillis(60)).build(); + SessionPoolOptions.newBuilder() + .setAcquireSessionTimeoutDuration(Duration.ofMillis(60)) + .build(); SpannerOptions.Builder builder = SpannerOptions.newBuilder() .setProjectId("my-project") @@ -181,7 +183,7 @@ public void testBatchCreateSessionsTimesOut_whenResourceExhausted() throws Excep builder .getSpannerStubSettingsBuilder() .batchCreateSessionsSettings() - .setSimpleTimeoutNoRetries(Duration.ofMillis(1000)); + .setSimpleTimeoutNoRetriesDuration(Duration.ofMillis(1000)); try (Spanner spanner = builder.build().getService()) { DatabaseId databaseId = DatabaseId.of("my-project", "my-instance", "my-database"); @@ -192,7 +194,6 @@ public void testBatchCreateSessionsTimesOut_whenResourceExhausted() throws Excep List> futures = new ArrayList<>(5000); AtomicInteger counter = new AtomicInteger(); for (int i = 0; i < 5000; i++) { - final int index = i; futures.add( service.submit( () -> { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CloseSpannerWithOpenResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CloseSpannerWithOpenResultSetTest.java index 8d622579714..c8228e5ecf8 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CloseSpannerWithOpenResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CloseSpannerWithOpenResultSetTest.java @@ -30,6 +30,7 @@ import com.google.spanner.v1.ExecuteSqlRequest; import io.grpc.ManagedChannelBuilder; import io.grpc.Status; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutorService; @@ -44,7 +45,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class CloseSpannerWithOpenResultSetTest extends AbstractMockServerTest { @@ -56,7 +56,9 @@ Spanner createSpanner() { .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption( - SessionPoolOptions.newBuilder().setWaitForMinSessions(Duration.ofSeconds(5L)).build()) + SessionPoolOptions.newBuilder() + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) + .build()) .build() .getService(); } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CompositeTracerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CompositeTracerTest.java index dfb7b252268..7f2e7fffc6f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CompositeTracerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/CompositeTracerTest.java @@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableList; import com.google.spanner.v1.ReadRequest; import java.lang.reflect.Method; +import java.time.Duration; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -40,7 +41,6 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class CompositeTracerTest { @@ -150,11 +150,11 @@ public void testAttemptCancelled() { public void testAttemptFailed() { RuntimeException error = new RuntimeException(); Duration delay = Duration.ofMillis(10); - compositeTracer.attemptFailed(error, delay); - verify(child1, times(1)).attemptFailed(error, delay); - verify(child2, times(1)).attemptFailed(error, delay); - verify(child3, times(1)).attemptFailed(error, delay); - verify(child4, times(1)).attemptFailed(error, delay); + compositeTracer.attemptFailedDuration(error, delay); + verify(child1, times(1)).attemptFailedDuration(error, delay); + verify(child2, times(1)).attemptFailedDuration(error, delay); + verify(child3, times(1)).attemptFailedDuration(error, delay); + verify(child4, times(1)).attemptFailedDuration(error, delay); } @Test diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminClientTest.java index 8bb644e75ce..e93066f2683 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminClientTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminClientTest.java @@ -55,6 +55,7 @@ import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; import io.grpc.protobuf.lite.ProtoLiteUtils; import java.net.InetSocketAddress; +import java.time.Duration; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -68,7 +69,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class DatabaseAdminClientTest { @@ -107,13 +107,13 @@ public static void startStaticServer() throws Exception { SpannerOptions.Builder builder = SpannerOptions.newBuilder(); RetrySettings longRunningInitialRetrySettings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(600L)) - .setMaxRpcTimeout(Duration.ofMillis(6000L)) - .setInitialRetryDelay(Duration.ofMillis(20L)) - .setMaxRetryDelay(Duration.ofMillis(45L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(600L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(6000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(20L)) + .setMaxRetryDelayDuration(Duration.ofMillis(45L)) .setRetryDelayMultiplier(1.5) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofMinutes(48L)) + .setTotalTimeoutDuration(Duration.ofMinutes(48L)) .build(); builder .getDatabaseAdminStubSettingsBuilder() @@ -128,12 +128,12 @@ public static void startStaticServer() throws Exception { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setInitialRetryDelay(Duration.ofMillis(10L)) - .setMaxRetryDelay(Duration.ofMillis(150L)) - .setMaxRpcTimeout(Duration.ofMillis(150L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setMaxRetryDelayDuration(Duration.ofMillis(150L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(150L)) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.3) .build())); @@ -152,12 +152,12 @@ public static void startStaticServer() throws Exception { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setInitialRetryDelay(Duration.ofMillis(10L)) - .setMaxRetryDelay(Duration.ofMillis(150L)) - .setMaxRpcTimeout(Duration.ofMillis(150L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setMaxRetryDelayDuration(Duration.ofMillis(150L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(150L)) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.3) .build())); @@ -175,19 +175,19 @@ public static void startStaticServer() throws Exception { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setInitialRetryDelay(Duration.ofMillis(10L)) - .setMaxRetryDelay(Duration.ofMillis(150L)) - .setMaxRpcTimeout(Duration.ofMillis(150L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setMaxRetryDelayDuration(Duration.ofMillis(150L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(150L)) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.3) .build())); builder.setRetryAdministrativeRequestsSettings( SpannerOptions.Builder.DEFAULT_ADMIN_REQUESTS_LIMIT_EXCEEDED_RETRY_SETTINGS .toBuilder() - .setInitialRetryDelay(Duration.ofNanos(1L)) + .setInitialRetryDelayDuration(Duration.ofNanos(1L)) .build()); spanner = builder diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminGaxTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminGaxTest.java index 0af51744abd..be9f07d7f79 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminGaxTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseAdminGaxTest.java @@ -37,6 +37,7 @@ import io.grpc.StatusRuntimeException; import io.grpc.inprocess.InProcessServerBuilder; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -56,7 +57,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import org.threeten.bp.Duration; @RunWith(Parameterized.class) public class DatabaseAdminGaxTest { @@ -214,22 +214,22 @@ public void setUp() throws Exception { mockDatabaseAdmin.reset(); RetrySettings retrySettingsWithLowTimeout = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setMaxRpcTimeout(Duration.ofMillis(1000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.0) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(200L)) + .setTotalTimeoutDuration(Duration.ofMillis(200L)) .build(); RetrySettings retrySettingsWithHighTimeout = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(2000L)) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(2000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) .setMaxAttempts(3) - .setTotalTimeout(Duration.ofMillis(15000L)) + .setTotalTimeoutDuration(Duration.ofMillis(15000L)) .build(); final RetrySettings retrySettingsToUse = exceptionType == ExceptionType.DELAYED diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java index 62a10c0adb4..86d0bfc2c94 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java @@ -111,6 +111,8 @@ import io.opentelemetry.api.OpenTelemetry; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; @@ -135,8 +137,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; @RunWith(JUnit4.class) public class DatabaseClientImplTest { @@ -2852,10 +2852,10 @@ public void testPartitionedDmlDoesNotTimeout() { mockSpanner.setExecuteSqlExecutionTime(SimulatedExecutionTime.ofMinimumAndRandomTime(20, 0)); final RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(1L)) - .setMaxRpcTimeout(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(1L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(1L)) .setMaxAttempts(1) - .setTotalTimeout(Duration.ofMillis(1L)) + .setTotalTimeoutDuration(Duration.ofMillis(1L)) .build(); SpannerOptions.Builder builder = SpannerOptions.newBuilder() @@ -2868,7 +2868,8 @@ public void testPartitionedDmlDoesNotTimeout() { DatabaseClient client = spanner.getDatabaseClient(DatabaseId.of(TEST_PROJECT, TEST_INSTANCE, TEST_DATABASE)); - assertThat(spanner.getOptions().getPartitionedDmlTimeout()).isEqualTo(Duration.ofHours(2L)); + assertThat(spanner.getOptions().getPartitionedDmlTimeoutDuration()) + .isEqualTo(Duration.ofHours(2L)); // PDML should not timeout with these settings. long updateCount = client.executePartitionedUpdate(UPDATE_STATEMENT); @@ -2900,11 +2901,12 @@ public void testPartitionedDmlWithLowerTimeout() { .setChannelProvider(channelProvider) .setCredentials(NoCredentials.getInstance()); // Set PDML timeout value. - builder.setPartitionedDmlTimeout(Duration.ofMillis(10L)); + builder.setPartitionedDmlTimeoutDuration(Duration.ofMillis(10L)); try (Spanner spanner = builder.build().getService()) { DatabaseClient client = spanner.getDatabaseClient(DatabaseId.of(TEST_PROJECT, TEST_INSTANCE, TEST_DATABASE)); - assertThat(spanner.getOptions().getPartitionedDmlTimeout()).isEqualTo(Duration.ofMillis(10L)); + assertThat(spanner.getOptions().getPartitionedDmlTimeoutDuration()) + .isEqualTo(Duration.ofMillis(10L)); // PDML should time out with these settings. mockSpanner.setExecuteSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(1000, 0)); @@ -2933,7 +2935,7 @@ public void testPartitionedDmlWithHigherTimeout() { .setChannelProvider(channelProvider) .setCredentials(NoCredentials.getInstance()); // Set PDML timeout value to a value that should allow the statement to be executed. - builder.setPartitionedDmlTimeout(Duration.ofMillis(5000L)); + builder.setPartitionedDmlTimeoutDuration(Duration.ofMillis(5000L)); // Set the ExecuteSql RPC timeout value to a value lower than the time needed to execute the // statement. The higher timeout value that is set above should be respected, and the value for // the ExecuteSQL RPC should be ignored specifically for Partitioned DML. @@ -2946,10 +2948,10 @@ public void testPartitionedDmlWithHigherTimeout() { .executeSqlSettings() .getRetrySettings() .toBuilder() - .setInitialRpcTimeout(Duration.ofMillis(10L)) - .setMaxRpcTimeout(Duration.ofMillis(10L)) - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) .build()); try (Spanner spanner = builder.build().getService()) { DatabaseClient client = @@ -3051,7 +3053,7 @@ public void testDatabaseOrInstanceDoesNotExistOnCreate() { .setSessionPoolOption( SessionPoolOptions.newBuilder() .setMinSessions(0) - .setWaitForMinSessions(waitForMinSessions) + .setWaitForMinSessionsDuration(waitForMinSessions) .build()) .build() .getService()) { @@ -3737,7 +3739,9 @@ public void testBatchCreateSessionsPermissionDenied() { .setChannelProvider(channelProvider) .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption( - SessionPoolOptions.newBuilder().setWaitForMinSessions(waitForMinSessions).build()) + SessionPoolOptions.newBuilder() + .setWaitForMinSessionsDuration(waitForMinSessions) + .build()) .build() .getService()) { DatabaseId databaseId = DatabaseId.of("my-project", "my-instance", "my-database"); @@ -3836,7 +3840,7 @@ public void testSpecificTimeout() { .withValue( SpannerOptions.CALL_CONTEXT_CONFIGURATOR_KEY, SpannerCallContextTimeoutConfigurator.create() - .withExecuteQueryTimeout(Duration.ofNanos(1L))) + .withExecuteQueryTimeoutDuration(Duration.ofNanos(1L))) .run( () -> { // Query should fail with a timeout. @@ -4956,7 +4960,7 @@ public void testStreamWaitTimeout() { @Override public ApiCallContext configure( ApiCallContext context, ReqT request, MethodDescriptor method) { - return context.withStreamWaitTimeout(Duration.ofNanos(1L)); + return context.withStreamWaitTimeoutDuration(Duration.ofNanos(1L)); } }; Context context = @@ -4983,7 +4987,7 @@ public void testZeroStreamWaitTimeout() { @Override public ApiCallContext configure( ApiCallContext context, ReqT request, MethodDescriptor method) { - return context.withStreamWaitTimeout(Duration.ZERO); + return context.withStreamWaitTimeoutDuration(Duration.ZERO); } }; Context context = @@ -5002,12 +5006,12 @@ public ApiCallContext configure( public void testRetryOnResourceExhausted() { final RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofSeconds(60L)) - .setMaxRpcTimeout(Duration.ofSeconds(60L)) - .setTotalTimeout(Duration.ofSeconds(60L)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(60L)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60L)) + .setTotalTimeoutDuration(Duration.ofSeconds(60L)) .setRpcTimeoutMultiplier(1.0d) - .setInitialRetryDelay(Duration.ZERO) - .setMaxRetryDelay(Duration.ZERO) + .setInitialRetryDelayDuration(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ZERO) .setMaxAttempts(100) .build(); SpannerOptions.Builder builder = @@ -5096,7 +5100,7 @@ public void testSessionPoolExhaustedError_containsStackTraces() { .setFailIfPoolExhausted() .setMinSessions(2) .setMaxSessions(4) - .setWaitForMinSessions(Duration.ofSeconds(10L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(10L)) .build()) .build() .getService()) { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultBenchmark.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultBenchmark.java index 7579c4328d2..35712cd5b4e 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultBenchmark.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultBenchmark.java @@ -92,7 +92,7 @@ public void setup() throws Exception { SessionPoolOptions.newBuilder() .setMinSessions(minSessions) .setMaxSessions(maxSessions) - .setWaitForMinSessions(org.threeten.bp.Duration.ofSeconds(20)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(20)) .build()) .setHost(SERVER_URL) .setNumChannels(NUM_GRPC_CHANNELS) @@ -168,7 +168,7 @@ public void burstUpdates(final BenchmarkState server) throws Exception { collectResultsAndPrint(service, results, TOTAL_WRITES_PER_RUN); } - private List runBenchmarksForSingleUseQueries( + private List runBenchmarksForSingleUseQueries( final BenchmarkState server, int numberOfOperations) { List results = new ArrayList<>(numberOfOperations); // Execute one query to make sure everything has been warmed up. @@ -186,7 +186,7 @@ private void executeWarmup(final BenchmarkState server) { } } - private java.time.Duration executeSingleUseQuery(final BenchmarkState server) { + private Duration executeSingleUseQuery(final BenchmarkState server) { Stopwatch watch = Stopwatch.createStarted(); try (ResultSet rs = server.client.singleUse().executeQuery(getRandomisedReadStatement())) { @@ -198,7 +198,7 @@ private java.time.Duration executeSingleUseQuery(final BenchmarkState server) { return watch.elapsed(); } - private List runBenchmarkForUpdates( + private List runBenchmarkForUpdates( final BenchmarkState server, int numberOfOperations) { List results = new ArrayList<>(numberOfOperations); // Execute one query to make sure everything has been warmed up. @@ -237,7 +237,7 @@ void collectResultsAndPrint( List>> results, int numOperationsPerThread) throws Exception { - final List collectResults = + final List collectResults = collectResults( service, results, numOperationsPerThread * PARALLEL_THREADS, Duration.ofMinutes(60)); printResults(collectResults); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/FakeClock.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/FakeClock.java index d46618ce2d0..ab2e859adff 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/FakeClock.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/FakeClock.java @@ -15,8 +15,8 @@ */ package com.google.cloud.spanner; +import java.time.Instant; import java.util.concurrent.atomic.AtomicLong; -import org.threeten.bp.Instant; /** * Class which allows to mock {@link Clock} in unit tests and return custom time values within the diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java index 59a18a3ab79..25c01560e92 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java @@ -44,6 +44,7 @@ import com.google.spanner.v1.Transaction; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; @@ -55,7 +56,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; /** Unit tests for {@link GrpcResultSet}. */ @RunWith(JUnit4.class) @@ -90,7 +90,7 @@ public void setUp() { new SpannerRpc.StreamingCall() { @Override public ApiCallContext getCallContext() { - return GrpcCallContext.createDefault().withStreamWaitTimeout(streamWaitTimeout); + return GrpcCallContext.createDefault().withStreamWaitTimeoutDuration(streamWaitTimeout); } @Override diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/InstanceAdminGaxTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/InstanceAdminGaxTest.java index c5a317ce5d7..f619d9b461f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/InstanceAdminGaxTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/InstanceAdminGaxTest.java @@ -44,6 +44,7 @@ import io.grpc.StatusRuntimeException; import io.grpc.inprocess.InProcessServerBuilder; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -64,7 +65,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import org.threeten.bp.Duration; @RunWith(Parameterized.class) public class InstanceAdminGaxTest { @@ -221,23 +221,23 @@ public void setUp() throws Exception { mockInstanceAdmin.reset(); RetrySettings retrySettingsWithLowTimeout = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(10L)) - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setMaxRpcTimeout(Duration.ofMillis(200L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(10L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(200L)) .setRetryDelayMultiplier(1.3d) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(20000L)) + .setTotalTimeoutDuration(Duration.ofMillis(20000L)) .setJittered(false) .build(); RetrySettings retrySettingsWithHighTimeout = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(2000L)) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(2000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) .setMaxAttempts(3) - .setTotalTimeout(Duration.ofMillis(15000L)) + .setTotalTimeoutDuration(Duration.ofMillis(15000L)) .build(); final RetrySettings retrySettingsToUse = exceptionType == ExceptionType.DELAYED diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/LongRunningSessionsBenchmark.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/LongRunningSessionsBenchmark.java index 19d614ded07..58eb423a5db 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/LongRunningSessionsBenchmark.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/LongRunningSessionsBenchmark.java @@ -28,6 +28,7 @@ import com.google.common.util.concurrent.ListeningScheduledExecutorService; import com.google.common.util.concurrent.MoreExecutors; import com.google.spanner.v1.BatchCreateSessionsRequest; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -48,7 +49,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; import org.openjdk.jmh.annotations.Warmup; -import org.threeten.bp.Duration; /** * Benchmarks for long-running sessions scenarios. The simulated execution times are based on @@ -126,7 +126,7 @@ public void setup() throws Exception { SessionPoolOptions.newBuilder() .setMinSessions(minSessions) .setMaxSessions(maxSessions) - .setWaitForMinSessions(Duration.ofSeconds(5)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5)) .setInactiveTransactionRemovalOptions(inactiveTransactionRemovalOptions) .build()) .build(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockDatabaseAdminServiceImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockDatabaseAdminServiceImplTest.java index 9c9f0e7f91a..637f97cb097 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockDatabaseAdminServiceImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockDatabaseAdminServiceImplTest.java @@ -58,6 +58,7 @@ import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -74,7 +75,6 @@ import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class MockDatabaseAdminServiceImplTest { @@ -150,12 +150,12 @@ public void setUp() throws IOException { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setInitialRetryDelay(Duration.ofMillis(10L)) - .setMaxRetryDelay(Duration.ofMillis(150L)) - .setMaxRpcTimeout(Duration.ofMillis(150L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setMaxRetryDelayDuration(Duration.ofMillis(150L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(150L)) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.3) .build())); @@ -164,12 +164,12 @@ public void setUp() throws IOException { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setInitialRetryDelay(Duration.ofMillis(10L)) - .setMaxRetryDelay(Duration.ofMillis(150L)) - .setMaxRpcTimeout(Duration.ofMillis(150L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setMaxRetryDelayDuration(Duration.ofMillis(150L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(150L)) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.3) .build())); @@ -178,12 +178,12 @@ public void setUp() throws IOException { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(20L)) - .setInitialRetryDelay(Duration.ofMillis(10L)) - .setMaxRetryDelay(Duration.ofMillis(150L)) - .setMaxRpcTimeout(Duration.ofMillis(150L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(20L)) + .setInitialRetryDelayDuration(Duration.ofMillis(10L)) + .setMaxRetryDelayDuration(Duration.ofMillis(150L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(150L)) .setMaxAttempts(10) - .setTotalTimeout(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.3) .setRpcTimeoutMultiplier(1.3) .build())); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java index 39f1ff180fa..676cb05eb07 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java @@ -86,6 +86,7 @@ import io.grpc.protobuf.lite.ProtoLiteUtils; import io.grpc.stub.StreamObserver; import java.math.BigDecimal; +import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -112,7 +113,6 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.LongStream; -import org.threeten.bp.Instant; /** * In-process mock implementation of a Cloud Spanner server. The user must specify the results the diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java index 4dc1da62e7b..9f3d0751471 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java @@ -98,7 +98,7 @@ public void createSpannerInstance() { // Set the maintainer to loop once every 1ms .setMultiplexedSessionMaintenanceLoopFrequency(Duration.ofMillis(1L)) // Set multiplexed sessions to be replaced once every 1ms - .setMultiplexedSessionMaintenanceDuration(org.threeten.bp.Duration.ofMillis(1L)) + .setMultiplexedSessionMaintenanceDuration(Duration.ofMillis(1L)) .setFailOnSessionLeak() .build()) .build() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientTest.java index 287fdd0bd0b..9a43ad07cdf 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientTest.java @@ -60,7 +60,7 @@ public void testMaintainer() { when(spanner.getOptions()).thenReturn(spannerOptions); when(spannerOptions.getSessionPoolOptions()).thenReturn(sessionPoolOptions); when(sessionPoolOptions.getMultiplexedSessionMaintenanceDuration()) - .thenReturn(org.threeten.bp.Duration.ofDays(7)); + .thenReturn(Duration.ofDays(7)); when(sessionPoolOptions.getMultiplexedSessionMaintenanceLoopFrequency()) .thenReturn(Duration.ofMinutes(10)); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionsBenchmark.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionsBenchmark.java index ff976141d96..c6f7e22f280 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionsBenchmark.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionsBenchmark.java @@ -95,7 +95,7 @@ public void setup() throws Exception { SessionPoolOptions.newBuilder() .setMinSessions(minSessions) .setMaxSessions(maxSessions) - .setWaitForMinSessions(org.threeten.bp.Duration.ofSeconds(20)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(20)) .setUseMultiplexedSession(true) .build()) .setHost(SERVER_URL) @@ -132,7 +132,7 @@ public void burstQueries(final BenchmarkState server) throws Exception { collectResultsAndPrint(service, results, TOTAL_READS_PER_RUN); } - private List runBenchmarksForSingleUseQueries( + private List runBenchmarksForSingleUseQueries( final BenchmarkState server, int numberOfOperations) { List results = new ArrayList<>(numberOfOperations); // Execute one query to make sure everything has been warmed up. @@ -150,7 +150,7 @@ private void executeWarmup(final BenchmarkState server) { } } - private java.time.Duration executeSingleUseQuery(final BenchmarkState server) { + private Duration executeSingleUseQuery(final BenchmarkState server) { Stopwatch watch = Stopwatch.createStarted(); try (ResultSet rs = server.client.singleUse().executeQuery(getRandomisedReadStatement())) { @@ -175,7 +175,7 @@ void collectResultsAndPrint( List>> results, int numOperationsPerThread) throws Exception { - final List collectResults = + final List collectResults = collectResults( service, results, numOperationsPerThread * PARALLEL_THREADS, Duration.ofMinutes(60)); printResults(collectResults); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenCensusApiTracerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenCensusApiTracerTest.java index 5e7a58cdb23..ad27c775729 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenCensusApiTracerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenCensusApiTracerTest.java @@ -41,6 +41,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.sdk.trace.data.SpanData; import java.lang.reflect.Modifier; +import java.time.Duration; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -55,7 +56,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(TracerTest.class) @RunWith(JUnit4.class) @@ -121,10 +121,10 @@ public void createSpannerInstance() { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofNanos(1L)) - .setMaxRetryDelay(Duration.ofNanos(1L)) + .setInitialRetryDelayDuration(Duration.ofNanos(1L)) + .setMaxRetryDelayDuration(Duration.ofNanos(1L)) .setRetryDelayMultiplier(1.0) - .setTotalTimeout(Duration.ofMinutes(10L)) + .setTotalTimeoutDuration(Duration.ofMinutes(10L)) .build())); spanner = builder @@ -133,7 +133,7 @@ public void createSpannerInstance() { .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofSeconds(5L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) .setFailOnSessionLeak() .build()) .setEnableApiTracing(true) @@ -359,7 +359,7 @@ public boolean isEnableApiTracing() { .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofSeconds(5L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) .setFailOnSessionLeak() .build()) .build() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryApiTracerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryApiTracerTest.java index 123f0f486a7..e4d25f1d9b3 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryApiTracerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryApiTracerTest.java @@ -47,6 +47,7 @@ import io.opentelemetry.sdk.trace.data.EventData; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; +import java.time.Duration; import java.util.List; import java.util.Map.Entry; import java.util.Objects; @@ -58,7 +59,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class OpenTelemetryApiTracerTest extends AbstractMockServerTest { @@ -121,10 +121,10 @@ public void createSpannerInstance() { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofNanos(1L)) - .setMaxRetryDelay(Duration.ofNanos(1L)) + .setInitialRetryDelayDuration(Duration.ofNanos(1L)) + .setMaxRetryDelayDuration(Duration.ofNanos(1L)) .setRetryDelayMultiplier(1.0) - .setTotalTimeout(Duration.ofMinutes(10L)) + .setTotalTimeoutDuration(Duration.ofMinutes(10L)) .build())); spanner = builder @@ -133,7 +133,7 @@ public void createSpannerInstance() { .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofSeconds(5L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) .setFailOnSessionLeak() .build()) .setEnableApiTracing(true) @@ -426,7 +426,7 @@ public boolean isEnableApiTracing() { .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofSeconds(5L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) .setFailOnSessionLeak() .build()) .build() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java index 9f65402c31f..7a14681d525 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetryBuiltInMetricsTracerTest.java @@ -43,6 +43,7 @@ import io.opentelemetry.sdk.metrics.data.LongPointData; import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.time.Duration; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -55,7 +56,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class OpenTelemetryBuiltInMetricsTracerTest extends AbstractMockServerTest { @@ -130,10 +130,10 @@ public void createSpannerInstance() { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofNanos(1L)) - .setMaxRetryDelay(Duration.ofNanos(1L)) + .setInitialRetryDelayDuration(Duration.ofNanos(1L)) + .setMaxRetryDelayDuration(Duration.ofNanos(1L)) .setRetryDelayMultiplier(1.0) - .setTotalTimeout(Duration.ofMinutes(10L)) + .setTotalTimeoutDuration(Duration.ofMinutes(10L)) .build())); spanner = builder @@ -142,7 +142,7 @@ public void createSpannerInstance() { .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofSeconds(5L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) .setFailOnSessionLeak() .build()) // Setting this to false so that Spanner Options does not register Metrics Tracer diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetrySpanTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetrySpanTest.java index a2aeb887733..f7f547ce357 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetrySpanTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OpenTelemetrySpanTest.java @@ -47,6 +47,7 @@ import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; import java.lang.reflect.Modifier; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -60,7 +61,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(TracerTest.class) @RunWith(JUnit4.class) @@ -237,7 +237,7 @@ public void setUp() throws Exception { .setSessionPoolOption( SessionPoolOptions.newBuilder() .setMinSessions(2) - .setWaitForMinSessions(Duration.ofSeconds(10)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(10)) .build()); spanner = builder.build().getService(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OperationTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OperationTest.java index 20fa72252f5..55211de1980 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OperationTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/OperationTest.java @@ -31,12 +31,12 @@ import com.google.rpc.Code; import com.google.rpc.Status; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; +import java.time.Duration; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.mockito.Mock; -import org.threeten.bp.Duration; /** Unit tests for {@link Operation}. */ @RunWith(JUnit4.class) @@ -160,8 +160,8 @@ public void waitForCompletes() { op = op.waitFor( - RetryOption.totalTimeout(Duration.ofSeconds(3)), - RetryOption.initialRetryDelay(Duration.ZERO)); + RetryOption.totalTimeoutDuration(Duration.ofSeconds(3)), + RetryOption.initialRetryDelayDuration(Duration.ZERO)); assertThat(op.getName()).isEqualTo("op1"); assertThat(op.isDone()).isTrue(); @@ -181,8 +181,8 @@ public void waitForTimeout() { SpannerException.class, () -> op.waitFor( - RetryOption.totalTimeout(Duration.ofMillis(100L)), - RetryOption.initialRetryDelay(Duration.ZERO))); + RetryOption.totalTimeoutDuration(Duration.ofMillis(100L)), + RetryOption.initialRetryDelayDuration(Duration.ZERO))); assertEquals(ErrorCode.DEADLINE_EXCEEDED, e.getErrorCode()); } } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/PartitionedDmlTransactionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/PartitionedDmlTransactionTest.java index 93e0e3eb3d0..68bfcca6146 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/PartitionedDmlTransactionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/PartitionedDmlTransactionTest.java @@ -47,6 +47,7 @@ import com.google.spanner.v1.Transaction; import com.google.spanner.v1.TransactionSelector; import io.grpc.Status.Code; +import java.time.Duration; import java.util.Collections; import java.util.Iterator; import java.util.concurrent.TimeUnit; @@ -59,7 +60,6 @@ import org.mockito.MockitoAnnotations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import org.threeten.bp.Duration; @SuppressWarnings("unchecked") @RunWith(JUnit4.class) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnDifferentGrpcChannelMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnDifferentGrpcChannelMockServerTest.java index b5e3e2e54cf..267c6077add 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnDifferentGrpcChannelMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnDifferentGrpcChannelMockServerTest.java @@ -42,6 +42,7 @@ import io.grpc.Status; import java.io.IOException; import java.net.InetSocketAddress; +import java.time.Duration; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -58,7 +59,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class RetryOnDifferentGrpcChannelMockServerTest extends AbstractMockServerTest { @@ -125,7 +125,9 @@ SpannerOptions.Builder createSpannerOptionsBuilder() { public void testReadWriteTransaction_retriesOnNewChannel() { SpannerOptions.Builder builder = createSpannerOptionsBuilder(); builder.setSessionPoolOption( - SessionPoolOptions.newBuilder().setWaitForMinSessions(Duration.ofSeconds(5L)).build()); + SessionPoolOptions.newBuilder() + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) + .build()); mockSpanner.setBeginTransactionExecutionTime( SimulatedExecutionTime.ofStickyException(Status.DEADLINE_EXCEEDED.asRuntimeException())); AtomicInteger attempts = new AtomicInteger(); @@ -159,7 +161,9 @@ public void testReadWriteTransaction_retriesOnNewChannel() { public void testReadWriteTransaction_stopsRetrying() { SpannerOptions.Builder builder = createSpannerOptionsBuilder(); builder.setSessionPoolOption( - SessionPoolOptions.newBuilder().setWaitForMinSessions(Duration.ofSeconds(5L)).build()); + SessionPoolOptions.newBuilder() + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) + .build()); mockSpanner.setBeginTransactionExecutionTime( SimulatedExecutionTime.ofStickyException(Status.DEADLINE_EXCEEDED.asRuntimeException())); @@ -200,7 +204,7 @@ public void testDenyListedChannelIsCleared() { SpannerOptions.Builder builder = createSpannerOptionsBuilder(); builder.setSessionPoolOption( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofSeconds(5)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5)) .setPoolMaintainerClock(clock) .build()); mockSpanner.setBeginTransactionExecutionTime( @@ -328,7 +332,9 @@ public void testSingleUseQuery_stopsRetrying() { public void testReadWriteTransaction_withGrpcContextDeadline_doesNotRetry() { SpannerOptions.Builder builder = createSpannerOptionsBuilder(); builder.setSessionPoolOption( - SessionPoolOptions.newBuilder().setWaitForMinSessions(Duration.ofSeconds(5L)).build()); + SessionPoolOptions.newBuilder() + .setWaitForMinSessionsDuration(Duration.ofSeconds(5L)) + .build()); mockSpanner.setBeginTransactionExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(500, 500)); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SamplesMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SamplesMockServerTest.java index d8dcfc10e05..61c8d0573d7 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SamplesMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SamplesMockServerTest.java @@ -23,10 +23,10 @@ import com.google.api.gax.rpc.StatusCode; import com.google.cloud.NoCredentials; import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult; +import java.time.Duration; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; /** Tests for samples that use an in-mem mock server instead of running on real Cloud Spanner. */ @RunWith(JUnit4.class) @@ -52,13 +52,13 @@ public void testSampleRetrySettings() { .setRetryableCodes(StatusCode.Code.UNAVAILABLE) .setRetrySettings( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500)) - .setMaxRetryDelay(Duration.ofSeconds(16)) + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setMaxRetryDelayDuration(Duration.ofSeconds(16)) .setRetryDelayMultiplier(1.5) - .setInitialRpcTimeout(Duration.ofNanos(1L)) - .setMaxRpcTimeout(Duration.ofNanos(1L)) + .setInitialRpcTimeoutDuration(Duration.ofNanos(1L)) + .setMaxRpcTimeoutDuration(Duration.ofNanos(1L)) .setRpcTimeoutMultiplier(1.0) - .setTotalTimeout(Duration.ofNanos(1L)) + .setTotalTimeoutDuration(Duration.ofNanos(1L)) .build()); // Create a Spanner client using the custom retry and timeout settings. try (Spanner spanner = builder.build().getService()) { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerBenchmark.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerBenchmark.java index 5f624cb6092..0370f5420e2 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerBenchmark.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerBenchmark.java @@ -27,6 +27,7 @@ import com.google.spanner.v1.BatchCreateSessionsRequest; import com.google.spanner.v1.BeginTransactionRequest; import com.google.spanner.v1.DeleteSessionRequest; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -46,7 +47,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; import org.openjdk.jmh.annotations.Warmup; -import org.threeten.bp.Duration; /** * Benchmarks for the SessionPoolMaintainer. Run these benchmarks from the command line like this: @@ -111,7 +111,7 @@ public void setup() throws Exception { .setSessionPoolOption( SessionPoolOptions.newBuilder() // Set idle timeout and loop frequency to very low values. - .setRemoveInactiveSessionAfter(Duration.ofMillis(idleTimeout)) + .setRemoveInactiveSessionAfterDuration(Duration.ofMillis(idleTimeout)) .setLoopFrequency(idleTimeout / 10) .build()) .build(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerMockServerTest.java index c74806161f6..99a773eeb0f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolMaintainerMockServerTest.java @@ -33,13 +33,13 @@ import com.google.spanner.v1.StructType.Field; import com.google.spanner.v1.Type; import com.google.spanner.v1.TypeCode; +import java.time.Duration; import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class SessionPoolMaintainerMockServerTest extends AbstractMockServerTest { @@ -80,7 +80,7 @@ public void createSpannerInstance() { .setSessionPoolOption( SessionPoolOptions.newBuilder() .setPoolMaintainerClock(clock) - .setWaitForMinSessions(Duration.ofSeconds(10L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(10L)) .setFailOnSessionLeak() .build()) .build() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolOptionsTest.java index 2e3e2c85da3..9e16b3fb1c8 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolOptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolOptionsTest.java @@ -25,6 +25,7 @@ import static org.junit.Assume.assumeFalse; import com.google.cloud.spanner.SessionPoolOptions.InactiveTransactionRemovalOptions; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -34,7 +35,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import org.threeten.bp.Duration; /** Unit tests for {@link com.google.cloud.spanner.SessionPoolOptions} */ @RunWith(Parameterized.class) @@ -223,10 +223,12 @@ public void setNegativeIdleTimeThreshold() { @Test public void setAcquireSessionTimeout() { SessionPoolOptions sessionPoolOptions1 = - SessionPoolOptions.newBuilder().setAcquireSessionTimeout(Duration.ofSeconds(20)).build(); + SessionPoolOptions.newBuilder() + .setAcquireSessionTimeoutDuration(Duration.ofSeconds(20)) + .build(); SessionPoolOptions sessionPoolOptions2 = SessionPoolOptions.newBuilder() - .setAcquireSessionTimeout(Duration.ofMillis(Long.MAX_VALUE)) + .setAcquireSessionTimeoutDuration(Duration.ofMillis(Long.MAX_VALUE)) .build(); assertEquals(Duration.ofSeconds(20), sessionPoolOptions1.getAcquireSessionTimeout()); @@ -235,13 +237,13 @@ public void setAcquireSessionTimeout() { @Test(expected = IllegalArgumentException.class) public void setAcquireSessionTimeout_valueLessThanLowerBound() { - SessionPoolOptions.newBuilder().setAcquireSessionTimeout(Duration.ofMillis(0)).build(); + SessionPoolOptions.newBuilder().setAcquireSessionTimeoutDuration(Duration.ofMillis(0)).build(); } @Test(expected = IllegalArgumentException.class) public void setAcquireSessionTimeout_valueMoreThanUpperBound() { SessionPoolOptions.newBuilder() - .setAcquireSessionTimeout(Duration.ofSeconds(Long.MAX_VALUE)) + .setAcquireSessionTimeoutDuration(Duration.ofSeconds(Long.MAX_VALUE)) .build(); } @@ -418,7 +420,7 @@ public void testToBuilder() { .build()); assertToBuilderRoundtrip( SessionPoolOptions.newBuilder() - .setRemoveInactiveSessionAfter( + .setRemoveInactiveSessionAfterDuration( Duration.ofMillis(ThreadLocalRandom.current().nextLong(10000))) .build()); assertToBuilderRoundtrip( @@ -438,11 +440,12 @@ public void testToBuilder() { .build()); assertToBuilderRoundtrip( SessionPoolOptions.newBuilder() - .setWaitForMinSessions(Duration.ofMillis(ThreadLocalRandom.current().nextLong(10000))) + .setWaitForMinSessionsDuration( + Duration.ofMillis(ThreadLocalRandom.current().nextLong(10000))) .build()); assertToBuilderRoundtrip( SessionPoolOptions.newBuilder() - .setAcquireSessionTimeout( + .setAcquireSessionTimeoutDuration( Duration.ofMillis(ThreadLocalRandom.current().nextLong(1, 10000))) .build()); assertToBuilderRoundtrip( diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java index 00339fd2946..0389410064a 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolTest.java @@ -105,6 +105,9 @@ import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; import java.io.PrintWriter; import java.io.StringWriter; +import java.time.Duration; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -133,9 +136,6 @@ import org.junit.runners.Parameterized.Parameters; import org.mockito.Mock; import org.mockito.Mockito; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; -import org.threeten.bp.temporal.ChronoUnit; /** Tests for SessionPool that mock out the underlying stub. */ @RunWith(Parameterized.class) @@ -314,7 +314,7 @@ public void poolLifo() { options .toBuilder() .setMinSessions(2) - .setWaitForMinSessions(Duration.ofSeconds(10L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(10L)) .build(); pool = createPool(); pool.maybeWaitOnMinSessions(); @@ -350,7 +350,7 @@ public void poolFifo() throws Exception { options .toBuilder() .setMinSessions(2) - .setWaitForMinSessions(Duration.ofSeconds(10L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(10L)) .build(); pool = createPool(); pool.maybeWaitOnMinSessions(); @@ -398,7 +398,7 @@ public void poolAllPositions() throws Exception { .toBuilder() .setMinSessions(numSessions) .setMaxSessions(numSessions) - .setWaitForMinSessions(Duration.ofSeconds(10L)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(10L)) .build(); pool = createPool(); pool.maybeWaitOnMinSessions(); @@ -2212,7 +2212,7 @@ public void testWaitOnMinSessionsWhenSessionsAreCreatedBeforeTimeout() { SessionPoolOptions.newBuilder() .setMinSessions(minSessions) .setMaxSessions(minSessions + 1) - .setWaitForMinSessions(Duration.ofSeconds(5)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(5)) .build(); doAnswer( invocation -> @@ -2241,7 +2241,7 @@ public void testWaitOnMinSessionsThrowsExceptionWhenTimeoutIsReached() { SessionPoolOptions.newBuilder() .setMinSessions(minSessions + 1) .setMaxSessions(minSessions + 1) - .setWaitForMinSessions(Duration.ofMillis(100)) + .setWaitForMinSessionsDuration(Duration.ofMillis(100)) .build(); pool = createPool(new FakeClock(), new FakeMetricRegistry(), SPANNER_DEFAULT_LABEL_VALUES); pool.maybeWaitOnMinSessions(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanExceptionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanExceptionTest.java index 2f16cd7c922..d09e65dfc0b 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanExceptionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanExceptionTest.java @@ -22,6 +22,7 @@ import com.google.cloud.NoCredentials; import com.google.cloud.spanner.connection.AbstractMockServerTest; import io.grpc.ManagedChannelBuilder; +import java.time.Duration; import java.util.ArrayList; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -31,7 +32,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class SpanExceptionTest extends AbstractMockServerTest { @@ -47,7 +47,7 @@ public void testReadOnlyTransaction() throws InterruptedException, ExecutionExce .setSessionPoolOption( SessionPoolOptions.newBuilder() .setMaxSessions(10) - .setAcquireSessionTimeout(Duration.ofMillis(10)) + .setAcquireSessionTimeoutDuration(Duration.ofMillis(10)) // .setAcquireSessionTimeout(null) .build()) .build() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanTest.java index ffe9e584de3..b87b7ba9752 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanTest.java @@ -45,6 +45,7 @@ import io.opentelemetry.sdk.trace.SdkTracerProvider; import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; import java.lang.reflect.Modifier; +import java.time.Duration; import java.util.List; import java.util.Map; import java.util.concurrent.ScheduledThreadPoolExecutor; @@ -58,7 +59,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(TracerTest.class) @RunWith(JUnit4.class) @@ -202,7 +202,7 @@ public void setUp() throws Exception { .setSessionPoolOption( SessionPoolOptions.newBuilder() .setMinSessions(2) - .setWaitForMinSessions(Duration.ofSeconds(10)) + .setWaitForMinSessionsDuration(Duration.ofSeconds(10)) .build()); spanner = builder.build().getService(); @@ -211,21 +211,21 @@ public void setUp() throws Exception { final RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(75L)) - .setMaxRpcTimeout(Duration.ofMillis(75L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(75L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(75L)) .setMaxAttempts(3) - .setTotalTimeout(Duration.ofMillis(200L)) + .setTotalTimeoutDuration(Duration.ofMillis(200L)) .build(); RetrySettings commitRetrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) .setMaxAttempts(1) - .setTotalTimeout(Duration.ofMillis(20000L)) + .setTotalTimeoutDuration(Duration.ofMillis(20000L)) .build(); builder .getSpannerStubSettingsBuilder() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerGaxRetryTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerGaxRetryTest.java index 90d76c6a2bb..8ce858e77d7 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerGaxRetryTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerGaxRetryTest.java @@ -41,6 +41,7 @@ import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; +import java.time.Duration; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -51,7 +52,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class SpannerGaxRetryTest { @@ -151,7 +151,10 @@ public void setUp() throws Exception { // wait time is for multiplexed sessions if (sessionPoolOptions.getUseMultiplexedSession()) { sessionPoolOptions = - sessionPoolOptions.toBuilder().setWaitForMinSessions(Duration.ofSeconds(5)).build(); + sessionPoolOptions + .toBuilder() + .setWaitForMinSessionsDuration(Duration.ofSeconds(5)) + .build(); } builder.setSessionPoolOption(sessionPoolOptions); // Create one client with default timeout values and one with short timeout values specifically @@ -161,21 +164,21 @@ public void setUp() throws Exception { final RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(175L)) - .setMaxRpcTimeout(Duration.ofMillis(175L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(175L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(175L)) .setMaxAttempts(3) - .setTotalTimeout(Duration.ofMillis(200L)) + .setTotalTimeoutDuration(Duration.ofMillis(200L)) .build(); RetrySettings commitRetrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) .setMaxAttempts(1) - .setTotalTimeout(Duration.ofMillis(20000L)) + .setTotalTimeoutDuration(Duration.ofMillis(20000L)) .build(); builder .getSpannerStubSettingsBuilder() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java index 7b891fdb7a9..cdab8e1df8b 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java @@ -66,6 +66,7 @@ import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.metrics.SdkMeterProvider; import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.time.Duration; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -82,7 +83,6 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.mockito.Mockito; -import org.threeten.bp.Duration; /** Unit tests for {@link com.google.cloud.spanner.SpannerOptions}. */ @RunWith(JUnit4.class) @@ -151,40 +151,40 @@ public void builder() { public void testSpannerDefaultRetrySettings() { RetrySettings witRetryPolicy1 = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(250L)) + .setInitialRetryDelayDuration(Duration.ofMillis(250L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(32000L)) - .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(3600000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) .build(); RetrySettings witRetryPolicy2 = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(250L)) + .setInitialRetryDelayDuration(Duration.ofMillis(250L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(32000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); RetrySettings witRetryPolicy3 = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(250L)) + .setInitialRetryDelayDuration(Duration.ofMillis(250L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(32000L)) - .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(30000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(30000L)) - .setTotalTimeout(Duration.ofMillis(30000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(30000L)) + .setTotalTimeoutDuration(Duration.ofMillis(30000L)) .build(); RetrySettings noRetry1 = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(3600000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) .build(); SpannerOptions options = SpannerOptions.newBuilder().setProjectId("test-project").build(); SpannerStubSettings stubSettings = options.getSpannerStubSettings(); @@ -226,13 +226,13 @@ public void testSpannerDefaultRetrySettings() { public void testSpannerCustomRetrySettings() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofSeconds(9999L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(9999L)) .setRetryDelayMultiplier(9999.99D) - .setMaxRetryDelay(Duration.ofSeconds(9999L)) - .setInitialRpcTimeout(Duration.ofSeconds(9999L)) + .setMaxRetryDelayDuration(Duration.ofSeconds(9999L)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(9999L)) .setRpcTimeoutMultiplier(9999.99D) - .setMaxRpcTimeout(Duration.ofSeconds(9999L)) - .setTotalTimeout(Duration.ofSeconds(9999L)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(9999L)) + .setTotalTimeoutDuration(Duration.ofSeconds(9999L)) .build(); SpannerOptions.Builder builder = SpannerOptions.newBuilder().setProjectId("test-project"); SpannerStubSettings.Builder stubSettingsBuilder = builder.getSpannerStubSettingsBuilder(); @@ -294,30 +294,30 @@ public void testSpannerCustomRetrySettings() { public void testDatabaseAdminDefaultRetrySettings() { RetrySettings withRetryPolicy1 = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(32000L)) - .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(3600000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) .build(); RetrySettings withRetryPolicy2 = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(32000L)) - .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(30000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(30000L)) - .setTotalTimeout(Duration.ofMillis(30000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(30000L)) + .setTotalTimeoutDuration(Duration.ofMillis(30000L)) .build(); RetrySettings noRetryPolicy2 = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(30000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(30000L)) - .setTotalTimeout(Duration.ofMillis(30000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(30000L)) + .setTotalTimeoutDuration(Duration.ofMillis(30000L)) .build(); SpannerOptions options = SpannerOptions.newBuilder().setProjectId("test-project").build(); DatabaseAdminStubSettings stubSettings = options.getDatabaseAdminStubSettings(); @@ -347,13 +347,13 @@ public void testDatabaseAdminDefaultRetrySettings() { public void testDatabaseAdminCustomRetrySettings() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofSeconds(9999L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(9999L)) .setRetryDelayMultiplier(9999.99D) - .setMaxRetryDelay(Duration.ofSeconds(9999L)) - .setInitialRpcTimeout(Duration.ofSeconds(9999L)) + .setMaxRetryDelayDuration(Duration.ofSeconds(9999L)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(9999L)) .setRpcTimeoutMultiplier(9999.99D) - .setMaxRpcTimeout(Duration.ofSeconds(9999L)) - .setTotalTimeout(Duration.ofSeconds(9999L)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(9999L)) + .setTotalTimeoutDuration(Duration.ofSeconds(9999L)) .build(); SpannerOptions.Builder builder = SpannerOptions.newBuilder().setProjectId("test-project"); DatabaseAdminStubSettings.Builder stubSettingsBuilder = @@ -384,37 +384,37 @@ public void testDatabaseAdminCustomRetrySettings() { public void testInstanceAdminDefaultRetrySettings() { RetrySettings withRetryPolicy1 = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(32000L)) - .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(3600000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) .build(); RetrySettings withRetryPolicy2 = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(32000L)) - .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(30000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(30000L)) - .setTotalTimeout(Duration.ofMillis(30000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(30000L)) + .setTotalTimeoutDuration(Duration.ofMillis(30000L)) .build(); RetrySettings noRetryPolicy1 = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(3600000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) .build(); RetrySettings noRetryPolicy2 = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(30000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(30000L)) - .setTotalTimeout(Duration.ofMillis(30000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(30000L)) + .setTotalTimeoutDuration(Duration.ofMillis(30000L)) .build(); SpannerOptions options = SpannerOptions.newBuilder().setProjectId("test-project").build(); InstanceAdminStubSettings stubSettings = options.getInstanceAdminStubSettings(); @@ -451,13 +451,13 @@ public void testInstanceAdminDefaultRetrySettings() { public void testInstanceAdminCustomRetrySettings() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofSeconds(9999L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(9999L)) .setRetryDelayMultiplier(9999.99D) - .setMaxRetryDelay(Duration.ofSeconds(9999L)) - .setInitialRpcTimeout(Duration.ofSeconds(9999L)) + .setMaxRetryDelayDuration(Duration.ofSeconds(9999L)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(9999L)) .setRpcTimeoutMultiplier(9999.99D) - .setMaxRpcTimeout(Duration.ofSeconds(9999L)) - .setTotalTimeout(Duration.ofSeconds(9999L)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(9999L)) + .setTotalTimeoutDuration(Duration.ofSeconds(9999L)) .build(); SpannerOptions.Builder builder = SpannerOptions.newBuilder().setProjectId("test-project"); InstanceAdminStubSettings.Builder stubSettingsBuilder = @@ -879,14 +879,14 @@ public void testSpannerCallContextTimeoutConfigurator_NullValues() { public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { SpannerCallContextTimeoutConfigurator configurator = SpannerCallContextTimeoutConfigurator.create(); - configurator.withBatchUpdateTimeout(Duration.ofSeconds(1L)); - configurator.withCommitTimeout(Duration.ofSeconds(2L)); - configurator.withExecuteQueryTimeout(Duration.ofSeconds(3L)); - configurator.withExecuteUpdateTimeout(Duration.ofSeconds(4L)); - configurator.withPartitionQueryTimeout(Duration.ofSeconds(5L)); - configurator.withPartitionReadTimeout(Duration.ofSeconds(6L)); - configurator.withReadTimeout(Duration.ofSeconds(7L)); - configurator.withRollbackTimeout(Duration.ofSeconds(8L)); + configurator.withBatchUpdateTimeoutDuration(Duration.ofSeconds(1L)); + configurator.withCommitTimeoutDuration(Duration.ofSeconds(2L)); + configurator.withExecuteQueryTimeoutDuration(Duration.ofSeconds(3L)); + configurator.withExecuteUpdateTimeoutDuration(Duration.ofSeconds(4L)); + configurator.withPartitionQueryTimeoutDuration(Duration.ofSeconds(5L)); + configurator.withPartitionReadTimeoutDuration(Duration.ofSeconds(6L)); + configurator.withReadTimeoutDuration(Duration.ofSeconds(7L)); + configurator.withRollbackTimeoutDuration(Duration.ofSeconds(8L)); ApiCallContext inputCallContext = GrpcCallContext.createDefault(); @@ -932,7 +932,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, CommitRequest.getDefaultInstance(), SpannerGrpc.getCommitMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(2L)); assertThat( configurator @@ -940,7 +940,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, RollbackRequest.getDefaultInstance(), SpannerGrpc.getRollbackMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(8L)); assertNull( @@ -954,7 +954,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, ExecuteSqlRequest.getDefaultInstance(), SpannerGrpc.getExecuteStreamingSqlMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(3L)); assertThat( configurator @@ -962,7 +962,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, ExecuteBatchDmlRequest.getDefaultInstance(), SpannerGrpc.getExecuteBatchDmlMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(1L)); assertNull( configurator.configure( @@ -973,7 +973,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, ReadRequest.getDefaultInstance(), SpannerGrpc.getStreamingReadMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(7L)); assertThat( @@ -982,7 +982,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, PartitionQueryRequest.getDefaultInstance(), SpannerGrpc.getPartitionQueryMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(5L)); assertThat( configurator @@ -990,7 +990,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, PartitionReadRequest.getDefaultInstance(), SpannerGrpc.getPartitionReadMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(6L)); } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java index 24817c84450..f55c55c6c93 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java @@ -46,6 +46,7 @@ import com.google.spanner.v1.CommitRequest; import com.google.spanner.v1.ExecuteSqlRequest; import io.grpc.Status; +import java.time.Duration; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -58,7 +59,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class StatementTimeoutTest extends AbstractMockServerTest { @@ -97,10 +97,10 @@ protected ITConnection createConnection() { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) - .setMaxRetryDelay(Duration.ofMillis(1L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(Duration.ofMillis(1L)) .setRetryDelayMultiplier(1.0) - .setTotalTimeout(Duration.ofMinutes(10L)) + .setTotalTimeoutDuration(Duration.ofMinutes(10L)) .build()))) .build(); return createITConnection(options); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBuiltInMetricsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBuiltInMetricsTest.java index 9ff7e06e813..258c1230709 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBuiltInMetricsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBuiltInMetricsTest.java @@ -31,6 +31,8 @@ import com.google.monitoring.v3.TimeInterval; import com.google.protobuf.util.Timestamps; import java.io.IOException; +import java.time.Duration; +import java.time.Instant; import java.util.concurrent.TimeUnit; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -39,8 +41,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; @Category(ParallelIntegrationTest.class) @RunWith(JUnit4.class) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITCommitTimestampTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITCommitTimestampTest.java index 5a3b5c14707..70c9cb3757a 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITCommitTimestampTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITCommitTimestampTest.java @@ -36,6 +36,8 @@ import com.google.cloud.spanner.connection.ConnectionOptions; import com.google.cloud.spanner.testing.RemoteSpannerHelper; import com.google.common.collect.ImmutableList; +import java.time.Duration; +import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.concurrent.ExecutionException; @@ -47,8 +49,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; /** Integration test for commit timestamp of Cloud Spanner. */ @Category(ParallelIntegrationTest.class) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java index 7338c76f07e..634f7919658 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java @@ -41,6 +41,7 @@ import com.google.common.collect.ImmutableList; import com.google.protobuf.ListValue; import com.google.protobuf.NullValue; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -57,7 +58,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(ParallelIntegrationTest.class) @RunWith(JUnit4.class) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java index b5fc084a54c..bacb4718da0 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java @@ -35,6 +35,7 @@ import com.google.cloud.spanner.testing.RemoteSpannerHelper; import com.google.common.collect.ImmutableList; import java.math.BigDecimal; +import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -47,7 +48,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(ParallelIntegrationTest.class) @RunWith(JUnit4.class) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrCreateDatabaseTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrCreateDatabaseTest.java index f9fa081e413..6056b857b18 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrCreateDatabaseTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrCreateDatabaseTest.java @@ -30,6 +30,7 @@ import com.google.cloud.spanner.ParallelIntegrationTest; import com.google.cloud.spanner.SpannerException; import com.google.cloud.spanner.testing.RemoteSpannerHelper; +import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -42,7 +43,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(ParallelIntegrationTest.class) @RunWith(JUnit4.class) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrUpdateDatabaseTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrUpdateDatabaseTest.java index fa756b2f277..c730a7fa36c 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrUpdateDatabaseTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrUpdateDatabaseTest.java @@ -35,6 +35,7 @@ import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.testing.RemoteSpannerHelper; import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata; +import java.time.Duration; import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; @@ -45,7 +46,6 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; @Category(ParallelIntegrationTest.class) @RunWith(JUnit4.class) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpcTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpcTest.java index b3ff3b8f1c2..a0f236b0fd7 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpcTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpcTest.java @@ -85,6 +85,7 @@ import io.opentelemetry.sdk.trace.samplers.Sampler; import java.io.IOException; import java.net.InetSocketAddress; +import java.time.Duration; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -96,7 +97,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; -import org.threeten.bp.Duration; @RunWith(Parameterized.class) public class GapicSpannerRpcTest { @@ -386,7 +386,7 @@ public ApiCallContext configure( // Sequence numbers are only assigned for DML statements, which means that // this is an update statement. if (sqlRequest.getSeqno() > 0L) { - return context.withTimeout(timeoutHolder.timeout); + return context.withTimeoutDuration(timeoutHolder.timeout); } } return null; From df03ae65b4daa8d2986b9c92e851df35d995a6c7 Mon Sep 17 00:00:00 2001 From: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:57:08 +0530 Subject: [PATCH 03/43] =?UTF-8?q?chore(spanner):=20support=20multiplexed?= =?UTF-8?q?=20session=20for=20rw=20transactions=20in=20ex=E2=80=A6=20(#347?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(spanner): support multiplexed session for rw transactions in executor * chore(spanner): lint fix --- .../cloud/executor/spanner/CloudClientExecutor.java | 11 ++++++++--- .../cloud/spanner/SessionPoolOptionsHelper.java | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index 69c0d4d3ea9..c82b6306eb8 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -829,10 +829,15 @@ private synchronized Spanner getClient(long timeoutSeconds, boolean useMultiplex com.google.cloud.spanner.SessionPoolOptions.Builder poolOptionsBuilder = com.google.cloud.spanner.SessionPoolOptions.newBuilder(); - SessionPoolOptionsHelper.setUseMultiplexedSession( - com.google.cloud.spanner.SessionPoolOptions.newBuilder(), useMultiplexedSession); + SessionPoolOptionsHelper.setUseMultiplexedSession(poolOptionsBuilder, useMultiplexedSession); SessionPoolOptionsHelper.setUseMultiplexedSessionBlindWrite( - com.google.cloud.spanner.SessionPoolOptions.newBuilder(), useMultiplexedSession); + poolOptionsBuilder, useMultiplexedSession); + SessionPoolOptionsHelper.setUseMultiplexedSessionForRW( + poolOptionsBuilder, useMultiplexedSession); + LOGGER.log( + Level.INFO, + String.format( + "Using multiplexed sessions for read-write transactions: %s", useMultiplexedSession)); com.google.cloud.spanner.SessionPoolOptions sessionPoolOptions = poolOptionsBuilder.build(); // Cloud Spanner Client does not support global retry settings, // Thus, we need to add retry settings to each individual stub. diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java index dafaa4a1f31..8e085947711 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java @@ -38,4 +38,10 @@ public static SessionPoolOptions.Builder setUseMultiplexedSessionBlindWrite( return sessionPoolOptionsBuilder.setUseMultiplexedSessionBlindWrite( useMultiplexedSessionBlindWrite); } + + // TODO: Remove when multiplexed session for read write is released. + public static SessionPoolOptions.Builder setUseMultiplexedSessionForRW( + SessionPoolOptions.Builder sessionPoolOptionsBuilder, boolean useMultiplexedSessionForRW) { + return sessionPoolOptionsBuilder.setUseMultiplexedSessionForRW(useMultiplexedSessionForRW); + } } From 27c2068e46028618e751715c312dec48bdeee3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Sun, 8 Dec 2024 11:34:44 +0100 Subject: [PATCH 04/43] chore: remove unused code and fix some warnings (#3533) --- .../spanner/connection/ConnectionImpl.java | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java index 1b94702061c..d7a1052d1c1 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java @@ -94,8 +94,8 @@ import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.Tracer; import java.io.File; -import java.io.FileInputStream; import java.io.InputStream; +import java.nio.file.Files; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; @@ -109,7 +109,6 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; @@ -130,9 +129,6 @@ class ConnectionImpl implements Connection { "This method may only be called while in autocommit mode"; private static final String NOT_ALLOWED_IN_AUTOCOMMIT = "This method may not be called while in autocommit mode"; - - private static final ParsedStatement BEGIN_STATEMENT = - AbstractStatementParser.getInstance(Dialect.GOOGLE_STANDARD_SQL).parse(Statement.of("BEGIN")); private static final ParsedStatement COMMIT_STATEMENT = AbstractStatementParser.getInstance(Dialect.GOOGLE_STANDARD_SQL) .parse(Statement.of("COMMIT")); @@ -145,9 +141,6 @@ class ConnectionImpl implements Connection { private static final ParsedStatement START_BATCH_DML_STATEMENT = AbstractStatementParser.getInstance(Dialect.GOOGLE_STANDARD_SQL) .parse(Statement.of("START BATCH DML")); - private static final ParsedStatement RUN_BATCH_STATEMENT = - AbstractStatementParser.getInstance(Dialect.GOOGLE_STANDARD_SQL) - .parse(Statement.of("RUN BATCH")); // These SAVEPOINT statements are used as sentinels to recognize the start/rollback/release of a // savepoint. @@ -185,17 +178,6 @@ private LeakedConnectionException() { private final ConnectionStatementExecutor connectionStatementExecutor = new ConnectionStatementExecutorImpl(this); - /** Simple thread factory that is used for fire-and-forget rollbacks. */ - static final class DaemonThreadFactory implements ThreadFactory { - @Override - public Thread newThread(Runnable r) { - Thread t = new Thread(r); - t.setName("connection-rollback-executor"); - t.setDaemon(true); - return t; - } - } - /** * Statements are executed using a separate thread in order to be able to cancel these. Statements * are automatically cancelled if the configured {@link ConnectionImpl#statementTimeout} is @@ -507,11 +489,6 @@ UnitOfWorkType getUnitOfWorkType() { return unitOfWorkType; } - /** Get the current batch mode of this connection. */ - BatchMode getBatchMode() { - return batchMode; - } - /** @return true if this connection is in a batch. */ boolean isInBatch() { return batchMode != BatchMode.NONE; @@ -900,7 +877,7 @@ public byte[] getProtoDescriptors() { String.format( "File %s is not a valid proto descriptors file", this.protoDescriptorsFilePath)); } - InputStream pdStream = new FileInputStream(protoDescriptorsFile); + InputStream pdStream = Files.newInputStream(protoDescriptorsFile.toPath()); this.protoDescriptors = ByteArray.copyFrom(pdStream).toByteArray(); } catch (Exception exception) { throw SpannerExceptionFactory.newSpannerException(exception); @@ -1420,7 +1397,7 @@ public ResultSet executeQuery(Statement query, QueryOption... options) { @Override public AsyncResultSet executeQueryAsync(Statement query, QueryOption... options) { - return parseAndExecuteQueryAsync(CallType.ASYNC, query, AnalyzeMode.NONE, options); + return parseAndExecuteQueryAsync(query, options); } @Override @@ -1620,8 +1597,7 @@ private ResultSet parseAndExecuteQuery( + parsedStatement.getSqlWithoutComments()); } - private AsyncResultSet parseAndExecuteQueryAsync( - CallType callType, Statement query, AnalyzeMode analyzeMode, QueryOption... options) { + private AsyncResultSet parseAndExecuteQueryAsync(Statement query, QueryOption... options) { Preconditions.checkNotNull(query); ConnectionPreconditions.checkState(!isClosed(), CLOSED_ERROR_MSG); ParsedStatement parsedStatement = getStatementParser().parse(query, buildQueryOptions()); @@ -1636,7 +1612,8 @@ private AsyncResultSet parseAndExecuteQueryAsync( spanner.getAsyncExecutorProvider(), options); case QUERY: - return internalExecuteQueryAsync(callType, parsedStatement, analyzeMode, options); + return internalExecuteQueryAsync( + CallType.ASYNC, parsedStatement, AnalyzeMode.NONE, options); case UPDATE: if (parsedStatement.hasReturningClause()) { // Cannot execute DML statement with returning clause in read-only mode or in @@ -1649,7 +1626,8 @@ private AsyncResultSet parseAndExecuteQueryAsync( "DML statement with returning clause cannot be executed in read-only mode: " + parsedStatement.getSqlWithoutComments()); } - return internalExecuteQueryAsync(callType, parsedStatement, analyzeMode, options); + return internalExecuteQueryAsync( + CallType.ASYNC, parsedStatement, AnalyzeMode.NONE, options); } case DDL: case UNKNOWN: From b060dfd29616832185b69e2e33874f6b54a7de89 Mon Sep 17 00:00:00 2001 From: Pratick Chokhani Date: Mon, 9 Dec 2024 21:11:11 +0530 Subject: [PATCH 05/43] feat(spanner): support multiplexed session for Partitioned operations (#3231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(spanner): support multiplexed session for Partitioned read or query. * chore(spanner): lint fixes * feat(spanner): support multiplexed session for Partitioned DML operations. * lint(spanner): javadoc fixes. * feat(spanner): Updated unit tests of Partitioned operations for Multiplexed Session. * feat(spanner): Updated unit tests of Partitioned operations for Multiplexed Session. * lint(spanner): Apply suggestions from code review Co-authored-by: Knut Olav Løite * lint(spanner): Apply suggestions from code review Co-authored-by: Knut Olav Løite * feat(spanner): Modified BatchClientImpl to store multiplexed session and create fresh session after expiration date. * feat(spanner): Removed env variable for Partitioned Ops ensuring that Multiplexed Session for Partitioned Ops is not available to customers. * lint(spanner): Removed unused variables. --------- Co-authored-by: Knut Olav Løite --- .github/workflows/ci.yaml | 2 + ...tegration-multiplexed-sessions-enabled.cfg | 5 ++ .../spanner/SessionPoolOptionsHelper.java | 8 +++ ...tractMultiplexedSessionDatabaseClient.java | 6 -- .../google/cloud/spanner/BatchClientImpl.java | 57 +++++++++++++++++- .../cloud/spanner/DatabaseClientImpl.java | 13 ++++ .../DelayedMultiplexedSessionTransaction.java | 13 ++++ .../MultiplexedSessionDatabaseClient.java | 7 +++ .../google/cloud/spanner/SessionClient.java | 45 ++++++-------- .../cloud/spanner/SessionPoolOptions.java | 59 ++++++++++++++++--- .../com/google/cloud/spanner/SpannerImpl.java | 27 ++++++++- .../cloud/spanner/BatchClientImplTest.java | 29 +++++++-- .../cloud/spanner/BatchTransactionIdTest.java | 3 + .../IntegrationTestWithClosedSessionsEnv.java | 1 + ...edSessionDatabaseClientMockServerTest.java | 1 + .../RetryOnInvalidatedSessionTest.java | 3 + 16 files changed, 230 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7eca4c6d5f0..ee28d7f8a66 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,6 +53,7 @@ jobs: env: JOB_TYPE: test GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true + GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS: true units-java8: # Building using Java 17 and run the tests with Java 8 runtime name: "units (8)" @@ -92,6 +93,7 @@ jobs: env: JOB_TYPE: test GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS: true + GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS: true windows: runs-on: windows-latest steps: diff --git a/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg b/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg index 771405de422..49edd2e8df6 100644 --- a/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg +++ b/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg @@ -36,3 +36,8 @@ env_vars: { key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS" value: "true" } + +env_vars: { + key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS" + value: "true" +} diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java index 8e085947711..f19cb8f4a2f 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java @@ -44,4 +44,12 @@ public static SessionPoolOptions.Builder setUseMultiplexedSessionForRW( SessionPoolOptions.Builder sessionPoolOptionsBuilder, boolean useMultiplexedSessionForRW) { return sessionPoolOptionsBuilder.setUseMultiplexedSessionForRW(useMultiplexedSessionForRW); } + + // TODO: Remove when multiplexed session for partitioned operations are released. + public static SessionPoolOptions.Builder setUseMultiplexedSessionForPartitionedOperations( + SessionPoolOptions.Builder sessionPoolOptionsBuilder, + boolean useMultiplexedSessionForPartitionedOps) { + return sessionPoolOptionsBuilder.setUseMultiplexedSessionPartitionedOps( + useMultiplexedSessionForPartitionedOps); + } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractMultiplexedSessionDatabaseClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractMultiplexedSessionDatabaseClient.java index ebfb0e0a774..10ab997d88a 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractMultiplexedSessionDatabaseClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractMultiplexedSessionDatabaseClient.java @@ -19,7 +19,6 @@ import com.google.api.gax.rpc.ServerStream; import com.google.cloud.Timestamp; import com.google.cloud.spanner.Options.TransactionOption; -import com.google.cloud.spanner.Options.UpdateOption; import com.google.spanner.v1.BatchWriteResponse; /** @@ -51,9 +50,4 @@ public ServerStream batchWriteAtLeastOnce( throws SpannerException { throw new UnsupportedOperationException(); } - - @Override - public long executePartitionedUpdate(Statement stmt, UpdateOption... options) { - throw new UnsupportedOperationException(); - } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BatchClientImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BatchClientImpl.java index 3d886dd383b..a250fd5ba39 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BatchClientImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/BatchClientImpl.java @@ -30,16 +30,50 @@ import com.google.spanner.v1.PartitionReadRequest; import com.google.spanner.v1.PartitionResponse; import com.google.spanner.v1.TransactionSelector; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; import java.util.List; import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.ReentrantLock; import javax.annotation.Nullable; +import javax.annotation.concurrent.GuardedBy; /** Default implementation for Batch Client interface. */ public class BatchClientImpl implements BatchClient { private final SessionClient sessionClient; - BatchClientImpl(SessionClient sessionClient) { + private final boolean isMultiplexedSessionEnabled; + + /** Lock to protect the multiplexed session. */ + private final ReentrantLock multiplexedSessionLock = new ReentrantLock(); + + /** The duration before we try to replace the multiplexed session. The default is 7 days. */ + private final Duration sessionExpirationDuration; + + /** The expiration date/time of the current multiplexed session. */ + @GuardedBy("multiplexedSessionLock") + private final AtomicReference expirationDate; + + @GuardedBy("multiplexedSessionLock") + private final AtomicReference multiplexedSessionReference; + + BatchClientImpl(SessionClient sessionClient, boolean isMultiplexedSessionEnabled) { this.sessionClient = checkNotNull(sessionClient); + this.isMultiplexedSessionEnabled = isMultiplexedSessionEnabled; + this.sessionExpirationDuration = + Duration.ofMillis( + sessionClient + .getSpanner() + .getOptions() + .getSessionPoolOptions() + .getMultiplexedSessionMaintenanceDuration() + .toMillis()); + // Initialize the expiration date to the start of time to avoid unnecessary null checks. + // This also ensured that a new session is created on first request. + this.expirationDate = new AtomicReference<>(Instant.MIN); + this.multiplexedSessionReference = new AtomicReference<>(); } @Override @@ -50,7 +84,12 @@ public String getDatabaseRole() { @Override public BatchReadOnlyTransaction batchReadOnlyTransaction(TimestampBound bound) { - SessionImpl session = sessionClient.createSession(); + SessionImpl session; + if (isMultiplexedSessionEnabled) { + session = getMultiplexedSession(); + } else { + session = sessionClient.createSession(); + } return new BatchReadOnlyTransactionImpl( MultiUseReadOnlyTransaction.newBuilder() .setSession(session) @@ -92,6 +131,20 @@ public BatchReadOnlyTransaction batchReadOnlyTransaction(BatchTransactionId batc batchTransactionId); } + private SessionImpl getMultiplexedSession() { + this.multiplexedSessionLock.lock(); + try { + if (Clock.systemUTC().instant().isAfter(this.expirationDate.get()) + || this.multiplexedSessionReference.get() == null) { + this.multiplexedSessionReference.set(this.sessionClient.createMultiplexedSession()); + this.expirationDate.set(Clock.systemUTC().instant().plus(this.sessionExpirationDuration)); + } + return this.multiplexedSessionReference.get(); + } finally { + this.multiplexedSessionLock.unlock(); + } + } + private static class BatchReadOnlyTransactionImpl extends MultiUseReadOnlyTransaction implements BatchReadOnlyTransaction { private final String sessionName; diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java index d7f16f89524..f571354dacb 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java @@ -36,6 +36,7 @@ class DatabaseClientImpl implements DatabaseClient { @VisibleForTesting final String clientId; @VisibleForTesting final SessionPool pool; @VisibleForTesting final MultiplexedSessionDatabaseClient multiplexedSessionDatabaseClient; + @VisibleForTesting final boolean useMultiplexedSessionPartitionedOps; @VisibleForTesting final boolean useMultiplexedSessionForRW; final boolean useMultiplexedSessionBlindWrite; @@ -47,6 +48,7 @@ class DatabaseClientImpl implements DatabaseClient { pool, /* useMultiplexedSessionBlindWrite = */ false, /* multiplexedSessionDatabaseClient = */ null, + /* useMultiplexedSessionPartitionedOps= */ false, tracer, /* useMultiplexedSessionForRW = */ false); } @@ -58,6 +60,7 @@ class DatabaseClientImpl implements DatabaseClient { pool, /* useMultiplexedSessionBlindWrite = */ false, /* multiplexedSessionDatabaseClient = */ null, + /* useMultiplexedSessionPartitionedOps= */ false, tracer, /* useMultiplexedSessionForRW = */ false); } @@ -67,12 +70,14 @@ class DatabaseClientImpl implements DatabaseClient { SessionPool pool, boolean useMultiplexedSessionBlindWrite, @Nullable MultiplexedSessionDatabaseClient multiplexedSessionDatabaseClient, + boolean useMultiplexedSessionPartitionedOps, TraceWrapper tracer, boolean useMultiplexedSessionForRW) { this.clientId = clientId; this.pool = pool; this.useMultiplexedSessionBlindWrite = useMultiplexedSessionBlindWrite; this.multiplexedSessionDatabaseClient = multiplexedSessionDatabaseClient; + this.useMultiplexedSessionPartitionedOps = useMultiplexedSessionPartitionedOps; this.tracer = tracer; this.useMultiplexedSessionForRW = useMultiplexedSessionForRW; } @@ -309,6 +314,14 @@ public AsyncTransactionManager transactionManagerAsync(TransactionOption... opti @Override public long executePartitionedUpdate(final Statement stmt, final UpdateOption... options) { + if (useMultiplexedSessionPartitionedOps) { + return getMultiplexedSession().executePartitionedUpdate(stmt, options); + } + return executePartitionedUpdateWithPooledSession(stmt, options); + } + + private long executePartitionedUpdateWithPooledSession( + final Statement stmt, final UpdateOption... options) { ISpan span = tracer.spanBuilder(PARTITION_DML_TRANSACTION); try (IScope s = tracer.withSpan(span)) { return runWithSessionRetry(session -> session.executePartitionedUpdate(stmt, options)); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DelayedMultiplexedSessionTransaction.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DelayedMultiplexedSessionTransaction.java index ad3e6b0cf70..0193805cbeb 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DelayedMultiplexedSessionTransaction.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DelayedMultiplexedSessionTransaction.java @@ -24,6 +24,7 @@ import com.google.cloud.spanner.DelayedReadContext.DelayedReadOnlyTransaction; import com.google.cloud.spanner.MultiplexedSessionDatabaseClient.MultiplexedSessionTransaction; import com.google.cloud.spanner.Options.TransactionOption; +import com.google.cloud.spanner.Options.UpdateOption; import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.ExecutionException; @@ -224,4 +225,16 @@ private SessionReference getSessionReference() { throw SpannerExceptionFactory.propagateInterrupt(interruptedException); } } + + /** + * Execute `stmt` within PARTITIONED_DML transaction using multiplexed session. This method is a + * blocking call as the interface expects to return the output of the `stmt`. + */ + @Override + public long executePartitionedUpdate(Statement stmt, UpdateOption... options) { + SessionReference sessionReference = getSessionReference(); + return new MultiplexedSessionTransaction( + client, span, sessionReference, NO_CHANNEL_HINT, /* singleUse = */ true) + .executePartitionedUpdate(stmt, options); + } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java index bd709adbd99..01f41a2dfdc 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java @@ -24,6 +24,7 @@ import com.google.api.core.SettableApiFuture; import com.google.cloud.Timestamp; import com.google.cloud.spanner.Options.TransactionOption; +import com.google.cloud.spanner.Options.UpdateOption; import com.google.cloud.spanner.SessionClient.SessionConsumer; import com.google.cloud.spanner.SpannerException.ResourceNotFoundException; import com.google.common.annotations.VisibleForTesting; @@ -553,6 +554,12 @@ public AsyncTransactionManager transactionManagerAsync(TransactionOption... opti .transactionManagerAsync(options); } + @Override + public long executePartitionedUpdate(Statement stmt, UpdateOption... options) { + return createMultiplexedSessionTransaction(/* singleUse = */ true) + .executePartitionedUpdate(stmt, options); + } + /** * It is enough with one executor to maintain the multiplexed sessions in all the clients, as they * do not need to be updated often, and the maintenance task is light. The core pool size is set diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java index 0eed13b018c..a3cbbf33826 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java @@ -237,6 +237,19 @@ SessionImpl createSession() { * @param consumer The {@link SessionConsumer} to use for callbacks when sessions are available. */ void createMultiplexedSession(SessionConsumer consumer) { + try { + SessionImpl sessionImpl = createMultiplexedSession(); + consumer.onSessionReady(sessionImpl); + } catch (Throwable t) { + consumer.onSessionCreateFailure(t, 1); + } + } + + /** + * Creates a multiplexed session and returns it. A multiplexed session is not affiliated with any + * GRPC channel. In case of an error during the gRPC calls, an exception will be thrown. + */ + SessionImpl createMultiplexedSession() { ISpan span = spanner.getTracer().spanBuilder(SpannerImpl.CREATE_MULTIPLEXED_SESSION); try (IScope s = spanner.getTracer().withSpan(span)) { com.google.spanner.v1.Session session = @@ -253,10 +266,12 @@ void createMultiplexedSession(SessionConsumer consumer) { spanner, new SessionReference( session.getName(), session.getCreateTime(), session.getMultiplexed(), null)); - consumer.onSessionReady(sessionImpl); + span.addAnnotation( + String.format("Request for %d multiplexed session returned %d session", 1, 1)); + return sessionImpl; } catch (Throwable t) { span.setStatus(t); - consumer.onSessionCreateFailure(t, 1); + throw t; } finally { span.end(); } @@ -289,31 +304,7 @@ private CreateMultiplexedSessionsRunnable(SessionConsumer consumer) { @Override public void run() { - ISpan span = spanner.getTracer().spanBuilder(SpannerImpl.CREATE_MULTIPLEXED_SESSION); - try (IScope s = spanner.getTracer().withSpan(span)) { - com.google.spanner.v1.Session session = - spanner - .getRpc() - .createSession( - db.getName(), - spanner.getOptions().getDatabaseRole(), - spanner.getOptions().getSessionLabels(), - null, - true); - SessionImpl sessionImpl = - new SessionImpl( - spanner, - new SessionReference( - session.getName(), session.getCreateTime(), session.getMultiplexed(), null)); - span.addAnnotation( - String.format("Request for %d multiplexed session returned %d session", 1, 1)); - consumer.onSessionReady(sessionImpl); - } catch (Throwable t) { - span.setStatus(t); - consumer.onSessionCreateFailure(t, 1); - } finally { - span.end(); - } + createMultiplexedSession(consumer); } } diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java index d4f3e598b11..a691f14817f 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java @@ -85,6 +85,9 @@ public class SessionPoolOptions { private final boolean useMultiplexedSessionForRW; + private final boolean useMultiplexedSessionForPartitionedOps; + + // TODO: Change to use java.time.Duration. private final Duration multiplexedSessionMaintenanceDuration; private SessionPoolOptions(Builder builder) { @@ -127,6 +130,14 @@ private SessionPoolOptions(Builder builder) { (useMultiplexedSessionForRWFromEnvVariable != null) ? useMultiplexedSessionForRWFromEnvVariable : builder.useMultiplexedSessionForRW; + // useMultiplexedSessionPartitionedOps priority => Environment var > private setter > client + // default + Boolean useMultiplexedSessionFromEnvVariablePartitionedOps = + getUseMultiplexedSessionFromEnvVariablePartitionedOps(); + this.useMultiplexedSessionForPartitionedOps = + (useMultiplexedSessionFromEnvVariablePartitionedOps != null) + ? useMultiplexedSessionFromEnvVariablePartitionedOps + : builder.useMultiplexedSessionPartitionedOps; this.multiplexedSessionMaintenanceDuration = builder.multiplexedSessionMaintenanceDuration; } @@ -349,17 +360,31 @@ public boolean getUseMultiplexedSessionForRW() { return getUseMultiplexedSession() && useMultiplexedSessionForRW; } + @VisibleForTesting + @InternalApi + public boolean getUseMultiplexedSessionPartitionedOps() { + return useMultiplexedSessionForPartitionedOps; + } + private static Boolean getUseMultiplexedSessionFromEnvVariable() { - String useMultiplexedSessionFromEnvVariable = - System.getenv("GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS"); - if (useMultiplexedSessionFromEnvVariable != null - && useMultiplexedSessionFromEnvVariable.length() > 0) { - if ("true".equalsIgnoreCase(useMultiplexedSessionFromEnvVariable) - || "false".equalsIgnoreCase(useMultiplexedSessionFromEnvVariable)) { - return Boolean.parseBoolean(useMultiplexedSessionFromEnvVariable); + return parseBooleanEnvVariable("GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS"); + } + + @VisibleForTesting + @InternalApi + protected static Boolean getUseMultiplexedSessionFromEnvVariablePartitionedOps() { + // Checks the value of env, GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS + // This returns null until Partitioned Operations is supported. + return null; + } + + private static Boolean parseBooleanEnvVariable(String variableName) { + String envVariable = System.getenv(variableName); + if (envVariable != null && envVariable.length() > 0) { + if ("true".equalsIgnoreCase(envVariable) || "false".equalsIgnoreCase(envVariable)) { + return Boolean.parseBoolean(envVariable); } else { - throw new IllegalArgumentException( - "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS should be either true or false."); + throw new IllegalArgumentException(variableName + " should be either true or false."); } } return null; @@ -585,6 +610,12 @@ public static class Builder { // default. private boolean useMultiplexedSessionForRW = false; + // This field controls the default behavior of session management for Partitioned operations in + // Java client. + // Set useMultiplexedSessionPartitionedOps to true to make multiplexed session for Partitioned + // operations the default. + private boolean useMultiplexedSessionPartitionedOps = false; + private Duration multiplexedSessionMaintenanceDuration = Duration.ofDays(7); private Clock poolMaintainerClock = Clock.INSTANCE; @@ -628,6 +659,7 @@ private Builder(SessionPoolOptions options) { this.useMultiplexedSession = options.useMultiplexedSession; this.useMultiplexedSessionBlindWrite = options.useMultiplexedSessionBlindWrite; this.useMultiplexedSessionForRW = options.useMultiplexedSessionForRW; + this.useMultiplexedSessionPartitionedOps = options.useMultiplexedSessionForPartitionedOps; this.multiplexedSessionMaintenanceDuration = options.multiplexedSessionMaintenanceDuration; this.poolMaintainerClock = options.poolMaintainerClock; } @@ -847,6 +879,15 @@ Builder setUseMultiplexedSessionForRW(boolean useMultiplexedSessionForRW) { return this; } + /** + * Sets whether the client should use multiplexed session for Partitioned operations or not. + * This method is intentionally package-private and intended for internal use. + */ + Builder setUseMultiplexedSessionPartitionedOps(boolean useMultiplexedSessionPartitionedOps) { + this.useMultiplexedSessionPartitionedOps = useMultiplexedSessionPartitionedOps; + return this; + } + @VisibleForTesting Builder setMultiplexedSessionMaintenanceDuration( Duration multiplexedSessionMaintenanceDuration) { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java index 1348d586e3a..ed815c77088 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java @@ -52,6 +52,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nullable; @@ -107,6 +108,11 @@ private static String nextDatabaseClientId(DatabaseId databaseId) { @GuardedBy("this") private final Map dbClients = new HashMap<>(); + @GuardedBy("dbBatchClientLock") + private final Map dbBatchClients = new HashMap<>(); + + private final ReentrantLock dbBatchClientLock = new ReentrantLock(); + private final CloseableExecutorProvider asyncExecutorProvider; @GuardedBy("this") @@ -308,6 +314,7 @@ public DatabaseClient getDatabaseClient(DatabaseId db) { pool, getOptions().getSessionPoolOptions().getUseMultiplexedSessionBlindWrite(), multiplexedSessionDatabaseClient, + getOptions().getSessionPoolOptions().getUseMultiplexedSessionPartitionedOps(), useMultiplexedSessionForRW); dbClients.put(db, dbClient); return dbClient; @@ -321,19 +328,37 @@ DatabaseClientImpl createDatabaseClient( SessionPool pool, boolean useMultiplexedSessionBlindWrite, @Nullable MultiplexedSessionDatabaseClient multiplexedSessionClient, + boolean useMultiplexedSessionPartitionedOps, boolean useMultiplexedSessionForRW) { return new DatabaseClientImpl( clientId, pool, useMultiplexedSessionBlindWrite, multiplexedSessionClient, + useMultiplexedSessionPartitionedOps, tracer, useMultiplexedSessionForRW); } @Override public BatchClient getBatchClient(DatabaseId db) { - return new BatchClientImpl(getSessionClient(db)); + if (getOptions().getSessionPoolOptions().getUseMultiplexedSessionPartitionedOps()) { + this.dbBatchClientLock.lock(); + try { + if (this.dbBatchClients.containsKey(db)) { + return this.dbBatchClients.get(db); + } + BatchClientImpl batchClient = + new BatchClientImpl( + getSessionClient(db), /*useMultiplexedSessionPartitionedOps=*/ true); + this.dbBatchClients.put(db, batchClient); + return batchClient; + } finally { + this.dbBatchClientLock.unlock(); + } + } + return new BatchClientImpl( + getSessionClient(db), /*useMultiplexedSessionPartitionedOps=*/ false); } @Override diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchClientImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchClientImplTest.java index 8d05df538a5..edafc7ddba9 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchClientImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchClientImplTest.java @@ -36,6 +36,7 @@ import com.google.spanner.v1.Session; import com.google.spanner.v1.Transaction; import io.opentelemetry.api.OpenTelemetry; +import java.time.Duration; import java.util.Collections; import java.util.Map; import org.junit.Before; @@ -56,6 +57,7 @@ public final class BatchClientImplTest { private static final String SESSION_NAME = DB_NAME + "/sessions/s1"; private static final ByteString TXN_ID = ByteString.copyFromUtf8("my-txn"); private static final String TIMESTAMP = "2017-11-15T10:54:20Z"; + private static boolean isMultiplexedSession = false; @Mock private SpannerRpc gapicRpc; @Mock private SpannerOptions spannerOptions; @@ -68,6 +70,11 @@ public final class BatchClientImplTest { public static void setupOpenTelemetry() { SpannerOptions.resetActiveTracingFramework(); SpannerOptions.enableOpenTelemetryTraces(); + Boolean useMultiplexedSessionFromEnvVariablePartitionedOps = + SessionPoolOptions.getUseMultiplexedSessionFromEnvVariablePartitionedOps(); + isMultiplexedSession = + useMultiplexedSessionFromEnvVariablePartitionedOps != null + && useMultiplexedSessionFromEnvVariablePartitionedOps; } @SuppressWarnings("unchecked") @@ -88,18 +95,32 @@ public void setUp() { when(spannerOptions.getTransportOptions()).thenReturn(transportOptions); SessionPoolOptions sessionPoolOptions = mock(SessionPoolOptions.class); when(sessionPoolOptions.getPoolMaintainerClock()).thenReturn(Clock.INSTANCE); + when(sessionPoolOptions.getUseMultiplexedSessionPartitionedOps()) + .thenReturn(isMultiplexedSession); + when(sessionPoolOptions.getMultiplexedSessionMaintenanceDuration()).thenReturn(Duration.ZERO); when(spannerOptions.getSessionPoolOptions()).thenReturn(sessionPoolOptions); @SuppressWarnings("resource") SpannerImpl spanner = new SpannerImpl(gapicRpc, spannerOptions); - client = new BatchClientImpl(spanner.getSessionClient(db)); + client = new BatchClientImpl(spanner.getSessionClient(db), isMultiplexedSession); } @SuppressWarnings("unchecked") @Test public void testBatchReadOnlyTxnWithBound() throws Exception { - Session sessionProto = Session.newBuilder().setName(SESSION_NAME).build(); - when(gapicRpc.createSession(eq(DB_NAME), anyString(), anyMap(), optionsCaptor.capture())) - .thenReturn(sessionProto); + Session sessionProto = + Session.newBuilder().setName(SESSION_NAME).setMultiplexed(isMultiplexedSession).build(); + if (isMultiplexedSession) { + when(gapicRpc.createSession( + eq(DB_NAME), + anyString(), + anyMap(), + optionsCaptor.capture(), + eq(isMultiplexedSession))) + .thenReturn(sessionProto); + } else { + when(gapicRpc.createSession(eq(DB_NAME), anyString(), anyMap(), optionsCaptor.capture())) + .thenReturn(sessionProto); + } com.google.protobuf.Timestamp timestamp = Timestamps.parse(TIMESTAMP); Transaction txnMetadata = Transaction.newBuilder().setId(TXN_ID).setReadTimestamp(timestamp).build(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchTransactionIdTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchTransactionIdTest.java index cf431348ce5..81d4de41695 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchTransactionIdTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchTransactionIdTest.java @@ -50,5 +50,8 @@ public void serialization() { reserializeAndAssert( new BatchTransactionId( "testSession", ByteString.copyFromUtf8("testTxn"), Timestamp.MIN_VALUE)); + reserializeAndAssert( + new BatchTransactionId( + "testSession", ByteString.copyFromUtf8("testTxn"), Timestamp.MIN_VALUE)); } } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTestWithClosedSessionsEnv.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTestWithClosedSessionsEnv.java index 6deca476fc3..72cfe0bfe44 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTestWithClosedSessionsEnv.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTestWithClosedSessionsEnv.java @@ -51,6 +51,7 @@ DatabaseClientImpl createDatabaseClient( SessionPool pool, boolean useMultiplexedSessionBlindWriteIgnore, MultiplexedSessionDatabaseClient ignore, + boolean useMultiplexedSessionPartitionedOpsIgnore, boolean useMultiplexedSessionForRWIgnore) { return new DatabaseClientWithClosedSessionImpl(clientId, pool, tracer); } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java index 9f3d0751471..3121b868b83 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java @@ -95,6 +95,7 @@ public void createSpannerInstance() { .setUseMultiplexedSession(true) .setUseMultiplexedSessionBlindWrite(true) .setUseMultiplexedSessionForRW(true) + .setUseMultiplexedSessionPartitionedOps(true) // Set the maintainer to loop once every 1ms .setMultiplexedSessionMaintenanceLoopFrequency(Duration.ofMillis(1L)) // Set multiplexed sessions to be replaced once every 1ms diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java index 42a62be33aa..3032a1cae40 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java @@ -1273,6 +1273,9 @@ public void transactionManagerReadRowUsingIndexInvalidatedDuringTransaction() @Test public void partitionedDml() throws InterruptedException { + assumeFalse( + "Multiplexed session do not throw a SessionNotFound errors. ", + spanner.getOptions().getSessionPoolOptions().getUseMultiplexedSessionPartitionedOps()); assertThrowsSessionNotFoundIfShouldFail( () -> client.executePartitionedUpdate(UPDATE_STATEMENT)); } From ebd326b2d5bc7871d0df0238d81cd1be8e88d800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Mon, 9 Dec 2024 17:09:16 +0100 Subject: [PATCH 06/43] test: enable more tests on the Emulator (#3535) Multiple tests were skipped on the Emulator, because the features that are covered by these tests were originally not supported on the Emulator. These features are now available on the Emulator, and the tests can be enabled. --- .../it/ITAsyncTransactionRetryTest.java | 6 - .../cloud/spanner/it/ITBatchReadTest.java | 62 +++---- .../google/cloud/spanner/it/ITDMLTest.java | 27 +-- .../cloud/spanner/it/ITDatabaseTest.java | 3 - .../cloud/spanner/it/ITDmlReturningTest.java | 28 ++- .../cloud/spanner/it/ITFloat32Test.java | 4 - .../it/ITForeignKeyDeleteCascadeTest.java | 174 ++++++++---------- .../cloud/spanner/it/ITJsonWriteReadTest.java | 26 +-- .../cloud/spanner/it/ITLargeReadTest.java | 41 ++--- .../cloud/spanner/it/ITPgJsonbTest.java | 38 ++-- .../cloud/spanner/it/ITPgNumericTest.java | 48 ++--- 11 files changed, 175 insertions(+), 282 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITAsyncTransactionRetryTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITAsyncTransactionRetryTest.java index fa44ad6f5d9..744d7042df4 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITAsyncTransactionRetryTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITAsyncTransactionRetryTest.java @@ -17,10 +17,8 @@ package com.google.cloud.spanner.connection.it; import static com.google.cloud.spanner.SpannerApiFutures.get; -import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeFalse; import com.google.api.core.ApiFuture; import com.google.api.core.SettableApiFuture; @@ -580,7 +578,6 @@ public void testAbortWithResultSetFullyConsumed() { @Test public void testAbortWithConcurrentInsert() { - assumeFalse("concurrent transactions are not supported on the emulator", isUsingEmulator()); AbortInterceptor interceptor = new AbortInterceptor(0); try (ITConnection connection = createConnection(interceptor, new CountTransactionRetryListener())) { @@ -632,7 +629,6 @@ public void testAbortWithConcurrentInsert() { @Test public void testAbortWithConcurrentDelete() { - assumeFalse("concurrent transactions are not supported on the emulator", isUsingEmulator()); AbortInterceptor interceptor = new AbortInterceptor(0); // first insert two test records try (ITConnection connection = createConnection()) { @@ -686,7 +682,6 @@ public void testAbortWithConcurrentDelete() { @Test public void testAbortWithConcurrentUpdate() { - assumeFalse("concurrent transactions are not supported on the emulator", isUsingEmulator()); AbortInterceptor interceptor = new AbortInterceptor(0); // first insert two test records try (ITConnection connection = createConnection()) { @@ -746,7 +741,6 @@ public void testAbortWithConcurrentUpdate() { */ @Test public void testAbortWithUnseenConcurrentInsert() throws InterruptedException { - assumeFalse("concurrent transactions are not supported on the emulator", isUsingEmulator()); AbortInterceptor interceptor = new AbortInterceptor(0); try (ITConnection connection = createConnection(interceptor, new CountTransactionRetryListener())) { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBatchReadTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBatchReadTest.java index 6598a3dca76..f028fbc2b15 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBatchReadTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBatchReadTest.java @@ -19,11 +19,9 @@ import static com.google.cloud.spanner.connection.ITAbstractSpannerTest.extractConnectionUrl; import static com.google.cloud.spanner.connection.ITAbstractSpannerTest.getKeyFile; import static com.google.cloud.spanner.connection.ITAbstractSpannerTest.hasValidKeyFile; -import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; import com.google.cloud.ByteArray; import com.google.cloud.Timestamp; @@ -96,10 +94,7 @@ public class ITBatchReadTest { public static List data() { List params = new ArrayList<>(); params.add(new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL)); - // PG dialect tests are not supported by the emulator - if (!isUsingEmulator()) { - params.add(new DialectTestParameter(Dialect.POSTGRESQL)); - } + params.add(new DialectTestParameter(Dialect.POSTGRESQL)); return params; } @@ -135,30 +130,28 @@ public static void setUpDatabase() throws Exception { List databaseClients = new ArrayList<>(); databaseClients.add(env.getTestHelper().getDatabaseClient(googleStandardDatabase)); - if (!isUsingEmulator()) { - postgreSQLDatabase = - env.getTestHelper().createTestDatabase(Dialect.POSTGRESQL, Collections.emptyList()); - env.getTestHelper() - .getClient() - .getDatabaseAdminClient() - .updateDatabaseDdl( - env.getTestHelper().getInstanceId().getInstance(), - postgreSQLDatabase.getId().getDatabase(), - ImmutableList.of( - "CREATE TABLE " - + TABLE_NAME - + " (" - + " Key bigint not null primary key," - + " Data bytea," - + " Fingerprint bigint," - + " Size bigint" - + ")", - "CREATE INDEX " + INDEX_NAME + " ON " + TABLE_NAME + "(Fingerprint)"), - null) - .get(); - postgreSQLBatchClient = env.getTestHelper().getBatchClient(postgreSQLDatabase); - databaseClients.add(env.getTestHelper().getDatabaseClient(postgreSQLDatabase)); - } + postgreSQLDatabase = + env.getTestHelper().createTestDatabase(Dialect.POSTGRESQL, Collections.emptyList()); + env.getTestHelper() + .getClient() + .getDatabaseAdminClient() + .updateDatabaseDdl( + env.getTestHelper().getInstanceId().getInstance(), + postgreSQLDatabase.getId().getDatabase(), + ImmutableList.of( + "CREATE TABLE " + + TABLE_NAME + + " (" + + " Key bigint not null primary key," + + " Data bytea," + + " Fingerprint bigint," + + " Size bigint" + + ")", + "CREATE INDEX " + INDEX_NAME + " ON " + TABLE_NAME + "(Fingerprint)"), + null) + .get(); + postgreSQLBatchClient = env.getTestHelper().getBatchClient(postgreSQLDatabase); + databaseClients.add(env.getTestHelper().getDatabaseClient(postgreSQLDatabase)); List rows = manyRows(); numRows = rows.size(); @@ -210,9 +203,6 @@ private Database getDatabase() { @Test public void read() { - assumeFalse( - "PostgreSQL does not support the PartitionRead RPC", dialect.dialect == Dialect.POSTGRESQL); - BitSet seenRows = new BitSet(numRows); TimestampBound bound = getRandomBound(); PartitionOptions partitionParams = getRandomPartitionOptions(); @@ -229,9 +219,6 @@ public void read() { @Test public void readUsingIndex() { - assumeFalse( - "PostgreSQL does not support the PartitionRead RPC", dialect.dialect == Dialect.POSTGRESQL); - TimestampBound bound = getRandomBound(); PartitionOptions partitionParams = getRandomPartitionOptions(); batchTxn = getBatchClient().batchReadOnlyTransaction(bound); @@ -258,8 +245,6 @@ public void readUsingIndex() { @Test public void dataBoostRead() { - assumeFalse("Emulator does not support data boost read", isUsingEmulator()); - BitSet seenRows = new BitSet(numRows); TimestampBound bound = getRandomBound(); PartitionOptions partitionParams = getRandomPartitionOptions(); @@ -312,7 +297,6 @@ private PartitionOptions getRandomPartitionOptions() { @Test public void dataBoostQuery() { - assumeFalse("Emulator does not support data boost query", isUsingEmulator()); BitSet seenRows = new BitSet(numRows); TimestampBound bound = getRandomBound(); PartitionOptions partitionParams = getRandomPartitionOptions(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDMLTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDMLTest.java index 5ea30912103..ab3c8e24a8c 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDMLTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDMLTest.java @@ -16,14 +16,12 @@ package com.google.cloud.spanner.it; -import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeFalse; import com.google.cloud.spanner.AbortedException; import com.google.cloud.spanner.Database; @@ -90,15 +88,13 @@ public static void setUpDatabase() { + " V INT64," + ") PRIMARY KEY (K)"); googleStandardSQLClient = env.getTestHelper().getDatabaseClient(googleStandardSQLDatabase); - if (!isUsingEmulator()) { - Database postgreSQLDatabase = - env.getTestHelper() - .createTestDatabase( - Dialect.POSTGRESQL, - Arrays.asList( - "CREATE TABLE T (" + " K VARCHAR PRIMARY KEY," + " V BIGINT" + ")")); - postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); - } + Database postgreSQLDatabase = + env.getTestHelper() + .createTestDatabase( + Dialect.POSTGRESQL, + Arrays.asList( + "CREATE TABLE T (" + " K VARCHAR PRIMARY KEY," + " V BIGINT" + ")")); + postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); } @AfterClass @@ -122,10 +118,7 @@ public void increaseTestIdAndDeleteTestData() { public static List data() { List params = new ArrayList<>(); params.add(new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL)); - // "PG dialect tests are not supported by the emulator" - if (!isUsingEmulator()) { - params.add(new DialectTestParameter(Dialect.POSTGRESQL)); - } + params.add(new DialectTestParameter(Dialect.POSTGRESQL)); return params; } @@ -389,10 +382,6 @@ public void standardDMLWithExecuteSQL() { @Test public void testUntypedNullValues() { - assumeFalse( - "Spanner PostgreSQL does not yet support untyped null values", - dialect.dialect == Dialect.POSTGRESQL); - DatabaseClient client = getClient(dialect.dialect); String sql; if (dialect.dialect == Dialect.POSTGRESQL) { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseTest.java index f9230b8836b..b9813d512fd 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseTest.java @@ -20,7 +20,6 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeFalse; import com.google.api.client.util.ExponentialBackOff; import com.google.api.gax.longrunning.OperationFuture; @@ -182,8 +181,6 @@ public void instanceNotFound() { @Test public void testNumericPrimaryKey() { - assumeFalse("Emulator does not support numeric primary keys", isUsingEmulator()); - final String table = "NumericTable"; // Creates table with numeric primary key diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDmlReturningTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDmlReturningTest.java index 8cb465e4c84..f54365ba84d 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDmlReturningTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDmlReturningTest.java @@ -42,7 +42,6 @@ import com.google.cloud.spanner.TransactionRunner; import com.google.cloud.spanner.TransactionRunner.TransactionCallable; import com.google.cloud.spanner.connection.ConnectionOptions; -import com.google.cloud.spanner.testing.EmulatorSpannerHelper; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -75,8 +74,6 @@ public final class ITDmlReturningTest { @BeforeClass public static void setUpDatabase() { - assumeFalse( - "DML Returning is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); Database googleStandardSQLDatabase = env.getTestHelper() .createTestDatabase( @@ -85,18 +82,16 @@ public static void setUpDatabase() { + " V INT64," + ") PRIMARY KEY (K)"); googleStandardSQLClient = env.getTestHelper().getDatabaseClient(googleStandardSQLDatabase); - if (!isUsingEmulator()) { - Database postgreSQLDatabase = - env.getTestHelper() - .createTestDatabase( - Dialect.POSTGRESQL, - Collections.singletonList( - "CREATE TABLE T (" - + " \"K\" VARCHAR PRIMARY KEY," - + " \"V\" BIGINT" - + ")")); - postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); - } + Database postgreSQLDatabase = + env.getTestHelper() + .createTestDatabase( + Dialect.POSTGRESQL, + Collections.singletonList( + "CREATE TABLE T (" + + " \"K\" VARCHAR PRIMARY KEY," + + " \"V\" BIGINT" + + ")")); + postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); } @AfterClass @@ -222,6 +217,9 @@ private void executeUpdateAsync(long expectedCount, final String... stmts) { @Test public void dmlReturningWithExecutePartitionedUpdate() { + assumeFalse( + "The emulator does not dis-allow THEN RETURN statements for PDML", isUsingEmulator()); + SpannerException e = assertThrows( SpannerException.class, diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITFloat32Test.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITFloat32Test.java index 393c2db8755..1536912f686 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITFloat32Test.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITFloat32Test.java @@ -16,13 +16,11 @@ package com.google.cloud.spanner.it; -import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; import com.google.cloud.Timestamp; import com.google.cloud.spanner.Database; @@ -93,8 +91,6 @@ public static List data() { @BeforeClass public static void setUpDatabase() throws ExecutionException, InterruptedException, TimeoutException { - assumeFalse("Emulator does not support FLOAT32 yet", isUsingEmulator()); - Database googleStandardSQLDatabase = env.getTestHelper().createTestDatabase(GOOGLE_STANDARD_SQL_SCHEMA); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITForeignKeyDeleteCascadeTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITForeignKeyDeleteCascadeTest.java index fc7c860267a..448aab85114 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITForeignKeyDeleteCascadeTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITForeignKeyDeleteCascadeTest.java @@ -15,11 +15,11 @@ */ package com.google.cloud.spanner.it; +import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; import com.google.cloud.spanner.Database; import com.google.cloud.spanner.DatabaseAdminClient; @@ -33,7 +33,6 @@ import com.google.cloud.spanner.ResultSet; import com.google.cloud.spanner.SpannerException; import com.google.cloud.spanner.Statement; -import com.google.cloud.spanner.testing.EmulatorSpannerHelper; import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.Arrays; @@ -68,46 +67,44 @@ public static List data() { private static Database GOOGLE_STANDARD_SQL_DATABASE; private static Database POSTGRESQL_DATABASE; - private static List dbs = new ArrayList<>(); + private static final List dbs = new ArrayList<>(); @Parameterized.Parameter(0) public DialectTestParameter dialect; @BeforeClass public static void setUpDatabase() { - if (!EmulatorSpannerHelper.isUsingEmulator()) { - GOOGLE_STANDARD_SQL_DATABASE = - env.getTestHelper() - .createTestDatabase( - ImmutableList.of( - "CREATE TABLE Singer (\n" - + " singer_id INT64 NOT NULL,\n" - + " first_name STRING(1024),\n" - + ") PRIMARY KEY(singer_id)\n", - "CREATE TABLE Concert (\n" - + " venue_id INT64 NOT NULL,\n" - + " singer_id INT64 NOT NULL,\n" - + " CONSTRAINT Fk_Concert_Singer FOREIGN KEY (singer_id) REFERENCES Singer (singer_id) ON DELETE CASCADE" - + ") PRIMARY KEY(venue_id, singer_id)")); - POSTGRESQL_DATABASE = - env.getTestHelper() - .createTestDatabase( - Dialect.POSTGRESQL, - ImmutableList.of( - "CREATE TABLE Singer (\n" - + " singer_id BIGINT PRIMARY KEY,\n" - + " first_name VARCHAR\n" - + ")", - "CREATE TABLE Concert (\n" - + " venue_id BIGINT NOT NULL,\n" - + " singer_id BIGINT NOT NULL,\n" - + " PRIMARY KEY (venue_id, singer_id),\n" - + " CONSTRAINT Fk_Concert_Singer FOREIGN KEY (singer_id) REFERENCES Singer (singer_id) ON DELETE CASCADE\n" - + " )")); - - dbs.add(GOOGLE_STANDARD_SQL_DATABASE); - dbs.add(POSTGRESQL_DATABASE); - } + GOOGLE_STANDARD_SQL_DATABASE = + env.getTestHelper() + .createTestDatabase( + ImmutableList.of( + "CREATE TABLE Singer (\n" + + " singer_id INT64 NOT NULL,\n" + + " first_name STRING(1024),\n" + + ") PRIMARY KEY(singer_id)\n", + "CREATE TABLE Concert (\n" + + " venue_id INT64 NOT NULL,\n" + + " singer_id INT64 NOT NULL,\n" + + " CONSTRAINT Fk_Concert_Singer FOREIGN KEY (singer_id) REFERENCES Singer (singer_id) ON DELETE CASCADE\n" + + ") PRIMARY KEY(venue_id, singer_id)")); + POSTGRESQL_DATABASE = + env.getTestHelper() + .createTestDatabase( + Dialect.POSTGRESQL, + ImmutableList.of( + "CREATE TABLE Singer (\n" + + " singer_id BIGINT PRIMARY KEY,\n" + + " first_name VARCHAR\n" + + ")", + "CREATE TABLE Concert (\n" + + " venue_id BIGINT NOT NULL,\n" + + " singer_id BIGINT NOT NULL,\n" + + " PRIMARY KEY (venue_id, singer_id),\n" + + " CONSTRAINT \"Fk_Concert_Singer\" FOREIGN KEY (singer_id) REFERENCES Singer (singer_id) ON DELETE CASCADE\n" + + " )")); + + dbs.add(GOOGLE_STANDARD_SQL_DATABASE); + dbs.add(POSTGRESQL_DATABASE); } @AfterClass @@ -120,10 +117,6 @@ public static void tearDown() { @Test public void testForeignKeyDeleteCascadeConstraints_withCreateDDLStatements() { - assumeFalse( - "Emulator does not yet support foreign key delete cascade", - EmulatorSpannerHelper.isUsingEmulator()); - final DatabaseClient databaseClient = getCreatedDatabaseClient(); try (final ResultSet rs = databaseClient @@ -133,17 +126,17 @@ public void testForeignKeyDeleteCascadeConstraints_withCreateDDLStatements() { "SELECT DELETE_RULE\n" + "FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS\n" + "WHERE CONSTRAINT_NAME ='Fk_Concert_Singer'"))) { - while (rs.next()) { - assertEquals(rs.getString(DELETE_RULE_COLUMN_NAME), "CASCADE"); + assertTrue(rs.next()); + // TODO: Enable for the emulator when it returns the correct value for DELETE_RULE. + if (!isUsingEmulator()) { + assertEquals("CASCADE", rs.getString(0)); } + assertFalse(rs.next()); } } @Test public void testForeignKeyDeleteCascadeConstraints_withAlterDDLStatements() throws Exception { - assumeFalse( - "Emulator does not yet support foreign key delete cascade", - EmulatorSpannerHelper.isUsingEmulator()); // Creating new tables within this test to ensure we don't pollute tables used by other tests in // this class. List createStatements; @@ -160,7 +153,7 @@ public void testForeignKeyDeleteCascadeConstraints_withAlterDDLStatements() thro + " PRIMARY KEY (venue_id, singer_id)\n" + " )", "ALTER TABLE ConcertV2 " - + "ADD CONSTRAINT Fk_Concert_Singer_V2 FOREIGN KEY(singer_id) REFERENCES Singer(singer_id) " + + "ADD CONSTRAINT \"Fk_Concert_Singer_V2\" FOREIGN KEY(singer_id) REFERENCES Singer(singer_id) " + "ON DELETE CASCADE"); } else { createStatements = @@ -181,7 +174,7 @@ public void testForeignKeyDeleteCascadeConstraints_withAlterDDLStatements() thro env.getTestHelper().createTestDatabase(dialect.dialect, createStatements); dbs.add(createdDatabase); - final DatabaseClient databaseClient = getCreatedDatabaseClient(); + final DatabaseClient databaseClient = env.getTestHelper().getDatabaseClient(createdDatabase); try (final ResultSet rs = databaseClient @@ -190,10 +183,13 @@ public void testForeignKeyDeleteCascadeConstraints_withAlterDDLStatements() thro Statement.of( "SELECT DELETE_RULE\n" + "FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS\n" - + "WHERE CONSTRAINT_NAME ='Fk_Concert_Singer'"))) { - while (rs.next()) { - assertEquals(rs.getString(DELETE_RULE_COLUMN_NAME), "CASCADE"); + + "WHERE CONSTRAINT_NAME ='Fk_Concert_Singer_V2'"))) { + assertTrue(rs.next()); + // TODO: Enable when the emulator returns the correct value for this column. + if (!isUsingEmulator()) { + assertEquals("CASCADE", rs.getString(0)); } + assertFalse(rs.next()); } // remove the foreign key delete cascade constraint @@ -215,19 +211,15 @@ public void testForeignKeyDeleteCascadeConstraints_withAlterDDLStatements() thro Statement.of( "SELECT DELETE_RULE\n" + "FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS\n" - + "WHERE CONSTRAINT_NAME ='Fk_Concert_Singer_V2'"))) { - while (rs.next()) { - assertEquals(rs.getString(DELETE_RULE_COLUMN_NAME), "NO ACTION"); - } + + "WHERE LOWER(CONSTRAINT_NAME) ='fk_concert_singer_v2'"))) { + assertTrue(rs.next()); + assertEquals("NO ACTION", rs.getString(0)); + assertFalse(rs.next()); } } @Test public void testForeignKeyDeleteCascadeConstraints_verifyValidInsertions() { - assumeFalse( - "Emulator does not yet support foreign key delete cascade", - EmulatorSpannerHelper.isUsingEmulator()); - final DatabaseClient databaseClient = getCreatedDatabaseClient(); final String singerInsertStatement = "INSERT INTO Singer (singer_id, first_name) VALUES (" + generateQueryParameters(2) + ")"; @@ -289,10 +281,6 @@ public void testForeignKeyDeleteCascadeConstraints_verifyValidInsertions() { @Test public void testForeignKeyDeleteCascadeConstraints_verifyInvalidInsertions() { - assumeFalse( - "Emulator does not yet support foreign key delete cascade", - EmulatorSpannerHelper.isUsingEmulator()); - final DatabaseClient databaseClient = getCreatedDatabaseClient(); // unsuccessful inserts into referencing tables when foreign key is not inserted into referenced @@ -319,16 +307,12 @@ public void testForeignKeyDeleteCascadeConstraints_verifyInvalidInsertions() { transaction.executeUpdate(concertInsertStatementWithInvalidValues); return null; })); - assertEquals(ex.getErrorCode(), ErrorCode.FAILED_PRECONDITION); - assertTrue(ex.getMessage().contains("Cannot find referenced values")); + assertEquals(ErrorCode.FAILED_PRECONDITION, ex.getErrorCode()); + assertTrue(ex.getMessage(), ex.getMessage().contains("Cannot find referenced")); } @Test public void testForeignKeyDeleteCascadeConstraints_forDeletions() { - assumeFalse( - "Emulator does not yet support foreign key delete cascade", - EmulatorSpannerHelper.isUsingEmulator()); - final DatabaseClient databaseClient = getCreatedDatabaseClient(); final String singerInsertStatement = @@ -396,10 +380,6 @@ public void testForeignKeyDeleteCascadeConstraints_forDeletions() { @Test public void testForeignKeyDeleteCascadeConstraints_forMutations_onConflictDueToParentTable() { - assumeFalse( - "Emulator does not yet support foreign key delete cascade", - EmulatorSpannerHelper.isUsingEmulator()); - final DatabaseClient databaseClient = getCreatedDatabaseClient(); // inserting and deleting the referenced key within the same mutation are considered @@ -423,15 +403,11 @@ public void testForeignKeyDeleteCascadeConstraints_forMutations_onConflictDueToP Mutation.delete("Singer", Key.of(4L)))); return null; })); - assertEquals(ex.getErrorCode(), ErrorCode.FAILED_PRECONDITION); + assertEquals(ErrorCode.FAILED_PRECONDITION, ex.getErrorCode()); } @Test public void testForeignKeyDeleteCascadeConstraints_forMutations_onConflictsDueToChildTable() { - assumeFalse( - "Emulator does not yet support foreign key delete cascade", - EmulatorSpannerHelper.isUsingEmulator()); - final DatabaseClient databaseClient = getCreatedDatabaseClient(); // referencing a foreign key in child table and deleting the referenced key in parent table @@ -454,25 +430,24 @@ public void testForeignKeyDeleteCascadeConstraints_forMutations_onConflictsDueTo transaction.executeUpdate(singerInsertStatementWithValues); return null; }); - SpannerException ex = - assertThrows( - SpannerException.class, - () -> - databaseClient - .readWriteTransaction() - .run( - transaction -> { - transaction.buffer( - Arrays.asList( - Mutation.newInsertBuilder("Concert") - .set("first_name") - .to(5L) - .set("singer_id") - .to(5L) - .build(), - Mutation.delete("Singer", Key.of(5L)))); - return null; - })); + assertThrows( + SpannerException.class, + () -> + databaseClient + .readWriteTransaction() + .run( + transaction -> { + transaction.buffer( + Arrays.asList( + Mutation.newInsertBuilder("Concert") + .set("first_name") + .to(5L) + .set("singer_id") + .to(5L) + .build(), + Mutation.delete("Singer", Key.of(5L)))); + return null; + })); } private DatabaseAdminClient getDatabaseAdminClient() { @@ -481,16 +456,13 @@ private DatabaseAdminClient getDatabaseAdminClient() { private DatabaseClient getCreatedDatabaseClient() { if (dialect.dialect == Dialect.POSTGRESQL) { - return env.getTestHelper().getDatabaseClient(this.POSTGRESQL_DATABASE); + return env.getTestHelper().getDatabaseClient(POSTGRESQL_DATABASE); } - return env.getTestHelper().getDatabaseClient(this.GOOGLE_STANDARD_SQL_DATABASE); + return env.getTestHelper().getDatabaseClient(GOOGLE_STANDARD_SQL_DATABASE); } /** * Returns '@p1, @p2, ..., @pNumParams' for GoogleSQL and $1, $2, ..., $NumParams' for PostgreSQL - * - * @param numParams - * @return */ private String generateQueryParameters(final int numParams) { final List params; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITJsonWriteReadTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITJsonWriteReadTest.java index c6f72349f0b..e355eaa07a3 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITJsonWriteReadTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITJsonWriteReadTest.java @@ -18,7 +18,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; -import static org.junit.Assume.assumeFalse; import com.google.cloud.spanner.Database; import com.google.cloud.spanner.DatabaseClient; @@ -30,7 +29,6 @@ import com.google.cloud.spanner.SpannerException; import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.Value; -import com.google.cloud.spanner.testing.EmulatorSpannerHelper; import com.google.cloud.spanner.testing.RemoteSpannerHelper; import com.google.common.io.Resources; import java.io.File; @@ -68,23 +66,19 @@ public class ITJsonWriteReadTest { @BeforeClass public static void beforeClass() { final RemoteSpannerHelper testHelper = env.getTestHelper(); - if (!EmulatorSpannerHelper.isUsingEmulator()) { - final Database database = - testHelper.createTestDatabase( - "CREATE TABLE " - + TABLE_NAME - + "(" - + "Id INT64 NOT NULL," - + "json JSON" - + ") PRIMARY KEY (Id)"); - databaseClient = testHelper.getDatabaseClient(database); - } + final Database database = + testHelper.createTestDatabase( + "CREATE TABLE " + + TABLE_NAME + + "(" + + "Id INT64 NOT NULL," + + "json JSON" + + ") PRIMARY KEY (Id)"); + databaseClient = testHelper.getDatabaseClient(database); } @Test public void testWriteValidJsonValues() throws IOException { - assumeFalse("Emulator does not yet support JSON", EmulatorSpannerHelper.isUsingEmulator()); - List resources = getJsonFilePaths(RESOURCES_DIR + File.separator + VALID_JSON_DIR); long id = 0L; @@ -116,8 +110,6 @@ public void testWriteValidJsonValues() throws IOException { @Test public void testWriteAndReadInvalidJsonValues() throws IOException { - assumeFalse("Emulator does not yet support JSON", EmulatorSpannerHelper.isUsingEmulator()); - List resources = getJsonFilePaths(RESOURCES_DIR + File.separator + INVALID_JSON_DIR); AtomicLong id = new AtomicLong(100); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITLargeReadTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITLargeReadTest.java index b60505c873a..83d505e2124 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITLargeReadTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITLargeReadTest.java @@ -16,7 +16,6 @@ package com.google.cloud.spanner.it; -import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static com.google.common.truth.Truth.assertThat; import com.google.cloud.ByteArray; @@ -31,6 +30,7 @@ import com.google.cloud.spanner.ResultSet; import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.connection.ConnectionOptions; +import com.google.common.collect.ImmutableList; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; import java.util.ArrayList; @@ -88,20 +88,18 @@ public static void setUpDatabase() { + " Size INT64," + ") PRIMARY KEY (Key)"); googleStandardSQLClient = env.getTestHelper().getDatabaseClient(googleStandardSQLDatabase); - if (!isUsingEmulator()) { - Database postgreSQLDatabase = - env.getTestHelper() - .createTestDatabase( - Dialect.POSTGRESQL, - Arrays.asList( - "CREATE TABLE TestTable (" - + " Key BIGINT PRIMARY KEY," - + " Data BYTEA," - + " Fingerprint BIGINT," - + " Size BIGINT" - + ")")); - postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); - } + Database postgreSQLDatabase = + env.getTestHelper() + .createTestDatabase( + Dialect.POSTGRESQL, + ImmutableList.of( + "CREATE TABLE TestTable (" + + " Key BIGINT PRIMARY KEY," + + " Data BYTEA," + + " Fingerprint BIGINT," + + " Size BIGINT" + + ")")); + postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); hasher = Hashing.goodFastHash(64); List mutations = new ArrayList<>(); @@ -127,17 +125,13 @@ public static void setUpDatabase() { i++; if (totalSize >= WRITE_BATCH_SIZE) { googleStandardSQLClient.write(mutations); - if (!isUsingEmulator()) { - postgreSQLClient.write(mutations); - } + postgreSQLClient.write(mutations); mutations.clear(); totalSize = 0; } } googleStandardSQLClient.write(mutations); - if (!isUsingEmulator()) { - postgreSQLClient.write(mutations); - } + postgreSQLClient.write(mutations); } @AfterClass @@ -149,10 +143,7 @@ public static void teardown() { public static List data() { List params = new ArrayList<>(); params.add(new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL)); - // "PG dialect tests are not supported by the emulator" - if (!isUsingEmulator()) { - params.add(new DialectTestParameter(Dialect.POSTGRESQL)); - } + params.add(new DialectTestParameter(Dialect.POSTGRESQL)); return params; } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java index 634f7919658..275fbe6545f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgJsonbTest.java @@ -16,11 +16,11 @@ package com.google.cloud.spanner.it; +import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; import com.google.cloud.spanner.Database; import com.google.cloud.spanner.DatabaseAdminClient; @@ -36,7 +36,6 @@ import com.google.cloud.spanner.SpannerExceptionFactory; import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.Value; -import com.google.cloud.spanner.testing.EmulatorSpannerHelper; import com.google.cloud.spanner.testing.RemoteSpannerHelper; import com.google.common.collect.ImmutableList; import com.google.protobuf.ListValue; @@ -53,7 +52,6 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; -import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; @@ -77,8 +75,6 @@ public class ITPgJsonbTest { @BeforeClass public static void beforeClass() throws Exception { - assumeFalse( - "PgJsonb is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); testHelper = env.getTestHelper(); databaseAdminClient = testHelper.getClient().getDatabaseAdminClient(); databasesToDrop = new ArrayList<>(); @@ -97,7 +93,7 @@ public static void beforeClass() throws Exception { } @AfterClass - public static void afterClass() throws Exception { + public static void afterClass() { if (databasesToDrop != null) { for (DatabaseId id : databasesToDrop) { try { @@ -170,11 +166,19 @@ public void testPgJsonbInSecondaryIndex() { SpannerException spannerException = SpannerExceptionFactory.asSpannerException(executionException.getCause()); assertEquals(ErrorCode.FAILED_PRECONDITION, spannerException.getErrorCode()); - assertTrue( - spannerException.getMessage(), - spannerException - .getMessage() - .contains("Index idx_jsonb is defined on a column of unsupported type PG.JSONB.")); + if (isUsingEmulator()) { + assertTrue( + spannerException.getMessage(), + spannerException + .getMessage() + .contains("Cannot reference PG.JSONB col1 in the creation of index idx_jsonb.")); + } else { + assertTrue( + spannerException.getMessage(), + spannerException + .getMessage() + .contains("Index idx_jsonb is defined on a column of unsupported type PG.JSONB.")); + } } private static final String JSON_VALUE_1 = "{\"color\":\"red\",\"value\":\"#f00\"}"; @@ -189,8 +193,6 @@ public void testPgJsonbInSecondaryIndex() { @Test public void testLiteralPgJsonb() { - assumeFalse( - "PgJsonb is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -223,8 +225,6 @@ public void testLiteralPgJsonb() { @Test public void testPgJsonbParameter() { - assumeFalse( - "PgJsonb is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -275,12 +275,8 @@ private ListValue getJsonListValue(List jsonList) { .build(); } - @Ignore("Untyped jsonb parameters are not yet supported") @Test public void testPgJsonbUntypedParameter() { - assumeFalse( - "PgJsonb is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); - // Verify that we can use Jsonb as an untyped parameter. This is especially important for // PGAdapter and the JDBC driver, as these will often use untyped parameters. databaseClient @@ -362,8 +358,6 @@ public void testPgJsonbUntypedParameter() { @Test public void testMutationsWithPgJsonbAsString() { - assumeFalse( - "PgJsonb is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -418,8 +412,6 @@ public void testMutationsWithPgJsonbAsString() { @Test public void testMutationsWithPgJsonbAsValue() { - assumeFalse( - "PgJsonb is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java index bacb4718da0..76025b07175 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPgNumericTest.java @@ -18,7 +18,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; import com.google.cloud.spanner.Database; import com.google.cloud.spanner.DatabaseAdminClient; @@ -31,7 +30,6 @@ import com.google.cloud.spanner.ResultSet; import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.Value; -import com.google.cloud.spanner.testing.EmulatorSpannerHelper; import com.google.cloud.spanner.testing.RemoteSpannerHelper; import com.google.common.collect.ImmutableList; import java.math.BigDecimal; @@ -67,8 +65,6 @@ public class ITPgNumericTest { @BeforeClass public static void beforeClass() throws Exception { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); testHelper = env.getTestHelper(); databaseAdminClient = testHelper.getClient().getDatabaseAdminClient(); databasesToDrop = new ArrayList<>(); @@ -116,8 +112,6 @@ public void setUp() throws Exception { @Test public void testLiteralPgNumeric() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -134,7 +128,9 @@ public void testLiteralPgNumeric() { }); try (ResultSet resultSet = - databaseClient.singleUse().executeQuery(Statement.of("SELECT * FROM " + tableName))) { + databaseClient + .singleUse() + .executeQuery(Statement.of("SELECT * FROM " + tableName + " ORDER BY id"))) { resultSet.next(); assertEquals("1.23", resultSet.getString("col1")); @@ -151,8 +147,6 @@ public void testLiteralPgNumeric() { @Test public void testParameterizedWithPgNumericAsValue() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -176,7 +170,9 @@ public void testParameterizedWithPgNumericAsValue() { }); try (ResultSet resultSet = - databaseClient.singleUse().executeQuery(Statement.of("SELECT * FROM " + tableName))) { + databaseClient + .singleUse() + .executeQuery(Statement.of("SELECT * FROM " + tableName + " ORDER BY id"))) { resultSet.next(); assertEquals("1.23", resultSet.getString("col1")); @@ -193,8 +189,6 @@ public void testParameterizedWithPgNumericAsValue() { @Test public void testParameterizedWithPgNumericAsDouble() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -218,7 +212,9 @@ public void testParameterizedWithPgNumericAsDouble() { }); try (ResultSet resultSet = - databaseClient.singleUse().executeQuery(Statement.of("SELECT * FROM " + tableName))) { + databaseClient + .singleUse() + .executeQuery(Statement.of("SELECT * FROM " + tableName + " ORDER BY id"))) { resultSet.next(); assertEquals("1.23", resultSet.getString("col1")); @@ -235,8 +231,6 @@ public void testParameterizedWithPgNumericAsDouble() { @Test public void testParameterizedWithPgNumericAsInt() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -260,8 +254,6 @@ public void testParameterizedWithPgNumericAsInt() { @Test public void testParameterizedWithPgNumericAsLong() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -285,8 +277,6 @@ public void testParameterizedWithPgNumericAsLong() { @Test public void testMutationsWithPgNumericAsString() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -315,7 +305,9 @@ public void testMutationsWithPgNumericAsString() { }); try (ResultSet resultSet = - databaseClient.singleUse().executeQuery(Statement.of("SELECT * FROM " + tableName))) { + databaseClient + .singleUse() + .executeQuery(Statement.of("SELECT * FROM " + tableName + " ORDER BY id"))) { resultSet.next(); assertEquals("1.23", resultSet.getString("col1")); @@ -332,8 +324,6 @@ public void testMutationsWithPgNumericAsString() { @Test public void testMutationsWithPgNumericAsInt() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -360,8 +350,6 @@ public void testMutationsWithPgNumericAsInt() { @Test public void testMutationsWithPgNumericAsLong() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -388,8 +376,6 @@ public void testMutationsWithPgNumericAsLong() { @Test public void testMutationsWithPgNumericAsBigDecimal() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -412,7 +398,9 @@ public void testMutationsWithPgNumericAsBigDecimal() { }); try (ResultSet resultSet = - databaseClient.singleUse().executeQuery(Statement.of("SELECT * FROM " + tableName))) { + databaseClient + .singleUse() + .executeQuery(Statement.of("SELECT * FROM " + tableName + " ORDER BY id"))) { resultSet.next(); assertEquals("1.23", resultSet.getString("col1")); @@ -425,8 +413,6 @@ public void testMutationsWithPgNumericAsBigDecimal() { @Test public void testMutationsWithPgNumericAsValue() { - assumeFalse( - "PgNumeric is not supported in the emulator", EmulatorSpannerHelper.isUsingEmulator()); databaseClient .readWriteTransaction() .run( @@ -455,7 +441,9 @@ public void testMutationsWithPgNumericAsValue() { }); try (ResultSet resultSet = - databaseClient.singleUse().executeQuery(Statement.of("SELECT * FROM " + tableName))) { + databaseClient + .singleUse() + .executeQuery(Statement.of("SELECT * FROM " + tableName + " ORDER BY id"))) { resultSet.next(); assertEquals("1.23", resultSet.getString("col1")); From 7e265ac6550d36ad103e7a3f4eabe42be2c15515 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian <179120858+sakthivelmanii@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:34:27 +0530 Subject: [PATCH 07/43] ci(spanner): Fix nightly job issues (#3522) * ci(spanner): Fix nightly job permission issue * update scope for surefire-junit4 --- google-cloud-spanner-executor/pom.xml | 9 ++++++++- .../cloud/spanner/it/slow/ITBackupTest.java | 2 +- samples/install-without-bom/pom.xml | 6 +++--- samples/snapshot/pom.xml | 6 +++--- samples/snippets/pom.xml | 6 +++--- .../spanner/AddAndDropDatabaseRole.java | 20 +++++++++++-------- .../com/example/spanner/PgSpannerSample.java | 4 ++-- .../archived/AddAndDropDatabaseRole.java | 1 + .../admin/archived/CreateSequenceSample.java | 2 +- .../admin/archived/PgSpannerSample.java | 5 ++--- ...eateIncrementalBackupScheduleSampleIT.java | 6 +++--- .../CreateInstancePartitionSampleIT.java | 2 ++ .../com/example/spanner/DatabaseRolesIT.java | 3 ++- .../com/example/spanner/SampleTestBaseV2.java | 1 + .../example/spanner/SpannerGraphSampleIT.java | 2 +- .../com/example/spanner/SpannerSampleIT.java | 5 +++++ .../CustomInstanceConfigSampleIT.java | 2 +- .../admin/archived/DatabaseRolesIT.java | 5 ++++- .../admin/archived/PgSpannerSampleIT.java | 2 +- 19 files changed, 56 insertions(+), 33 deletions(-) diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index 1c45d6915fd..ccb631bb1a2 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -189,6 +189,13 @@ test + + org.apache.maven.surefire + surefire-junit4 + 3.5.2 + test + + @@ -259,7 +266,7 @@ org.apache.maven.plugins maven-dependency-plugin - com.google.api:gax + com.google.api:gax,org.apache.maven.surefire:surefire-junit4 diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/slow/ITBackupTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/slow/ITBackupTest.java index 9deb3289e07..1359046aee0 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/slow/ITBackupTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/slow/ITBackupTest.java @@ -717,7 +717,7 @@ private void testPagination() { Page page = dbAdminClient.listBackups(instanceId, Options.pageSize(1)); assertEquals(1, Iterables.size(page.getValues())); numBackups++; - assertTrue(page.hasNextPage()); + assertFalse(page.hasNextPage()); Set seenPageTokens = new HashSet<>(); seenPageTokens.add(""); while (page.hasNextPage()) { diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4de16e06367..cc7900ed246 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -148,12 +148,12 @@ 3.5.2 - java-client-integration-tests + java-sample-integration-tests java-client-mr-integration-tests nam11 us-east1 - java-client-integration-test-cmek-ring - java-client-integration-test-cmek-key + cmek-test-key-ring + cmek-test-key mysample quick-db diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cca1680ac10..9a6e4d0e30e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -147,12 +147,12 @@ 3.5.2 - java-client-integration-tests + java-sample-integration-tests java-client-mr-integration-tests nam11 us-east1 - java-client-integration-test-cmek-ring - java-client-integration-test-cmek-key + cmek-test-key-ring + cmek-test-key mysample mysample-instance quick-db diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 06698627ef9..df0488ac116 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -178,12 +178,12 @@ 3.5.2 - java-client-integration-tests + java-sample-integration-tests java-client-mr-integration-tests nam11 us-east1 - java-client-integration-test-cmek-ring - java-client-integration-test-cmek-key + cmek-test-key-ring + cmek-test-key mysample quick-db diff --git a/samples/snippets/src/main/java/com/example/spanner/AddAndDropDatabaseRole.java b/samples/snippets/src/main/java/com/example/spanner/AddAndDropDatabaseRole.java index 75e85f5f85c..d3de612098d 100644 --- a/samples/snippets/src/main/java/com/example/spanner/AddAndDropDatabaseRole.java +++ b/samples/snippets/src/main/java/com/example/spanner/AddAndDropDatabaseRole.java @@ -23,6 +23,8 @@ import com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient; import com.google.common.collect.ImmutableList; import com.google.spanner.admin.database.v1.DatabaseName; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -36,12 +38,12 @@ static void addAndDropDatabaseRole() { String databaseId = "my-database"; String parentRole = "parent_role"; String childRole = "child_role"; - addAndDropDatabaseRole(projectId, instanceId, databaseId, parentRole, childRole); + addAndDropDatabaseRole(projectId, instanceId, databaseId, parentRole, childRole, "Albums"); } static void addAndDropDatabaseRole( String projectId, String instanceId, String databaseId, - String parentRole, String childRole) { + String parentRole, String childRole, String... tables) { try (Spanner spanner = SpannerOptions.newBuilder() .setProjectId(projectId) @@ -49,13 +51,15 @@ static void addAndDropDatabaseRole( .getService(); DatabaseAdminClient databaseAdminClient = spanner.createDatabaseAdminClient()) { System.out.println("Waiting for role create operation to complete..."); + List roleStatements = new ArrayList<>(ImmutableList.of( + String.format("CREATE ROLE %s", parentRole), + String.format("CREATE ROLE %s", childRole), + String.format("GRANT ROLE %s TO ROLE %s", parentRole, childRole))); + for (String table : tables) { + roleStatements.add(String.format("GRANT SELECT ON TABLE %s TO ROLE %s", table, parentRole)); + } databaseAdminClient.updateDatabaseDdlAsync( - DatabaseName.of(projectId, instanceId, databaseId), - ImmutableList.of( - String.format("CREATE ROLE %s", parentRole), - String.format("GRANT SELECT ON TABLE Albums TO ROLE %s", parentRole), - String.format("CREATE ROLE %s", childRole), - String.format("GRANT ROLE %s TO ROLE %s", parentRole, childRole))) + DatabaseName.of(projectId, instanceId, databaseId), roleStatements) .get(5, TimeUnit.MINUTES); System.out.printf( "Created roles %s and %s and granted privileges%n", parentRole, childRole); diff --git a/samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java b/samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java index 600206c1481..b3ad5cd08c4 100644 --- a/samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java +++ b/samples/snippets/src/main/java/com/example/spanner/PgSpannerSample.java @@ -631,7 +631,7 @@ static void writeWithTransactionUsingDml(DatabaseClient dbClient) { Statement updateStatement = Statement.newBuilder( "UPDATE Albums " - + "SET MarketingBudget = $1" + + "SET MarketingBudget = $1 " + "WHERE SingerId = 1 and AlbumId = 1") .bind("p1") .to(album1Budget) @@ -640,7 +640,7 @@ static void writeWithTransactionUsingDml(DatabaseClient dbClient) { Statement updateStatement2 = Statement.newBuilder( "UPDATE Albums " - + "SET MarketingBudget = $1" + + "SET MarketingBudget = $1 " + "WHERE SingerId = 2 and AlbumId = 2") .bind("p1") .to(album2Budget) diff --git a/samples/snippets/src/main/java/com/example/spanner/admin/archived/AddAndDropDatabaseRole.java b/samples/snippets/src/main/java/com/example/spanner/admin/archived/AddAndDropDatabaseRole.java index cce8543492e..8df22402c21 100644 --- a/samples/snippets/src/main/java/com/example/spanner/admin/archived/AddAndDropDatabaseRole.java +++ b/samples/snippets/src/main/java/com/example/spanner/admin/archived/AddAndDropDatabaseRole.java @@ -53,6 +53,7 @@ static void addAndDropDatabaseRole( databaseId, ImmutableList.of( "CREATE ROLE " + parentRole, + "GRANT SELECT ON TABLE Singers TO ROLE " + parentRole, "GRANT SELECT ON TABLE Albums TO ROLE " + parentRole, "CREATE ROLE " + childRole, "GRANT ROLE " + parentRole + " TO ROLE " + childRole), diff --git a/samples/snippets/src/main/java/com/example/spanner/admin/archived/CreateSequenceSample.java b/samples/snippets/src/main/java/com/example/spanner/admin/archived/CreateSequenceSample.java index 637bd39d9a1..d0172eb2d53 100644 --- a/samples/snippets/src/main/java/com/example/spanner/admin/archived/CreateSequenceSample.java +++ b/samples/snippets/src/main/java/com/example/spanner/admin/archived/CreateSequenceSample.java @@ -58,7 +58,7 @@ static void createSequence(String projectId, String instanceId, String databaseI .get(5, TimeUnit.MINUTES); System.out.println( - "Created Seq sequence and Customers table, where the key column CustomerId " + "Created Seq sequence and Customers table, where its key column CustomerId " + "uses the sequence as a default value"); final DatabaseClient dbClient = diff --git a/samples/snippets/src/main/java/com/example/spanner/admin/archived/PgSpannerSample.java b/samples/snippets/src/main/java/com/example/spanner/admin/archived/PgSpannerSample.java index 8a95cebef04..0ab3a75c967 100644 --- a/samples/snippets/src/main/java/com/example/spanner/admin/archived/PgSpannerSample.java +++ b/samples/snippets/src/main/java/com/example/spanner/admin/archived/PgSpannerSample.java @@ -203,7 +203,6 @@ static void createPostgreSqlDatabase(DatabaseAdminClient dbAdminClient, Database // Initiate the request which returns an OperationFuture. Database db = op.get(); System.out.println("Created database [" + db.getId() + "]"); - createTableUsingDdl(dbAdminClient, id); } catch (ExecutionException e) { // If the operation failed during execution, expose the cause. throw (SpannerException) e.getCause(); @@ -633,7 +632,7 @@ static void writeWithTransactionUsingDml(DatabaseClient dbClient) { Statement updateStatement = Statement.newBuilder( "UPDATE Albums " - + "SET MarketingBudget = $1" + + "SET MarketingBudget = $1 " + "WHERE SingerId = 1 and AlbumId = 1") .bind("p1") .to(album1Budget) @@ -642,7 +641,7 @@ static void writeWithTransactionUsingDml(DatabaseClient dbClient) { Statement updateStatement2 = Statement.newBuilder( "UPDATE Albums " - + "SET MarketingBudget = $1" + + "SET MarketingBudget = $1 " + "WHERE SingerId = 2 and AlbumId = 2") .bind("p1") .to(album2Budget) diff --git a/samples/snippets/src/test/java/com/example/spanner/CreateIncrementalBackupScheduleSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/CreateIncrementalBackupScheduleSampleIT.java index 74136562e10..5d590a5b382 100644 --- a/samples/snippets/src/test/java/com/example/spanner/CreateIncrementalBackupScheduleSampleIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/CreateIncrementalBackupScheduleSampleIT.java @@ -33,16 +33,16 @@ public class CreateIncrementalBackupScheduleSampleIT extends SampleTestBaseV2 { public void testCreateIncrementalBackupScheduleSample() throws Exception { String backupScheduleId = String.format("schedule-%s", UUID.randomUUID()); BackupScheduleName backupScheduleName = - BackupScheduleName.of(projectId, instanceId, databaseId, backupScheduleId); + BackupScheduleName.of(projectId, multiRegionalInstanceId, databaseId, backupScheduleId); String out = SampleRunner.runSample( () -> { try { CreateIncrementalBackupScheduleSample.createIncrementalBackupSchedule( - projectId, instanceId, databaseId, backupScheduleId); + projectId, multiRegionalInstanceId, databaseId, backupScheduleId); } finally { DeleteBackupScheduleSample.deleteBackupSchedule( - projectId, instanceId, databaseId, backupScheduleId); + projectId, multiRegionalInstanceId, databaseId, backupScheduleId); } }); assertThat(out) diff --git a/samples/snippets/src/test/java/com/example/spanner/CreateInstancePartitionSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/CreateInstancePartitionSampleIT.java index 3038d29750d..b243a9229d2 100644 --- a/samples/snippets/src/test/java/com/example/spanner/CreateInstancePartitionSampleIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/CreateInstancePartitionSampleIT.java @@ -22,6 +22,7 @@ import com.google.cloud.spanner.InstanceConfigId; import com.google.cloud.spanner.InstanceId; import com.google.cloud.spanner.InstanceInfo; +import com.google.spanner.admin.instance.v1.Instance.Edition; import com.google.spanner.admin.instance.v1.InstancePartitionName; import org.junit.Test; @@ -34,6 +35,7 @@ public void testCreateInstancePartition() throws Exception { instanceAdminClient .createInstance( InstanceInfo.newBuilder(InstanceId.of(projectId, instanceId)) + .setEdition(Edition.ENTERPRISE_PLUS) .setDisplayName("Geo-partitioning test instance") .setInstanceConfigId(InstanceConfigId.of(projectId, "regional-us-central1")) .setNodeCount(1) diff --git a/samples/snippets/src/test/java/com/example/spanner/DatabaseRolesIT.java b/samples/snippets/src/test/java/com/example/spanner/DatabaseRolesIT.java index 6c2b41c3672..4b9013e62f4 100644 --- a/samples/snippets/src/test/java/com/example/spanner/DatabaseRolesIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/DatabaseRolesIT.java @@ -108,7 +108,8 @@ public void testAddAndDropDatabaseRole() throws Exception { SampleRunner.runSample( () -> AddAndDropDatabaseRole.addAndDropDatabaseRole( - projectId, instanceId, databaseId.getDatabase(), "new_parent", "new_child")); + projectId, instanceId, databaseId.getDatabase(), "new_parent", "new_child", + "Singers", "Albums")); assertTrue(out.contains("Created roles new_parent and new_child and granted privileges")); assertTrue(out.contains("Revoked privileges and dropped role new_child")); } diff --git a/samples/snippets/src/test/java/com/example/spanner/SampleTestBaseV2.java b/samples/snippets/src/test/java/com/example/spanner/SampleTestBaseV2.java index 909e79738b8..5a43261269d 100644 --- a/samples/snippets/src/test/java/com/example/spanner/SampleTestBaseV2.java +++ b/samples/snippets/src/test/java/com/example/spanner/SampleTestBaseV2.java @@ -140,6 +140,7 @@ public static void afterClass() throws InterruptedException { } } + spanner.close(); databaseAdminClient.close(); instanceAdminClient.close(); diff --git a/samples/snippets/src/test/java/com/example/spanner/SpannerGraphSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/SpannerGraphSampleIT.java index 6f778de49ab..be6e67282ab 100644 --- a/samples/snippets/src/test/java/com/example/spanner/SpannerGraphSampleIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/SpannerGraphSampleIT.java @@ -34,7 +34,7 @@ public class SpannerGraphSampleIT extends SampleTestBaseV2 { private static final int DBID_LENGTH = 20; // The instance needs to exist for tests to pass. - private static final String instanceId = System.getProperty("spanner.test.instance"); + private static final String instanceId = System.getProperty("spanner.test.instance.mr"); private static final String baseDbId = System.getProperty("spanner.sample.database"); static Spanner spanner; static DatabaseAdminClient databaseAdminClient; diff --git a/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java index 4e02f714e39..d59152b407c 100644 --- a/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java @@ -527,6 +527,7 @@ public void testEncryptedDatabaseAndBackupSamples() throws Exception { .setNodeCount(1) .build()) .get(); + System.out.println("Creating database ..."); try { String out = SampleRunner.runSample( @@ -538,6 +539,7 @@ public void testEncryptedDatabaseAndBackupSamples() throws Exception { String.format( "Created database [%s]", DatabaseName.of(projectId, instanceId, databaseId))); + System.out.println("Creating backup with encryption key ..."); out = SampleRunner.runSampleWithRetry( () -> @@ -556,6 +558,7 @@ public void testEncryptedDatabaseAndBackupSamples() throws Exception { + "was created at (.*) using encryption key %s", projectId, instanceId, encryptedBackupId, key)); + System.out.println("Restoring backup with encryption key ..."); out = SampleRunner.runSampleWithRetry( () -> @@ -587,6 +590,7 @@ public void testEncryptedDatabaseAndBackupSamples() throws Exception { } finally { // Delete the backups from the test instance first, as the instance can only be deleted once // all backups have been deleted. + System.out.println("Deleting backups ..."); deleteAllBackups(instanceId); instanceAdminClient.deleteInstance(instanceId); } @@ -633,6 +637,7 @@ private static void deleteAllBackups(String instanceId) throws InterruptedExcept InstanceName instanceName = InstanceName.of(projectId, instanceId); for (Backup backup : databaseAdminClient.listBackups(instanceName.toString()).iterateAll()) { int attempts = 0; + System.out.printf("Deleting backup ... %s%n", backup.getName()); while (attempts < 30) { try { attempts++; diff --git a/samples/snippets/src/test/java/com/example/spanner/admin/archived/CustomInstanceConfigSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/admin/archived/CustomInstanceConfigSampleIT.java index a56b72b75f1..c8271225ccb 100644 --- a/samples/snippets/src/test/java/com/example/spanner/admin/archived/CustomInstanceConfigSampleIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/admin/archived/CustomInstanceConfigSampleIT.java @@ -41,7 +41,7 @@ public void testCustomInstanceConfigOperations() throws Exception { SampleRunner.runSample( () -> ListInstanceConfigOperationsSample.listInstanceConfigOperations(projectId)); - assertTrue(out2.contains("List instance config operation")); + assertTrue(out2.contains("Create instance config operation")); // Update display name to a randomly generated instance config id. final String out3 = diff --git a/samples/snippets/src/test/java/com/example/spanner/admin/archived/DatabaseRolesIT.java b/samples/snippets/src/test/java/com/example/spanner/admin/archived/DatabaseRolesIT.java index 3e40189d946..f1bad568978 100644 --- a/samples/snippets/src/test/java/com/example/spanner/admin/archived/DatabaseRolesIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/admin/archived/DatabaseRolesIT.java @@ -31,12 +31,15 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.junit.runners.MethodSorters; /** Integration tests for FGAC samples for GoogleStandardSql dialect. */ @RunWith(JUnit4.class) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class DatabaseRolesIT extends SampleTestBase { private static DatabaseId databaseId; @@ -105,7 +108,7 @@ public void testAddAndDropDatabaseRole() throws Exception { SampleRunner.runSample( () -> AddAndDropDatabaseRole.addAndDropDatabaseRole( - projectId, instanceId, databaseId.getDatabase(), "new-parent", "new-child")); + projectId, instanceId, databaseId.getDatabase(), "new_parent", "new_child")); assertTrue(out.contains("Created roles new_parent and new_child and granted privileges")); assertTrue(out.contains("Revoked privileges and dropped role new_child")); } diff --git a/samples/snippets/src/test/java/com/example/spanner/admin/archived/PgSpannerSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/admin/archived/PgSpannerSampleIT.java index 72900b5e417..c4ba80f3f80 100644 --- a/samples/snippets/src/test/java/com/example/spanner/admin/archived/PgSpannerSampleIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/admin/archived/PgSpannerSampleIT.java @@ -130,7 +130,7 @@ public void testSample() throws Exception { assertThat(databaseId).isNotNull(); System.out.println("Create Database ..."); - String out = runSample("createpgdatabase"); + String out = runSample("createdatabase"); assertThat(out).contains("Created database"); assertThat(out).contains(dbId.getName()); From 7d2534d0e0e9c54bc2c4bf2affdeb6adda56b5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Tue, 10 Dec 2024 10:28:58 +0100 Subject: [PATCH 08/43] chore: add internal option for statement executor type (#3534) The Connection API by default uses either a platform thread or a virtual thread for each connection to execute and control the statements of that connection. This is used to enable asynchronous execution of statements and allows a statement to be cancelled by just interrupting this thread. Both these use cases are however not (or only very rarely) used by the most common users of the Connection API; the JDBC driver and PGAdapter. PGAdapter uses the PostgreSQL wire-protocol, which by design is synchronous, and JDBC is also a synchronous API. The latter has a cancel() method that currently requires this threading model, but this can be modified in the JDBC driver. Using a direct executor instead of a single-threaded executor per connection can save one thread per connection. The option is intentionally made package-private, so the above-mentioned frameworks can set it by default without it becoming part of the public API. --- .../spanner/connection/ConnectionImpl.java | 19 +++++- .../spanner/connection/ConnectionOptions.java | 13 ++++ .../spanner/connection/StatementExecutor.java | 23 +++++-- .../connection/AbstractMockServerTest.java | 6 ++ .../ConnectionAsyncApiAbortedTest.java | 7 ++ .../connection/ConnectionAsyncApiTest.java | 7 ++ .../spanner/connection/ConnectionTest.java | 7 ++ .../connection/StatementTimeoutTest.java | 64 ++++++++++++++++++- 8 files changed, 136 insertions(+), 10 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java index d7a1052d1c1..25ee8b39af4 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java @@ -76,6 +76,7 @@ import com.google.cloud.spanner.connection.AbstractStatementParser.StatementType; import com.google.cloud.spanner.connection.ConnectionProperty.Context; import com.google.cloud.spanner.connection.ConnectionState.Type; +import com.google.cloud.spanner.connection.StatementExecutor.StatementExecutorType; import com.google.cloud.spanner.connection.StatementExecutor.StatementTimeout; import com.google.cloud.spanner.connection.StatementResult.ResultType; import com.google.cloud.spanner.connection.UnitOfWork.CallType; @@ -284,9 +285,17 @@ static UnitOfWorkType of(TransactionMode transactionMode) { Preconditions.checkNotNull(options); this.leakedException = options.isTrackConnectionLeaks() ? new LeakedConnectionException() : null; + StatementExecutorType statementExecutorType; + if (options.getStatementExecutorType() != null) { + statementExecutorType = options.getStatementExecutorType(); + } else { + statementExecutorType = + options.isUseVirtualThreads() + ? StatementExecutorType.VIRTUAL_THREAD + : StatementExecutorType.DIRECT_EXECUTOR; + } this.statementExecutor = - new StatementExecutor( - options.isUseVirtualThreads(), options.getStatementExecutionInterceptors()); + new StatementExecutor(statementExecutorType, options.getStatementExecutionInterceptors()); this.spannerPool = SpannerPool.INSTANCE; this.options = options; this.spanner = spannerPool.getSpanner(options, this); @@ -330,7 +339,11 @@ && getDialect() == Dialect.POSTGRESQL this.leakedException = options.isTrackConnectionLeaks() ? new LeakedConnectionException() : null; this.statementExecutor = - new StatementExecutor(options.isUseVirtualThreads(), Collections.emptyList()); + new StatementExecutor( + options.isUseVirtualThreads() + ? StatementExecutorType.VIRTUAL_THREAD + : StatementExecutorType.DIRECT_EXECUTOR, + Collections.emptyList()); this.spannerPool = Preconditions.checkNotNull(spannerPool); this.options = Preconditions.checkNotNull(options); this.spanner = spannerPool.getSpanner(options, this); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java index 66b09c35afd..2be2d7980b2 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java @@ -70,6 +70,7 @@ import com.google.cloud.spanner.SpannerException; import com.google.cloud.spanner.SpannerExceptionFactory; import com.google.cloud.spanner.SpannerOptions; +import com.google.cloud.spanner.connection.StatementExecutor.StatementExecutorType; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.base.Strings; @@ -614,6 +615,7 @@ public static class Builder { new HashMap<>(); private String uri; private Credentials credentials; + private StatementExecutorType statementExecutorType; private SessionPoolOptions sessionPoolOptions; private List statementExecutionInterceptors = Collections.emptyList(); @@ -777,6 +779,11 @@ Builder setCredentials(Credentials credentials) { return this; } + Builder setStatementExecutorType(StatementExecutorType statementExecutorType) { + this.statementExecutorType = statementExecutorType; + return this; + } + public Builder setOpenTelemetry(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; return this; @@ -814,6 +821,7 @@ public static Builder newBuilder() { private final String instanceId; private final String databaseName; private final Credentials credentials; + private final StatementExecutorType statementExecutorType; private final SessionPoolOptions sessionPoolOptions; private final OpenTelemetry openTelemetry; @@ -834,6 +842,7 @@ private ConnectionOptions(Builder builder) { ConnectionPropertyValue value = cast(connectionPropertyValues.get(LENIENT.getKey())); this.warnings = checkValidProperties(value != null && value.getValue(), uri); this.fixedCredentials = builder.credentials; + this.statementExecutorType = builder.statementExecutorType; this.openTelemetry = builder.openTelemetry; this.statementExecutionInterceptors = @@ -1105,6 +1114,10 @@ CredentialsProvider getCredentialsProvider() { return getInitialConnectionPropertyValue(CREDENTIALS_PROVIDER); } + StatementExecutorType getStatementExecutorType() { + return this.statementExecutorType; + } + /** The {@link SessionPoolOptions} of this {@link ConnectionOptions}. */ public SessionPoolOptions getSessionPoolOptions() { return sessionPoolOptions; diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java index b92e575a047..7340834a926 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/StatementExecutor.java @@ -146,7 +146,10 @@ java.time.Duration asDuration() { ThreadFactoryUtil.createVirtualOrPlatformDaemonThreadFactory("connection-executor", false); /** Creates an {@link ExecutorService} for a {@link StatementExecutor}. */ - private static ListeningExecutorService createExecutorService(boolean useVirtualThreads) { + private static ListeningExecutorService createExecutorService(StatementExecutorType type) { + if (type == StatementExecutorType.DIRECT_EXECUTOR) { + return MoreExecutors.newDirectExecutorService(); + } return MoreExecutors.listeningDecorator( Context.taskWrapping( new ThreadPoolExecutor( @@ -155,7 +158,7 @@ private static ListeningExecutorService createExecutorService(boolean useVirtual 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), - useVirtualThreads + type == StatementExecutorType.VIRTUAL_THREAD ? DEFAULT_VIRTUAL_THREAD_FACTORY : DEFAULT_DAEMON_THREAD_FACTORY))); } @@ -168,13 +171,23 @@ private static ListeningExecutorService createExecutorService(boolean useVirtual */ private final List interceptors; + enum StatementExecutorType { + PLATFORM_THREAD, + VIRTUAL_THREAD, + DIRECT_EXECUTOR, + } + @VisibleForTesting StatementExecutor() { - this(DEFAULT_USE_VIRTUAL_THREADS, Collections.emptyList()); + this( + DEFAULT_USE_VIRTUAL_THREADS + ? StatementExecutorType.VIRTUAL_THREAD + : StatementExecutorType.PLATFORM_THREAD, + Collections.emptyList()); } - StatementExecutor(boolean useVirtualThreads, List interceptors) { - this.executor = createExecutorService(useVirtualThreads); + StatementExecutor(StatementExecutorType type, List interceptors) { + this.executor = createExecutorService(type); this.interceptors = Collections.unmodifiableList(interceptors); } diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java index 375fdda2a95..fa3ab00b138 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractMockServerTest.java @@ -283,6 +283,7 @@ ITConnection createConnection( ConnectionOptions.newBuilder() .setUri(getBaseUrl() + additionalUrlOptions) .setStatementExecutionInterceptors(interceptors); + configureConnectionOptions(builder); ConnectionOptions options = builder.build(); ITConnection connection = createITConnection(options); for (TransactionRetryListener listener : transactionRetryListeners) { @@ -291,6 +292,11 @@ ITConnection createConnection( return connection; } + protected ConnectionOptions.Builder configureConnectionOptions( + ConnectionOptions.Builder builder) { + return builder; + } + protected String getBaseUrl() { return String.format( "cloudspanner://localhost:%d/projects/proj/instances/inst/databases/db?usePlainText=true;autocommit=false;retryAbortsInternally=true", diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiAbortedTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiAbortedTest.java index 97d745edd7f..1f4378ecd86 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiAbortedTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiAbortedTest.java @@ -32,7 +32,9 @@ import com.google.cloud.spanner.Options; import com.google.cloud.spanner.SpannerExceptionFactory; import com.google.cloud.spanner.Statement; +import com.google.cloud.spanner.connection.ConnectionOptions.Builder; import com.google.cloud.spanner.connection.ITAbstractSpannerTest.ITConnection; +import com.google.cloud.spanner.connection.StatementExecutor.StatementExecutorType; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -127,6 +129,11 @@ ITConnection createConnection(TransactionRetryListener listener) { return connection; } + @Override + protected Builder configureConnectionOptions(Builder builder) { + return builder.setStatementExecutorType(StatementExecutorType.PLATFORM_THREAD); + } + @Test public void testSingleQueryAborted() { RetryCounter counter = new RetryCounter(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiTest.java index 21fe086d4f8..c6777da5b51 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionAsyncApiTest.java @@ -36,7 +36,9 @@ import com.google.cloud.spanner.SpannerApiFutures; import com.google.cloud.spanner.SpannerException; import com.google.cloud.spanner.Statement; +import com.google.cloud.spanner.connection.ConnectionOptions.Builder; import com.google.cloud.spanner.connection.SpannerPool.CheckAndCloseSpannersMode; +import com.google.cloud.spanner.connection.StatementExecutor.StatementExecutorType; import com.google.cloud.spanner.connection.StatementResult.ResultType; import com.google.common.base.Function; import com.google.common.collect.Collections2; @@ -86,6 +88,11 @@ public void setup() { } } + @Override + protected Builder configureConnectionOptions(Builder builder) { + return builder.setStatementExecutorType(StatementExecutorType.PLATFORM_THREAD); + } + @After public void reset() { mockSpanner.removeAllExecutionTimes(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java index c5b34982255..9ae174bd403 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionTest.java @@ -36,6 +36,8 @@ import com.google.cloud.spanner.SpannerOptions; import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.TimestampBound; +import com.google.cloud.spanner.connection.ConnectionOptions.Builder; +import com.google.cloud.spanner.connection.StatementExecutor.StatementExecutorType; import com.google.common.collect.ImmutableList; import com.google.spanner.v1.BatchCreateSessionsRequest; import com.google.spanner.v1.CommitRequest; @@ -417,6 +419,11 @@ protected String getBaseUrl() { return super.getBaseUrl() + ";maxSessions=1"; } + @Override + protected Builder configureConnectionOptions(Builder builder) { + return builder.setStatementExecutorType(StatementExecutorType.PLATFORM_THREAD); + } + @Test public void testMaxSessions() throws InterruptedException, TimeoutException, ExecutionException { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java index f55c55c6c93..a50fb98f1e3 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/StatementTimeoutTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeFalse; import com.google.api.core.SettableApiFuture; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; @@ -35,6 +36,7 @@ import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.connection.AbstractConnectionImplTest.ConnectionConsumer; import com.google.cloud.spanner.connection.ITAbstractSpannerTest.ITConnection; +import com.google.cloud.spanner.connection.StatementExecutor.StatementExecutorType; import com.google.common.base.Stopwatch; import com.google.common.collect.Collections2; import com.google.longrunning.Operation; @@ -58,9 +60,11 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; -@RunWith(JUnit4.class) +@RunWith(Parameterized.class) public class StatementTimeoutTest extends AbstractMockServerTest { private static final String SLOW_SELECT = "SELECT foo FROM bar"; @@ -85,10 +89,18 @@ public class StatementTimeoutTest extends AbstractMockServerTest { */ private static final int TIMEOUT_FOR_SLOW_STATEMENTS = 50; + @Parameters(name = "statementExecutorType = {0}") + public static Object[] parameters() { + return StatementExecutorType.values(); + } + + @Parameter public StatementExecutorType statementExecutorType; + protected ITConnection createConnection() { ConnectionOptions options = ConnectionOptions.newBuilder() .setUri(getBaseUrl() + ";trackSessionLeaks=false") + .setStatementExecutorType(statementExecutorType) .setConfigurator( optionsConfigurator -> optionsConfigurator @@ -618,6 +630,10 @@ private void waitForDdlRequestOnServer() { @Test public void testCancelReadOnlyAutocommit() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -643,6 +659,10 @@ public void testCancelReadOnlyAutocommit() { @Test public void testCancelReadOnlyAutocommitMultipleStatements() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -675,6 +695,10 @@ public void testCancelReadOnlyAutocommitMultipleStatements() { @Test public void testCancelReadOnlyTransactional() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -700,6 +724,10 @@ public void testCancelReadOnlyTransactional() { @Test public void testCancelReadOnlyTransactionalMultipleStatements() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -737,6 +765,10 @@ public void testCancelReadOnlyTransactionalMultipleStatements() { @Test public void testCancelReadWriteAutocommit() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -761,6 +793,10 @@ public void testCancelReadWriteAutocommit() { @Test public void testCancelReadWriteAutocommitMultipleStatements() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -792,6 +828,10 @@ public void testCancelReadWriteAutocommitMultipleStatements() { @Test public void testCancelReadWriteAutocommitSlowUpdate() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -815,6 +855,10 @@ public void testCancelReadWriteAutocommitSlowUpdate() { @Test public void testCancelReadWriteAutocommitSlowCommit() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setCommitExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -838,6 +882,10 @@ public void testCancelReadWriteAutocommitSlowCommit() { @Test public void testCancelReadWriteTransactional() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -862,6 +910,10 @@ public void testCancelReadWriteTransactional() { @Test public void testCancelReadWriteTransactionalMultipleStatements() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + mockSpanner.setExecuteStreamingSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(EXECUTION_TIME_SLOW_STATEMENT, 0)); @@ -928,6 +980,10 @@ static void addMockDdlOperations(int count, boolean done) { @Test public void testCancelDdlBatch() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + addSlowMockDdlOperation(); try (Connection connection = createConnection()) { @@ -951,6 +1007,10 @@ public void testCancelDdlBatch() { @Test public void testCancelDdlAutocommit() { + assumeFalse( + "Direct executor does not yet support cancelling statements", + statementExecutorType == StatementExecutorType.DIRECT_EXECUTOR); + addSlowMockDdlOperation(); try (Connection connection = createConnection()) { From 725efa35531e865564bc4a06c5ec865ee4142f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Tue, 10 Dec 2024 10:29:15 +0100 Subject: [PATCH 09/43] feat: support 'set local' for retry_aborts_internally (#3532) Adds support for `set local retry_aborts_internally=true|false` in the Connection API. This change also adds the parsing infrastructure that is needed to support `set local` for all connection variables. Support for this will be added to other connection variables in follow-up pull requests. --- .../ClientSideStatementSetExecutor.java | 62 +- .../spanner/connection/ConnectionImpl.java | 6 +- .../ConnectionStatementExecutor.java | 2 +- .../ConnectionStatementExecutorImpl.java | 5 +- .../connection/ClientSideStatements.json | 11 +- .../connection/PG_ClientSideStatements.json | 19 +- .../ConnectionStateMockServerTest.java | 63 + .../connection/ClientSideStatementsTest.sql | 674 +++++ .../ConnectionImplGeneratedSqlScriptTest.sql | 224 +- .../postgresql/ClientSideStatementsTest.sql | 2696 +++++++++++++++++ .../ConnectionImplGeneratedSqlScriptTest.sql | 224 +- 11 files changed, 3740 insertions(+), 246 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java index 413905116ff..38c7c364106 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ClientSideStatementSetExecutor.java @@ -16,13 +16,18 @@ package com.google.cloud.spanner.connection; +import com.google.cloud.Tuple; import com.google.cloud.spanner.ErrorCode; import com.google.cloud.spanner.SpannerExceptionFactory; import com.google.cloud.spanner.connection.AbstractStatementParser.ParsedStatement; import com.google.cloud.spanner.connection.ClientSideStatementImpl.CompileException; import com.google.common.base.Preconditions; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.util.concurrent.UncheckedExecutionException; import java.lang.reflect.Constructor; import java.lang.reflect.Method; +import java.util.concurrent.ExecutionException; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -31,8 +36,10 @@ * AUTOCOMMIT=TRUE. */ class ClientSideStatementSetExecutor implements ClientSideStatementExecutor { + private final Cache> cache; private final ClientSideStatementImpl statement; private final Method method; + private final boolean supportsLocal; private final ClientSideStatementValueConverter converter; private final Pattern allowedValuesPattern; @@ -46,12 +53,18 @@ class ClientSideStatementSetExecutor implements ClientSideStatementExecutor { @SuppressWarnings("unchecked") ClientSideStatementSetExecutor(ClientSideStatementImpl statement) throws CompileException { Preconditions.checkNotNull(statement.getSetStatement()); + this.cache = + CacheBuilder.newBuilder() + .maximumSize(25) + // Set the concurrency level to 1, as we don't expect many concurrent updates. + .concurrencyLevel(1) + .build(); try { this.statement = statement; this.allowedValuesPattern = Pattern.compile( String.format( - "(?is)\\A\\s*set\\s+%s\\s*%s\\s*%s\\s*\\z", + "(?is)\\A\\s*set\\s+((?:local|session)\\s+)?%s\\s*%s\\s*%s\\s*\\z", statement.getSetStatement().getPropertyName(), statement.getSetStatement().getSeparator(), statement.getSetStatement().getAllowedValues())); @@ -64,9 +77,21 @@ class ClientSideStatementSetExecutor implements ClientSideStatementExecutor { Constructor> constructor = converterClass.getConstructor(String.class); this.converter = constructor.newInstance(statement.getSetStatement().getAllowedValues()); - this.method = - ConnectionStatementExecutor.class.getDeclaredMethod( - statement.getMethodName(), converter.getParameterClass()); + Method method; + boolean supportsLocal; + try { + method = + ConnectionStatementExecutor.class.getDeclaredMethod( + statement.getMethodName(), converter.getParameterClass()); + supportsLocal = false; + } catch (NoSuchMethodException ignore) { + method = + ConnectionStatementExecutor.class.getDeclaredMethod( + statement.getMethodName(), converter.getParameterClass(), Boolean.class); + supportsLocal = true; + } + this.method = method; + this.supportsLocal = supportsLocal; } catch (Exception e) { throw new CompileException(e, statement); } @@ -75,17 +100,29 @@ class ClientSideStatementSetExecutor implements ClientSideStatementExecutor { @Override public StatementResult execute(ConnectionStatementExecutor connection, ParsedStatement statement) throws Exception { - return (StatementResult) - method.invoke(connection, getParameterValue(statement.getSqlWithoutComments())); + Tuple value; + try { + value = + this.cache.get( + statement.getSqlWithoutComments(), + () -> getParameterValue(statement.getSqlWithoutComments())); + } catch (ExecutionException | UncheckedExecutionException executionException) { + throw SpannerExceptionFactory.asSpannerException(executionException.getCause()); + } + if (this.supportsLocal) { + return (StatementResult) method.invoke(connection, value.x(), value.y()); + } + return (StatementResult) method.invoke(connection, value.x()); } - T getParameterValue(String sql) { + Tuple getParameterValue(String sql) { Matcher matcher = allowedValuesPattern.matcher(sql); - if (matcher.find() && matcher.groupCount() >= 1) { - String value = matcher.group(1); + if (matcher.find() && matcher.groupCount() >= 2) { + boolean local = matcher.group(1) != null && "local".equalsIgnoreCase(matcher.group(1).trim()); + String value = matcher.group(2); T res = converter.convert(value); if (res != null) { - return res; + return Tuple.of(res, local); } throw SpannerExceptionFactory.newSpannerException( ErrorCode.INVALID_ARGUMENT, @@ -94,8 +131,9 @@ T getParameterValue(String sql) { this.statement.getSetStatement().getPropertyName(), value)); } else { Matcher invalidMatcher = this.statement.getPattern().matcher(sql); - if (invalidMatcher.find() && invalidMatcher.groupCount() == 1) { - String invalidValue = invalidMatcher.group(1); + int valueGroup = this.supportsLocal ? 2 : 1; + if (invalidMatcher.find() && invalidMatcher.groupCount() == valueGroup) { + String invalidValue = invalidMatcher.group(valueGroup); throw SpannerExceptionFactory.newSpannerException( ErrorCode.INVALID_ARGUMENT, String.format( diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java index 25ee8b39af4..9f4a43d5a2e 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java @@ -942,8 +942,12 @@ public boolean isRetryAbortsInternally() { @Override public void setRetryAbortsInternally(boolean retryAbortsInternally) { + setRetryAbortsInternally(retryAbortsInternally, /* local = */ false); + } + + void setRetryAbortsInternally(boolean retryAbortsInternally, boolean local) { checkSetRetryAbortsInternallyAvailable(); - setConnectionPropertyValue(RETRY_ABORTS_INTERNALLY, retryAbortsInternally); + setConnectionPropertyValue(RETRY_ABORTS_INTERNALLY, retryAbortsInternally, local); } @Override diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutor.java index 48f79118fee..458f117242e 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutor.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutor.java @@ -44,7 +44,7 @@ interface ConnectionStatementExecutor { StatementResult statementShowReadOnly(); - StatementResult statementSetRetryAbortsInternally(Boolean retryAbortsInternally); + StatementResult statementSetRetryAbortsInternally(Boolean retryAbortsInternally, Boolean local); StatementResult statementShowRetryAbortsInternally(); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutorImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutorImpl.java index 9b28ee7503b..a321c6a5cbc 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutorImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionStatementExecutorImpl.java @@ -181,9 +181,10 @@ public StatementResult statementShowReadOnly() { } @Override - public StatementResult statementSetRetryAbortsInternally(Boolean retryAbortsInternally) { + public StatementResult statementSetRetryAbortsInternally( + Boolean retryAbortsInternally, Boolean local) { Preconditions.checkNotNull(retryAbortsInternally); - getConnection().setRetryAbortsInternally(retryAbortsInternally); + getConnection().setRetryAbortsInternally(retryAbortsInternally, local); return noResult(SET_RETRY_ABORTS_INTERNALLY); } diff --git a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json index 31e8d4efd1d..7998d50c2b8 100644 --- a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json +++ b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json @@ -355,13 +355,18 @@ } }, { - "name": "SET RETRY_ABORTS_INTERNALLY = TRUE|FALSE", + "name": "SET [LOCAL] RETRY_ABORTS_INTERNALLY = TRUE|FALSE", "executorName": "ClientSideStatementSetExecutor", "resultType": "NO_RESULT", "statementType": "SET_RETRY_ABORTS_INTERNALLY", - "regex": "(?is)\\A\\s*set\\s+retry_aborts_internally\\s*(?:=)\\s*(.*)\\z", + "regex": "(?is)\\A\\s*set\\s+(local\\s+)?retry_aborts_internally\\s*(?:=)\\s*(.*)\\z", "method": "statementSetRetryAbortsInternally", - "exampleStatements": ["set retry_aborts_internally = true", "set retry_aborts_internally = false"], + "exampleStatements": [ + "set retry_aborts_internally = true", + "set retry_aborts_internally = false", + "set local retry_aborts_internally = true", + "set local retry_aborts_internally = false" + ], "examplePrerequisiteStatements": ["set readonly = false", "set autocommit = false"], "setStatement": { "propertyName": "RETRY_ABORTS_INTERNALLY", diff --git a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json index 969487142e1..1c9dea19597 100644 --- a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json +++ b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json @@ -404,13 +404,26 @@ } }, { - "name": "SET SPANNER.RETRY_ABORTS_INTERNALLY =|TO TRUE|FALSE", + "name": "SET [SESSION|LOCAL] SPANNER.RETRY_ABORTS_INTERNALLY =|TO TRUE|FALSE", "executorName": "ClientSideStatementSetExecutor", "resultType": "NO_RESULT", "statementType": "SET_RETRY_ABORTS_INTERNALLY", - "regex": "(?is)\\A\\s*set\\s+spanner\\.retry_aborts_internally(?:\\s*=\\s*|\\s+to\\s+)(.*)\\z", + "regex": "(?is)\\A\\s*set\\s+((?:session|local)\\s+)?spanner\\.retry_aborts_internally(?:\\s*=\\s*|\\s+to\\s+)(.*)\\z", "method": "statementSetRetryAbortsInternally", - "exampleStatements": ["set spanner.retry_aborts_internally = true", "set spanner.retry_aborts_internally = false", "set spanner.retry_aborts_internally to true", "set spanner.retry_aborts_internally to false"], + "exampleStatements": [ + "set spanner.retry_aborts_internally = true", + "set spanner.retry_aborts_internally = false", + "set spanner.retry_aborts_internally to true", + "set spanner.retry_aborts_internally to false", + "set local spanner.retry_aborts_internally = true", + "set local spanner.retry_aborts_internally = false", + "set local spanner.retry_aborts_internally to true", + "set local spanner.retry_aborts_internally to false", + "set session spanner.retry_aborts_internally = true", + "set session spanner.retry_aborts_internally = false", + "set session spanner.retry_aborts_internally to true", + "set session spanner.retry_aborts_internally to false" + ], "examplePrerequisiteStatements": ["set spanner.readonly = false", "set autocommit = false"], "setStatement": { "propertyName": "SPANNER.RETRY_ABORTS_INTERNALLY", diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionStateMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionStateMockServerTest.java index ea79a7132bf..4c9397a6714 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionStateMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionStateMockServerTest.java @@ -19,10 +19,15 @@ import static com.google.cloud.spanner.connection.ConnectionProperties.CONNECTION_STATE_TYPE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; import com.google.cloud.spanner.Dialect; +import com.google.cloud.spanner.ErrorCode; import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult; +import com.google.cloud.spanner.SpannerException; +import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.connection.ConnectionState.Type; import com.google.cloud.spanner.connection.ITAbstractSpannerTest.ITConnection; import org.junit.After; @@ -84,6 +89,10 @@ ITConnection createConnection(ConnectionState.Type type) { return createConnection(";" + CONNECTION_STATE_TYPE.getKey() + "=" + type.name()); } + String getPrefix() { + return dialect == Dialect.POSTGRESQL ? "SPANNER." : ""; + } + @Test public void testConnectionStateType() { try (Connection connection = createConnection()) { @@ -228,4 +237,58 @@ public void testLocalChangeIsLostAfterTransaction() { } } } + + @Test + public void testSetLocalWithSqlStatement() { + try (Connection connection = createConnection()) { + connection.setAutocommit(false); + + assertTrue(connection.isRetryAbortsInternally()); + connection.execute( + Statement.of(String.format("set local %sretry_aborts_internally=false", getPrefix()))); + assertFalse(connection.isRetryAbortsInternally()); + connection.commit(); + assertTrue(connection.isRetryAbortsInternally()); + } + } + + @Test + public void testSetSessionWithSqlStatement() { + assumeTrue("Only PostgreSQL supports the 'session' keyword", dialect == Dialect.POSTGRESQL); + + try (Connection connection = createConnection()) { + connection.setAutocommit(false); + + assertTrue(connection.isRetryAbortsInternally()); + connection.execute( + Statement.of(String.format("set session %sretry_aborts_internally=false", getPrefix()))); + assertFalse(connection.isRetryAbortsInternally()); + connection.commit(); + assertFalse(connection.isRetryAbortsInternally()); + } + } + + @Test + public void testSetLocalInvalidValue() { + try (Connection connection = createConnection()) { + connection.setAutocommit(false); + + assertTrue(connection.isRetryAbortsInternally()); + SpannerException exception = + assertThrows( + SpannerException.class, + () -> + connection.execute( + Statement.of( + String.format("set local %sretry_aborts_internally=foo", getPrefix())))); + assertEquals(ErrorCode.INVALID_ARGUMENT, exception.getErrorCode()); + assertTrue( + exception.getMessage(), + exception + .getMessage() + .endsWith( + String.format("Unknown value for %sRETRY_ABORTS_INTERNALLY: foo", getPrefix()))); + assertTrue(connection.isRetryAbortsInternally()); + } + } } diff --git a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql index 552e75f1097..181f30987d0 100644 --- a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql +++ b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql @@ -9895,6 +9895,680 @@ set autocommit = false; @EXPECT EXCEPTION INVALID_ARGUMENT set retry_aborts_internally =/-false; NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +SET LOCAL RETRY_ABORTS_INTERNALLY = TRUE; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; + set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; + set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; + + + +set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = true ; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = true ; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = true + +; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set +local +retry_aborts_internally += +true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true bar; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true%; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =%true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true_; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =_true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true&; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =&true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true$; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =$true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true@; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =@true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true!; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =!true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true*; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =*true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true(; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =(true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true); +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =)true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true-; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =-true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true+; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =+true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true-#; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =-#true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true/; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =/true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true\; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =\true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true?; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =?true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true-/; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =-/true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true/#; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =/#true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set local retry_aborts_internally = true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = true/-; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =/-true; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +SET LOCAL RETRY_ABORTS_INTERNALLY = FALSE; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; + set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; + set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; + + + +set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = false ; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = false ; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = false + +; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +set +local +retry_aborts_internally += +false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false bar; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false%; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =%false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false_; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =_false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false&; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =&false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false$; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =$false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false@; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =@false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false!; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =!false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false*; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =*false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false(; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =(false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false); +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =)false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false-; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =-false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false+; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =+false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false-#; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =-#false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false/; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =/false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false\; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =\false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false?; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =?false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false-/; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =-/false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false/#; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =/#false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set local retry_aborts_internally = false; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally = false/-; +NEW_CONNECTION; +set readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local retry_aborts_internally =/-false; +NEW_CONNECTION; set autocommit_dml_mode='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; diff --git a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql index 5985ba92479..5dcf6577d5b 100644 --- a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql +++ b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql @@ -160,15 +160,15 @@ NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.066000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.066000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.280000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.280000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.066000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.280000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -510,15 +510,15 @@ NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.187000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.187000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.405000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.405000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.187000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.405000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -950,8 +950,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; ROLLBACK; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.294000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.294000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.518000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.518000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; @@ -961,7 +961,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.294000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.518000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -1462,8 +1462,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.413000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.413000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.636000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.636000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; @@ -1473,7 +1473,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.413000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.636000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -1876,15 +1876,15 @@ NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.523000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.523000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.733000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.733000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.523000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.733000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -2243,14 +2243,14 @@ SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.613000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.812000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.613000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.812000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -2600,13 +2600,13 @@ SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.705000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.901000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.705000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.901000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -2910,14 +2910,14 @@ SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.790000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.790000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.978000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.978000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.790000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.978000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -3245,15 +3245,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.890000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.890000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.078000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.078000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.890000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.078000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -3662,8 +3662,8 @@ SET AUTOCOMMIT=FALSE; START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); RUN BATCH; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.965000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.965000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.149000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.149000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -3672,7 +3672,7 @@ START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.965000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.149000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -4081,14 +4081,14 @@ SET AUTOCOMMIT=FALSE; START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.043000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.223000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.043000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.223000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -4438,13 +4438,13 @@ SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.113000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.284000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.113000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.284000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -4877,8 +4877,8 @@ SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.181000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.181000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.349000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.349000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -4888,7 +4888,7 @@ SET TRANSACTION READ ONLY; SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.181000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.349000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -5288,15 +5288,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.260000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.260000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.424000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.424000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.260000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.424000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -5641,15 +5641,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.330000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.330000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.488000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.488000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.330000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.488000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -6088,8 +6088,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; ROLLBACK; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.402000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.402000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.558000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.558000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -6099,7 +6099,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.402000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.558000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -6607,8 +6607,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.495000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.495000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.646000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.646000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -6618,7 +6618,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.495000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.646000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -7023,15 +7023,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.578000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.578000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.725000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.725000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.578000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.725000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -7394,14 +7394,14 @@ SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.654000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.790000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.654000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.790000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -7756,13 +7756,13 @@ SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.734000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.868000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.734000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.868000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -8075,14 +8075,14 @@ SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.805000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.805000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.940000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.940000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.805000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.940000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -8392,13 +8392,13 @@ SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.865000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.865000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; @@ -8753,8 +8753,8 @@ SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.924000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.924000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.061000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.061000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -8762,7 +8762,7 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.924000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.061000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; @@ -9200,8 +9200,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; UPDATE foo SET bar=1; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.991000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.991000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.128000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.128000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -9209,8 +9209,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; UPDATE foo SET bar=1; COMMIT; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.991000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:11.991000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.128000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.128000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -9596,15 +9596,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.064000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.064000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.200000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.200000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.064000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.200000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; @@ -9958,15 +9958,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.125000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.125000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.258000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.258000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.125000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.125000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.258000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.258000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -10329,15 +10329,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; UPDATE foo SET bar=1; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.193000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.193000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.325000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.325000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; UPDATE foo SET bar=1; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.193000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.193000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.325000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.325000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -10730,16 +10730,16 @@ SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.262000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.262000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.390000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.390000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.262000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.262000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.390000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.390000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -11125,15 +11125,15 @@ NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.330000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.330000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.456000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.456000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.330000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.330000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.456000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.456000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -11466,14 +11466,14 @@ SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.396000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.396000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.538000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.538000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.396000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.396000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.538000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.538000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; @@ -11796,15 +11796,15 @@ NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.456000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.456000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.595000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.595000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.456000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.456000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.595000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.595000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; @@ -12211,8 +12211,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.519000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.519000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.658000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.658000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; @@ -12220,8 +12220,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.519000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.519000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.658000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.658000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; @@ -12604,15 +12604,15 @@ NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.586000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.586000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.723000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.723000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.586000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.723000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; @@ -12950,15 +12950,15 @@ NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.650000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.650000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.781000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.781000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.650000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.650000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.781000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.781000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; @@ -13305,15 +13305,15 @@ NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.715000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.715000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.844000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.844000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.715000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.715000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.844000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.844000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; @@ -13630,14 +13630,14 @@ SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.778000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.778000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.904000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.904000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.778000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.778000000Z' +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.904000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.904000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; diff --git a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ClientSideStatementsTest.sql b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ClientSideStatementsTest.sql index aea0bf4b808..54374f0ad87 100644 --- a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ClientSideStatementsTest.sql +++ b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ClientSideStatementsTest.sql @@ -49892,6 +49892,2702 @@ set autocommit = false; @EXPECT EXCEPTION INVALID_ARGUMENT set spanner.retry_aborts_internally to/-false; NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET LOCAL SPANNER.RETRY_ABORTS_INTERNALLY = TRUE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = true + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +local +spanner.retry_aborts_internally += +true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =%true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =_true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =&true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =$true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =@true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =!true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =*true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =(true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =)true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =+true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =-#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =\true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =?true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =-/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =/#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set local spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = true/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =/-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET LOCAL SPANNER.RETRY_ABORTS_INTERNALLY = FALSE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = false + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +local +spanner.retry_aborts_internally += +false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =%false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =_false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =&false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =$false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =@false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =!false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =*false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =(false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =)false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =-false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =+false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =-#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =\false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =?false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =-/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =/#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set local spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally = false/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally =/-false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET LOCAL SPANNER.RETRY_ABORTS_INTERNALLY TO TRUE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to true + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +local +spanner.retry_aborts_internally +to +true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to%true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to_true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to&true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to$true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to@true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to!true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to*true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to(true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to)true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to+true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to-#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to\true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to?true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to-/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to/#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set local spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to true/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to/-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET LOCAL SPANNER.RETRY_ABORTS_INTERNALLY TO FALSE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to false + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +local +spanner.retry_aborts_internally +to +false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to%false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to_false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to&false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to$false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to@false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to!false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to*false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to(false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to)false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to-false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to+false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to-#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to\false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to?false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to-/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to/#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set local spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to false/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set local spanner.retry_aborts_internally to/-false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET SESSION SPANNER.RETRY_ABORTS_INTERNALLY = TRUE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = true + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +session +spanner.retry_aborts_internally += +true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =%true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =_true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =&true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =$true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =@true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =!true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =*true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =(true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =)true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =+true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =-#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =\true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =?true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =-/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =/#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set session spanner.retry_aborts_internally = true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = true/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =/-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET SESSION SPANNER.RETRY_ABORTS_INTERNALLY = FALSE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = false + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +session +spanner.retry_aborts_internally += +false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =%false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =_false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =&false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =$false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =@false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =!false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =*false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =(false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =)false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =-false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =+false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =-#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =\false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =?false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =-/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =/#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set session spanner.retry_aborts_internally = false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally = false/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally =/-false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET SESSION SPANNER.RETRY_ABORTS_INTERNALLY TO TRUE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to true ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to true + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +session +spanner.retry_aborts_internally +to +true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to%true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to_true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to&true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to$true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to@true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to!true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to*true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to(true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to)true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to+true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to-#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to\true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to?true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to-/true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to/#true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set session spanner.retry_aborts_internally to true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to true/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to/-true; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +SET SESSION SPANNER.RETRY_ABORTS_INTERNALLY TO FALSE; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; + + + +set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to false ; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to false + +; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +set +session +spanner.retry_aborts_internally +to +false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false bar; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false%; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to%false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false_; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to_false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false&; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to&false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false$; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to$false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false@; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to@false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false!; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to!false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false*; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to*false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false(; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to(false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false); +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to)false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to-false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false+; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to+false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false-#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to-#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false\; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to\false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false?; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to?false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false-/; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to-/false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false/#; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to/#false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set session spanner.retry_aborts_internally to false; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to false/-; +NEW_CONNECTION; +set spanner.readonly = false; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set session spanner.retry_aborts_internally to/-false; +NEW_CONNECTION; set spanner.autocommit_dml_mode='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; diff --git a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql index 3db3bda388b..f5456bb55ee 100644 --- a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql +++ b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql @@ -160,15 +160,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.130000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.130000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.347000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.347000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.130000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.347000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -510,15 +510,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.240000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.240000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.458000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.458000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.240000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.458000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -950,8 +950,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; ROLLBACK; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.352000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.352000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.580000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.580000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; @@ -961,7 +961,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.352000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.580000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -1462,8 +1462,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.472000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.472000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.692000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.692000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; @@ -1473,7 +1473,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.472000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.692000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -1876,15 +1876,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.566000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.566000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.772000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:24.772000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.566000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.772000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -2243,14 +2243,14 @@ SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.661000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.857000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.661000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.857000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -2600,13 +2600,13 @@ SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.751000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:24.942000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.751000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:24.942000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -2910,14 +2910,14 @@ SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.827000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.827000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.018000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.018000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.827000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.018000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; @@ -3245,15 +3245,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:10.925000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:10.925000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.111000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.111000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:10.925000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.111000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -3662,8 +3662,8 @@ SET AUTOCOMMIT=FALSE; START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); RUN BATCH; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.005000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.005000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.187000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.187000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -3672,7 +3672,7 @@ START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.005000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.187000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -4081,14 +4081,14 @@ SET AUTOCOMMIT=FALSE; START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.078000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.253000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.078000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.253000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -4438,13 +4438,13 @@ SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.144000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.315000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.144000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.315000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -4877,8 +4877,8 @@ SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.224000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.224000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.390000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.390000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -4888,7 +4888,7 @@ SET TRANSACTION READ ONLY; SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.224000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.390000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -5288,15 +5288,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.296000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.296000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.454000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.454000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.296000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.454000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -5641,15 +5641,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.363000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.363000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.519000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.519000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.363000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.519000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -6088,8 +6088,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; ROLLBACK; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.444000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.444000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.597000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.597000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -6099,7 +6099,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.444000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.597000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -6607,8 +6607,8 @@ BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.539000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.539000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.689000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.689000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -6618,7 +6618,7 @@ BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.539000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.689000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -7023,15 +7023,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.614000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.614000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.755000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.755000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.614000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.755000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -7394,14 +7394,14 @@ SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.693000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.829000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.693000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.829000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -7756,13 +7756,13 @@ SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.771000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.906000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.771000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.906000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -8075,14 +8075,14 @@ SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.836000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.836000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:25.970000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:25.970000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.836000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:25.970000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; @@ -8392,13 +8392,13 @@ SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.894000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.028000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.894000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.028000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; @@ -8753,8 +8753,8 @@ SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:11.953000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:11.953000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.091000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.091000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -8762,7 +8762,7 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:11.953000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.091000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; @@ -9200,8 +9200,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; UPDATE foo SET bar=1; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.028000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.028000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.165000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.165000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -9209,8 +9209,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; UPDATE foo SET bar=1; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.028000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.028000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.165000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.165000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -9596,15 +9596,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.093000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.093000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.228000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.228000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.093000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.228000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; @@ -9958,15 +9958,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.159000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.159000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.292000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.292000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.159000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.159000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.292000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.292000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -10329,15 +10329,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; UPDATE foo SET bar=1; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.227000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.227000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.357000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.357000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; UPDATE foo SET bar=1; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.227000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.227000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.357000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.357000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -10730,16 +10730,16 @@ SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.296000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.296000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.423000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.423000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.296000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.296000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.423000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.423000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -11125,15 +11125,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.365000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.365000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.492000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.492000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.365000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.365000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.492000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.492000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -11466,14 +11466,14 @@ SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.427000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.427000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.567000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.567000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.427000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.427000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.567000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.567000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; @@ -11796,15 +11796,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.485000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.485000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.626000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.626000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.485000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.485000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.626000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.626000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; @@ -12211,8 +12211,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.555000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.555000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.692000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.692000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; @@ -12220,8 +12220,8 @@ SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.555000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.555000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.692000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.692000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; @@ -12604,15 +12604,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.615000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.615000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.751000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.751000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.615000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.751000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; @@ -12950,15 +12950,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.682000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.682000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.812000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.812000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.682000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.682000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.812000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.812000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; @@ -13305,15 +13305,15 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.747000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.747000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.875000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.875000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.747000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.747000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.875000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.875000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; @@ -13630,14 +13630,14 @@ SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-11-25T10:49:12.807000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-11-25T10:49:12.807000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-12-07T16:05:26.931000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-12-07T16:05:26.931000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-11-25T10:49:12.807000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-11-25T10:49:12.807000000Z' +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-12-07T16:05:26.931000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-12-07T16:05:26.931000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; From 9172b0dcb5a3352c0336d520985527dcf3a316c2 Mon Sep 17 00:00:00 2001 From: Pratick Chokhani Date: Wed, 11 Dec 2024 15:27:55 +0530 Subject: [PATCH 10/43] feat: add opt-in for using multiplexed sessions for blind writes (#3540) * feat(spanner): Releasing Multiplexed session for blind write. * fix(spanner): Added exception for `setUseMultiplexedSessionBlindWrite` in Clirr check. Removing this is safe as it's not used by customers. * fix(spanner): Fixed unit test for multiplexed session. --- .../clirr-ignored-differences.xml | 5 ++++ .../executor/spanner/CloudClientExecutor.java | 2 -- .../spanner/SessionPoolOptionsHelper.java | 8 ------ .../cloud/spanner/SessionPoolOptions.java | 25 +------------------ ...edSessionDatabaseClientMockServerTest.java | 1 - .../RetryOnInvalidatedSessionTest.java | 3 +++ 6 files changed, 9 insertions(+), 35 deletions(-) diff --git a/google-cloud-spanner-executor/clirr-ignored-differences.xml b/google-cloud-spanner-executor/clirr-ignored-differences.xml index 9d3c127bcc9..11e9890f1d9 100644 --- a/google-cloud-spanner-executor/clirr-ignored-differences.xml +++ b/google-cloud-spanner-executor/clirr-ignored-differences.xml @@ -7,4 +7,9 @@ CloudExecutorImpl(boolean) CloudExecutorImpl(boolean, double) + + 7002 + com/google/cloud/spanner/SessionPoolOptionsHelper + com.google.cloud.spanner.SessionPoolOptions$Builder setUseMultiplexedSessionBlindWrite(com.google.cloud.spanner.SessionPoolOptions$Builder, boolean) + diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index c82b6306eb8..d3f5712646a 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -830,8 +830,6 @@ private synchronized Spanner getClient(long timeoutSeconds, boolean useMultiplex com.google.cloud.spanner.SessionPoolOptions.Builder poolOptionsBuilder = com.google.cloud.spanner.SessionPoolOptions.newBuilder(); SessionPoolOptionsHelper.setUseMultiplexedSession(poolOptionsBuilder, useMultiplexedSession); - SessionPoolOptionsHelper.setUseMultiplexedSessionBlindWrite( - poolOptionsBuilder, useMultiplexedSession); SessionPoolOptionsHelper.setUseMultiplexedSessionForRW( poolOptionsBuilder, useMultiplexedSession); LOGGER.log( diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java index f19cb8f4a2f..9dd8ac29563 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/spanner/SessionPoolOptionsHelper.java @@ -31,14 +31,6 @@ public static SessionPoolOptions.Builder setUseMultiplexedSession( return sessionPoolOptionsBuilder.setUseMultiplexedSession(useMultiplexedSession); } - // TODO: Remove when multiplexed session for blind write is released. - public static SessionPoolOptions.Builder setUseMultiplexedSessionBlindWrite( - SessionPoolOptions.Builder sessionPoolOptionsBuilder, - boolean useMultiplexedSessionBlindWrite) { - return sessionPoolOptionsBuilder.setUseMultiplexedSessionBlindWrite( - useMultiplexedSessionBlindWrite); - } - // TODO: Remove when multiplexed session for read write is released. public static SessionPoolOptions.Builder setUseMultiplexedSessionForRW( SessionPoolOptions.Builder sessionPoolOptionsBuilder, boolean useMultiplexedSessionForRW) { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java index a691f14817f..36a4e5fe208 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPoolOptions.java @@ -77,12 +77,6 @@ public class SessionPoolOptions { private final boolean useMultiplexedSession; - /** - * Controls whether multiplexed session is enabled for blind write or not. This is only used for - * systest soak. TODO: Remove when multiplexed session for blind write is released. - */ - private final boolean useMultiplexedSessionBlindWrite; - private final boolean useMultiplexedSessionForRW; private final boolean useMultiplexedSessionForPartitionedOps; @@ -122,7 +116,6 @@ private SessionPoolOptions(Builder builder) { (useMultiplexedSessionFromEnvVariable != null) ? useMultiplexedSessionFromEnvVariable : builder.useMultiplexedSession; - this.useMultiplexedSessionBlindWrite = builder.useMultiplexedSessionBlindWrite; // useMultiplexedSessionForRW priority => Environment var > private setter > client default Boolean useMultiplexedSessionForRWFromEnvVariable = getUseMultiplexedSessionForRWFromEnvVariable(); @@ -205,7 +198,6 @@ public int hashCode() { this.inactiveTransactionRemovalOptions, this.poolMaintainerClock, this.useMultiplexedSession, - this.useMultiplexedSessionBlindWrite, this.useMultiplexedSessionForRW, this.multiplexedSessionMaintenanceDuration); } @@ -349,7 +341,7 @@ public boolean getUseMultiplexedSession() { @VisibleForTesting @InternalApi protected boolean getUseMultiplexedSessionBlindWrite() { - return getUseMultiplexedSession() && useMultiplexedSessionBlindWrite; + return getUseMultiplexedSession(); } @VisibleForTesting @@ -601,9 +593,6 @@ public static class Builder { // Set useMultiplexedSession to true to make multiplexed session the default. private boolean useMultiplexedSession = false; - // TODO: Remove when multiplexed session for blind write is released. - private boolean useMultiplexedSessionBlindWrite = false; - // This field controls the default behavior of session management for RW operations in Java // client. // Set useMultiplexedSessionForRW to true to make multiplexed session for RW operations the @@ -657,7 +646,6 @@ private Builder(SessionPoolOptions options) { this.randomizePositionQPSThreshold = options.randomizePositionQPSThreshold; this.inactiveTransactionRemovalOptions = options.inactiveTransactionRemovalOptions; this.useMultiplexedSession = options.useMultiplexedSession; - this.useMultiplexedSessionBlindWrite = options.useMultiplexedSessionBlindWrite; this.useMultiplexedSessionForRW = options.useMultiplexedSessionForRW; this.useMultiplexedSessionPartitionedOps = options.useMultiplexedSessionForPartitionedOps; this.multiplexedSessionMaintenanceDuration = options.multiplexedSessionMaintenanceDuration; @@ -857,17 +845,6 @@ Builder setUseMultiplexedSession(boolean useMultiplexedSession) { return this; } - /** - * This method enables multiplexed sessions for blind writes. This method will be removed in the - * future when multiplexed sessions has been made the default for all operations. - */ - @InternalApi - @VisibleForTesting - Builder setUseMultiplexedSessionBlindWrite(boolean useMultiplexedSessionBlindWrite) { - this.useMultiplexedSessionBlindWrite = useMultiplexedSessionBlindWrite; - return this; - } - /** * Sets whether the client should use multiplexed session for R/W operations or not. This method * is intentionally package-private and intended for internal use. diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java index 3121b868b83..c808bbe1110 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java @@ -93,7 +93,6 @@ public void createSpannerInstance() { .setSessionPoolOption( SessionPoolOptions.newBuilder() .setUseMultiplexedSession(true) - .setUseMultiplexedSessionBlindWrite(true) .setUseMultiplexedSessionForRW(true) .setUseMultiplexedSessionPartitionedOps(true) // Set the maintainer to loop once every 1ms diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java index 3032a1cae40..a6c3f9fa7c5 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java @@ -1288,6 +1288,9 @@ public void write() throws InterruptedException { @Test public void writeAtLeastOnce() throws InterruptedException { + assumeFalse( + "Multiplexed session do not throw a SessionNotFound errors. ", + spanner.getOptions().getSessionPoolOptions().getUseMultiplexedSession()); assertThrowsSessionNotFoundIfShouldFail( () -> client.writeAtLeastOnce( From 5c30ba2a8e22a178ce2d51095fad1c2f77a307d4 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian <179120858+sakthivelmanii@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:50:37 +0530 Subject: [PATCH 11/43] ci(spanner): clean up unused kokoro configurations (#3542) * ci(spanner): clean up unused kokoro configurations * chore: generate libraries at Tue Dec 10 09:54:10 UTC 2024 --------- Co-authored-by: cloud-java-bot --- .kokoro/continuous/java8.cfg | 12 ------- .kokoro/nightly/java7.cfg | 7 ---- .kokoro/nightly/java8-win.cfg | 3 -- .kokoro/presubmit/clirr.cfg | 13 ------- .kokoro/presubmit/integration-cloud-devel.cfg | 22 ------------ .kokoro/presubmit/java11-samples.cfg | 34 ------------------- .kokoro/presubmit/java11.cfg | 7 ---- .kokoro/presubmit/java7.cfg | 7 ---- .kokoro/presubmit/java8-osx.cfg | 3 -- .kokoro/presubmit/java8-samples.cfg | 34 ------------------- .kokoro/presubmit/java8-win.cfg | 3 -- .kokoro/presubmit/java8.cfg | 12 ------- .kokoro/presubmit/linkage-monitor.cfg | 12 ------- .kokoro/presubmit/lint.cfg | 13 ------- .kokoro/presubmit/samples.cfg | 33 ------------------ owlbot.py | 4 --- synth.metadata | 25 -------------- 17 files changed, 244 deletions(-) delete mode 100644 .kokoro/continuous/java8.cfg delete mode 100644 .kokoro/nightly/java7.cfg delete mode 100644 .kokoro/nightly/java8-win.cfg delete mode 100644 .kokoro/presubmit/clirr.cfg delete mode 100644 .kokoro/presubmit/integration-cloud-devel.cfg delete mode 100644 .kokoro/presubmit/java11-samples.cfg delete mode 100644 .kokoro/presubmit/java11.cfg delete mode 100644 .kokoro/presubmit/java7.cfg delete mode 100644 .kokoro/presubmit/java8-osx.cfg delete mode 100644 .kokoro/presubmit/java8-samples.cfg delete mode 100644 .kokoro/presubmit/java8-win.cfg delete mode 100644 .kokoro/presubmit/java8.cfg delete mode 100644 .kokoro/presubmit/linkage-monitor.cfg delete mode 100644 .kokoro/presubmit/lint.cfg delete mode 100644 .kokoro/presubmit/samples.cfg diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg deleted file mode 100644 index 495cc7bacd6..00000000000 --- a/.kokoro/continuous/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg deleted file mode 100644 index cb24f44eea3..00000000000 --- a/.kokoro/nightly/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg deleted file mode 100644 index b219b38ad4a..00000000000 --- a/.kokoro/nightly/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-spanner/.kokoro/build.bat" diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg deleted file mode 100644 index ec572442e2e..00000000000 --- a/.kokoro/presubmit/clirr.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "clirr" -} \ No newline at end of file diff --git a/.kokoro/presubmit/integration-cloud-devel.cfg b/.kokoro/presubmit/integration-cloud-devel.cfg deleted file mode 100644 index 94b698199e1..00000000000 --- a/.kokoro/presubmit/integration-cloud-devel.cfg +++ /dev/null @@ -1,22 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration-cloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-client-testing" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-client-testing" -} diff --git a/.kokoro/presubmit/java11-samples.cfg b/.kokoro/presubmit/java11-samples.cfg deleted file mode 100644 index 2812301e787..00000000000 --- a/.kokoro/presubmit/java11-samples.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} - diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg deleted file mode 100644 index 709f2b4c73d..00000000000 --- a/.kokoro/presubmit/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg deleted file mode 100644 index cb24f44eea3..00000000000 --- a/.kokoro/presubmit/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg deleted file mode 100644 index 63f547222f5..00000000000 --- a/.kokoro/presubmit/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-spanner/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-samples.cfg b/.kokoro/presubmit/java8-samples.cfg deleted file mode 100644 index 49a231b9f2a..00000000000 --- a/.kokoro/presubmit/java8-samples.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} - diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg deleted file mode 100644 index b219b38ad4a..00000000000 --- a/.kokoro/presubmit/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-spanner/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg deleted file mode 100644 index 495cc7bacd6..00000000000 --- a/.kokoro/presubmit/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg deleted file mode 100644 index 083448f9f80..00000000000 --- a/.kokoro/presubmit/linkage-monitor.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-spanner/.kokoro/linkage-monitor.sh" -} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg deleted file mode 100644 index 6d323c8ae76..00000000000 --- a/.kokoro/presubmit/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg deleted file mode 100644 index 724216504ef..00000000000 --- a/.kokoro/presubmit/samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/owlbot.py b/owlbot.py index bc9b537f818..5765d1df17f 100644 --- a/owlbot.py +++ b/owlbot.py @@ -31,12 +31,8 @@ ".kokoro/nightly/samples.cfg", ".kokoro/build.bat", ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/java8-samples.cfg", - ".kokoro/presubmit/java11-samples.cfg", - ".kokoro/presubmit/samples.cfg", ".kokoro/presubmit/graalvm-native.cfg", ".kokoro/presubmit/graalvm-native-17.cfg", - ".kokoro/release/common.cfg", "samples/install-without-bom/pom.xml", "samples/snapshot/pom.xml", "samples/snippets/pom.xml", diff --git a/synth.metadata b/synth.metadata index 9622106469d..9f19ee9c447 100644 --- a/synth.metadata +++ b/synth.metadata @@ -68,41 +68,16 @@ ".kokoro/coerce_logs.sh", ".kokoro/common.cfg", ".kokoro/common.sh", - ".kokoro/continuous/java8.cfg", ".kokoro/dependencies.sh", ".kokoro/nightly/integration.cfg", ".kokoro/nightly/java11.cfg", - ".kokoro/nightly/java7.cfg", ".kokoro/nightly/java8-osx.cfg", - ".kokoro/nightly/java8-win.cfg", ".kokoro/nightly/java8.cfg", ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/clirr.cfg", ".kokoro/presubmit/dependencies.cfg", ".kokoro/presubmit/graalvm-native.cfg", ".kokoro/presubmit/integration.cfg", ".kokoro/presubmit/java11.cfg", - ".kokoro/presubmit/java7.cfg", - ".kokoro/presubmit/java8-osx.cfg", - ".kokoro/presubmit/java8-win.cfg", - ".kokoro/presubmit/java8.cfg", - ".kokoro/presubmit/linkage-monitor.cfg", - ".kokoro/presubmit/lint.cfg", - ".kokoro/release/bump_snapshot.cfg", - ".kokoro/release/common.cfg", - ".kokoro/release/common.sh", - ".kokoro/release/drop.cfg", - ".kokoro/release/drop.sh", - ".kokoro/release/promote.cfg", - ".kokoro/release/promote.sh", - ".kokoro/release/publish_javadoc.cfg", - ".kokoro/release/publish_javadoc.sh", - ".kokoro/release/publish_javadoc11.cfg", - ".kokoro/release/publish_javadoc11.sh", - ".kokoro/release/snapshot.cfg", - ".kokoro/release/snapshot.sh", - ".kokoro/release/stage.cfg", - ".kokoro/release/stage.sh", ".kokoro/trampoline.sh", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", From 41e1495fe598a0e51cdf3e2fc711d57d691cac00 Mon Sep 17 00:00:00 2001 From: Pratick Chokhani Date: Fri, 13 Dec 2024 11:52:06 +0530 Subject: [PATCH 12/43] test(spanner): Enabled multiplexed session for partitioned operations in systest. (#3545) --- .../com/google/cloud/executor/spanner/CloudClientExecutor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index d3f5712646a..d0490be44a1 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -832,6 +832,8 @@ private synchronized Spanner getClient(long timeoutSeconds, boolean useMultiplex SessionPoolOptionsHelper.setUseMultiplexedSession(poolOptionsBuilder, useMultiplexedSession); SessionPoolOptionsHelper.setUseMultiplexedSessionForRW( poolOptionsBuilder, useMultiplexedSession); + SessionPoolOptionsHelper.setUseMultiplexedSessionForPartitionedOperations( + poolOptionsBuilder, useMultiplexedSession); LOGGER.log( Level.INFO, String.format( From 30c2e5921e1d46697326dfb983859676189aa844 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:20:25 -0500 Subject: [PATCH 13/43] chore(main): release 6.82.1-SNAPSHOT (#3526) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 ++++++++--------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 +++++++++---------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 +++++++++---------- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 22c13635ce8..6e7fd7bf6b3 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index 1db01f10946..85721ffac54 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.82.0 + 6.82.1-SNAPSHOT pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT com.google.cloud google-cloud-spanner test-jar - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index ccb631bb1a2..5e61e241e08 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.82.0 + 6.82.1-SNAPSHOT jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index b7589c10203..b319d9fe047 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 000a88b6261..30487a57c05 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index b794aca19dd..0f8a34788bd 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index b63e9bd6038..bb23ca37c75 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index dc1c2c1c936..28c5151e6fd 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 72a2a6797e3..8422efe0373 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.82.0 + 6.82.1-SNAPSHOT Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index 4d29a245a80..dd32122e0b0 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index 08da9e3b853..d24c9cfad3a 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index 23a213ca72f..53c9c6291c4 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index 8c3dc7a8adf..c60bf93b4fe 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9a6e4d0e30e..6871ac6b4fb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 745b2174e24..b361e0ba011 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.0 -proto-google-cloud-spanner-v1:6.82.0:6.82.0 -proto-google-cloud-spanner-admin-database-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-admin-database-v1:6.82.0:6.82.0 -google-cloud-spanner:6.82.0:6.82.0 -google-cloud-spanner-executor:6.82.0:6.82.0 -proto-google-cloud-spanner-executor-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-executor-v1:6.82.0:6.82.0 +proto-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT +google-cloud-spanner:6.82.0:6.82.1-SNAPSHOT +google-cloud-spanner-executor:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT From 1611c0c7559e79128f2a2a5194ed2fc9c8acbad5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 17:09:48 +0100 Subject: [PATCH 14/43] deps: update sdk platform java dependencies (#3549) --- .github/workflows/hermetic_library_generation.yaml | 2 +- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-spanner-bom/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 35aa3b151d6..604b674bad9 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -37,7 +37,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - uses: googleapis/sdk-platform-java/.github/scripts@v2.50.0 + - uses: googleapis/sdk-platform-java/.github/scripts@v2.51.0 if: env.SHOULD_RUN == 'true' with: base_ref: ${{ github.base_ref }} diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index f5298fed0f2..f62b0af0eb1 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,6 +17,6 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.0 with: bom-path: google-cloud-spanner-bom/pom.xml diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 82ed3a43e49..76ca3ee6daf 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index a836c97f04b..644bb62ce7d 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0" } env_vars: { diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index 85721ffac54..f746277c9ca 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.40.0 + 3.41.0 Google Cloud Spanner BOM diff --git a/pom.xml b/pom.xml index 8422efe0373..67a5f525a0f 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.40.0 + 3.41.0 From f2e3d20b5b6a6ed4a128df7e9988354f304af917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 13 Dec 2024 17:46:16 +0100 Subject: [PATCH 15/43] chore: reset default to platform thread (#3551) Reset the default to using a platform thread for connections. This was the default before adding an option for setting the executor type, and the new default is causing problems with the async Connection API. Fixes #3541 --- .../com/google/cloud/spanner/connection/ConnectionImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java index 9f4a43d5a2e..2d7c917d230 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java @@ -292,7 +292,7 @@ static UnitOfWorkType of(TransactionMode transactionMode) { statementExecutorType = options.isUseVirtualThreads() ? StatementExecutorType.VIRTUAL_THREAD - : StatementExecutorType.DIRECT_EXECUTOR; + : StatementExecutorType.PLATFORM_THREAD; } this.statementExecutor = new StatementExecutor(statementExecutorType, options.getStatementExecutionInterceptors()); @@ -342,7 +342,7 @@ && getDialect() == Dialect.POSTGRESQL new StatementExecutor( options.isUseVirtualThreads() ? StatementExecutorType.VIRTUAL_THREAD - : StatementExecutorType.DIRECT_EXECUTOR, + : StatementExecutorType.PLATFORM_THREAD, Collections.emptyList()); this.spannerPool = Preconditions.checkNotNull(spannerPool); this.options = Preconditions.checkNotNull(options); From 9640c9a92956baedc31aa3e4a4cb5fe9d7e291e3 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:18:21 -0500 Subject: [PATCH 16/43] chore: Update generation configuration at Fri Dec 13 16:21:35 UTC 2024 (#3523) * chore: Update generation configuration at Wed Dec 4 02:29:01 UTC 2024 * chore: Update generation configuration at Thu Dec 5 02:29:11 UTC 2024 * chore: Update generation configuration at Fri Dec 6 02:28:46 UTC 2024 * chore: generate libraries at Fri Dec 6 02:29:25 UTC 2024 * chore: Update generation configuration at Sat Dec 7 02:28:09 UTC 2024 * chore: Update generation configuration at Tue Dec 10 02:29:37 UTC 2024 * chore: Update generation configuration at Wed Dec 11 02:28:47 UTC 2024 * chore: Update generation configuration at Thu Dec 12 02:29:08 UTC 2024 * chore: generate libraries at Thu Dec 12 02:29:50 UTC 2024 * chore: Update generation configuration at Fri Dec 13 02:29:25 UTC 2024 * chore: Update generation configuration at Fri Dec 13 16:21:35 UTC 2024 * chore: generate libraries at Fri Dec 13 16:22:12 UTC 2024 * update workflow script --------- Co-authored-by: rahul2393 Co-authored-by: Joe Wang --- .github/scripts/update_generation_config.sh | 63 ++++++++++++++++--- README.md | 2 +- generation_config.yaml | 6 +- .../java/com/google/spanner/v1/TypeCode.java | 24 +++++++ .../java/com/google/spanner/v1/TypeProto.java | 20 +++--- .../main/proto/google/spanner/v1/type.proto | 4 ++ renovate.json | 17 ----- 7 files changed, 97 insertions(+), 39 deletions(-) diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh index 561a313040f..91434688cc5 100644 --- a/.github/scripts/update_generation_config.sh +++ b/.github/scripts/update_generation_config.sh @@ -28,11 +28,23 @@ function update_config() { sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" } +# Update an action to a new version in GitHub action. +function update_action() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + # use a different delimiter because the key_word contains "/". + sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}" +} + # The parameters of this script is: # 1. base_branch, the base branch of the result pull request. # 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java # 3. [optional] generation_config, the path to the generation configuration, # the default value is generation_config.yaml in the repository root. +# 4. [optional] workflow, the library generation workflow file, +# the default value is .github/workflows/hermetic_library_generation.yaml. while [[ $# -gt 0 ]]; do key="$1" case "${key}" in @@ -48,6 +60,10 @@ case "${key}" in generation_config="$2" shift ;; + --workflow) + workflow="$2" + shift + ;; *) echo "Invalid option: [$1]" exit 1 @@ -71,21 +87,34 @@ if [ -z "${generation_config}" ]; then echo "Use default generation config: ${generation_config}" fi +if [ -z "${workflow}" ]; then + workflow=".github/workflows/hermetic_library_generation.yaml" + echo "Use default library generation workflow file: ${workflow}" +fi + current_branch="generate-libraries-${base_branch}" title="chore: Update generation configuration at $(date)" -# try to find a open pull request associated with the branch +git checkout "${base_branch}" +# Try to find a open pull request associated with the branch pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") -# create a branch if there's no open pull request associated with the +# Create a branch if there's no open pull request associated with the # branch; otherwise checkout the pull request. if [ -z "${pr_num}" ]; then git checkout -b "${current_branch}" + # Push the current branch to remote so that we can + # compare the commits later. + git push -u origin "${current_branch}" else gh pr checkout "${pr_num}" fi +# Only allow fast-forward merging; exit with non-zero result if there's merging +# conflict. +git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" + mkdir tmp-googleapis -# use partial clone because only commit history is needed. +# Use partial clone because only commit history is needed. git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis pushd tmp-googleapis git pull @@ -94,25 +123,43 @@ popd rm -rf tmp-googleapis update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" -# update gapic-generator-java version to the latest +# Update gapic-generator-java version to the latest latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java") update_config "gapic_generator_version" "${latest_version}" "${generation_config}" -# update libraries-bom version to the latest +# Update composite action version to latest gapic-generator-java version +update_action "googleapis/sdk-platform-java/.github/scripts" \ + "${latest_version}" \ + "${workflow}" + +# Update libraries-bom version to the latest latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") update_config "libraries_bom_version" "${latest_version}" "${generation_config}" -git add "${generation_config}" +git add "${generation_config}" "${workflow}" changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then echo "The latest generation config is not changed." echo "Skip committing to the pull request." +else + git commit -m "${title}" +fi + +# There are potentially at most two commits: merge commit and change commit. +# We want to exit the script if no commit happens (otherwise this will be an +# infinite loop). +# `git cherry` is a way to find whether the local branch has commits that are +# not in the remote branch. +# If we find any such commit, push them to remote branch. +unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l) +if [[ "${unpushed_commit}" -eq 0 ]]; then + echo "No unpushed commits, exit" exit 0 fi -git commit -m "${title}" + if [ -z "${pr_num}" ]; then git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" - git fetch -q --unshallow remote_repo + git fetch -q remote_repo git push -f remote_repo "${current_branch}" gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" else diff --git a/README.md b/README.md index 29f1bb0322d..296dd00f422 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.50.0') +implementation platform('com.google.cloud:libraries-bom:26.51.0') implementation 'com.google.cloud:google-cloud-spanner' ``` diff --git a/generation_config.yaml b/generation_config.yaml index ef44b5b9dea..f7c5f12a081 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ -gapic_generator_version: 2.50.0 -googleapis_commitish: 349841abac6c3e580ccce6e3d6fcc182ed2512c2 -libraries_bom_version: 26.50.0 +gapic_generator_version: 2.51.0 +googleapis_commitish: 7d0c6bee2517d77635beb2a1dd6d6e7d4d943512 +libraries_bom_version: 26.51.0 libraries: - api_shortname: spanner name_pretty: Cloud Spanner diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java index 9c36f6c971b..9db5e0c186e 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java @@ -228,6 +228,17 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum { * INTERVAL = 16; */ INTERVAL(16), + /** + * + * + *

+   * Encoded as `string`, in lower-case hexa-decimal format, as described
+   * in RFC 9562, section 4.
+   * 
+ * + * UUID = 17; + */ + UUID(17), UNRECOGNIZED(-1), ; @@ -424,6 +435,17 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum { * INTERVAL = 16; */ public static final int INTERVAL_VALUE = 16; + /** + * + * + *
+   * Encoded as `string`, in lower-case hexa-decimal format, as described
+   * in RFC 9562, section 4.
+   * 
+ * + * UUID = 17; + */ + public static final int UUID_VALUE = 17; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -481,6 +503,8 @@ public static TypeCode forNumber(int value) { return ENUM; case 16: return INTERVAL; + case 17: + return UUID; default: return null; } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java index 3c41d2585b4..e640269d997 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java @@ -60,20 +60,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pe_fqn\030\005 \001(\t\"\177\n\nStructType\0223\n\006fields\030\001 \003" + "(\0132#.google.spanner.v1.StructType.Field\032" + "<\n\005Field\022\014\n\004name\030\001 \001(\t\022%\n\004type\030\002 \001(\0132\027.g" - + "oogle.spanner.v1.Type*\325\001\n\010TypeCode\022\031\n\025TY" + + "oogle.spanner.v1.Type*\337\001\n\010TypeCode\022\031\n\025TY" + "PE_CODE_UNSPECIFIED\020\000\022\010\n\004BOOL\020\001\022\t\n\005INT64" + "\020\002\022\013\n\007FLOAT64\020\003\022\013\n\007FLOAT32\020\017\022\r\n\tTIMESTAM" + "P\020\004\022\010\n\004DATE\020\005\022\n\n\006STRING\020\006\022\t\n\005BYTES\020\007\022\t\n\005" + "ARRAY\020\010\022\n\n\006STRUCT\020\t\022\013\n\007NUMERIC\020\n\022\010\n\004JSON" - + "\020\013\022\t\n\005PROTO\020\r\022\010\n\004ENUM\020\016\022\014\n\010INTERVAL\020\020*d\n" - + "\022TypeAnnotationCode\022$\n TYPE_ANNOTATION_C" - + "ODE_UNSPECIFIED\020\000\022\016\n\nPG_NUMERIC\020\002\022\014\n\010PG_" - + "JSONB\020\003\022\n\n\006PG_OID\020\004B\254\001\n\025com.google.spann" - + "er.v1B\tTypeProtoP\001Z5cloud.google.com/go/" - + "spanner/apiv1/spannerpb;spannerpb\252\002\027Goog" - + "le.Cloud.Spanner.V1\312\002\027Google\\Cloud\\Spann" - + "er\\V1\352\002\032Google::Cloud::Spanner::V1b\006prot" - + "o3" + + "\020\013\022\t\n\005PROTO\020\r\022\010\n\004ENUM\020\016\022\014\n\010INTERVAL\020\020\022\010\n" + + "\004UUID\020\021*d\n\022TypeAnnotationCode\022$\n TYPE_AN" + + "NOTATION_CODE_UNSPECIFIED\020\000\022\016\n\nPG_NUMERI" + + "C\020\002\022\014\n\010PG_JSONB\020\003\022\n\n\006PG_OID\020\004B\254\001\n\025com.go" + + "ogle.spanner.v1B\tTypeProtoP\001Z5cloud.goog" + + "le.com/go/spanner/apiv1/spannerpb;spanne" + + "rpb\252\002\027Google.Cloud.Spanner.V1\312\002\027Google\\C" + + "loud\\Spanner\\V1\352\002\032Google::Cloud::Spanner" + + "::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto index 734cfb54cda..a8a73bf31ee 100644 --- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto @@ -175,6 +175,10 @@ enum TypeCode { // For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 // months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. INTERVAL = 16; + + // Encoded as `string`, in lower-case hexa-decimal format, as described + // in RFC 9562, section 4. + UUID = 17; } // `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to diff --git a/renovate.json b/renovate.json index 167bf279fe7..3ad0aae27d8 100644 --- a/renovate.json +++ b/renovate.json @@ -41,16 +41,6 @@ ], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" - }, - { - "fileMatch": [ - "^.github/workflows/hermetic_library_generation.yaml$" - ], - "matchStrings": [ - "uses: googleapis/sdk-platform-java/.github/scripts@v(?.+?)\\n" - ], - "depNameTemplate": "com.google.api:gapic-generator-java", - "datasourceTemplate": "maven" } ], "packageRules": [ @@ -111,13 +101,6 @@ "^com.fasterxml.jackson.core" ], "groupName": "jackson dependencies" - }, - { - "matchPackagePatterns": [ - "^com.google.api:gapic-generator-java", - "^com.google.cloud:sdk-platform-java-config" - ], - "groupName": "SDK platform Java dependencies" } ], "semanticCommits": true, From 41673f2a21ceeac69ad58edd1ba786e5b92e4d71 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:01:00 +0530 Subject: [PATCH 17/43] chore(main): release 6.83.0 (#3547) * chore(main): release 6.83.0 * chore: generate libraries at Fri Dec 13 17:19:20 UTC 2024 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot --- CHANGELOG.md | 22 +++++++++++++++++++ README.md | 6 ++--- benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 +++++++-------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 ++++++++--------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 ++++++++--------- 17 files changed, 76 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1436e341430..aa465a19065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [6.83.0](https://github.com/googleapis/java-spanner/compare/v6.82.0...v6.83.0) (2024-12-13) + + +### Features + +* Add Metrics host for built in metrics ([#3519](https://github.com/googleapis/java-spanner/issues/3519)) ([4ed455a](https://github.com/googleapis/java-spanner/commit/4ed455a43edf7ff8d138ce4d40a52d3224383b14)) +* Add opt-in for using multiplexed sessions for blind writes ([#3540](https://github.com/googleapis/java-spanner/issues/3540)) ([216f53e](https://github.com/googleapis/java-spanner/commit/216f53e4cbc0150078ece7785da33b342a6ab082)) +* Add UUID in Spanner TypeCode enum ([41f83dc](https://github.com/googleapis/java-spanner/commit/41f83dcf046f955ec289d4e976f40a03922054cb)) +* Introduce java.time variables and methods ([#3495](https://github.com/googleapis/java-spanner/issues/3495)) ([8a7d533](https://github.com/googleapis/java-spanner/commit/8a7d533ded21b9b94992b68c702c08bb84474e1b)) +* **spanner:** Support multiplexed session for Partitioned operations ([#3231](https://github.com/googleapis/java-spanner/issues/3231)) ([4501a3e](https://github.com/googleapis/java-spanner/commit/4501a3ea69a9346e8b95edf6f94ff839b509ec73)) +* Support 'set local' for retry_aborts_internally ([#3532](https://github.com/googleapis/java-spanner/issues/3532)) ([331942f](https://github.com/googleapis/java-spanner/commit/331942f51b11660b9de9c8fe8aacd6f60ac254b5)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.0 ([41f83dc](https://github.com/googleapis/java-spanner/commit/41f83dcf046f955ec289d4e976f40a03922054cb)) + + +### Dependencies + +* Update sdk platform java dependencies ([#3549](https://github.com/googleapis/java-spanner/issues/3549)) ([6235f0f](https://github.com/googleapis/java-spanner/commit/6235f0f2c223718c537addc450fa5910d1500271)) + ## [6.82.0](https://github.com/googleapis/java-spanner/compare/v6.81.2...v6.82.0) (2024-12-04) diff --git a/README.md b/README.md index 296dd00f422..d6e321fc595 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-spanner' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-spanner:6.82.0' +implementation 'com.google.cloud:google-cloud-spanner:6.83.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.82.0" +libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.83.0" ``` ## Authentication @@ -725,7 +725,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.82.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.83.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 6e7fd7bf6b3..a99f5079062 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index f746277c9ca..c47dd4d6a26 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.82.1-SNAPSHOT + 6.83.0 pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 com.google.cloud google-cloud-spanner test-jar - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index 5e61e241e08..aa1e3f4c0a0 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.82.1-SNAPSHOT + 6.83.0 jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index b319d9fe047..78ea3c3c6d6 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 30487a57c05..18c7bd598f2 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index 0f8a34788bd..78992b2516a 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index bb23ca37c75..d481c405057 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index 28c5151e6fd..344c4aa0c8f 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/pom.xml b/pom.xml index 67a5f525a0f..e9b43661142 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.82.1-SNAPSHOT + 6.83.0 Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index dd32122e0b0..e9010b10626 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index d24c9cfad3a..a9d5185760b 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index 53c9c6291c4..c329cb17fa6 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index c60bf93b4fe..0f4a788bafc 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6871ac6b4fb..e9d6615ba1c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/versions.txt b/versions.txt index b361e0ba011..497bc580774 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT -proto-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT -proto-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT -google-cloud-spanner:6.82.0:6.82.1-SNAPSHOT -google-cloud-spanner-executor:6.82.0:6.82.1-SNAPSHOT -proto-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 +proto-google-cloud-spanner-v1:6.83.0:6.83.0 +proto-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 +google-cloud-spanner:6.83.0:6.83.0 +google-cloud-spanner-executor:6.83.0:6.83.0 +proto-google-cloud-spanner-executor-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-executor-v1:6.83.0:6.83.0 From 5c779055b7cb6cd4e36c808afa3360f3ead1cd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 13 Dec 2024 21:32:31 +0100 Subject: [PATCH 18/43] chore: make state field volatile in AsyncResultSetImpl (#3550) * chore: make state field volatile in AsyncResultSetImpl Mark the `state` field in `AsyncResultSetImpl` volatile, as it is inspected by different threads. * fix: protect writes with monitor --------- Co-authored-by: rahul2393 --- .../com/google/cloud/spanner/AsyncResultSetImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java index 1161822cd10..d980c90f78c 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java @@ -112,9 +112,9 @@ private enum State { * Listeners that will be called when the {@link AsyncResultSetImpl} has finished fetching all * rows and any underlying transaction or session can be closed. */ - private Collection listeners = new LinkedList<>(); + private final Collection listeners = new LinkedList<>(); - private State state = State.INITIALIZED; + private volatile State state = State.INITIALIZED; /** This variable indicates that produce rows thread is initiated */ private volatile boolean produceRowsInitiated; @@ -498,10 +498,12 @@ public ApiFuture setCallback(Executor exec, ReadyCallback cb) { } private void initiateProduceRows() { - if (this.state == State.STREAMING_INITIALIZED) { - this.state = State.RUNNING; + synchronized (monitor) { + if (this.state == State.STREAMING_INITIALIZED) { + this.state = State.RUNNING; + } + produceRowsInitiated = true; } - produceRowsInitiated = true; this.service.execute(new ProduceRowsRunnable()); } From 6354f3500aa1df6bbf81fe3f0790869c13a0bedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 13 Dec 2024 21:34:15 +0100 Subject: [PATCH 19/43] chore: make valid connection properties public (#3546) Make the list of valid connection properties public, so tools that depend on the Connection API can use this to for example generate documentation for valid properties. Also add valid values to the connection properties that have that (e.g. enums and booleans). Co-authored-by: rahul2393 --- .../connection/ConnectionProperties.java | 68 ++++++++++++++++--- .../connection/ConnectionProperty.java | 36 +++++++--- 2 files changed, 86 insertions(+), 18 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java index 0ca9b7256e2..fd40efa8f4a 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java @@ -112,20 +112,22 @@ import com.google.cloud.spanner.connection.ClientSideStatementValueConverters.StringValueConverter; import com.google.cloud.spanner.connection.ConnectionProperty.Context; import com.google.cloud.spanner.connection.DirectedReadOptionsUtil.DirectedReadOptionsConverter; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.spanner.v1.DirectedReadOptions; import java.time.Duration; -import java.util.Map; /** * Utility class that defines all known connection properties. This class will eventually replace * the list of {@link com.google.cloud.spanner.connection.ConnectionOptions.ConnectionProperty} in * {@link ConnectionOptions}. */ -class ConnectionProperties { +public class ConnectionProperties { private static final ImmutableMap.Builder> CONNECTION_PROPERTIES_BUILDER = ImmutableMap.builder(); + private static final Boolean[] BOOLEANS = new Boolean[] {Boolean.TRUE, Boolean.FALSE}; + static final ConnectionProperty CONNECTION_STATE_TYPE = create( "connection_state_type", @@ -133,6 +135,7 @@ class ConnectionProperties { + "If no value is set, then the database dialect default will be used, " + "which is NON_TRANSACTIONAL for GoogleSQL and TRANSACTIONAL for PostgreSQL.", null, + ConnectionState.Type.values(), ConnectionStateTypeConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty TRACING_PREFIX = @@ -148,6 +151,7 @@ class ConnectionProperties { LENIENT_PROPERTY_NAME, "Silently ignore unknown properties in the connection string/properties (true/false)", DEFAULT_LENIENT, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENDPOINT = @@ -167,6 +171,7 @@ class ConnectionProperties { + "The instance and database in the connection string will automatically be created if these do not yet exist on the emulator. " + "Add dialect=postgresql to the connection string to make sure that the database that is created uses the PostgreSQL dialect.", false, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_AUTO_SAVEPOINTS_FOR_EMULATOR = @@ -175,6 +180,7 @@ class ConnectionProperties { "Automatically creates savepoints for each statement in a read/write transaction when using the Emulator. " + "This is no longer needed when using Emulator version 1.5.23 or higher.", false, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_PLAIN_TEXT = @@ -182,6 +188,7 @@ class ConnectionProperties { USE_PLAIN_TEXT_PROPERTY_NAME, "Use a plain text communication channel (i.e. non-TLS) for communicating with the server (true/false). Set this value to true for communication with the Cloud Spanner emulator.", DEFAULT_USE_PLAIN_TEXT, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); @@ -226,6 +233,7 @@ class ConnectionProperties { DIALECT_PROPERTY_NAME, "Sets the dialect to use for new databases that are created by this connection.", Dialect.GOOGLE_STANDARD_SQL, + Dialect.values(), DialectConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty TRACK_SESSION_LEAKS = @@ -238,6 +246,7 @@ class ConnectionProperties { + "actual session leak is detected. The stack trace of the exception will " + "in that case not contain the call stack of when the session was checked out.", DEFAULT_TRACK_SESSION_LEAKS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty TRACK_CONNECTION_LEAKS = @@ -250,6 +259,7 @@ class ConnectionProperties { + "actual connection leak is detected. The stack trace of the exception will " + "in that case not contain the call stack of when the connection was created.", DEFAULT_TRACK_CONNECTION_LEAKS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ROUTE_TO_LEADER = @@ -257,6 +267,7 @@ class ConnectionProperties { ROUTE_TO_LEADER_PROPERTY_NAME, "Should read/write transactions and partitioned DML be routed to leader region (true/false)", DEFAULT_ROUTE_TO_LEADER, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_VIRTUAL_THREADS = @@ -265,6 +276,7 @@ class ConnectionProperties { "Use a virtual thread instead of a platform thread for each connection (true/false). " + "This option only has any effect if the application is running on Java 21 or higher. In all other cases, the option is ignored.", DEFAULT_USE_VIRTUAL_THREADS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_VIRTUAL_GRPC_TRANSPORT_THREADS = @@ -273,6 +285,7 @@ class ConnectionProperties { "Use a virtual thread instead of a platform thread for the gRPC executor (true/false). " + "This option only has any effect if the application is running on Java 21 or higher. In all other cases, the option is ignored.", DEFAULT_USE_VIRTUAL_GRPC_TRANSPORT_THREADS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENABLE_EXTENDED_TRACING = @@ -282,6 +295,7 @@ class ConnectionProperties { + "by this connection. The SQL string is added as the standard OpenTelemetry " + "attribute 'db.statement'.", DEFAULT_ENABLE_EXTENDED_TRACING, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENABLE_API_TRACING = @@ -292,6 +306,7 @@ class ConnectionProperties { + "or if you want to debug potential latency problems caused by RPCs that are " + "being retried.", DEFAULT_ENABLE_API_TRACING, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENABLE_END_TO_END_TRACING = @@ -302,6 +317,7 @@ class ConnectionProperties { + "Server side traces can only go to Google Cloud Trace, so to see end to end traces, " + "the application should configure an exporter that exports the traces to Google Cloud Trace.", DEFAULT_ENABLE_END_TO_END_TRACING, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty MIN_SESSIONS = @@ -345,6 +361,7 @@ class ConnectionProperties { AUTOCOMMIT_PROPERTY_NAME, "Should the connection start in autocommit (true/false)", DEFAULT_AUTOCOMMIT, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty READONLY = @@ -352,13 +369,16 @@ class ConnectionProperties { READONLY_PROPERTY_NAME, "Should the connection start in read-only mode (true/false)", DEFAULT_READONLY, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty AUTOCOMMIT_DML_MODE = create( "autocommit_dml_mode", - "Should the connection automatically retry Aborted errors (true/false)", + "Determines the transaction type that is used to execute " + + "DML statements when the connection is in auto-commit mode.", AutocommitDmlMode.TRANSACTIONAL, + AutocommitDmlMode.values(), AutocommitDmlModeConverter.INSTANCE, Context.USER); static final ConnectionProperty RETRY_ABORTS_INTERNALLY = @@ -371,6 +391,7 @@ class ConnectionProperties { RETRY_ABORTS_INTERNALLY_PROPERTY_NAME, "Should the connection automatically retry Aborted errors (true/false)", DEFAULT_RETRY_ABORTS_INTERNALLY, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty RETURN_COMMIT_STATS = @@ -378,6 +399,7 @@ class ConnectionProperties { "returnCommitStats", "Request that Spanner returns commit statistics for read/write transactions (true/false)", DEFAULT_RETURN_COMMIT_STATS, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE = @@ -389,6 +411,7 @@ class ConnectionProperties { + "the first write operation in a read/write transaction will be executed using the read/write transaction. Enabling this mode can reduce locking " + "and improve performance for applications that can handle the lower transaction isolation semantics.", DEFAULT_DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty KEEP_TRANSACTION_ALIVE = @@ -398,6 +421,7 @@ class ConnectionProperties { + "if no other statements are being executed. This option should be used with caution, as it can keep transactions alive and hold on to locks " + "longer than intended. This option should typically be used for CLI-type application that might wait for user input for a longer period of time.", DEFAULT_KEEP_TRANSACTION_ALIVE, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); @@ -415,6 +439,7 @@ class ConnectionProperties { + "Executing a query that cannot be partitioned will fail. " + "Executing a query in a read/write transaction will also fail.", DEFAULT_AUTO_PARTITION_MODE, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty DATA_BOOST_ENABLED = @@ -423,6 +448,7 @@ class ConnectionProperties { "Enable data boost for all partitioned queries that are executed by this connection. " + "This setting is only used for partitioned queries and is ignored by all other statements.", DEFAULT_DATA_BOOST_ENABLED, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty MAX_PARTITIONS = @@ -468,6 +494,7 @@ class ConnectionProperties { RPC_PRIORITY_NAME, "Sets the priority for all RPC invocations from this connection (HIGH/MEDIUM/LOW). The default is HIGH.", DEFAULT_RPC_PRIORITY, + RpcPriority.values(), RpcPriorityConverter.INSTANCE, Context.USER); static final ConnectionProperty SAVEPOINT_SUPPORT = @@ -475,6 +502,7 @@ class ConnectionProperties { "savepoint_support", "Determines the behavior of the connection when savepoints are used.", SavepointSupport.FAIL_AFTER_ROLLBACK, + SavepointSupport.values(), SavepointSupportConverter.INSTANCE, Context.USER); static final ConnectionProperty DDL_IN_TRANSACTION_MODE = @@ -482,6 +510,7 @@ class ConnectionProperties { DDL_IN_TRANSACTION_MODE_PROPERTY_NAME, "Determines how the connection should handle DDL statements in a read/write transaction.", DEFAULT_DDL_IN_TRANSACTION_MODE, + DdlInTransactionMode.values(), DdlInTransactionModeConverter.INSTANCE, Context.USER); static final ConnectionProperty MAX_COMMIT_DELAY = @@ -504,6 +533,7 @@ class ConnectionProperties { + "This setting is only in read/write transactions. DML statements in auto-commit mode " + "are executed directly.", DEFAULT_AUTO_BATCH_DML, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty AUTO_BATCH_DML_UPDATE_COUNT = @@ -538,12 +568,17 @@ class ConnectionProperties { + AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION_PROPERTY_NAME + " to false.", DEFAULT_AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); - static final Map> CONNECTION_PROPERTIES = + static final ImmutableMap> CONNECTION_PROPERTIES = CONNECTION_PROPERTIES_BUILDER.build(); + /** The list of all supported connection properties. */ + public static ImmutableList> VALID_CONNECTION_PROPERTIES = + ImmutableList.copyOf(ConnectionProperties.CONNECTION_PROPERTIES.values()); + /** Utility method for creating a new core {@link ConnectionProperty}. */ private static ConnectionProperty create( String name, @@ -551,10 +586,27 @@ private static ConnectionProperty create( T defaultValue, ClientSideStatementValueConverter converter, Context context) { - ConnectionProperty property = - ConnectionProperty.create(name, description, defaultValue, converter, context); - CONNECTION_PROPERTIES_BUILDER.put(property.getKey(), property); - return property; + return create(name, description, defaultValue, null, converter, context); + } + + /** Utility method for creating a new core {@link ConnectionProperty}. */ + private static ConnectionProperty create( + String name, + String description, + T defaultValue, + T[] validValues, + ClientSideStatementValueConverter converter, + Context context) { + try { + ConnectionProperty property = + ConnectionProperty.create( + name, description, defaultValue, validValues, converter, context); + CONNECTION_PROPERTIES_BUILDER.put(property.getKey(), property); + return property; + } catch (Throwable t) { + t.printStackTrace(); + } + return null; } /** Parse the connection properties that can be found in the given connection URL. */ diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java index c203d44203b..7c06774cf2f 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java @@ -37,12 +37,13 @@ * connection state is an opt-in. */ public class ConnectionProperty { + /** * Context indicates when a {@link ConnectionProperty} may be set. Each higher-ordinal value * includes the preceding values, meaning that a {@link ConnectionProperty} with {@link * Context#USER} can be set both at connection startup and during the connection's lifetime. */ - enum Context { + public enum Context { /** The property can only be set at startup of the connection. */ STARTUP, /** @@ -79,8 +80,20 @@ static ConnectionProperty create( T defaultValue, ClientSideStatementValueConverter converter, Context context) { + return create(name, description, defaultValue, null, converter, context); + } + + /** Utility method for creating a typed {@link ConnectionProperty}. */ + @Nonnull + static ConnectionProperty create( + @Nonnull String name, + String description, + T defaultValue, + T[] validValues, + ClientSideStatementValueConverter converter, + Context context) { return new ConnectionProperty<>( - null, name, description, defaultValue, null, converter, context); + null, name, description, defaultValue, validValues, converter, context); } /** @@ -163,35 +176,38 @@ ConnectionPropertyValue convert(@Nullable String stringValue) { return new ConnectionPropertyValue<>(this, convertedValue, convertedValue); } - String getKey() { + @Nonnull + public String getKey() { return this.key; } - boolean hasExtension() { + public boolean hasExtension() { return this.extension != null; } - String getExtension() { + public String getExtension() { return this.extension; } - String getName() { + @Nonnull + public String getName() { return this.name; } - String getDescription() { + @Nonnull + public String getDescription() { return this.description; } - T getDefaultValue() { + public T getDefaultValue() { return this.defaultValue; } - T[] getValidValues() { + public T[] getValidValues() { return this.validValues; } - Context getContext() { + public Context getContext() { return this.context; } } From 5cf957d4f17ef094c70887b92202a57eb239c3a0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 14 Dec 2024 06:50:21 +0100 Subject: [PATCH 20/43] deps: update opentelemetry.version to v1.45.0 (#3531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.opentelemetry:opentelemetry-sdk-testing](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk-testing/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk-testing/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk-testing/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk-testing/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.opentelemetry:opentelemetry-sdk-trace](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk-trace/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk-trace/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk-trace/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk-trace/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.opentelemetry:opentelemetry-sdk-metrics](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.opentelemetry:opentelemetry-sdk](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
open-telemetry/opentelemetry-java (io.opentelemetry:opentelemetry-sdk-testing) ### [`v1.45.0`](https://redirect.github.com/open-telemetry/opentelemetry-java/blob/HEAD/CHANGELOG.md#Version-1450-2024-12-06) [Compare Source](https://redirect.github.com/open-telemetry/opentelemetry-java/compare/v1.44.1...v1.45.0) ##### API - Add convenience method `setAttribute(Attribute, int)` to SpanBuilder (matching the existing convenience method in Span) ([#​6884](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6884)) - Extends TextMapGetter with experimental GetAll() method, implement usage in W3CBaggagePropagator ([#​6852](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6852)) ##### SDK ##### Traces - Add synchronization to SimpleSpanProcessor to ensure thread-safe export of spans ([#​6885](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6885)) ##### Metrics - Lazily initialize ReservoirCells ([#​6851](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6851)) ##### Logs - Add synchronization to SimpleLogRecordProcessor to ensure thread-safe export of logs ([#​6885](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6885)) ##### Exporters - OTLP: Update opentelementry-proto to 1.4 ([#​6906](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6906)) - OTLP: Rename internal Marshaler#writeJsonToGenerator method to allow jackson runtimeOnly dependency ([#​6896](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6896)) - OTLP: Fix repeated string serialization for JSON. ([#​6888](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6888)) - OTLP: Fix missing unsafe available check ([#​6920](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6920)) ##### Extensions - Declarative config: Don't require empty objects when referencing custom components ([#​6891](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6891)) ##### Tooling - Add javadoc boilerplate internal comment v2 for experimental classes ([#​6886](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6886)) - Update develocity configuration ([#​6903](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6903))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/java-spanner). --- benchmarks/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index a99f5079062..d418f739dfb 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -34,7 +34,7 @@ UTF-8 UTF-8 2.10.1 - 1.44.1 + 1.45.0
From 2758d40658e6bfa51f0e4e8e8da12fb401f141d2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 08:40:21 +0000 Subject: [PATCH 21/43] chore(main): release 6.83.1-SNAPSHOT (#3554) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 ++++++++--------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 +++++++++---------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 +++++++++---------- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index d418f739dfb..31ad076c283 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index c47dd4d6a26..d8f035ea2fb 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.83.0 + 6.83.1-SNAPSHOT pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT com.google.cloud google-cloud-spanner test-jar - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index aa1e3f4c0a0..dd43ae439e6 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.83.0 + 6.83.1-SNAPSHOT jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index 78ea3c3c6d6..c5128cc19f7 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 18c7bd598f2..2ec9ebce7b9 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index 78992b2516a..78a64b26cb1 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index d481c405057..de84666cd41 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index 344c4aa0c8f..294952b7ecb 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index e9b43661142..46157f0f1ed 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.83.0 + 6.83.1-SNAPSHOT Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index e9010b10626..af791549cdb 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index a9d5185760b..96dfaf95ad2 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index c329cb17fa6..c37eb525cc6 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index 0f4a788bafc..16495a9b5c4 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e9d6615ba1c..3bf1c4779cf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 497bc580774..371f87c50c2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 -proto-google-cloud-spanner-v1:6.83.0:6.83.0 -proto-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 -google-cloud-spanner:6.83.0:6.83.0 -google-cloud-spanner-executor:6.83.0:6.83.0 -proto-google-cloud-spanner-executor-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-executor-v1:6.83.0:6.83.0 +proto-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.1-SNAPSHOT +proto-google-cloud-spanner-v1:6.83.0:6.83.1-SNAPSHOT +proto-google-cloud-spanner-admin-database-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-admin-database-v1:6.83.0:6.83.1-SNAPSHOT +google-cloud-spanner:6.83.0:6.83.1-SNAPSHOT +google-cloud-spanner-executor:6.83.0:6.83.1-SNAPSHOT +proto-google-cloud-spanner-executor-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-executor-v1:6.83.0:6.83.1-SNAPSHOT From e19495480ecc53e2d9a815f65d54bc98cd46c96e Mon Sep 17 00:00:00 2001 From: Sagnik Ghosh Date: Mon, 16 Dec 2024 07:00:34 +0000 Subject: [PATCH 22/43] feat(spanner): add jdbc support for external hosts (#3536) * feat(spanner): add jdbc support for external hosts * feat(spanner): added default port value and unit tests * feat(spanner): fixed redundant class name typo --- .../spanner/connection/ConnectionOptions.java | 40 ++++++++++++++++--- .../connection/ConnectionOptionsTest.java | 37 +++++++++++++++++ 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java index 2be2d7980b2..6e991816ab6 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java @@ -628,11 +628,16 @@ private Builder() {} public static final String SPANNER_URI_FORMAT = "(?:cloudspanner:)(?//[\\w.-]+(?:\\.[\\w\\.-]+)*[\\w\\-\\._~:/?#\\[\\]@!\\$&'\\(\\)\\*\\+,;=.]+)?/projects/(?(([a-z]|[-.:]|[0-9])+|(DEFAULT_PROJECT_ID)))(/instances/(?([a-z]|[-]|[0-9])+)(/databases/(?([a-z]|[-]|[_]|[0-9])+))?)?(?:[?|;].*)?"; + public static final String EXTERNAL_HOST_FORMAT = + "(?:cloudspanner:)(?//[\\w.-]+(?::\\d+)?)(/instances/(?[a-z0-9-]+))?(/databases/(?[a-z0-9_-]+))(?:[?;].*)?"; private static final String SPANNER_URI_REGEX = "(?is)^" + SPANNER_URI_FORMAT + "$"; @VisibleForTesting static final Pattern SPANNER_URI_PATTERN = Pattern.compile(SPANNER_URI_REGEX); + @VisibleForTesting + static final Pattern EXTERNAL_HOST_PATTERN = Pattern.compile(EXTERNAL_HOST_FORMAT); + private static final String HOST_GROUP = "HOSTGROUP"; private static final String PROJECT_GROUP = "PROJECTGROUP"; private static final String INSTANCE_GROUP = "INSTANCEGROUP"; @@ -643,6 +648,10 @@ private boolean isValidUri(String uri) { return SPANNER_URI_PATTERN.matcher(uri).matches(); } + private boolean isValidExternalHostUri(String uri) { + return EXTERNAL_HOST_PATTERN.matcher(uri).matches(); + } + /** * Sets the URI of the Cloud Spanner database to connect to. A connection URI must be specified * in this format: @@ -700,9 +709,11 @@ private boolean isValidUri(String uri) { * @return this builder */ public Builder setUri(String uri) { - Preconditions.checkArgument( - isValidUri(uri), - "The specified URI is not a valid Cloud Spanner connection URI. Please specify a URI in the format \"cloudspanner:[//host[:port]]/projects/project-id[/instances/instance-id[/databases/database-name]][\\?property-name=property-value[;property-name=property-value]*]?\""); + if (!isValidExternalHostUri(uri)) { + Preconditions.checkArgument( + isValidUri(uri), + "The specified URI is not a valid Cloud Spanner connection URI. Please specify a URI in the format \"cloudspanner:[//host[:port]]/projects/project-id[/instances/instance-id[/databases/database-name]][\\?property-name=property-value[;property-name=property-value]*]?\""); + } ConnectionPropertyValue value = cast(ConnectionProperties.parseValues(uri).get(LENIENT.getKey())); checkValidProperties(value != null && value.getValue(), uri); @@ -829,7 +840,14 @@ public static Builder newBuilder() { private final SpannerOptionsConfigurator configurator; private ConnectionOptions(Builder builder) { - Matcher matcher = Builder.SPANNER_URI_PATTERN.matcher(builder.uri); + Matcher matcher; + boolean isExternalHost = false; + if (builder.isValidExternalHostUri(builder.uri)) { + matcher = Builder.EXTERNAL_HOST_PATTERN.matcher(builder.uri); + isExternalHost = true; + } else { + matcher = Builder.SPANNER_URI_PATTERN.matcher(builder.uri); + } Preconditions.checkArgument( matcher.find(), String.format("Invalid connection URI specified: %s", builder.uri)); @@ -947,12 +965,18 @@ && getInitialConnectionPropertyValue(OAUTH_TOKEN) == null this.sessionPoolOptions = SessionPoolOptions.newBuilder().setAutoDetectDialect(true).build(); } - String projectId = matcher.group(Builder.PROJECT_GROUP); + String projectId = "default"; + String instanceId = matcher.group(Builder.INSTANCE_GROUP); + if (!isExternalHost) { + projectId = matcher.group(Builder.PROJECT_GROUP); + } else if (instanceId == null) { + instanceId = "default"; + } if (Builder.DEFAULT_PROJECT_ID_PLACEHOLDER.equalsIgnoreCase(projectId)) { projectId = getDefaultProjectId(this.credentials); } this.projectId = projectId; - this.instanceId = matcher.group(Builder.INSTANCE_GROUP); + this.instanceId = instanceId; this.databaseName = matcher.group(Builder.DATABASE_GROUP); } @@ -981,6 +1005,10 @@ static String determineHost( // The leading '//' is already included in the regex for the connection URL, so we don't need // to add the leading '//' to the host name here. host = matcher.group(Builder.HOST_GROUP); + if (Builder.EXTERNAL_HOST_FORMAT.equals(matcher.pattern().pattern()) + && !host.matches(".*:\\d+$")) { + host = String.format("%s:15000", host); + } } if (usePlainText) { return PLAIN_TEXT_PROTOCOL + host; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java index f826ec08dfc..69c4a010327 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java @@ -16,6 +16,7 @@ package com.google.cloud.spanner.connection; +import static com.google.cloud.spanner.connection.ConnectionOptions.Builder.EXTERNAL_HOST_PATTERN; import static com.google.cloud.spanner.connection.ConnectionOptions.Builder.SPANNER_URI_PATTERN; import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_ENDPOINT; import static com.google.cloud.spanner.connection.ConnectionOptions.determineHost; @@ -1211,4 +1212,40 @@ public void testEnableApiTracing() { .build() .isEnableApiTracing()); } + + @Test + public void testExternalHostPatterns() { + Matcher matcherWithoutInstance = + EXTERNAL_HOST_PATTERN.matcher("cloudspanner://localhost:15000/databases/test-db"); + assertTrue(matcherWithoutInstance.matches()); + assertNull(matcherWithoutInstance.group("INSTANCEGROUP")); + assertEquals("test-db", matcherWithoutInstance.group("DATABASEGROUP")); + Matcher matcherWithProperty = + EXTERNAL_HOST_PATTERN.matcher( + "cloudspanner://localhost:15000/instances/default/databases/singers-db?usePlainText=true"); + assertTrue(matcherWithProperty.matches()); + assertEquals("default", matcherWithProperty.group("INSTANCEGROUP")); + assertEquals("singers-db", matcherWithProperty.group("DATABASEGROUP")); + Matcher matcherWithoutPort = + EXTERNAL_HOST_PATTERN.matcher( + "cloudspanner://localhost/instances/default/databases/test-db"); + assertTrue(matcherWithoutPort.matches()); + assertEquals("default", matcherWithoutPort.group("INSTANCEGROUP")); + assertEquals("test-db", matcherWithoutPort.group("DATABASEGROUP")); + assertEquals( + "http://localhost:15000", + determineHost( + matcherWithoutPort, + DEFAULT_ENDPOINT, + /* autoConfigEmulator= */ true, + /* usePlainText= */ true, + ImmutableMap.of())); + Matcher matcherWithProject = + EXTERNAL_HOST_PATTERN.matcher( + "cloudspanner://localhost:15000/projects/default/instances/default/databases/singers-db"); + assertFalse(matcherWithProject.matches()); + Matcher matcherWithoutHost = + EXTERNAL_HOST_PATTERN.matcher("cloudspanner:/instances/default/databases/singers-db"); + assertFalse(matcherWithoutHost.matches()); + } } From 33d22eb3f1da502f8dfaf44ab01b00e7d370b25c Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian <179120858+sakthivelmanii@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:16:34 +0530 Subject: [PATCH 23/43] ci(spanner): improve performance of samples tests (#3558) --- samples/install-without-bom/pom.xml | 5 +++++ samples/snapshot/pom.xml | 5 +++++ samples/snippets/pom.xml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index cc7900ed246..0d6406bd321 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -147,6 +147,8 @@ maven-failsafe-plugin 3.5.2 + 10 + false java-sample-integration-tests java-client-mr-integration-tests @@ -157,6 +159,9 @@ mysample quick-db + + **/SpannerSampleIT.java + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3bf1c4779cf..772e830d5ef 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -146,6 +146,8 @@ maven-failsafe-plugin 3.5.2 + 10 + false java-sample-integration-tests java-client-mr-integration-tests @@ -157,6 +159,9 @@ mysample-instance quick-db + + **/SpannerSampleIT.java + diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index df0488ac116..a137325f545 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -177,6 +177,8 @@ maven-failsafe-plugin 3.5.2 + 10 + false java-sample-integration-tests java-client-mr-integration-tests @@ -187,6 +189,9 @@ mysample quick-db + + **/SpannerSampleIT.java + From 488aa8c2a2e6a57b536314105a315fa493eb197e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Mon, 16 Dec 2024 18:00:28 +0100 Subject: [PATCH 24/43] test: unflake RetryOnInvalidatedSessionTest (#3561) --- .../google/cloud/spanner/RetryOnInvalidatedSessionTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java index a6c3f9fa7c5..f070f154216 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java @@ -207,7 +207,7 @@ public static void stopServer() throws InterruptedException { public void setUp() throws InterruptedException { mockSpanner.reset(); if (spanner == null - || spanner.getOptions().getSessionPoolOptions().isFailIfPoolExhausted() + || spanner.getOptions().getSessionPoolOptions().isFailIfSessionNotFound() != failOnInvalidatedSession) { if (spanner != null) { spanner.close(); @@ -228,8 +228,8 @@ public void setUp() throws InterruptedException { .build() .getService(); client = spanner.getDatabaseClient(DatabaseId.of("[PROJECT]", "[INSTANCE]", "[DATABASE]")); - invalidateSessionPool(client, spanner.getOptions().getSessionPoolOptions().getMinSessions()); } + invalidateSessionPool(client, spanner.getOptions().getSessionPoolOptions().getMinSessions()); } private static void invalidateSessionPool(DatabaseClient client, int minSessions) @@ -1002,6 +1002,7 @@ public void transactionManagerBatchUpdate() throws InterruptedException { } catch (AbortedException e) { transaction = assertThrowsSessionNotFoundIfShouldFail(() -> manager.resetForRetry()); if (transaction == null) { + manager.close(); break; } } From 871cb82ec1fc1b1da327f24bb8fb69e040061a13 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian <179120858+sakthivelmanii@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:48:15 +0530 Subject: [PATCH 25/43] ci(spanner): Create a new Sample Slow tests (#3560) * ci(spanner): Create a new Sample Slow tests * Fix delete backup issue in autogenerated admin client --- .kokoro/build.sh | 8 +- .kokoro/nightly/java11-samples-slow-tests.cfg | 39 +++++++++ samples/snippets/pom.xml | 85 ++++++++++++++----- .../com/example/spanner/SpannerSampleIT.java | 10 ++- 4 files changed, 117 insertions(+), 25 deletions(-) create mode 100644 .kokoro/nightly/java11-samples-slow-tests.cfg diff --git a/.kokoro/build.sh b/.kokoro/build.sh index d603c59859b..8875b41d373 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -206,12 +206,17 @@ slowtests) verify RETURN_CODE=$? ;; -samples) +samples|samples-slow-tests) SAMPLES_DIR=samples + PROFILES='' # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] then SAMPLES_DIR=samples/snapshot + elif [[ ${JOB_TYPE} = 'samples-slow-tests' ]] + then + SAMPLES_DIR=samples/snippets + PROFILES='-Pslow-tests,!integration-tests' fi if [[ -f ${SAMPLES_DIR}/pom.xml ]] @@ -227,6 +232,7 @@ samples) -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ + ${PROFILES} \ -fae \ verify RETURN_CODE=$? diff --git a/.kokoro/nightly/java11-samples-slow-tests.cfg b/.kokoro/nightly/java11-samples-slow-tests.cfg new file mode 100644 index 00000000000..7246153b048 --- /dev/null +++ b/.kokoro/nightly/java11-samples-slow-tests.cfg @@ -0,0 +1,39 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples-slow-tests" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a137325f545..f78c2d3b308 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -115,6 +115,69 @@ test + + + integration-tests + + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.5.2 + + 10 + false + + java-sample-integration-tests + java-client-mr-integration-tests + nam11 + us-east1 + cmek-test-key-ring + cmek-test-key + mysample + quick-db + + + **/SpannerSampleIT.java + + + + + + + + slow-tests + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.5.2 + + 10 + false + + java-sample-integration-tests + java-client-mr-integration-tests + nam11 + us-east1 + cmek-test-key-ring + cmek-test-key + mysample + quick-db + + + **/SpannerSampleIT.java + + + + + + + @@ -172,28 +235,6 @@ - - org.apache.maven.plugins - maven-failsafe-plugin - 3.5.2 - - 10 - false - - java-sample-integration-tests - java-client-mr-integration-tests - nam11 - us-east1 - cmek-test-key-ring - cmek-test-key - mysample - quick-db - - - **/SpannerSampleIT.java - - - org.apache.maven.plugins maven-checkstyle-plugin diff --git a/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java b/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java index d59152b407c..a3b12caa392 100644 --- a/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java +++ b/samples/snippets/src/test/java/com/example/spanner/SpannerSampleIT.java @@ -19,6 +19,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertTrue; +import com.google.api.gax.rpc.FailedPreconditionException; import com.google.cloud.Timestamp; import com.google.cloud.spanner.DatabaseId; import com.google.cloud.spanner.ErrorCode; @@ -643,8 +644,13 @@ private static void deleteAllBackups(String instanceId) throws InterruptedExcept attempts++; databaseAdminClient.deleteBackup(backup.getName()); break; - } catch (SpannerException e) { - if (e.getErrorCode() == ErrorCode.FAILED_PRECONDITION + } catch (SpannerException | FailedPreconditionException e) { + ErrorCode errorCode = ErrorCode.FAILED_PRECONDITION; + + if (e instanceof SpannerException) { + errorCode = ((SpannerException) e).getErrorCode(); + } + if (errorCode == ErrorCode.FAILED_PRECONDITION && e.getMessage() .contains( "Please try deleting the backup once the restore or post-restore optimize " From 07ee201b696839cda2d28bc5bab8ea74f164995d Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:49:22 -0500 Subject: [PATCH 26/43] chore: Update generation configuration at Sat Dec 14 02:27:24 UTC 2024 (#3555) Co-authored-by: rahul2393 --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index f7c5f12a081..ec32505fcca 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.51.0 -googleapis_commitish: 7d0c6bee2517d77635beb2a1dd6d6e7d4d943512 +googleapis_commitish: f4eff5440fd07389f820d22d2a55690c6390dc6d libraries_bom_version: 26.51.0 libraries: - api_shortname: spanner From dc392e3e7d0ed4978c0c4e40c710f15023c7fc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Wed, 18 Dec 2024 06:51:08 +0100 Subject: [PATCH 27/43] test: enable write tests for PostgreSQL (#3529) --- .../google/cloud/spanner/it/ITWriteTest.java | 96 +++++++++++-------- 1 file changed, 57 insertions(+), 39 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWriteTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWriteTest.java index 17f5f8e0ec9..c5eb9284479 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWriteTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWriteTest.java @@ -19,6 +19,7 @@ import static com.google.cloud.spanner.SpannerMatchers.isSpannerException; import static com.google.cloud.spanner.Type.array; import static com.google.cloud.spanner.Type.json; +import static com.google.cloud.spanner.Type.pgJsonb; import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertArrayEquals; @@ -54,7 +55,6 @@ import com.google.cloud.spanner.Type; import com.google.cloud.spanner.Value; import com.google.cloud.spanner.connection.ConnectionOptions; -import com.google.cloud.spanner.testing.EmulatorSpannerHelper; import com.google.common.collect.ImmutableList; import com.google.protobuf.NullValue; import com.google.rpc.Code; @@ -98,9 +98,7 @@ public class ITWriteTest { public static List data() { List params = new ArrayList<>(); params.add(new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL)); - if (!EmulatorSpannerHelper.isUsingEmulator()) { - params.add(new DialectTestParameter(Dialect.POSTGRESQL)); - } + params.add(new DialectTestParameter(Dialect.POSTGRESQL)); return params; } @@ -149,7 +147,7 @@ public static List data() { + " StringValue VARCHAR," + " JsonValue JSONB," + " BytesValue BYTEA," - + " TimestampValue TIMESTAMPTZ," + + " TimestampValue SPANNER.COMMIT_TIMESTAMP," + " DateValue DATE," + " NumericValue NUMERIC," + " BoolArrayValue BOOL[]," @@ -181,12 +179,10 @@ public static void setUpDatabase() env.getTestHelper().createTestDatabase(GOOGLE_STANDARD_SQL_SCHEMA); googleStandardSQLClient = env.getTestHelper().getDatabaseClient(googleStandardSQLDatabase); - if (!EmulatorSpannerHelper.isUsingEmulator()) { - Database postgreSQLDatabase = - env.getTestHelper() - .createTestDatabase(Dialect.POSTGRESQL, Arrays.asList(POSTGRESQL_SCHEMA)); - postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); - } + Database postgreSQLDatabase = + env.getTestHelper() + .createTestDatabase(Dialect.POSTGRESQL, Arrays.asList(POSTGRESQL_SCHEMA)); + postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); } @Before @@ -481,31 +477,42 @@ public void writeStringNull() { @Test public void writeJson() { - assumeFalse("PostgreSQL does not yet support JSON", dialect.dialect == Dialect.POSTGRESQL); write(baseInsert().set("JsonValue").to(Value.json("{\"rating\":9,\"open\":true}")).build()); Struct row = readLastRow("JsonValue"); assertThat(row.isNull(0)).isFalse(); - assertThat(row.getColumnType("JsonValue")).isEqualTo(json()); - assertThat(row.getJson(0)).isEqualTo("{\"open\":true,\"rating\":9}"); + if (dialect.dialect == Dialect.POSTGRESQL) { + assertThat(row.getColumnType("jsonvalue")).isEqualTo(pgJsonb()); + assertThat(row.getPgJsonb(0)).isEqualTo("{\"open\": true, \"rating\": 9}"); + } else { + assertThat(row.getColumnType("JsonValue")).isEqualTo(json()); + assertThat(row.getJson(0)).isEqualTo("{\"open\":true,\"rating\":9}"); + } } @Test public void writeJsonEmpty() { - assumeFalse("PostgreSQL does not yet support JSON", dialect.dialect == Dialect.POSTGRESQL); write(baseInsert().set("JsonValue").to(Value.json("{}")).build()); Struct row = readLastRow("JsonValue"); assertThat(row.isNull(0)).isFalse(); - assertThat(row.getColumnType("JsonValue")).isEqualTo(json()); - assertThat(row.getJson(0)).isEqualTo("{}"); + if (dialect.dialect == Dialect.POSTGRESQL) { + assertThat(row.getColumnType("jsonvalue")).isEqualTo(pgJsonb()); + assertThat(row.getPgJsonb(0)).isEqualTo("{}"); + } else { + assertThat(row.getColumnType("JsonValue")).isEqualTo(json()); + assertThat(row.getJson(0)).isEqualTo("{}"); + } } @Test public void writeJsonNull() { - assumeFalse("PostgreSQL does not yet support JSON", dialect.dialect == Dialect.POSTGRESQL); write(baseInsert().set("JsonValue").to(Value.json(null)).build()); Struct row = readLastRow("JsonValue"); assertThat(row.isNull(0)).isTrue(); - assertThat(row.getColumnType("JsonValue")).isEqualTo(json()); + if (dialect.dialect == Dialect.POSTGRESQL) { + assertThat(row.getColumnType("jsonvalue")).isEqualTo(pgJsonb()); + } else { + assertThat(row.getColumnType("JsonValue")).isEqualTo(json()); + } } @Test @@ -626,8 +633,6 @@ public void writeBytesNull() { @Test public void writeTimestamp() { - assumeFalse( - "PostgresSQL does not yet support Timestamp", dialect.dialect == Dialect.POSTGRESQL); Timestamp timestamp = Timestamp.parseTimestamp("2016-09-15T00:00:00.111111Z"); write(baseInsert().set("TimestampValue").to(timestamp).build()); Struct row = readLastRow("TimestampValue"); @@ -644,8 +649,6 @@ public void writeTimestampNull() { @Test public void writeCommitTimestamp() { - assumeFalse( - "PostgreSQL does not yet support Commit Timestamp", dialect.dialect == Dialect.POSTGRESQL); Timestamp commitTimestamp = write(baseInsert().set("TimestampValue").to(Value.COMMIT_TIMESTAMP).build()); Struct row = readLastRow("TimestampValue"); @@ -830,36 +833,46 @@ public void writeStringArray() { @Test public void writeJsonArrayNull() { - assumeFalse("PostgreSQL does not yet support Array", dialect.dialect == Dialect.POSTGRESQL); write(baseInsert().set("JsonArrayValue").toJsonArray(null).build()); Struct row = readLastRow("JsonArrayValue"); assertThat(row.isNull(0)).isTrue(); - assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); + if (dialect.dialect == Dialect.POSTGRESQL) { + assertThat(row.getColumnType("jsonarrayvalue")).isEqualTo(array(pgJsonb())); + } else { + assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); + } } @Test public void writeJsonArrayEmpty() { - assumeFalse("PostgreSQL does not yet support Array", dialect.dialect == Dialect.POSTGRESQL); write(baseInsert().set("JsonArrayValue").toJsonArray(Collections.emptyList()).build()); Struct row = readLastRow("JsonArrayValue"); assertThat(row.isNull(0)).isFalse(); - assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); - assertThat(row.getJsonList(0)).containsExactly(); + if (dialect.dialect == Dialect.POSTGRESQL) { + assertThat(row.getColumnType("jsonarrayvalue")).isEqualTo(array(pgJsonb())); + assertThat(row.getPgJsonbList(0)).containsExactly(); + } else { + assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); + assertThat(row.getJsonList(0)).containsExactly(); + } } @Test public void writeJsonArray() { - assumeFalse("PostgreSQL does not yet support Array", dialect.dialect == Dialect.POSTGRESQL); write(baseInsert().set("JsonArrayValue").toJsonArray(Arrays.asList("[]", null, "{}")).build()); Struct row = readLastRow("JsonArrayValue"); assertThat(row.isNull(0)).isFalse(); - assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); - assertThat(row.getJsonList(0)).containsExactly("[]", null, "{}").inOrder(); + if (dialect.dialect == Dialect.POSTGRESQL) { + assertThat(row.getColumnType("jsonarrayvalue")).isEqualTo(array(pgJsonb())); + assertThat(row.getPgJsonbList(0)).containsExactly("[]", null, "{}").inOrder(); + } else { + assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); + assertThat(row.getJsonList(0)).containsExactly("[]", null, "{}").inOrder(); + } } @Test public void writeJsonArrayNoNulls() { - assumeFalse("PostgreSQL does not yet support Array", dialect.dialect == Dialect.POSTGRESQL); write( baseInsert() .set("JsonArrayValue") @@ -867,10 +880,17 @@ public void writeJsonArrayNoNulls() { .build()); Struct row = readLastRow("JsonArrayValue"); assertThat(row.isNull(0)).isFalse(); - assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); - assertThat(row.getJsonList(0)) - .containsExactly("[]", "{\"color\":\"red\",\"value\":\"#f00\"}", "{}") - .inOrder(); + if (dialect.dialect == Dialect.POSTGRESQL) { + assertThat(row.getColumnType("jsonarrayvalue")).isEqualTo(array(pgJsonb())); + assertThat(row.getPgJsonbList(0)) + .containsExactly("[]", "{\"color\": \"red\", \"value\": \"#f00\"}", "{}") + .inOrder(); + } else { + assertThat(row.getColumnType("JsonArrayValue")).isEqualTo(array(json())); + assertThat(row.getJsonList(0)) + .containsExactly("[]", "{\"color\":\"red\",\"value\":\"#f00\"}", "{}") + .inOrder(); + } } @Test @@ -1430,9 +1450,7 @@ public void testTypeNamesPostgreSQL() { assertTrue(resultSet.next()); assertEquals("timestampvalue", resultSet.getString("column_name")); - assertEquals( - Type.timestamp().getSpannerTypeName(dialect.dialect), - resultSet.getString("spanner_type")); + assertEquals("spanner.commit_timestamp", resultSet.getString("spanner_type")); assertTrue(resultSet.next()); assertEquals("datevalue", resultSet.getString("column_name")); From ee81eba42dd3777a2cee66f65937b1dddc8f17c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Wed, 18 Dec 2024 15:18:27 +0100 Subject: [PATCH 28/43] chore: include session min/max in error message (#3566) --- .../java/com/google/cloud/spanner/SessionPool.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java index aba6aee1db8..ffaf913580b 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java @@ -2831,10 +2831,13 @@ private StringBuilder createCheckedOutSessionsStackTraces() { // Create the error message without holding the lock, as we are potentially looping through a // large set, and analyzing a large number of stack traces. StringBuilder stackTraces = - new StringBuilder( - "There are currently " - + currentlyCheckedOutSessions.size() - + " sessions checked out:\n\n"); + new StringBuilder("MinSessions: ") + .append(options.getMinSessions()) + .append("\nMaxSessions: ") + .append(options.getMaxSessions()) + .append("\nThere are currently ") + .append(currentlyCheckedOutSessions.size()) + .append(" sessions checked out:\n\n"); if (options.isTrackStackTraceOfSessionCheckout()) { for (PooledSessionFuture session : currentlyCheckedOutSessions) { if (session.leakedException != null) { From 8173e517323780e8a743e349f3d4f6918f39afc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Wed, 18 Dec 2024 16:38:13 +0100 Subject: [PATCH 29/43] fix: retry specific internal errors (#3565) * chore: make internal auth backend errors retryable Spanner occasionally returns INTERNAL errors regarding the auth backend server. These errors should be regarded as retryable. * fix: retry specific internal errors Some specific internal errors should be retrid. Instead of adding INTERNAL as a standard retryable error code, we use an interceptor to catch and translate those specific errors. See also b/375684610 * chore: address review comments * fix: wait for session pool to initialize * fix: register errors before creating the client --- .../spanner/IsRetryableInternalError.java | 38 ++++---- .../spi/v1/SpannerErrorInterceptor.java | 7 ++ .../spanner/IsRetryableInternalErrorTest.java | 11 +++ .../spanner/RetryableInternalErrorTest.java | 95 +++++++++++++++++++ 4 files changed, 133 insertions(+), 18 deletions(-) create mode 100644 google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryableInternalErrorTest.java diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/IsRetryableInternalError.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/IsRetryableInternalError.java index d250c0ad6c4..e69e1ec9d78 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/IsRetryableInternalError.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/IsRetryableInternalError.java @@ -18,33 +18,35 @@ import com.google.api.gax.rpc.InternalException; import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableList; import io.grpc.Status; +import io.grpc.Status.Code; import io.grpc.StatusRuntimeException; public class IsRetryableInternalError implements Predicate { + public static final IsRetryableInternalError INSTANCE = new IsRetryableInternalError(); - private static final String HTTP2_ERROR_MESSAGE = "HTTP/2 error code: INTERNAL_ERROR"; - private static final String CONNECTION_CLOSED_ERROR_MESSAGE = - "Connection closed with unknown cause"; - private static final String EOS_ERROR_MESSAGE = - "Received unexpected EOS on DATA frame from server"; + private static final ImmutableList RETRYABLE_ERROR_MESSAGES = + ImmutableList.of( + "HTTP/2 error code: INTERNAL_ERROR", + "Connection closed with unknown cause", + "Received unexpected EOS on DATA frame from server", + "stream terminated by RST_STREAM", + "Authentication backend internal server error. Please retry."); - private static final String RST_STREAM_ERROR_MESSAGE = "stream terminated by RST_STREAM"; + public boolean isRetryableInternalError(Status status) { + return status.getCode() == Code.INTERNAL + && status.getDescription() != null + && isRetryableErrorMessage(status.getDescription()); + } @Override public boolean apply(Throwable cause) { - if (isInternalError(cause)) { - if (cause.getMessage().contains(HTTP2_ERROR_MESSAGE)) { - return true; - } else if (cause.getMessage().contains(CONNECTION_CLOSED_ERROR_MESSAGE)) { - return true; - } else if (cause.getMessage().contains(EOS_ERROR_MESSAGE)) { - return true; - } else if (cause.getMessage().contains(RST_STREAM_ERROR_MESSAGE)) { - return true; - } - } - return false; + return isInternalError(cause) && isRetryableErrorMessage(cause.getMessage()); + } + + private boolean isRetryableErrorMessage(String errorMessage) { + return RETRYABLE_ERROR_MESSAGES.stream().anyMatch(errorMessage::contains); } private boolean isInternalError(Throwable cause) { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerErrorInterceptor.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerErrorInterceptor.java index 65db088ffac..549ea18a97f 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerErrorInterceptor.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/SpannerErrorInterceptor.java @@ -16,6 +16,7 @@ package com.google.cloud.spanner.spi.v1; +import com.google.cloud.spanner.IsRetryableInternalError; import com.google.rpc.BadRequest; import com.google.rpc.Help; import com.google.rpc.LocalizedMessage; @@ -32,6 +33,7 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; +import io.grpc.Status.Code; import io.grpc.protobuf.ProtoUtils; import java.util.logging.Level; import java.util.logging.Logger; @@ -69,6 +71,11 @@ public void start(Listener responseListener, Metadata headers) { @Override public void onClose(Status status, Metadata trailers) { try { + // Translate INTERNAL errors that should be retried to a retryable error code. + if (IsRetryableInternalError.INSTANCE.isRetryableInternalError(status)) { + status = + Status.fromCode(Code.UNAVAILABLE).withDescription(status.getDescription()); + } if (trailers.containsKey(LOCALIZED_MESSAGE_KEY)) { status = Status.fromCodeValue(status.getCode().value()) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IsRetryableInternalErrorTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IsRetryableInternalErrorTest.java index 63039fcd237..514b1e96b7f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IsRetryableInternalErrorTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IsRetryableInternalErrorTest.java @@ -127,6 +127,17 @@ public void rstStreamInternalExceptionIsRetryable() { assertTrue(predicate.apply(e)); } + @Test + public void testAuthenticationBackendInternalServerErrorIsRetryable() { + final StatusRuntimeException exception = + new StatusRuntimeException( + Status.fromCode(Code.INTERNAL) + .withDescription( + "INTERNAL: Authentication backend internal server error. Please retry.")); + + assertTrue(predicate.apply(exception)); + } + @Test public void genericInternalExceptionIsNotRetryable() { final InternalException e = diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryableInternalErrorTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryableInternalErrorTest.java new file mode 100644 index 00000000000..3106bd16526 --- /dev/null +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryableInternalErrorTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2024 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.spanner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.NoCredentials; +import com.google.cloud.spanner.MockSpannerServiceImpl.SimulatedExecutionTime; +import com.google.cloud.spanner.connection.AbstractMockServerTest; +import com.google.spanner.v1.BatchCreateSessionsRequest; +import com.google.spanner.v1.ExecuteSqlRequest; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Status; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class RetryableInternalErrorTest extends AbstractMockServerTest { + @Test + public void testTranslateInternalException() { + mockSpanner.setBatchCreateSessionsExecutionTime( + SimulatedExecutionTime.ofException( + Status.INTERNAL + .withDescription("Authentication backend internal server error. Please retry.") + .asRuntimeException())); + mockSpanner.setExecuteStreamingSqlExecutionTime( + SimulatedExecutionTime.ofException( + Status.INTERNAL + .withDescription("Authentication backend internal server error. Please retry.") + .asRuntimeException())); + + try (Spanner spanner = + SpannerOptions.newBuilder() + .setProjectId("my-project") + .setHost(String.format("http://localhost:%d", getPort())) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setCredentials(NoCredentials.getInstance()) + .setSessionPoolOption( + SessionPoolOptions.newBuilder() + .setMinSessions(1) + .setMaxSessions(1) + .setWaitForMinSessions(Duration.ofSeconds(5)) + .build()) + .build() + .getService()) { + + DatabaseClient client = spanner.getDatabaseClient(DatabaseId.of("p", "i", "d")); + // Execute a query. This will block until a BatchCreateSessions call has finished and then + // invoke ExecuteStreamingSql. Both of these RPCs should be retried. + try (ResultSet resultSet = client.singleUse().executeQuery(SELECT1_STATEMENT)) { + assertTrue(resultSet.next()); + assertFalse(resultSet.next()); + } + // Verify that both the BatchCreateSessions call and the ExecuteStreamingSql call were + // retried. + assertEquals(2, mockSpanner.countRequestsOfType(BatchCreateSessionsRequest.class)); + assertEquals(2, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class)); + // Clear the requests before the next test. + mockSpanner.clearRequests(); + + // Execute a DML statement. This uses the ExecuteSql RPC. + assertEquals(0, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class)); + mockSpanner.setExecuteSqlExecutionTime( + SimulatedExecutionTime.ofException( + Status.INTERNAL + .withDescription("Authentication backend internal server error. Please retry.") + .asRuntimeException())); + assertEquals( + Long.valueOf(1L), + client + .readWriteTransaction() + .run(transaction -> transaction.executeUpdate(INSERT_STATEMENT))); + // Verify that also this request was retried. + assertEquals(2, mockSpanner.countRequestsOfType(ExecuteSqlRequest.class)); + } + } +} From 0a4d70a7666d5a144082054e2a2ae3d6fe1d2e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Wed, 18 Dec 2024 18:12:09 +0100 Subject: [PATCH 30/43] chore: disable native metrics when there are no credentials (#3567) * chore: disable native metrics when there are no credentials Native metrics were automatically disabled when the emulator is used, but some clients (e.g. PGAdapter) set up the connection to the emulator manually instead of setting the environment variable. Also, when using in-mem mock servers, native metrics should be disabled, as they cannot be exported. This PR therefore adds an additional check that disables native metrics when the client uses a NoCredentials instance. * chore: make method private --- .../main/java/com/google/cloud/spanner/SpannerOptions.java | 7 ++++++- .../java/com/google/cloud/spanner/SpannerOptionsTest.java | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java index 7c232ddaa18..bc81b42903a 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java @@ -83,6 +83,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; @@ -1791,6 +1792,10 @@ public CallCredentialsProvider getCallCredentialsProvider() { return callCredentialsProvider; } + private boolean usesNoCredentials() { + return Objects.equals(getCredentials(), NoCredentials.getInstance()); + } + public String getCompressorName() { return compressorName; } @@ -1838,7 +1843,7 @@ private ApiTracerFactory createApiTracerFactory( // Add Metrics Tracer factory if built in metrics are enabled and if the client is data client // and if emulator is not enabled. - if (isEnableBuiltInMetrics() && !isAdminClient && !isEmulatorEnabled) { + if (isEnableBuiltInMetrics() && !isAdminClient && !isEmulatorEnabled && !usesNoCredentials()) { ApiTracerFactory metricsTracerFactory = createMetricsApiTracerFactory(); if (metricsTracerFactory != null) { apiTracerFactories.add(metricsTracerFactory); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java index cdab8e1df8b..70482c0ffdd 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java @@ -738,7 +738,7 @@ public void testLeaderAwareRoutingEnablement() { @Test public void testEndToEndTracingEnablement() { - // Test that end to end tracing is disabled by default. + // Test that end-to-end tracing is disabled by default. assertFalse(SpannerOptions.newBuilder().setProjectId("p").build().isEndToEndTracingEnabled()); assertTrue( SpannerOptions.newBuilder() @@ -755,7 +755,7 @@ public void testEndToEndTracingEnablement() { } @Test - public void testmonitoringHost() { + public void testMonitoringHost() { String metricsEndpoint = "test-endpoint:443"; assertNull(SpannerOptions.newBuilder().setProjectId("p").build().getMonitoringHost()); assertThat( From e5185b120d6182682bc7a77db7e34d068e8f0d46 Mon Sep 17 00:00:00 2001 From: larkee <31196561+larkee@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:18:20 +1100 Subject: [PATCH 31/43] feat: add support for ARRAY to CloudCilentExecutor (#3544) There are SPANNER_SYS tables that contain ARRAY columns. Adding support for this in the CloudClientExecutor so that queries involving these tables do not throw an error. --- .../executor/spanner/CloudClientExecutor.java | 101 ++++++++++++------ 1 file changed, 67 insertions(+), 34 deletions(-) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index d0490be44a1..64a29ed3e61 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -2842,61 +2842,75 @@ private Status processResults( /** Convert a result row to a row proto(value list) for sending back to the client. */ private com.google.spanner.executor.v1.ValueList buildRow( StructReader result, OutcomeSender sender) throws SpannerException { - com.google.spanner.executor.v1.ValueList.Builder rowBuilder = - com.google.spanner.executor.v1.ValueList.newBuilder(); + sender.setRowType(buildStructType(result)); + return buildStruct(result); + } + + /** Construct a StructType for a given struct. This is used to set the row type. */ + private com.google.spanner.v1.StructType buildStructType(StructReader struct) { com.google.spanner.v1.StructType.Builder rowTypeBuilder = com.google.spanner.v1.StructType.newBuilder(); - for (int i = 0; i < result.getColumnCount(); ++i) { - com.google.cloud.spanner.Type columnType = result.getColumnType(i); + for (int i = 0; i < struct.getColumnCount(); ++i) { + com.google.cloud.spanner.Type columnType = struct.getColumnType(i); rowTypeBuilder.addFields( com.google.spanner.v1.StructType.Field.newBuilder() - .setName(result.getType().getStructFields().get(i).getName()) + .setName(struct.getType().getStructFields().get(i).getName()) .setType(cloudTypeToTypeProto(columnType)) .build()); + } + return rowTypeBuilder.build(); + } + + /** Convert a struct to a proto(value list) for constructing result rows and struct values. */ + private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct) { + com.google.spanner.executor.v1.ValueList.Builder structBuilder = + com.google.spanner.executor.v1.ValueList.newBuilder(); + for (int i = 0; i < struct.getColumnCount(); ++i) { + com.google.cloud.spanner.Type columnType = struct.getColumnType(i); com.google.spanner.executor.v1.Value.Builder value = com.google.spanner.executor.v1.Value.newBuilder(); - if (result.isNull(i)) { + if (struct.isNull(i)) { value.setIsNull(true); } else { switch (columnType.getCode()) { case BOOL: - value.setBoolValue(result.getBoolean(i)); + value.setBoolValue(struct.getBoolean(i)); break; case FLOAT32: - value.setDoubleValue((double) result.getFloat(i)); + value.setDoubleValue((double) struct.getFloat(i)); break; case FLOAT64: - value.setDoubleValue(result.getDouble(i)); + value.setDoubleValue(struct.getDouble(i)); break; case INT64: - value.setIntValue(result.getLong(i)); + value.setIntValue(struct.getLong(i)); break; case STRING: - value.setStringValue(result.getString(i)); + value.setStringValue(struct.getString(i)); break; case BYTES: - value.setBytesValue(toByteString(result.getBytes(i))); + value.setBytesValue(toByteString(struct.getBytes(i))); break; case TIMESTAMP: - value.setTimestampValue(timestampToProto(result.getTimestamp(i))); + value.setTimestampValue(timestampToProto(struct.getTimestamp(i))); break; case DATE: - value.setDateDaysValue(daysFromDate(result.getDate(i))); + value.setDateDaysValue(daysFromDate(struct.getDate(i))); break; case NUMERIC: - String ascii = result.getBigDecimal(i).toPlainString(); + String ascii = struct.getBigDecimal(i).toPlainString(); value.setStringValue(ascii); break; case JSON: - value.setStringValue(result.getJson(i)); + value.setStringValue(struct.getJson(i)); break; case ARRAY: - switch (result.getColumnType(i).getArrayElementType().getCode()) { + switch (struct.getColumnType(i).getArrayElementType().getCode()) { case BOOL: { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getBooleanList(i); + List values = struct.getBooleanList(i); for (Boolean booleanValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -2915,7 +2929,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getFloatList(i); + List values = struct.getFloatList(i); for (Float floatValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -2934,7 +2948,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getDoubleList(i); + List values = struct.getDoubleList(i); for (Double doubleValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -2953,7 +2967,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getLongList(i); + List values = struct.getLongList(i); for (Long longValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -2972,7 +2986,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getStringList(i); + List values = struct.getStringList(i); for (String stringValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -2991,7 +3005,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getBytesList(i); + List values = struct.getBytesList(i); for (ByteArray byteArrayValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -3013,7 +3027,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getDateList(i); + List values = struct.getDateList(i); for (Date dateValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -3033,7 +3047,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getTimestampList(i); + List values = struct.getTimestampList(i); for (Timestamp timestampValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -3053,7 +3067,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getBigDecimalList(i); + List values = struct.getBigDecimalList(i); for (BigDecimal bigDec : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -3072,7 +3086,7 @@ private com.google.spanner.executor.v1.ValueList buildRow( { com.google.spanner.executor.v1.ValueList.Builder builder = com.google.spanner.executor.v1.ValueList.newBuilder(); - List values = result.getJsonList(i); + List values = struct.getJsonList(i); for (String stringValue : values) { com.google.spanner.executor.v1.Value.Builder valueProto = com.google.spanner.executor.v1.Value.newBuilder(); @@ -3087,28 +3101,47 @@ private com.google.spanner.executor.v1.ValueList buildRow( com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.JSON).build()); } break; + case STRUCT: + { + com.google.spanner.executor.v1.ValueList.Builder builder = + com.google.spanner.executor.v1.ValueList.newBuilder(); + List values = struct.getStructList(i); + for (StructReader structValue : values) { + com.google.spanner.executor.v1.Value.Builder valueProto = + com.google.spanner.executor.v1.Value.newBuilder(); + if (structValue == null) { + builder.addValue(valueProto.setIsNull(true).build()); + } else { + builder.addValue(valueProto.setStructValue(buildStruct(structValue))).build(); + } + } + value.setArrayValue(builder.build()); + value.setArrayType( + com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.STRUCT).build()); + } + break; default: throw SpannerExceptionFactory.newSpannerException( ErrorCode.INVALID_ARGUMENT, "Unsupported row array type: " - + result.getColumnType(i) + + struct.getColumnType(i) + " for result type " - + result.getType().toString()); + + struct.getType().toString()); } break; default: throw SpannerExceptionFactory.newSpannerException( ErrorCode.INVALID_ARGUMENT, "Unsupported row type: " - + result.getColumnType(i) + + struct.getColumnType(i) + " for result type " - + result.getType().toString()); + + struct.getType().toString()); } } - rowBuilder.addValue(value.build()); + structBuilder.addValue(value.build()); } - sender.setRowType(rowTypeBuilder.build()); - return rowBuilder.build(); + ; + return structBuilder.build(); } /** Convert a ListValue proto to a list of cloud Value. */ From 2f580cef65279db75b7c55a5231e7cbac080a577 Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:12:32 -0500 Subject: [PATCH 32/43] chore: Update generation configuration at Wed Dec 18 05:50:09 UTC 2024 (#3564) * chore: Update generation configuration at Wed Dec 18 05:50:09 UTC 2024 * chore: generate libraries at Wed Dec 18 05:59:39 UTC 2024 --- README.md | 2 +- generation_config.yaml | 4 +- .../reflect-config.json | 54 + .../instance/v1/InstanceAdminClient.java | 719 ++++----- .../reflect-config.json | 54 + .../v1/InstanceAdminClientHttpJsonTest.java | 15 + .../instance/v1/InstanceAdminClientTest.java | 11 + .../admin/instance/v1/InstanceAdminGrpc.java | 284 ++-- .../admin/instance/v1/AutoscalingConfig.java | 10 +- .../admin/instance/v1/CommonProto.java | 35 +- .../v1/CreateInstanceConfigRequest.java | 76 +- .../CreateInstanceConfigRequestOrBuilder.java | 18 +- .../v1/DeleteInstanceConfigRequest.java | 4 +- .../instance/v1/FreeInstanceMetadata.java | 1430 +++++++++++++++++ .../v1/FreeInstanceMetadataOrBuilder.java | 147 ++ .../spanner/admin/instance/v1/Instance.java | 840 ++++++++-- .../admin/instance/v1/InstanceConfig.java | 1163 +++++++++++++- .../instance/v1/InstanceConfigOrBuilder.java | 129 +- .../admin/instance/v1/InstanceOrBuilder.java | 97 +- .../admin/instance/v1/InstancePartition.java | 163 +- .../v1/InstancePartitionOrBuilder.java | 52 +- .../ListInstanceConfigOperationsRequest.java | 21 +- ...tanceConfigOperationsRequestOrBuilder.java | 6 +- .../ListInstanceConfigOperationsResponse.java | 138 +- ...anceConfigOperationsResponseOrBuilder.java | 30 +- ...istInstancePartitionOperationsRequest.java | 57 +- ...cePartitionOperationsRequestOrBuilder.java | 15 +- ...stInstancePartitionOperationsResponse.java | 138 +- ...ePartitionOperationsResponseOrBuilder.java | 30 +- .../v1/ListInstancePartitionsRequest.java | 28 +- ...istInstancePartitionsRequestOrBuilder.java | 8 +- .../v1/ListInstancePartitionsResponse.java | 78 +- ...stInstancePartitionsResponseOrBuilder.java | 24 +- .../admin/instance/v1/ReplicaInfo.java | 14 +- .../instance/v1/ReplicaInfoOrBuilder.java | 4 +- .../v1/SpannerInstanceAdminProto.java | 780 ++++----- .../v1/UpdateInstanceConfigRequest.java | 4 +- .../spanner/admin/instance/v1/common.proto | 1 + .../instance/v1/spanner_instance_admin.proto | 323 ++-- 39 files changed, 5352 insertions(+), 1654 deletions(-) create mode 100644 proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadata.java create mode 100644 proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadataOrBuilder.java diff --git a/README.md b/README.md index d6e321fc595..2d74ad3c5d5 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.51.0') +implementation platform('com.google.cloud:libraries-bom:26.52.0') implementation 'com.google.cloud:google-cloud-spanner' ``` diff --git a/generation_config.yaml b/generation_config.yaml index ec32505fcca..9123f338f53 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.51.0 -googleapis_commitish: f4eff5440fd07389f820d22d2a55690c6390dc6d -libraries_bom_version: 26.51.0 +googleapis_commitish: 67495ab130490fec112841715649b86a7d335e6a +libraries_bom_version: 26.52.0 libraries: - api_shortname: spanner name_pretty: Cloud Spanner diff --git a/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json b/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json index b3291f2748a..25668dd3de8 100644 --- a/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json +++ b/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json @@ -2978,6 +2978,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.FreeInstanceMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.FreeInstanceMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.FreeInstanceMetadata$ExpireBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.FulfillmentPeriod", "queryAllDeclaredConstructors": true, @@ -3077,6 +3104,15 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.Instance$InstanceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.Instance$State", "queryAllDeclaredConstructors": true, @@ -3104,6 +3140,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$FreeInstanceAvailability", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$QuorumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.InstanceConfig$State", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java index 8a7e12b50e7..53432393f48 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java @@ -130,7 +130,8 @@ * * *

ListInstanceConfigs - *

Lists the supported instance configurations for a given project. + *

Lists the supported instance configurations for a given project. + *

Returns both Google-managed configurations and user-managed configurations. * *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    @@ -169,14 +170,14 @@ * * *

    CreateInstanceConfig - *

    Creates an instance configuration and begins preparing it to be used. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of preparing the new instance configuration. The instance configuration name is assigned by the caller. If the named instance configuration already exists, `CreateInstanceConfig` returns `ALREADY_EXISTS`. + *

    Creates an instance configuration and begins preparing it to be used. The returned long-running operation can be used to track the progress of preparing the new instance configuration. The instance configuration name is assigned by the caller. If the named instance configuration already exists, `CreateInstanceConfig` returns `ALREADY_EXISTS`. *

    Immediately after the request returns: *

    * The instance configuration is readable via the API, with all requested attributes. The instance configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] field is set to true. Its state is `CREATING`. *

    While the operation is pending: *

    * Cancelling the operation renders the instance configuration immediately unreadable via the API. * Except for deleting the creating resource, all other attempts to modify the instance configuration are rejected. *

    Upon completion of the returned operation: *

    * Instances can be created using the instance configuration. * The instance configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] field becomes false. Its state becomes `READY`. - *

    The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<instance_config_name>/operations/<operation_id>` and can be used to track creation of the instance configuration. The [metadata][google.longrunning.Operation.metadata] field type is [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. The [response][google.longrunning.Operation.response] field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + *

    The returned long-running operation will have a name of the format `<instance_config_name>/operations/<operation_id>` and can be used to track creation of the instance configuration. The metadata field type is [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. *

    Authorization requires `spanner.instanceConfigs.create` permission on the resource [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. * *

    Request object method variants only take one parameter, a request object, which must be constructed before the call.

    @@ -197,7 +198,7 @@ * * *

    UpdateInstanceConfig - *

    Updates an instance configuration. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of updating the instance. If the named instance configuration does not exist, returns `NOT_FOUND`. + *

    Updates an instance configuration. The returned long-running operation can be used to track the progress of updating the instance. If the named instance configuration does not exist, returns `NOT_FOUND`. *

    Only user-managed configurations can be updated. *

    Immediately after the request returns: *

    * The instance configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] field is set to true. @@ -205,7 +206,7 @@ *

    * Cancelling the operation sets its metadata's [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. The operation is guaranteed to succeed at undoing all changes, after which point it terminates with a `CANCELLED` status. * All other attempts to modify the instance configuration are rejected. * Reading the instance configuration via the API continues to give the pre-request values. *

    Upon completion of the returned operation: *

    * Creating instances using the instance configuration uses the new values. * The new values of the instance configuration are readable via the API. * The instance configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] field becomes false. - *

    The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<instance_config_name>/operations/<operation_id>` and can be used to track the instance configuration modification. The [metadata][google.longrunning.Operation.metadata] field type is [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. The [response][google.longrunning.Operation.response] field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + *

    The returned long-running operation will have a name of the format `<instance_config_name>/operations/<operation_id>` and can be used to track the instance configuration modification. The metadata field type is [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. *

    Authorization requires `spanner.instanceConfigs.update` permission on the resource [name][google.spanner.admin.instance.v1.InstanceConfig.name]. * *

    Request object method variants only take one parameter, a request object, which must be constructed before the call.

    @@ -246,7 +247,7 @@ * * *

    ListInstanceConfigOperations - *

    Lists the user-managed instance configuration [long-running operations][google.longrunning.Operation] in the given project. An instance configuration operation has a name of the form `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`. The long-running operation [metadata][google.longrunning.Operation.metadata] field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by `operation.metadata.value.start_time` in descending order starting from the most recently started operation. + *

    Lists the user-managed instance configuration long-running operations in the given project. An instance configuration operation has a name of the form `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`. The long-running operation metadata field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by `operation.metadata.value.start_time` in descending order starting from the most recently started operation. * *

    Request object method variants only take one parameter, a request object, which must be constructed before the call.

    *
      @@ -325,14 +326,14 @@ * * *

      CreateInstance - *

      Creates an instance and begins preparing it to begin serving. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, `CreateInstance` returns `ALREADY_EXISTS`. + *

      Creates an instance and begins preparing it to begin serving. The returned long-running operation can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, `CreateInstance` returns `ALREADY_EXISTS`. *

      Immediately upon completion of this request: *

      * The instance is readable via the API, with all requested attributes but no allocated resources. Its state is `CREATING`. *

      Until completion of the returned operation: *

      * Cancelling the operation renders the instance immediately unreadable via the API. * The instance can be deleted. * All other attempts to modify the instance are rejected. *

      Upon completion of the returned operation: *

      * Billing for all successfully-allocated resources begins (some types may have lower than the requested levels). * Databases can be created in the instance. * The instance's allocated resource levels are readable via the API. * The instance's state becomes `READY`. - *

      The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<instance_name>/operations/<operation_id>` and can be used to track creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The [response][google.longrunning.Operation.response] field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

      The returned long-running operation will have a name of the format `<instance_name>/operations/<operation_id>` and can be used to track creation of the instance. The metadata field type is [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The response field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

      Request object method variants only take one parameter, a request object, which must be constructed before the call.

      *
        @@ -352,14 +353,14 @@ * * *

        UpdateInstance - *

        Updates an instance, and begins allocating or releasing resources as requested. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of updating the instance. If the named instance does not exist, returns `NOT_FOUND`. + *

        Updates an instance, and begins allocating or releasing resources as requested. The returned long-running operation can be used to track the progress of updating the instance. If the named instance does not exist, returns `NOT_FOUND`. *

        Immediately upon completion of this request: *

        * For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level. *

        Until completion of the returned operation: *

        * Cancelling the operation sets its metadata's [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a `CANCELLED` status. * All other attempts to modify the instance are rejected. * Reading the instance via the API continues to give the pre-request resource levels. *

        Upon completion of the returned operation: *

        * Billing begins for all successfully-allocated resources (some types may have lower than the requested levels). * All newly-reserved resources are available for serving the instance's tables. * The instance's new resource levels are readable via the API. - *

        The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<instance_name>/operations/<operation_id>` and can be used to track the instance modification. The [metadata][google.longrunning.Operation.metadata] field type is [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The [response][google.longrunning.Operation.response] field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

        The returned long-running operation will have a name of the format `<instance_name>/operations/<operation_id>` and can be used to track the instance modification. The metadata field type is [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The response field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. *

        Authorization requires `spanner.instances.update` permission on the resource [name][google.spanner.admin.instance.v1.Instance.name]. * *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        @@ -481,14 +482,14 @@ * * *

        CreateInstancePartition - *

        Creates an instance partition and begins preparing it to be used. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of preparing the new instance partition. The instance partition name is assigned by the caller. If the named instance partition already exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. + *

        Creates an instance partition and begins preparing it to be used. The returned long-running operation can be used to track the progress of preparing the new instance partition. The instance partition name is assigned by the caller. If the named instance partition already exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. *

        Immediately upon completion of this request: *

        * The instance partition is readable via the API, with all requested attributes but no allocated resources. Its state is `CREATING`. *

        Until completion of the returned operation: *

        * Cancelling the operation renders the instance partition immediately unreadable via the API. * The instance partition can be deleted. * All other attempts to modify the instance partition are rejected. *

        Upon completion of the returned operation: *

        * Billing for all successfully-allocated resources begins (some types may have lower than the requested levels). * Databases can start using this instance partition. * The instance partition's allocated resource levels are readable via the API. * The instance partition's state becomes `READY`. - *

        The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<instance_partition_name>/operations/<operation_id>` and can be used to track creation of the instance partition. The [metadata][google.longrunning.Operation.metadata] field type is [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. The [response][google.longrunning.Operation.response] field type is [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. + *

        The returned long-running operation will have a name of the format `<instance_partition_name>/operations/<operation_id>` and can be used to track creation of the instance partition. The metadata field type is [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. The response field type is [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        *
          @@ -528,14 +529,14 @@ * * *

          UpdateInstancePartition - *

          Updates an instance partition, and begins allocating or releasing resources as requested. The returned [long-running operation][google.longrunning.Operation] can be used to track the progress of updating the instance partition. If the named instance partition does not exist, returns `NOT_FOUND`. + *

          Updates an instance partition, and begins allocating or releasing resources as requested. The returned long-running operation can be used to track the progress of updating the instance partition. If the named instance partition does not exist, returns `NOT_FOUND`. *

          Immediately upon completion of this request: *

          * For resource types for which a decrease in the instance partition's allocation has been requested, billing is based on the newly-requested level. *

          Until completion of the returned operation: *

          * Cancelling the operation sets its metadata's [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a `CANCELLED` status. * All other attempts to modify the instance partition are rejected. * Reading the instance partition via the API continues to give the pre-request resource levels. *

          Upon completion of the returned operation: *

          * Billing begins for all successfully-allocated resources (some types may have lower than the requested levels). * All newly-reserved resources are available for serving the instance partition's tables. * The instance partition's new resource levels are readable via the API. - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<instance_partition_name>/operations/<operation_id>` and can be used to track the instance partition modification. The [metadata][google.longrunning.Operation.metadata] field type is [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. The [response][google.longrunning.Operation.response] field type is [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. + *

          The returned long-running operation will have a name of the format `<instance_partition_name>/operations/<operation_id>` and can be used to track the instance partition modification. The metadata field type is [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. The response field type is [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. *

          Authorization requires `spanner.instancePartitions.update` permission on the resource [name][google.spanner.admin.instance.v1.InstancePartition.name]. * *

          Request object method variants only take one parameter, a request object, which must be constructed before the call.

          @@ -555,7 +556,7 @@ * * *

          ListInstancePartitionOperations - *

          Lists instance partition [long-running operations][google.longrunning.Operation] in the given instance. An instance partition operation has a name of the form `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`. The long-running operation [metadata][google.longrunning.Operation.metadata] field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by `operation.metadata.value.start_time` in descending order starting from the most recently started operation. + *

          Lists instance partition long-running operations in the given instance. An instance partition operation has a name of the form `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`. The long-running operation metadata field type `metadata.type_url` describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by `operation.metadata.value.start_time` in descending order starting from the most recently started operation. *

          Authorization requires `spanner.instancePartitionOperations.list` permission on the resource [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. * *

          Request object method variants only take one parameter, a request object, which must be constructed before the call.

          @@ -576,14 +577,14 @@ * * *

          MoveInstance - *

          Moves an instance to the target instance configuration. You can use the returned [long-running operation][google.longrunning.Operation] to track the progress of moving the instance. + *

          Moves an instance to the target instance configuration. You can use the returned long-running operation to track the progress of moving the instance. *

          `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of the following criteria: *

          * Is undergoing a move to a different instance configuration * Has backups * Has an ongoing update * Contains any CMEK-enabled databases * Is a free trial instance *

          While the operation is pending: *

          * All other attempts to modify the instance, including changes to its compute capacity, are rejected. * The following database and backup admin operations are rejected: *

          * `DatabaseAdmin.CreateDatabase` * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is specified in the request.) * `DatabaseAdmin.RestoreDatabase` * `DatabaseAdmin.CreateBackup` * `DatabaseAdmin.CopyBackup` *

          * Both the source and target instance configurations are subject to hourly compute and storage charges. * The instance might experience higher read-write latencies and a higher transaction abort rate. However, moving an instance doesn't cause any downtime. - *

          The returned [long-running operation][google.longrunning.Operation] has a name of the format `<instance_name>/operations/<operation_id>` and can be used to track the move instance operation. The [metadata][google.longrunning.Operation.metadata] field type is [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The [response][google.longrunning.Operation.response] field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling the operation sets its metadata's [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. Cancellation is not immediate because it involves moving any data previously moved to the target instance configuration back to the original instance configuration. You can use this operation to track the progress of the cancellation. Upon successful completion of the cancellation, the operation terminates with `CANCELLED` status. + *

          The returned long-running operation has a name of the format `<instance_name>/operations/<operation_id>` and can be used to track the move instance operation. The metadata field type is [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The response field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling the operation sets its metadata's [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. Cancellation is not immediate because it involves moving any data previously moved to the target instance configuration back to the original instance configuration. You can use this operation to track the progress of the cancellation. Upon successful completion of the cancellation, the operation terminates with `CANCELLED` status. *

          If not cancelled, upon completion of the returned operation: *

          * The instance successfully moves to the target instance configuration. * You are billed for compute and storage in target instance configuration. *

          Authorization requires the `spanner.instances.update` permission on the resource [instance][google.spanner.admin.instance.v1.Instance]. @@ -734,6 +735,8 @@ public final OperationsClient getHttpJsonOperationsClient() { /** * Lists the supported instance configurations for a given project. * + *

          Returns both Google-managed configurations and user-managed configurations. + * *

          Sample code: * *

          {@code
          @@ -766,6 +769,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(ProjectName pa
             /**
              * Lists the supported instance configurations for a given project.
              *
          +   * 

          Returns both Google-managed configurations and user-managed configurations. + * *

          Sample code: * *

          {@code
          @@ -796,6 +801,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(String parent)
             /**
              * Lists the supported instance configurations for a given project.
              *
          +   * 

          Returns both Google-managed configurations and user-managed configurations. + * *

          Sample code: * *

          {@code
          @@ -829,6 +836,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(
             /**
              * Lists the supported instance configurations for a given project.
              *
          +   * 

          Returns both Google-managed configurations and user-managed configurations. + * *

          Sample code: * *

          {@code
          @@ -862,6 +871,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(
             /**
              * Lists the supported instance configurations for a given project.
              *
          +   * 

          Returns both Google-managed configurations and user-managed configurations. + * *

          Sample code: * *

          {@code
          @@ -1013,11 +1024,10 @@ public final UnaryCallable getInstance
           
             // AUTO-GENERATED DOCUMENTATION AND METHOD.
             /**
          -   * Creates an instance configuration and begins preparing it to be used. The returned
          -   * [long-running operation][google.longrunning.Operation] can be used to track the progress of
          -   * preparing the new instance configuration. The instance configuration name is assigned by the
          -   * caller. If the named instance configuration already exists, `CreateInstanceConfig` returns
          -   * `ALREADY_EXISTS`.
          +   * Creates an instance configuration and begins preparing it to be used. The returned long-running
          +   * operation can be used to track the progress of preparing the new instance configuration. The
          +   * instance configuration name is assigned by the caller. If the named instance configuration
          +   * already exists, `CreateInstanceConfig` returns `ALREADY_EXISTS`.
              *
              * 

          Immediately after the request returns: * @@ -1038,13 +1048,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. Its state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * creation of the instance configuration. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track + * creation of the instance configuration. The metadata field type is * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.create` permission on the resource * [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. @@ -1070,9 +1079,9 @@ public final UnaryCallable getInstance * * @param parent Required. The name of the project in which to create the instance configuration. * Values are of the form `projects/<project>`. - * @param instanceConfig Required. The InstanceConfig proto of the configuration to create. - * instance_config.name must be `<parent>/instanceConfigs/<instance_config_id>`. - * instance_config.base_config must be a Google managed configuration name, e.g. + * @param instanceConfig Required. The `InstanceConfig` proto of the configuration to create. + * `instance_config.name` must be `<parent>/instanceConfigs/<instance_config_id>`. + * `instance_config.base_config` must be a Google-managed configuration name, e.g. * <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3. * @param instanceConfigId Required. The ID of the instance configuration to create. Valid * identifiers are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 @@ -1094,11 +1103,10 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance configuration and begins preparing it to be used. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * preparing the new instance configuration. The instance configuration name is assigned by the - * caller. If the named instance configuration already exists, `CreateInstanceConfig` returns - * `ALREADY_EXISTS`. + * Creates an instance configuration and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance configuration. The + * instance configuration name is assigned by the caller. If the named instance configuration + * already exists, `CreateInstanceConfig` returns `ALREADY_EXISTS`. * *

          Immediately after the request returns: * @@ -1119,13 +1127,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. Its state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * creation of the instance configuration. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track + * creation of the instance configuration. The metadata field type is * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.create` permission on the resource * [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. @@ -1151,9 +1158,9 @@ public final UnaryCallable getInstance * * @param parent Required. The name of the project in which to create the instance configuration. * Values are of the form `projects/<project>`. - * @param instanceConfig Required. The InstanceConfig proto of the configuration to create. - * instance_config.name must be `<parent>/instanceConfigs/<instance_config_id>`. - * instance_config.base_config must be a Google managed configuration name, e.g. + * @param instanceConfig Required. The `InstanceConfig` proto of the configuration to create. + * `instance_config.name` must be `<parent>/instanceConfigs/<instance_config_id>`. + * `instance_config.base_config` must be a Google-managed configuration name, e.g. * <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3. * @param instanceConfigId Required. The ID of the instance configuration to create. Valid * identifiers are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64 @@ -1175,11 +1182,10 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance configuration and begins preparing it to be used. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * preparing the new instance configuration. The instance configuration name is assigned by the - * caller. If the named instance configuration already exists, `CreateInstanceConfig` returns - * `ALREADY_EXISTS`. + * Creates an instance configuration and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance configuration. The + * instance configuration name is assigned by the caller. If the named instance configuration + * already exists, `CreateInstanceConfig` returns `ALREADY_EXISTS`. * *

          Immediately after the request returns: * @@ -1200,13 +1206,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. Its state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * creation of the instance configuration. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track + * creation of the instance configuration. The metadata field type is * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.create` permission on the resource * [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. @@ -1241,11 +1246,10 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance configuration and begins preparing it to be used. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * preparing the new instance configuration. The instance configuration name is assigned by the - * caller. If the named instance configuration already exists, `CreateInstanceConfig` returns - * `ALREADY_EXISTS`. + * Creates an instance configuration and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance configuration. The + * instance configuration name is assigned by the caller. If the named instance configuration + * already exists, `CreateInstanceConfig` returns `ALREADY_EXISTS`. * *

          Immediately after the request returns: * @@ -1266,13 +1270,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. Its state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * creation of the instance configuration. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track + * creation of the instance configuration. The metadata field type is * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.create` permission on the resource * [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. @@ -1308,11 +1311,10 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance configuration and begins preparing it to be used. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * preparing the new instance configuration. The instance configuration name is assigned by the - * caller. If the named instance configuration already exists, `CreateInstanceConfig` returns - * `ALREADY_EXISTS`. + * Creates an instance configuration and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance configuration. The + * instance configuration name is assigned by the caller. If the named instance configuration + * already exists, `CreateInstanceConfig` returns `ALREADY_EXISTS`. * *

          Immediately after the request returns: * @@ -1333,13 +1335,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. Its state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * creation of the instance configuration. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track + * creation of the instance configuration. The metadata field type is * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.create` permission on the resource * [parent][google.spanner.admin.instance.v1.CreateInstanceConfigRequest.parent]. @@ -1374,9 +1375,9 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an instance configuration. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of updating the - * instance. If the named instance configuration does not exist, returns `NOT_FOUND`. + * Updates an instance configuration. The returned long-running operation can be used to track the + * progress of updating the instance. If the named instance configuration does not exist, returns + * `NOT_FOUND`. * *

          Only user-managed configurations can be updated. * @@ -1402,13 +1403,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * the instance configuration modification. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track the + * instance configuration modification. The metadata field type is * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.update` permission on the resource * [name][google.spanner.admin.instance.v1.InstanceConfig.name]. @@ -1454,9 +1454,9 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an instance configuration. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of updating the - * instance. If the named instance configuration does not exist, returns `NOT_FOUND`. + * Updates an instance configuration. The returned long-running operation can be used to track the + * progress of updating the instance. If the named instance configuration does not exist, returns + * `NOT_FOUND`. * *

          Only user-managed configurations can be updated. * @@ -1482,13 +1482,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * the instance configuration modification. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track the + * instance configuration modification. The metadata field type is * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.update` permission on the resource * [name][google.spanner.admin.instance.v1.InstanceConfig.name]. @@ -1522,9 +1521,9 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an instance configuration. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of updating the - * instance. If the named instance configuration does not exist, returns `NOT_FOUND`. + * Updates an instance configuration. The returned long-running operation can be used to track the + * progress of updating the instance. If the named instance configuration does not exist, returns + * `NOT_FOUND`. * *

          Only user-managed configurations can be updated. * @@ -1550,13 +1549,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * the instance configuration modification. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track the + * instance configuration modification. The metadata field type is * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.update` permission on the resource * [name][google.spanner.admin.instance.v1.InstanceConfig.name]. @@ -1591,9 +1589,9 @@ public final UnaryCallable getInstance // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an instance configuration. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of updating the - * instance. If the named instance configuration does not exist, returns `NOT_FOUND`. + * Updates an instance configuration. The returned long-running operation can be used to track the + * progress of updating the instance. If the named instance configuration does not exist, returns + * `NOT_FOUND`. * *

          Only user-managed configurations can be updated. * @@ -1619,13 +1617,12 @@ public final UnaryCallable getInstance * configuration's [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] * field becomes false. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_config_name>/operations/<operation_id>` and can be used to track - * the instance configuration modification. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_config_name>/operations/<operation_id>` and can be used to track the + * instance configuration modification. The metadata field type is * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - * The [response][google.longrunning.Operation.response] field type is - * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if successful. + * The response field type is [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], + * if successful. * *

          Authorization requires `spanner.instanceConfigs.update` permission on the resource * [name][google.spanner.admin.instance.v1.InstanceConfig.name]. @@ -1801,15 +1798,14 @@ public final UnaryCallable deleteInstanceCon // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the user-managed instance configuration [long-running - * operations][google.longrunning.Operation] in the given project. An instance configuration - * operation has a name of the form + * Lists the user-managed instance configuration long-running operations in the given project. An + * instance configuration operation has a name of the form * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Sample code: * @@ -1843,15 +1839,14 @@ public final ListInstanceConfigOperationsPagedResponse listInstanceConfigOperati // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the user-managed instance configuration [long-running - * operations][google.longrunning.Operation] in the given project. An instance configuration - * operation has a name of the form + * Lists the user-managed instance configuration long-running operations in the given project. An + * instance configuration operation has a name of the form * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Sample code: * @@ -1883,15 +1878,14 @@ public final ListInstanceConfigOperationsPagedResponse listInstanceConfigOperati // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the user-managed instance configuration [long-running - * operations][google.longrunning.Operation] in the given project. An instance configuration - * operation has a name of the form + * Lists the user-managed instance configuration long-running operations in the given project. An + * instance configuration operation has a name of the form * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Sample code: * @@ -1926,15 +1920,14 @@ public final ListInstanceConfigOperationsPagedResponse listInstanceConfigOperati // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the user-managed instance configuration [long-running - * operations][google.longrunning.Operation] in the given project. An instance configuration - * operation has a name of the form + * Lists the user-managed instance configuration long-running operations in the given project. An + * instance configuration operation has a name of the form * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Sample code: * @@ -1969,15 +1962,14 @@ public final ListInstanceConfigOperationsPagedResponse listInstanceConfigOperati // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists the user-managed instance configuration [long-running - * operations][google.longrunning.Operation] in the given project. An instance configuration - * operation has a name of the form + * Lists the user-managed instance configuration long-running operations in the given project. An + * instance configuration operation has a name of the form * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Sample code: * @@ -2209,7 +2201,9 @@ public final UnaryCallable listInst * }

          * * @param parent Required. The instance whose instance partitions should be listed. Values are of - * the form `projects/<project>/instances/<instance>`. + * the form `projects/<project>/instances/<instance>`. Use `{instance} = '-'` to + * list instance partitions for all Instances in a project, e.g., + * `projects/myproject/instances/-`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancePartitionsPagedResponse listInstancePartitions(InstanceName parent) { @@ -2242,7 +2236,9 @@ public final ListInstancePartitionsPagedResponse listInstancePartitions(Instance * }
          * * @param parent Required. The instance whose instance partitions should be listed. Values are of - * the form `projects/<project>/instances/<instance>`. + * the form `projects/<project>/instances/<instance>`. Use `{instance} = '-'` to + * list instance partitions for all Instances in a project, e.g., + * `projects/myproject/instances/-`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancePartitionsPagedResponse listInstancePartitions(String parent) { @@ -2475,10 +2471,10 @@ public final UnaryCallable getInstanceCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance and begins preparing it to begin serving. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance. The instance name is assigned by the caller. If the named instance already exists, - * `CreateInstance` returns `ALREADY_EXISTS`. + * Creates an instance and begins preparing it to begin serving. The returned long-running + * operation can be used to track the progress of preparing the new instance. The instance name is + * assigned by the caller. If the named instance already exists, `CreateInstance` returns + * `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -2498,12 +2494,11 @@ public final UnaryCallable getInstanceCallable() { * instance's allocated resource levels are readable via the API. * The instance's state * becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track - * creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is - * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track creation of + * the instance. The metadata field type is + * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Sample code: * @@ -2543,10 +2538,10 @@ public final OperationFuture createInstanceAsy // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance and begins preparing it to begin serving. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance. The instance name is assigned by the caller. If the named instance already exists, - * `CreateInstance` returns `ALREADY_EXISTS`. + * Creates an instance and begins preparing it to begin serving. The returned long-running + * operation can be used to track the progress of preparing the new instance. The instance name is + * assigned by the caller. If the named instance already exists, `CreateInstance` returns + * `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -2566,12 +2561,11 @@ public final OperationFuture createInstanceAsy * instance's allocated resource levels are readable via the API. * The instance's state * becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track - * creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is - * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track creation of + * the instance. The metadata field type is + * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Sample code: * @@ -2611,10 +2605,10 @@ public final OperationFuture createInstanceAsy // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance and begins preparing it to begin serving. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance. The instance name is assigned by the caller. If the named instance already exists, - * `CreateInstance` returns `ALREADY_EXISTS`. + * Creates an instance and begins preparing it to begin serving. The returned long-running + * operation can be used to track the progress of preparing the new instance. The instance name is + * assigned by the caller. If the named instance already exists, `CreateInstance` returns + * `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -2634,12 +2628,11 @@ public final OperationFuture createInstanceAsy * instance's allocated resource levels are readable via the API. * The instance's state * becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track - * creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is - * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track creation of + * the instance. The metadata field type is + * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Sample code: * @@ -2670,10 +2663,10 @@ public final OperationFuture createInstanceAsy // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance and begins preparing it to begin serving. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance. The instance name is assigned by the caller. If the named instance already exists, - * `CreateInstance` returns `ALREADY_EXISTS`. + * Creates an instance and begins preparing it to begin serving. The returned long-running + * operation can be used to track the progress of preparing the new instance. The instance name is + * assigned by the caller. If the named instance already exists, `CreateInstance` returns + * `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -2693,12 +2686,11 @@ public final OperationFuture createInstanceAsy * instance's allocated resource levels are readable via the API. * The instance's state * becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track - * creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is - * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track creation of + * the instance. The metadata field type is + * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Sample code: * @@ -2729,10 +2721,10 @@ public final OperationFuture createInstanceAsy // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance and begins preparing it to begin serving. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance. The instance name is assigned by the caller. If the named instance already exists, - * `CreateInstance` returns `ALREADY_EXISTS`. + * Creates an instance and begins preparing it to begin serving. The returned long-running + * operation can be used to track the progress of preparing the new instance. The instance name is + * assigned by the caller. If the named instance already exists, `CreateInstance` returns + * `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -2752,12 +2744,11 @@ public final OperationFuture createInstanceAsy * instance's allocated resource levels are readable via the API. * The instance's state * becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track - * creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is - * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track creation of + * the instance. The metadata field type is + * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Sample code: * @@ -2788,8 +2779,8 @@ public final UnaryCallable createInstanceCalla // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance, and begins allocating or releasing resources as requested. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * updating the instance. If the named instance does not exist, returns `NOT_FOUND`. + * long-running operation can be used to track the progress of updating the instance. If the named + * instance does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -2811,12 +2802,11 @@ public final UnaryCallable createInstanceCalla * than the requested levels). * All newly-reserved resources are available for serving the * instance's tables. * The instance's new resource levels are readable via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track the - * instance modification. The [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track the instance + * modification. The metadata field type is + * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Authorization requires `spanner.instances.update` permission on the resource * [name][google.spanner.admin.instance.v1.Instance.name]. @@ -2857,8 +2847,8 @@ public final OperationFuture updateInstanceAsy // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance, and begins allocating or releasing resources as requested. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * updating the instance. If the named instance does not exist, returns `NOT_FOUND`. + * long-running operation can be used to track the progress of updating the instance. If the named + * instance does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -2880,12 +2870,11 @@ public final OperationFuture updateInstanceAsy * than the requested levels). * All newly-reserved resources are available for serving the * instance's tables. * The instance's new resource levels are readable via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track the - * instance modification. The [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track the instance + * modification. The metadata field type is + * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Authorization requires `spanner.instances.update` permission on the resource * [name][google.spanner.admin.instance.v1.Instance.name]. @@ -2919,8 +2908,8 @@ public final OperationFuture updateInstanceAsy // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance, and begins allocating or releasing resources as requested. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * updating the instance. If the named instance does not exist, returns `NOT_FOUND`. + * long-running operation can be used to track the progress of updating the instance. If the named + * instance does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -2942,12 +2931,11 @@ public final OperationFuture updateInstanceAsy * than the requested levels). * All newly-reserved resources are available for serving the * instance's tables. * The instance's new resource levels are readable via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track the - * instance modification. The [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track the instance + * modification. The metadata field type is + * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Authorization requires `spanner.instances.update` permission on the resource * [name][google.spanner.admin.instance.v1.Instance.name]. @@ -2981,8 +2969,8 @@ public final OperationFuture updateInstanceAsy // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance, and begins allocating or releasing resources as requested. The returned - * [long-running operation][google.longrunning.Operation] can be used to track the progress of - * updating the instance. If the named instance does not exist, returns `NOT_FOUND`. + * long-running operation can be used to track the progress of updating the instance. If the named + * instance does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -3004,12 +2992,11 @@ public final OperationFuture updateInstanceAsy * than the requested levels). * All newly-reserved resources are available for serving the * instance's tables. * The instance's new resource levels are readable via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_name>/operations/<operation_id>` and can be used to track the - * instance modification. The [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. + *

          The returned long-running operation will have a name of the format + * `<instance_name>/operations/<operation_id>` and can be used to track the instance + * modification. The metadata field type is + * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. * *

          Authorization requires `spanner.instances.update` permission on the resource * [name][google.spanner.admin.instance.v1.Instance.name]. @@ -3725,10 +3712,10 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance partition and begins preparing it to be used. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance partition. The instance partition name is assigned by the caller. If the named - * instance partition already exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. + * Creates an instance partition and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance partition. The + * instance partition name is assigned by the caller. If the named instance partition already + * exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -3748,12 +3735,11 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest * instance partition's allocated resource levels are readable via the API. * The instance * partition's state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track creation of the instance partition. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track + * creation of the instance partition. The metadata field type is * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Sample code: @@ -3799,10 +3785,10 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance partition and begins preparing it to be used. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance partition. The instance partition name is assigned by the caller. If the named - * instance partition already exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. + * Creates an instance partition and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance partition. The + * instance partition name is assigned by the caller. If the named instance partition already + * exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -3822,12 +3808,11 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest * instance partition's allocated resource levels are readable via the API. * The instance * partition's state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track creation of the instance partition. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track + * creation of the instance partition. The metadata field type is * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Sample code: @@ -3873,10 +3858,10 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance partition and begins preparing it to be used. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance partition. The instance partition name is assigned by the caller. If the named - * instance partition already exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. + * Creates an instance partition and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance partition. The + * instance partition name is assigned by the caller. If the named instance partition already + * exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -3896,12 +3881,11 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest * instance partition's allocated resource levels are readable via the API. * The instance * partition's state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track creation of the instance partition. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track + * creation of the instance partition. The metadata field type is * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Sample code: @@ -3933,10 +3917,10 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance partition and begins preparing it to be used. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance partition. The instance partition name is assigned by the caller. If the named - * instance partition already exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. + * Creates an instance partition and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance partition. The + * instance partition name is assigned by the caller. If the named instance partition already + * exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -3956,12 +3940,11 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest * instance partition's allocated resource levels are readable via the API. * The instance * partition's state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track creation of the instance partition. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track + * creation of the instance partition. The metadata field type is * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Sample code: @@ -3994,10 +3977,10 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates an instance partition and begins preparing it to be used. The returned [long-running - * operation][google.longrunning.Operation] can be used to track the progress of preparing the new - * instance partition. The instance partition name is assigned by the caller. If the named - * instance partition already exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. + * Creates an instance partition and begins preparing it to be used. The returned long-running + * operation can be used to track the progress of preparing the new instance partition. The + * instance partition name is assigned by the caller. If the named instance partition already + * exists, `CreateInstancePartition` returns `ALREADY_EXISTS`. * *

          Immediately upon completion of this request: * @@ -4017,12 +4000,11 @@ public final InstancePartition getInstancePartition(GetInstancePartitionRequest * instance partition's allocated resource levels are readable via the API. * The instance * partition's state becomes `READY`. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track creation of the instance partition. The [metadata][google.longrunning.Operation.metadata] - * field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track + * creation of the instance partition. The metadata field type is * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Sample code: @@ -4194,9 +4176,8 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance partition, and begins allocating or releasing resources as requested. The - * returned [long-running operation][google.longrunning.Operation] can be used to track the - * progress of updating the instance partition. If the named instance partition does not exist, - * returns `NOT_FOUND`. + * returned long-running operation can be used to track the progress of updating the instance + * partition. If the named instance partition does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -4219,12 +4200,11 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request * instance partition's tables. * The instance partition's new resource levels are readable * via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track the instance partition modification. The - * [metadata][google.longrunning.Operation.metadata] field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track the + * instance partition modification. The metadata field type is * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Authorization requires `spanner.instancePartitions.update` permission on the resource @@ -4270,9 +4250,8 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance partition, and begins allocating or releasing resources as requested. The - * returned [long-running operation][google.longrunning.Operation] can be used to track the - * progress of updating the instance partition. If the named instance partition does not exist, - * returns `NOT_FOUND`. + * returned long-running operation can be used to track the progress of updating the instance + * partition. If the named instance partition does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -4295,12 +4274,11 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request * instance partition's tables. * The instance partition's new resource levels are readable * via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track the instance partition modification. The - * [metadata][google.longrunning.Operation.metadata] field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track the + * instance partition modification. The metadata field type is * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Authorization requires `spanner.instancePartitions.update` permission on the resource @@ -4335,9 +4313,8 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance partition, and begins allocating or releasing resources as requested. The - * returned [long-running operation][google.longrunning.Operation] can be used to track the - * progress of updating the instance partition. If the named instance partition does not exist, - * returns `NOT_FOUND`. + * returned long-running operation can be used to track the progress of updating the instance + * partition. If the named instance partition does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -4360,12 +4337,11 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request * instance partition's tables. * The instance partition's new resource levels are readable * via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track the instance partition modification. The - * [metadata][google.longrunning.Operation.metadata] field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track the + * instance partition modification. The metadata field type is * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Authorization requires `spanner.instancePartitions.update` permission on the resource @@ -4401,9 +4377,8 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an instance partition, and begins allocating or releasing resources as requested. The - * returned [long-running operation][google.longrunning.Operation] can be used to track the - * progress of updating the instance partition. If the named instance partition does not exist, - * returns `NOT_FOUND`. + * returned long-running operation can be used to track the progress of updating the instance + * partition. If the named instance partition does not exist, returns `NOT_FOUND`. * *

          Immediately upon completion of this request: * @@ -4426,12 +4401,11 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request * instance partition's tables. * The instance partition's new resource levels are readable * via the API. * - *

          The returned [long-running operation][google.longrunning.Operation] will have a name of the - * format `<instance_partition_name>/operations/<operation_id>` and can be used to - * track the instance partition modification. The - * [metadata][google.longrunning.Operation.metadata] field type is + *

          The returned long-running operation will have a name of the format + * `<instance_partition_name>/operations/<operation_id>` and can be used to track the + * instance partition modification. The metadata field type is * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - * The [response][google.longrunning.Operation.response] field type is + * The response field type is * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if successful. * *

          Authorization requires `spanner.instancePartitions.update` permission on the resource @@ -4465,14 +4439,14 @@ public final void deleteInstancePartition(DeleteInstancePartitionRequest request // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists instance partition [long-running operations][google.longrunning.Operation] in the given - * instance. An instance partition operation has a name of the form + * Lists instance partition long-running operations in the given instance. An instance partition + * operation has a name of the form * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Authorization requires `spanner.instancePartitionOperations.list` permission on the resource * [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. @@ -4509,14 +4483,14 @@ public final ListInstancePartitionOperationsPagedResponse listInstancePartitionO // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists instance partition [long-running operations][google.longrunning.Operation] in the given - * instance. An instance partition operation has a name of the form + * Lists instance partition long-running operations in the given instance. An instance partition + * operation has a name of the form * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Authorization requires `spanner.instancePartitionOperations.list` permission on the resource * [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. @@ -4551,14 +4525,14 @@ public final ListInstancePartitionOperationsPagedResponse listInstancePartitionO // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists instance partition [long-running operations][google.longrunning.Operation] in the given - * instance. An instance partition operation has a name of the form + * Lists instance partition long-running operations in the given instance. An instance partition + * operation has a name of the form * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Authorization requires `spanner.instancePartitionOperations.list` permission on the resource * [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. @@ -4597,14 +4571,14 @@ public final ListInstancePartitionOperationsPagedResponse listInstancePartitionO // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists instance partition [long-running operations][google.longrunning.Operation] in the given - * instance. An instance partition operation has a name of the form + * Lists instance partition long-running operations in the given instance. An instance partition + * operation has a name of the form * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Authorization requires `spanner.instancePartitionOperations.list` permission on the resource * [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. @@ -4643,14 +4617,14 @@ public final ListInstancePartitionOperationsPagedResponse listInstancePartitionO // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists instance partition [long-running operations][google.longrunning.Operation] in the given - * instance. An instance partition operation has a name of the form + * Lists instance partition long-running operations in the given instance. An instance partition + * operation has a name of the form * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`. - * The long-running operation [metadata][google.longrunning.Operation.metadata] field type - * `metadata.type_url` describes the type of the metadata. Operations returned include those that - * have completed/failed/canceled within the last 7 days, and pending operations. Operations - * returned are ordered by `operation.metadata.value.start_time` in descending order starting from - * the most recently started operation. + * The long-running operation metadata field type `metadata.type_url` describes the type of the + * metadata. Operations returned include those that have completed/failed/canceled within the last + * 7 days, and pending operations. Operations returned are ordered by + * `operation.metadata.value.start_time` in descending order starting from the most recently + * started operation. * *

          Authorization requires `spanner.instancePartitionOperations.list` permission on the resource * [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent]. @@ -4696,8 +4670,8 @@ public final ListInstancePartitionOperationsPagedResponse listInstancePartitionO // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Moves an instance to the target instance configuration. You can use the returned [long-running - * operation][google.longrunning.Operation] to track the progress of moving the instance. + * Moves an instance to the target instance configuration. You can use the returned long-running + * operation to track the progress of moving the instance. * *

          `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of the following * criteria: @@ -4718,13 +4692,12 @@ public final ListInstancePartitionOperationsPagedResponse listInstancePartitionO * storage charges. * The instance might experience higher read-write latencies and a higher * transaction abort rate. However, moving an instance doesn't cause any downtime. * - *

          The returned [long-running operation][google.longrunning.Operation] has a name of the format + *

          The returned long-running operation has a name of the format * `<instance_name>/operations/<operation_id>` and can be used to track the move - * instance operation. The [metadata][google.longrunning.Operation.metadata] field type is - * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling the operation - * sets its metadata's + * instance operation. The metadata field type is + * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling + * the operation sets its metadata's * [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. Cancellation * is not immediate because it involves moving any data previously moved to the target instance * configuration back to the original instance configuration. You can use this operation to track @@ -4770,8 +4743,8 @@ public final OperationFuture moveIns // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Moves an instance to the target instance configuration. You can use the returned [long-running - * operation][google.longrunning.Operation] to track the progress of moving the instance. + * Moves an instance to the target instance configuration. You can use the returned long-running + * operation to track the progress of moving the instance. * *

          `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of the following * criteria: @@ -4792,13 +4765,12 @@ public final OperationFuture moveIns * storage charges. * The instance might experience higher read-write latencies and a higher * transaction abort rate. However, moving an instance doesn't cause any downtime. * - *

          The returned [long-running operation][google.longrunning.Operation] has a name of the format + *

          The returned long-running operation has a name of the format * `<instance_name>/operations/<operation_id>` and can be used to track the move - * instance operation. The [metadata][google.longrunning.Operation.metadata] field type is - * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling the operation - * sets its metadata's + * instance operation. The metadata field type is + * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling + * the operation sets its metadata's * [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. Cancellation * is not immediate because it involves moving any data previously moved to the target instance * configuration back to the original instance configuration. You can use this operation to track @@ -4844,8 +4816,8 @@ public final OperationFuture moveIns // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Moves an instance to the target instance configuration. You can use the returned [long-running - * operation][google.longrunning.Operation] to track the progress of moving the instance. + * Moves an instance to the target instance configuration. You can use the returned long-running + * operation to track the progress of moving the instance. * *

          `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of the following * criteria: @@ -4866,13 +4838,12 @@ public final OperationFuture moveIns * storage charges. * The instance might experience higher read-write latencies and a higher * transaction abort rate. However, moving an instance doesn't cause any downtime. * - *

          The returned [long-running operation][google.longrunning.Operation] has a name of the format + *

          The returned long-running operation has a name of the format * `<instance_name>/operations/<operation_id>` and can be used to track the move - * instance operation. The [metadata][google.longrunning.Operation.metadata] field type is - * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The - * [response][google.longrunning.Operation.response] field type is - * [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling the operation - * sets its metadata's + * instance operation. The metadata field type is + * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. The response + * field type is [Instance][google.spanner.admin.instance.v1.Instance], if successful. Cancelling + * the operation sets its metadata's * [cancel_time][google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time]. Cancellation * is not immediate because it involves moving any data previously moved to the target instance * configuration back to the original instance configuration. You can use this operation to track diff --git a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json index 1a2d3dd10d9..65363fdf447 100644 --- a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json +++ b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.admin.instance.v1/reflect-config.json @@ -1889,6 +1889,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.FreeInstanceMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.FreeInstanceMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.FreeInstanceMetadata$ExpireBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.FulfillmentPeriod", "queryAllDeclaredConstructors": true, @@ -1988,6 +2015,15 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.Instance$InstanceType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.Instance$State", "queryAllDeclaredConstructors": true, @@ -2015,6 +2051,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$FreeInstanceAvailability", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.admin.instance.v1.InstanceConfig$QuorumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.admin.instance.v1.InstanceConfig$State", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java index 50532826e53..c85b9c5297c 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientHttpJsonTest.java @@ -45,6 +45,7 @@ import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.spanner.admin.instance.v1.AutoscalingConfig; +import com.google.spanner.admin.instance.v1.FreeInstanceMetadata; import com.google.spanner.admin.instance.v1.Instance; import com.google.spanner.admin.instance.v1.InstanceConfig; import com.google.spanner.admin.instance.v1.InstanceConfigName; @@ -223,6 +224,7 @@ public void getInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockService.addResponse(expectedResponse); @@ -275,6 +277,7 @@ public void getInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockService.addResponse(expectedResponse); @@ -327,6 +330,7 @@ public void createInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = Operation.newBuilder() @@ -389,6 +393,7 @@ public void createInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = Operation.newBuilder() @@ -451,6 +456,7 @@ public void updateInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = Operation.newBuilder() @@ -471,6 +477,7 @@ public void updateInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -512,6 +519,7 @@ public void updateInstanceConfigExceptionTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateInstanceConfigAsync(instanceConfig, updateMask).get(); @@ -917,6 +925,7 @@ public void getInstanceTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -971,6 +980,7 @@ public void getInstanceTest2() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); @@ -1025,6 +1035,7 @@ public void createInstanceTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1088,6 +1099,7 @@ public void createInstanceTest2() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1151,6 +1163,7 @@ public void updateInstanceTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1173,6 +1186,7 @@ public void updateInstanceTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); FieldMask fieldMask = FieldMask.newBuilder().build(); @@ -1215,6 +1229,7 @@ public void updateInstanceExceptionTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); FieldMask fieldMask = FieldMask.newBuilder().build(); client.updateInstanceAsync(instance, fieldMask).get(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java index 73c6de9b2ca..7c62ef03883 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClientTest.java @@ -53,6 +53,7 @@ import com.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest; import com.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest; import com.google.spanner.admin.instance.v1.DeleteInstanceRequest; +import com.google.spanner.admin.instance.v1.FreeInstanceMetadata; import com.google.spanner.admin.instance.v1.GetInstanceConfigRequest; import com.google.spanner.admin.instance.v1.GetInstancePartitionRequest; import com.google.spanner.admin.instance.v1.GetInstanceRequest; @@ -235,6 +236,7 @@ public void getInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockInstanceAdmin.addResponse(expectedResponse); @@ -281,6 +283,7 @@ public void getInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); mockInstanceAdmin.addResponse(expectedResponse); @@ -327,6 +330,7 @@ public void createInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = Operation.newBuilder() @@ -389,6 +393,7 @@ public void createInstanceConfigTest2() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = Operation.newBuilder() @@ -451,6 +456,7 @@ public void updateInstanceConfigTest() throws Exception { .setEtag("etag3123477") .addAllLeaderOptions(new ArrayList()) .setReconciling(true) + .setStorageLimitPerProcessingUnit(-1769187130) .build(); Operation resultOperation = Operation.newBuilder() @@ -852,6 +858,7 @@ public void getInstanceTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); mockInstanceAdmin.addResponse(expectedResponse); @@ -900,6 +907,7 @@ public void getInstanceTest2() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); mockInstanceAdmin.addResponse(expectedResponse); @@ -948,6 +956,7 @@ public void createInstanceTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1010,6 +1019,7 @@ public void createInstanceTest2() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1072,6 +1082,7 @@ public void updateInstanceTest() throws Exception { .addAllEndpointUris(new ArrayList()) .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setFreeInstanceMetadata(FreeInstanceMetadata.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() diff --git a/grpc-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceAdminGrpc.java b/grpc-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceAdminGrpc.java index 81d08cb9dbe..1fad30fd9b0 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceAdminGrpc.java +++ b/grpc-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceAdminGrpc.java @@ -1114,6 +1114,8 @@ public interface AsyncService { * *

                * Lists the supported instance configurations for a given project.
          +     * Returns both Google-managed configurations and user-managed
          +     * configurations.
                * 
          */ default void listInstanceConfigs( @@ -1145,7 +1147,7 @@ default void getInstanceConfig( * *
                * Creates an instance configuration and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance configuration. The instance configuration name is assigned by the
                * caller. If the named instance configuration already exists,
          @@ -1165,13 +1167,13 @@ default void getInstanceConfig(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false. Its state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * creation of the instance configuration. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.create` permission on
          @@ -1191,7 +1193,7 @@ default void createInstanceConfig(
                *
                * 
                * Updates an instance configuration. The returned
          -     * [long-running operation][google.longrunning.Operation] can be used to track
          +     * long-running operation can be used to track
                * the progress of updating the instance. If the named instance configuration
                * does not exist, returns `NOT_FOUND`.
                * Only user-managed configurations can be updated.
          @@ -1214,13 +1216,13 @@ default void createInstanceConfig(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * the instance configuration modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.update` permission on
          @@ -1257,12 +1259,12 @@ default void deleteInstanceConfig(
                *
                *
                * 
          -     * Lists the user-managed instance configuration [long-running
          -     * operations][google.longrunning.Operation] in the given project. An instance
          +     * Lists the user-managed instance configuration long-running
          +     * operations in the given project. An instance
                * configuration operation has a name of the form
                * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -1330,7 +1332,7 @@ default void getInstance(
                *
                * 
                * Creates an instance and begins preparing it to begin serving. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance. The instance name is assigned by the caller. If the
                * named instance already exists, `CreateInstance` returns
          @@ -1349,12 +1351,12 @@ default void getInstance(
                *   * Databases can be created in the instance.
                *   * The instance's allocated resource levels are readable via the API.
                *   * The instance's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track creation of the instance.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * 
          */ @@ -1370,8 +1372,7 @@ default void createInstance( * *
                * Updates an instance, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance. If the named instance does not
                * exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -1392,12 +1393,12 @@ default void createInstance(
                *   * All newly-reserved resources are available for serving the instance's
                *     tables.
                *   * The instance's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track the instance modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * Authorization requires `spanner.instances.update` permission on
                * the resource [name][google.spanner.admin.instance.v1.Instance.name].
          @@ -1503,7 +1504,7 @@ default void getInstancePartition(
                *
                * 
                * Creates an instance partition and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new instance partition.
                * The instance partition name is assigned by the caller. If the named
                * instance partition already exists, `CreateInstancePartition` returns
          @@ -1523,13 +1524,13 @@ default void getInstancePartition(
                *   * The instance partition's allocated resource levels are readable via the
                *     API.
                *   * The instance partition's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track creation of the instance partition.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * 
          @@ -1565,8 +1566,7 @@ default void deleteInstancePartition( * *
                * Updates an instance partition, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance partition. If the named instance
                * partition does not exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -1588,13 +1588,13 @@ default void deleteInstancePartition(
                *   * All newly-reserved resources are available for serving the instance
                *     partition's tables.
                *   * The instance partition's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track the instance partition modification. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * Authorization requires `spanner.instancePartitions.update` permission on
          @@ -1613,12 +1613,11 @@ default void updateInstancePartition(
                *
                *
                * 
          -     * Lists instance partition [long-running
          -     * operations][google.longrunning.Operation] in the given instance.
          +     * Lists instance partition long-running operations in the given instance.
                * An instance partition operation has a name of the form
                * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -1643,7 +1642,7 @@ default void listInstancePartitionOperations(
                *
                * 
                * Moves an instance to the target instance configuration. You can use the
          -     * returned [long-running operation][google.longrunning.Operation] to track
          +     * returned long-running operation to track
                * the progress of moving the instance.
                * `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of
                * the following criteria:
          @@ -1667,13 +1666,13 @@ default void listInstancePartitionOperations(
                *   * The instance might experience higher read-write latencies and a higher
                *     transaction abort rate. However, moving an instance doesn't cause any
                *     downtime.
          -     * The returned [long-running operation][google.longrunning.Operation] has
          +     * The returned long-running operation has
                * a name of the format
                * `<instance_name>/operations/<operation_id>` and can be used to track
                * the move instance operation. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance],
                * if successful.
                * Cancelling the operation sets its metadata's
          @@ -1775,6 +1774,8 @@ protected InstanceAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions c
                *
                * 
                * Lists the supported instance configurations for a given project.
          +     * Returns both Google-managed configurations and user-managed
          +     * configurations.
                * 
          */ public void listInstanceConfigs( @@ -1810,7 +1811,7 @@ public void getInstanceConfig( * *
                * Creates an instance configuration and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance configuration. The instance configuration name is assigned by the
                * caller. If the named instance configuration already exists,
          @@ -1830,13 +1831,13 @@ public void getInstanceConfig(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false. Its state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * creation of the instance configuration. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.create` permission on
          @@ -1858,7 +1859,7 @@ public void createInstanceConfig(
                *
                * 
                * Updates an instance configuration. The returned
          -     * [long-running operation][google.longrunning.Operation] can be used to track
          +     * long-running operation can be used to track
                * the progress of updating the instance. If the named instance configuration
                * does not exist, returns `NOT_FOUND`.
                * Only user-managed configurations can be updated.
          @@ -1881,13 +1882,13 @@ public void createInstanceConfig(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * the instance configuration modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.update` permission on
          @@ -1928,12 +1929,12 @@ public void deleteInstanceConfig(
                *
                *
                * 
          -     * Lists the user-managed instance configuration [long-running
          -     * operations][google.longrunning.Operation] in the given project. An instance
          +     * Lists the user-managed instance configuration long-running
          +     * operations in the given project. An instance
                * configuration operation has a name of the form
                * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -2009,7 +2010,7 @@ public void getInstance(
                *
                * 
                * Creates an instance and begins preparing it to begin serving. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance. The instance name is assigned by the caller. If the
                * named instance already exists, `CreateInstance` returns
          @@ -2028,12 +2029,12 @@ public void getInstance(
                *   * Databases can be created in the instance.
                *   * The instance's allocated resource levels are readable via the API.
                *   * The instance's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track creation of the instance.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * 
          */ @@ -2051,8 +2052,7 @@ public void createInstance( * *
                * Updates an instance, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance. If the named instance does not
                * exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -2073,12 +2073,12 @@ public void createInstance(
                *   * All newly-reserved resources are available for serving the instance's
                *     tables.
                *   * The instance's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track the instance modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * Authorization requires `spanner.instances.update` permission on
                * the resource [name][google.spanner.admin.instance.v1.Instance.name].
          @@ -2196,7 +2196,7 @@ public void getInstancePartition(
                *
                * 
                * Creates an instance partition and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new instance partition.
                * The instance partition name is assigned by the caller. If the named
                * instance partition already exists, `CreateInstancePartition` returns
          @@ -2216,13 +2216,13 @@ public void getInstancePartition(
                *   * The instance partition's allocated resource levels are readable via the
                *     API.
                *   * The instance partition's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track creation of the instance partition.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * 
          @@ -2262,8 +2262,7 @@ public void deleteInstancePartition( * *
                * Updates an instance partition, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance partition. If the named instance
                * partition does not exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -2285,13 +2284,13 @@ public void deleteInstancePartition(
                *   * All newly-reserved resources are available for serving the instance
                *     partition's tables.
                *   * The instance partition's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track the instance partition modification. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * Authorization requires `spanner.instancePartitions.update` permission on
          @@ -2312,12 +2311,11 @@ public void updateInstancePartition(
                *
                *
                * 
          -     * Lists instance partition [long-running
          -     * operations][google.longrunning.Operation] in the given instance.
          +     * Lists instance partition long-running operations in the given instance.
                * An instance partition operation has a name of the form
                * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -2344,7 +2342,7 @@ public void listInstancePartitionOperations(
                *
                * 
                * Moves an instance to the target instance configuration. You can use the
          -     * returned [long-running operation][google.longrunning.Operation] to track
          +     * returned long-running operation to track
                * the progress of moving the instance.
                * `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of
                * the following criteria:
          @@ -2368,13 +2366,13 @@ public void listInstancePartitionOperations(
                *   * The instance might experience higher read-write latencies and a higher
                *     transaction abort rate. However, moving an instance doesn't cause any
                *     downtime.
          -     * The returned [long-running operation][google.longrunning.Operation] has
          +     * The returned long-running operation has
                * a name of the format
                * `<instance_name>/operations/<operation_id>` and can be used to track
                * the move instance operation. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance],
                * if successful.
                * Cancelling the operation sets its metadata's
          @@ -2446,6 +2444,8 @@ protected InstanceAdminBlockingStub build(
                *
                * 
                * Lists the supported instance configurations for a given project.
          +     * Returns both Google-managed configurations and user-managed
          +     * configurations.
                * 
          */ public com.google.spanner.admin.instance.v1.ListInstanceConfigsResponse listInstanceConfigs( @@ -2472,7 +2472,7 @@ public com.google.spanner.admin.instance.v1.InstanceConfig getInstanceConfig( * *
                * Creates an instance configuration and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance configuration. The instance configuration name is assigned by the
                * caller. If the named instance configuration already exists,
          @@ -2492,13 +2492,13 @@ public com.google.spanner.admin.instance.v1.InstanceConfig getInstanceConfig(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false. Its state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * creation of the instance configuration. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.create` permission on
          @@ -2517,7 +2517,7 @@ public com.google.longrunning.Operation createInstanceConfig(
                *
                * 
                * Updates an instance configuration. The returned
          -     * [long-running operation][google.longrunning.Operation] can be used to track
          +     * long-running operation can be used to track
                * the progress of updating the instance. If the named instance configuration
                * does not exist, returns `NOT_FOUND`.
                * Only user-managed configurations can be updated.
          @@ -2540,13 +2540,13 @@ public com.google.longrunning.Operation createInstanceConfig(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * the instance configuration modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.update` permission on
          @@ -2581,12 +2581,12 @@ public com.google.protobuf.Empty deleteInstanceConfig(
                *
                *
                * 
          -     * Lists the user-managed instance configuration [long-running
          -     * operations][google.longrunning.Operation] in the given project. An instance
          +     * Lists the user-managed instance configuration long-running
          +     * operations in the given project. An instance
                * configuration operation has a name of the form
                * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -2646,7 +2646,7 @@ public com.google.spanner.admin.instance.v1.Instance getInstance(
                *
                * 
                * Creates an instance and begins preparing it to begin serving. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance. The instance name is assigned by the caller. If the
                * named instance already exists, `CreateInstance` returns
          @@ -2665,12 +2665,12 @@ public com.google.spanner.admin.instance.v1.Instance getInstance(
                *   * Databases can be created in the instance.
                *   * The instance's allocated resource levels are readable via the API.
                *   * The instance's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track creation of the instance.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * 
          */ @@ -2685,8 +2685,7 @@ public com.google.longrunning.Operation createInstance( * *
                * Updates an instance, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance. If the named instance does not
                * exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -2707,12 +2706,12 @@ public com.google.longrunning.Operation createInstance(
                *   * All newly-reserved resources are available for serving the instance's
                *     tables.
                *   * The instance's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track the instance modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * Authorization requires `spanner.instances.update` permission on
                * the resource [name][google.spanner.admin.instance.v1.Instance.name].
          @@ -2808,7 +2807,7 @@ public com.google.spanner.admin.instance.v1.InstancePartition getInstancePartiti
                *
                * 
                * Creates an instance partition and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new instance partition.
                * The instance partition name is assigned by the caller. If the named
                * instance partition already exists, `CreateInstancePartition` returns
          @@ -2828,13 +2827,13 @@ public com.google.spanner.admin.instance.v1.InstancePartition getInstancePartiti
                *   * The instance partition's allocated resource levels are readable via the
                *     API.
                *   * The instance partition's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track creation of the instance partition.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * 
          @@ -2868,8 +2867,7 @@ public com.google.protobuf.Empty deleteInstancePartition( * *
                * Updates an instance partition, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance partition. If the named instance
                * partition does not exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -2891,13 +2889,13 @@ public com.google.protobuf.Empty deleteInstancePartition(
                *   * All newly-reserved resources are available for serving the instance
                *     partition's tables.
                *   * The instance partition's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track the instance partition modification. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * Authorization requires `spanner.instancePartitions.update` permission on
          @@ -2915,12 +2913,11 @@ public com.google.longrunning.Operation updateInstancePartition(
                *
                *
                * 
          -     * Lists instance partition [long-running
          -     * operations][google.longrunning.Operation] in the given instance.
          +     * Lists instance partition long-running operations in the given instance.
                * An instance partition operation has a name of the form
                * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -2943,7 +2940,7 @@ public com.google.longrunning.Operation updateInstancePartition(
                *
                * 
                * Moves an instance to the target instance configuration. You can use the
          -     * returned [long-running operation][google.longrunning.Operation] to track
          +     * returned long-running operation to track
                * the progress of moving the instance.
                * `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of
                * the following criteria:
          @@ -2967,13 +2964,13 @@ public com.google.longrunning.Operation updateInstancePartition(
                *   * The instance might experience higher read-write latencies and a higher
                *     transaction abort rate. However, moving an instance doesn't cause any
                *     downtime.
          -     * The returned [long-running operation][google.longrunning.Operation] has
          +     * The returned long-running operation has
                * a name of the format
                * `<instance_name>/operations/<operation_id>` and can be used to track
                * the move instance operation. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance],
                * if successful.
                * Cancelling the operation sets its metadata's
          @@ -3042,6 +3039,8 @@ protected InstanceAdminFutureStub build(
                *
                * 
                * Lists the supported instance configurations for a given project.
          +     * Returns both Google-managed configurations and user-managed
          +     * configurations.
                * 
          */ public com.google.common.util.concurrent.ListenableFuture< @@ -3071,7 +3070,7 @@ protected InstanceAdminFutureStub build( * *
                * Creates an instance configuration and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance configuration. The instance configuration name is assigned by the
                * caller. If the named instance configuration already exists,
          @@ -3091,13 +3090,13 @@ protected InstanceAdminFutureStub build(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false. Its state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * creation of the instance configuration. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.create` permission on
          @@ -3117,7 +3116,7 @@ protected InstanceAdminFutureStub build(
                *
                * 
                * Updates an instance configuration. The returned
          -     * [long-running operation][google.longrunning.Operation] can be used to track
          +     * long-running operation can be used to track
                * the progress of updating the instance. If the named instance configuration
                * does not exist, returns `NOT_FOUND`.
                * Only user-managed configurations can be updated.
          @@ -3140,13 +3139,13 @@ protected InstanceAdminFutureStub build(
                *   * The instance configuration's
                *   [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling]
                *   field becomes false.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_config_name>/operations/<operation_id>` and can be used to track
                * the instance configuration modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if
                * successful.
                * Authorization requires `spanner.instanceConfigs.update` permission on
          @@ -3183,12 +3182,12 @@ protected InstanceAdminFutureStub build(
                *
                *
                * 
          -     * Lists the user-managed instance configuration [long-running
          -     * operations][google.longrunning.Operation] in the given project. An instance
          +     * Lists the user-managed instance configuration long-running
          +     * operations in the given project. An instance
                * configuration operation has a name of the form
                * `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -3252,7 +3251,7 @@ protected InstanceAdminFutureStub build(
                *
                * 
                * Creates an instance and begins preparing it to begin serving. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new
                * instance. The instance name is assigned by the caller. If the
                * named instance already exists, `CreateInstance` returns
          @@ -3271,12 +3270,12 @@ protected InstanceAdminFutureStub build(
                *   * Databases can be created in the instance.
                *   * The instance's allocated resource levels are readable via the API.
                *   * The instance's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track creation of the instance.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * 
          */ @@ -3291,8 +3290,7 @@ protected InstanceAdminFutureStub build( * *
                * Updates an instance, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance. If the named instance does not
                * exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -3313,12 +3311,12 @@ protected InstanceAdminFutureStub build(
                *   * All newly-reserved resources are available for serving the instance's
                *     tables.
                *   * The instance's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format `<instance_name>/operations/<operation_id>` and
                * can be used to track the instance modification.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance], if successful.
                * Authorization requires `spanner.instances.update` permission on
                * the resource [name][google.spanner.admin.instance.v1.Instance.name].
          @@ -3419,7 +3417,7 @@ protected InstanceAdminFutureStub build(
                *
                * 
                * Creates an instance partition and begins preparing it to be used. The
          -     * returned [long-running operation][google.longrunning.Operation]
          +     * returned long-running operation
                * can be used to track the progress of preparing the new instance partition.
                * The instance partition name is assigned by the caller. If the named
                * instance partition already exists, `CreateInstancePartition` returns
          @@ -3439,13 +3437,13 @@ protected InstanceAdminFutureStub build(
                *   * The instance partition's allocated resource levels are readable via the
                *     API.
                *   * The instance partition's state becomes `READY`.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track creation of the instance partition.  The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * 
          @@ -3481,8 +3479,7 @@ protected InstanceAdminFutureStub build( * *
                * Updates an instance partition, and begins allocating or releasing resources
          -     * as requested. The returned [long-running
          -     * operation][google.longrunning.Operation] can be used to track the
          +     * as requested. The returned long-running operation can be used to track the
                * progress of updating the instance partition. If the named instance
                * partition does not exist, returns `NOT_FOUND`.
                * Immediately upon completion of this request:
          @@ -3504,13 +3501,13 @@ protected InstanceAdminFutureStub build(
                *   * All newly-reserved resources are available for serving the instance
                *     partition's tables.
                *   * The instance partition's new resource levels are readable via the API.
          -     * The returned [long-running operation][google.longrunning.Operation] will
          +     * The returned long-running operation will
                * have a name of the format
                * `<instance_partition_name>/operations/<operation_id>` and can be used to
                * track the instance partition modification. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
                * successful.
                * Authorization requires `spanner.instancePartitions.update` permission on
          @@ -3529,12 +3526,11 @@ protected InstanceAdminFutureStub build(
                *
                *
                * 
          -     * Lists instance partition [long-running
          -     * operations][google.longrunning.Operation] in the given instance.
          +     * Lists instance partition long-running operations in the given instance.
                * An instance partition operation has a name of the form
                * `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`.
                * The long-running operation
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata. Operations returned
                * include those that have completed/failed/canceled within the last 7 days,
                * and pending operations. Operations returned are ordered by
          @@ -3559,7 +3555,7 @@ protected InstanceAdminFutureStub build(
                *
                * 
                * Moves an instance to the target instance configuration. You can use the
          -     * returned [long-running operation][google.longrunning.Operation] to track
          +     * returned long-running operation to track
                * the progress of moving the instance.
                * `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of
                * the following criteria:
          @@ -3583,13 +3579,13 @@ protected InstanceAdminFutureStub build(
                *   * The instance might experience higher read-write latencies and a higher
                *     transaction abort rate. However, moving an instance doesn't cause any
                *     downtime.
          -     * The returned [long-running operation][google.longrunning.Operation] has
          +     * The returned long-running operation has
                * a name of the format
                * `<instance_name>/operations/<operation_id>` and can be used to track
                * the move instance operation. The
          -     * [metadata][google.longrunning.Operation.metadata] field type is
          +     * metadata field type is
                * [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata].
          -     * The [response][google.longrunning.Operation.response] field type is
          +     * The response field type is
                * [Instance][google.spanner.admin.instance.v1.Instance],
                * if successful.
                * Cancelling the operation sets its metadata's
          diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/AutoscalingConfig.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/AutoscalingConfig.java
          index eeb39bfd3d2..2881c4fa894 100644
          --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/AutoscalingConfig.java
          +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/AutoscalingConfig.java
          @@ -1397,7 +1397,7 @@ public interface AutoscalingTargetsOrBuilder
                * Required. The target storage utilization percentage that the autoscaler
                * should be trying to achieve for the instance. This number is on a scale
                * from 0 (no utilization) to 100 (full utilization). The valid range is
          -     * [10, 100] inclusive.
          +     * [10, 99] inclusive.
                * 
          * * int32 storage_utilization_percent = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1481,7 +1481,7 @@ public int getHighPriorityCpuUtilizationPercent() { * Required. The target storage utilization percentage that the autoscaler * should be trying to achieve for the instance. This number is on a scale * from 0 (no utilization) to 100 (full utilization). The valid range is - * [10, 100] inclusive. + * [10, 99] inclusive. *
          * * int32 storage_utilization_percent = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1958,7 +1958,7 @@ public Builder clearHighPriorityCpuUtilizationPercent() { * Required. The target storage utilization percentage that the autoscaler * should be trying to achieve for the instance. This number is on a scale * from 0 (no utilization) to 100 (full utilization). The valid range is - * [10, 100] inclusive. + * [10, 99] inclusive. *
          * * int32 storage_utilization_percent = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1977,7 +1977,7 @@ public int getStorageUtilizationPercent() { * Required. The target storage utilization percentage that the autoscaler * should be trying to achieve for the instance. This number is on a scale * from 0 (no utilization) to 100 (full utilization). The valid range is - * [10, 100] inclusive. + * [10, 99] inclusive. *
          * * int32 storage_utilization_percent = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -2000,7 +2000,7 @@ public Builder setStorageUtilizationPercent(int value) { * Required. The target storage utilization percentage that the autoscaler * should be trying to achieve for the instance. This number is on a scale * from 0 (no utilization) to 100 (full utilization). The valid range is - * [10, 100] inclusive. + * [10, 99] inclusive. *
          * * int32 storage_utilization_percent = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CommonProto.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CommonProto.java index a589f16c104..0b9697fe631 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CommonProto.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CommonProto.java @@ -47,28 +47,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n-google/spanner/admin/instance/v1/commo" + "n.proto\022 google.spanner.admin.instance.v" - + "1\032\037google/api/field_behavior.proto\032\037goog" - + "le/protobuf/timestamp.proto\"\213\001\n\021Operatio" - + "nProgress\022\030\n\020progress_percent\030\001 \001(\005\022.\n\ns" - + "tart_time\030\002 \001(\0132\032.google.protobuf.Timest" - + "amp\022,\n\010end_time\030\003 \001(\0132\032.google.protobuf." - + "Timestamp\")\n\020ReplicaSelection\022\025\n\010locatio" - + "n\030\001 \001(\tB\003\340A\002*w\n\021FulfillmentPeriod\022\"\n\036FUL" - + "FILLMENT_PERIOD_UNSPECIFIED\020\000\022\035\n\031FULFILL" - + "MENT_PERIOD_NORMAL\020\001\022\037\n\033FULFILLMENT_PERI" - + "OD_EXTENDED\020\002B\375\001\n$com.google.spanner.adm" - + "in.instance.v1B\013CommonProtoP\001ZFcloud.goo" - + "gle.com/go/spanner/admin/instance/apiv1/" - + "instancepb;instancepb\252\002&Google.Cloud.Spa" - + "nner.Admin.Instance.V1\312\002&Google\\Cloud\\Sp" - + "anner\\Admin\\Instance\\V1\352\002+Google::Cloud:" - + ":Spanner::Admin::Instance::V1b\006proto3" + + "1\032\037google/api/field_behavior.proto\032\031goog" + + "le/api/resource.proto\032\037google/protobuf/t" + + "imestamp.proto\"\213\001\n\021OperationProgress\022\030\n\020" + + "progress_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022,\n\010end_ti" + + "me\030\003 \001(\0132\032.google.protobuf.Timestamp\")\n\020" + + "ReplicaSelection\022\025\n\010location\030\001 \001(\tB\003\340A\002*" + + "w\n\021FulfillmentPeriod\022\"\n\036FULFILLMENT_PERI" + + "OD_UNSPECIFIED\020\000\022\035\n\031FULFILLMENT_PERIOD_N" + + "ORMAL\020\001\022\037\n\033FULFILLMENT_PERIOD_EXTENDED\020\002" + + "B\375\001\n$com.google.spanner.admin.instance.v" + + "1B\013CommonProtoP\001ZFcloud.google.com/go/sp" + + "anner/admin/instance/apiv1/instancepb;in" + + "stancepb\252\002&Google.Cloud.Spanner.Admin.In" + + "stance.V1\312\002&Google\\Cloud\\Spanner\\Admin\\I" + + "nstance\\V1\352\002+Google::Cloud::Spanner::Adm" + + "in::Instance::V1b\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.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_spanner_admin_instance_v1_OperationProgress_descriptor = @@ -93,6 +95,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequest.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequest.java index 72a0f24207f..ba1db21439b 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequest.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequest.java @@ -24,7 +24,7 @@ * *
            * The request for
          - * [CreateInstanceConfigRequest][InstanceAdmin.CreateInstanceConfigRequest].
          + * [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig].
            * 
          * * Protobuf type {@code google.spanner.admin.instance.v1.CreateInstanceConfigRequest} @@ -186,10 +186,10 @@ public com.google.protobuf.ByteString getInstanceConfigIdBytes() { * * *
          -   * Required. The InstanceConfig proto of the configuration to create.
          -   * instance_config.name must be
          +   * Required. The `InstanceConfig` proto of the configuration to create.
          +   * `instance_config.name` must be
              * `<parent>/instanceConfigs/<instance_config_id>`.
          -   * instance_config.base_config must be a Google managed configuration name,
          +   * `instance_config.base_config` must be a Google-managed configuration name,
              * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
              * 
          * @@ -207,10 +207,10 @@ public boolean hasInstanceConfig() { * * *
          -   * Required. The InstanceConfig proto of the configuration to create.
          -   * instance_config.name must be
          +   * Required. The `InstanceConfig` proto of the configuration to create.
          +   * `instance_config.name` must be
              * `<parent>/instanceConfigs/<instance_config_id>`.
          -   * instance_config.base_config must be a Google managed configuration name,
          +   * `instance_config.base_config` must be a Google-managed configuration name,
              * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
              * 
          * @@ -230,10 +230,10 @@ public com.google.spanner.admin.instance.v1.InstanceConfig getInstanceConfig() { * * *
          -   * Required. The InstanceConfig proto of the configuration to create.
          -   * instance_config.name must be
          +   * Required. The `InstanceConfig` proto of the configuration to create.
          +   * `instance_config.name` must be
              * `<parent>/instanceConfigs/<instance_config_id>`.
          -   * instance_config.base_config must be a Google managed configuration name,
          +   * `instance_config.base_config` must be a Google-managed configuration name,
              * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
              * 
          * @@ -464,7 +464,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
              * The request for
          -   * [CreateInstanceConfigRequest][InstanceAdmin.CreateInstanceConfigRequest].
          +   * [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig].
              * 
          * * Protobuf type {@code google.spanner.admin.instance.v1.CreateInstanceConfigRequest} @@ -957,10 +957,10 @@ public Builder setInstanceConfigIdBytes(com.google.protobuf.ByteString value) { * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -977,10 +977,10 @@ public boolean hasInstanceConfig() { * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -1003,10 +1003,10 @@ public com.google.spanner.admin.instance.v1.InstanceConfig getInstanceConfig() { * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -1031,10 +1031,10 @@ public Builder setInstanceConfig(com.google.spanner.admin.instance.v1.InstanceCo * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -1057,10 +1057,10 @@ public Builder setInstanceConfig( * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -1091,10 +1091,10 @@ public Builder mergeInstanceConfig(com.google.spanner.admin.instance.v1.Instance * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -1116,10 +1116,10 @@ public Builder clearInstanceConfig() { * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -1136,10 +1136,10 @@ public com.google.spanner.admin.instance.v1.InstanceConfig.Builder getInstanceCo * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * @@ -1161,10 +1161,10 @@ public com.google.spanner.admin.instance.v1.InstanceConfig.Builder getInstanceCo * * *
          -     * Required. The InstanceConfig proto of the configuration to create.
          -     * instance_config.name must be
          +     * Required. The `InstanceConfig` proto of the configuration to create.
          +     * `instance_config.name` must be
                * `<parent>/instanceConfigs/<instance_config_id>`.
          -     * instance_config.base_config must be a Google managed configuration name,
          +     * `instance_config.base_config` must be a Google-managed configuration name,
                * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
                * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequestOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequestOrBuilder.java index 60e1ef481e4..224bcea9c61 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequestOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/CreateInstanceConfigRequestOrBuilder.java @@ -90,10 +90,10 @@ public interface CreateInstanceConfigRequestOrBuilder * * *
          -   * Required. The InstanceConfig proto of the configuration to create.
          -   * instance_config.name must be
          +   * Required. The `InstanceConfig` proto of the configuration to create.
          +   * `instance_config.name` must be
              * `<parent>/instanceConfigs/<instance_config_id>`.
          -   * instance_config.base_config must be a Google managed configuration name,
          +   * `instance_config.base_config` must be a Google-managed configuration name,
              * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
              * 
          * @@ -108,10 +108,10 @@ public interface CreateInstanceConfigRequestOrBuilder * * *
          -   * Required. The InstanceConfig proto of the configuration to create.
          -   * instance_config.name must be
          +   * Required. The `InstanceConfig` proto of the configuration to create.
          +   * `instance_config.name` must be
              * `<parent>/instanceConfigs/<instance_config_id>`.
          -   * instance_config.base_config must be a Google managed configuration name,
          +   * `instance_config.base_config` must be a Google-managed configuration name,
              * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
              * 
          * @@ -126,10 +126,10 @@ public interface CreateInstanceConfigRequestOrBuilder * * *
          -   * Required. The InstanceConfig proto of the configuration to create.
          -   * instance_config.name must be
          +   * Required. The `InstanceConfig` proto of the configuration to create.
          +   * `instance_config.name` must be
              * `<parent>/instanceConfigs/<instance_config_id>`.
          -   * instance_config.base_config must be a Google managed configuration name,
          +   * `instance_config.base_config` must be a Google-managed configuration name,
              * e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
              * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/DeleteInstanceConfigRequest.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/DeleteInstanceConfigRequest.java index c62e5c1a242..e079d363160 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/DeleteInstanceConfigRequest.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/DeleteInstanceConfigRequest.java @@ -24,7 +24,7 @@ * *
            * The request for
          - * [DeleteInstanceConfigRequest][InstanceAdmin.DeleteInstanceConfigRequest].
          + * [DeleteInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig].
            * 
          * * Protobuf type {@code google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} @@ -389,7 +389,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
              * The request for
          -   * [DeleteInstanceConfigRequest][InstanceAdmin.DeleteInstanceConfigRequest].
          +   * [DeleteInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig].
              * 
          * * Protobuf type {@code google.spanner.admin.instance.v1.DeleteInstanceConfigRequest} diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadata.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadata.java new file mode 100644 index 00000000000..2daf2ff7462 --- /dev/null +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadata.java @@ -0,0 +1,1430 @@ +/* + * Copyright 2024 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! +// source: google/spanner/admin/instance/v1/spanner_instance_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.spanner.admin.instance.v1; + +/** + * + * + *
          + * Free instance specific metadata that is kept even after an instance has been
          + * upgraded for tracking purposes.
          + * 
          + * + * Protobuf type {@code google.spanner.admin.instance.v1.FreeInstanceMetadata} + */ +public final class FreeInstanceMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.admin.instance.v1.FreeInstanceMetadata) + FreeInstanceMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use FreeInstanceMetadata.newBuilder() to construct. + private FreeInstanceMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FreeInstanceMetadata() { + expireBehavior_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FreeInstanceMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.class, + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.Builder.class); + } + + /** + * + * + *
          +   * Allows users to change behavior when a free instance expires.
          +   * 
          + * + * Protobuf enum {@code google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior} + */ + public enum ExpireBehavior implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
          +     * Not specified.
          +     * 
          + * + * EXPIRE_BEHAVIOR_UNSPECIFIED = 0; + */ + EXPIRE_BEHAVIOR_UNSPECIFIED(0), + /** + * + * + *
          +     * When the free instance expires, upgrade the instance to a provisioned
          +     * instance.
          +     * 
          + * + * FREE_TO_PROVISIONED = 1; + */ + FREE_TO_PROVISIONED(1), + /** + * + * + *
          +     * When the free instance expires, disable the instance, and delete it
          +     * after the grace period passes if it has not been upgraded.
          +     * 
          + * + * REMOVE_AFTER_GRACE_PERIOD = 2; + */ + REMOVE_AFTER_GRACE_PERIOD(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
          +     * Not specified.
          +     * 
          + * + * EXPIRE_BEHAVIOR_UNSPECIFIED = 0; + */ + public static final int EXPIRE_BEHAVIOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
          +     * When the free instance expires, upgrade the instance to a provisioned
          +     * instance.
          +     * 
          + * + * FREE_TO_PROVISIONED = 1; + */ + public static final int FREE_TO_PROVISIONED_VALUE = 1; + /** + * + * + *
          +     * When the free instance expires, disable the instance, and delete it
          +     * after the grace period passes if it has not been upgraded.
          +     * 
          + * + * REMOVE_AFTER_GRACE_PERIOD = 2; + */ + public static final int REMOVE_AFTER_GRACE_PERIOD_VALUE = 2; + + 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 ExpireBehavior 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 ExpireBehavior forNumber(int value) { + switch (value) { + case 0: + return EXPIRE_BEHAVIOR_UNSPECIFIED; + case 1: + return FREE_TO_PROVISIONED; + case 2: + return REMOVE_AFTER_GRACE_PERIOD; + 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 ExpireBehavior findValueByNumber(int number) { + return ExpireBehavior.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 final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ExpireBehavior[] VALUES = values(); + + public static ExpireBehavior 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 ExpireBehavior(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior) + } + + private int bitField0_; + public static final int EXPIRE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
          +   * Output only. Timestamp after which the instance will either be upgraded or
          +   * scheduled for deletion after a grace period. ExpireBehavior is used to
          +   * choose between upgrading or scheduling the free instance for deletion. This
          +   * timestamp is set during the creation of a free instance.
          +   * 
          + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
          +   * Output only. Timestamp after which the instance will either be upgraded or
          +   * scheduled for deletion after a grace period. ExpireBehavior is used to
          +   * choose between upgrading or scheduling the free instance for deletion. This
          +   * timestamp is set during the creation of a free instance.
          +   * 
          + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
          +   * Output only. Timestamp after which the instance will either be upgraded or
          +   * scheduled for deletion after a grace period. ExpireBehavior is used to
          +   * choose between upgrading or scheduling the free instance for deletion. This
          +   * timestamp is set during the creation of a free instance.
          +   * 
          + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + public static final int UPGRADE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp upgradeTime_; + /** + * + * + *
          +   * Output only. If present, the timestamp at which the free instance was
          +   * upgraded to a provisioned instance.
          +   * 
          + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the upgradeTime field is set. + */ + @java.lang.Override + public boolean hasUpgradeTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
          +   * Output only. If present, the timestamp at which the free instance was
          +   * upgraded to a provisioned instance.
          +   * 
          + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The upgradeTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpgradeTime() { + return upgradeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : upgradeTime_; + } + /** + * + * + *
          +   * Output only. If present, the timestamp at which the free instance was
          +   * upgraded to a provisioned instance.
          +   * 
          + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpgradeTimeOrBuilder() { + return upgradeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : upgradeTime_; + } + + public static final int EXPIRE_BEHAVIOR_FIELD_NUMBER = 3; + private int expireBehavior_ = 0; + /** + * + * + *
          +   * Specifies the expiration behavior of a free instance. The default of
          +   * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +   * or after creation, and before expiration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @return The enum numeric value on the wire for expireBehavior. + */ + @java.lang.Override + public int getExpireBehaviorValue() { + return expireBehavior_; + } + /** + * + * + *
          +   * Specifies the expiration behavior of a free instance. The default of
          +   * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +   * or after creation, and before expiration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @return The expireBehavior. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior + getExpireBehavior() { + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior result = + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior.forNumber( + expireBehavior_); + return result == null + ? com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getExpireTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpgradeTime()); + } + if (expireBehavior_ + != com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior + .EXPIRE_BEHAVIOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, expireBehavior_); + } + 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, getExpireTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpgradeTime()); + } + if (expireBehavior_ + != com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior + .EXPIRE_BEHAVIOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, expireBehavior_); + } + 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.spanner.admin.instance.v1.FreeInstanceMetadata)) { + return super.equals(obj); + } + com.google.spanner.admin.instance.v1.FreeInstanceMetadata other = + (com.google.spanner.admin.instance.v1.FreeInstanceMetadata) obj; + + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (hasUpgradeTime() != other.hasUpgradeTime()) return false; + if (hasUpgradeTime()) { + if (!getUpgradeTime().equals(other.getUpgradeTime())) return false; + } + if (expireBehavior_ != other.expireBehavior_) 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 (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + if (hasUpgradeTime()) { + hash = (37 * hash) + UPGRADE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpgradeTime().hashCode(); + } + hash = (37 * hash) + EXPIRE_BEHAVIOR_FIELD_NUMBER; + hash = (53 * hash) + expireBehavior_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata 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.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.spanner.admin.instance.v1.FreeInstanceMetadata 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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
          +   * Free instance specific metadata that is kept even after an instance has been
          +   * upgraded for tracking purposes.
          +   * 
          + * + * Protobuf type {@code google.spanner.admin.instance.v1.FreeInstanceMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.admin.instance.v1.FreeInstanceMetadata) + com.google.spanner.admin.instance.v1.FreeInstanceMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.class, + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.Builder.class); + } + + // Construct using com.google.spanner.admin.instance.v1.FreeInstanceMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExpireTimeFieldBuilder(); + getUpgradeTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + upgradeTime_ = null; + if (upgradeTimeBuilder_ != null) { + upgradeTimeBuilder_.dispose(); + upgradeTimeBuilder_ = null; + } + expireBehavior_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.admin.instance.v1.SpannerInstanceAdminProto + .internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_descriptor; + } + + @java.lang.Override + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata getDefaultInstanceForType() { + return com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata build() { + com.google.spanner.admin.instance.v1.FreeInstanceMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata buildPartial() { + com.google.spanner.admin.instance.v1.FreeInstanceMetadata result = + new com.google.spanner.admin.instance.v1.FreeInstanceMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.admin.instance.v1.FreeInstanceMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.upgradeTime_ = + upgradeTimeBuilder_ == null ? upgradeTime_ : upgradeTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.expireBehavior_ = expireBehavior_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.admin.instance.v1.FreeInstanceMetadata) { + return mergeFrom((com.google.spanner.admin.instance.v1.FreeInstanceMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.admin.instance.v1.FreeInstanceMetadata other) { + if (other == com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDefaultInstance()) + return this; + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + if (other.hasUpgradeTime()) { + mergeUpgradeTime(other.getUpgradeTime()); + } + if (other.expireBehavior_ != 0) { + setExpireBehaviorValue(other.getExpireBehaviorValue()); + } + 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(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpgradeTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + expireBehavior_ = 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 com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + if (expireTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000001); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
          +     * Output only. Timestamp after which the instance will either be upgraded or
          +     * scheduled for deletion after a grace period. ExpireBehavior is used to
          +     * choose between upgrading or scheduling the free instance for deletion. This
          +     * timestamp is set during the creation of a free instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + private com.google.protobuf.Timestamp upgradeTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + upgradeTimeBuilder_; + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the upgradeTime field is set. + */ + public boolean hasUpgradeTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The upgradeTime. + */ + public com.google.protobuf.Timestamp getUpgradeTime() { + if (upgradeTimeBuilder_ == null) { + return upgradeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : upgradeTime_; + } else { + return upgradeTimeBuilder_.getMessage(); + } + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpgradeTime(com.google.protobuf.Timestamp value) { + if (upgradeTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + upgradeTime_ = value; + } else { + upgradeTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpgradeTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (upgradeTimeBuilder_ == null) { + upgradeTime_ = builderForValue.build(); + } else { + upgradeTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpgradeTime(com.google.protobuf.Timestamp value) { + if (upgradeTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && upgradeTime_ != null + && upgradeTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpgradeTimeBuilder().mergeFrom(value); + } else { + upgradeTime_ = value; + } + } else { + upgradeTimeBuilder_.mergeFrom(value); + } + if (upgradeTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpgradeTime() { + bitField0_ = (bitField0_ & ~0x00000002); + upgradeTime_ = null; + if (upgradeTimeBuilder_ != null) { + upgradeTimeBuilder_.dispose(); + upgradeTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpgradeTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpgradeTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpgradeTimeOrBuilder() { + if (upgradeTimeBuilder_ != null) { + return upgradeTimeBuilder_.getMessageOrBuilder(); + } else { + return upgradeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : upgradeTime_; + } + } + /** + * + * + *
          +     * Output only. If present, the timestamp at which the free instance was
          +     * upgraded to a provisioned instance.
          +     * 
          + * + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpgradeTimeFieldBuilder() { + if (upgradeTimeBuilder_ == null) { + upgradeTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpgradeTime(), getParentForChildren(), isClean()); + upgradeTime_ = null; + } + return upgradeTimeBuilder_; + } + + private int expireBehavior_ = 0; + /** + * + * + *
          +     * Specifies the expiration behavior of a free instance. The default of
          +     * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +     * or after creation, and before expiration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @return The enum numeric value on the wire for expireBehavior. + */ + @java.lang.Override + public int getExpireBehaviorValue() { + return expireBehavior_; + } + /** + * + * + *
          +     * Specifies the expiration behavior of a free instance. The default of
          +     * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +     * or after creation, and before expiration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @param value The enum numeric value on the wire for expireBehavior to set. + * @return This builder for chaining. + */ + public Builder setExpireBehaviorValue(int value) { + expireBehavior_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
          +     * Specifies the expiration behavior of a free instance. The default of
          +     * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +     * or after creation, and before expiration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @return The expireBehavior. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior + getExpireBehavior() { + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior result = + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior.forNumber( + expireBehavior_); + return result == null + ? com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior.UNRECOGNIZED + : result; + } + /** + * + * + *
          +     * Specifies the expiration behavior of a free instance. The default of
          +     * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +     * or after creation, and before expiration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @param value The expireBehavior to set. + * @return This builder for chaining. + */ + public Builder setExpireBehavior( + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + expireBehavior_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
          +     * Specifies the expiration behavior of a free instance. The default of
          +     * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +     * or after creation, and before expiration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearExpireBehavior() { + bitField0_ = (bitField0_ & ~0x00000004); + expireBehavior_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.admin.instance.v1.FreeInstanceMetadata) + } + + // @@protoc_insertion_point(class_scope:google.spanner.admin.instance.v1.FreeInstanceMetadata) + private static final com.google.spanner.admin.instance.v1.FreeInstanceMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.admin.instance.v1.FreeInstanceMetadata(); + } + + public static com.google.spanner.admin.instance.v1.FreeInstanceMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FreeInstanceMetadata 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.spanner.admin.instance.v1.FreeInstanceMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadataOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadataOrBuilder.java new file mode 100644 index 00000000000..4b326237d9c --- /dev/null +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/FreeInstanceMetadataOrBuilder.java @@ -0,0 +1,147 @@ +/* + * Copyright 2024 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! +// source: google/spanner/admin/instance/v1/spanner_instance_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.spanner.admin.instance.v1; + +public interface FreeInstanceMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.admin.instance.v1.FreeInstanceMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
          +   * Output only. Timestamp after which the instance will either be upgraded or
          +   * scheduled for deletion after a grace period. ExpireBehavior is used to
          +   * choose between upgrading or scheduling the free instance for deletion. This
          +   * timestamp is set during the creation of a free instance.
          +   * 
          + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
          +   * Output only. Timestamp after which the instance will either be upgraded or
          +   * scheduled for deletion after a grace period. ExpireBehavior is used to
          +   * choose between upgrading or scheduling the free instance for deletion. This
          +   * timestamp is set during the creation of a free instance.
          +   * 
          + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
          +   * Output only. Timestamp after which the instance will either be upgraded or
          +   * scheduled for deletion after a grace period. ExpireBehavior is used to
          +   * choose between upgrading or scheduling the free instance for deletion. This
          +   * timestamp is set during the creation of a free instance.
          +   * 
          + * + * .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
          +   * Output only. If present, the timestamp at which the free instance was
          +   * upgraded to a provisioned instance.
          +   * 
          + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the upgradeTime field is set. + */ + boolean hasUpgradeTime(); + /** + * + * + *
          +   * Output only. If present, the timestamp at which the free instance was
          +   * upgraded to a provisioned instance.
          +   * 
          + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The upgradeTime. + */ + com.google.protobuf.Timestamp getUpgradeTime(); + /** + * + * + *
          +   * Output only. If present, the timestamp at which the free instance was
          +   * upgraded to a provisioned instance.
          +   * 
          + * + * .google.protobuf.Timestamp upgrade_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpgradeTimeOrBuilder(); + + /** + * + * + *
          +   * Specifies the expiration behavior of a free instance. The default of
          +   * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +   * or after creation, and before expiration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @return The enum numeric value on the wire for expireBehavior. + */ + int getExpireBehaviorValue(); + /** + * + * + *
          +   * Specifies the expiration behavior of a free instance. The default of
          +   * ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during
          +   * or after creation, and before expiration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior expire_behavior = 3; + * + * + * @return The expireBehavior. + */ + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior getExpireBehavior(); +} diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/Instance.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/Instance.java index 5ed73ef4173..fe231c4ef6f 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/Instance.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/Instance.java @@ -44,6 +44,7 @@ private Instance() { displayName_ = ""; replicaComputeCapacity_ = java.util.Collections.emptyList(); state_ = 0; + instanceType_ = 0; endpointUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); edition_ = 0; defaultBackupScheduleType_ = 0; @@ -245,6 +246,172 @@ private State(int value) { // @@protoc_insertion_point(enum_scope:google.spanner.admin.instance.v1.Instance.State) } + /** + * + * + *
          +   * The type of this instance. The type can be used to distinguish product
          +   * variants, that can affect aspects like: usage restrictions, quotas and
          +   * billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED
          +   * instances.
          +   * 
          + * + * Protobuf enum {@code google.spanner.admin.instance.v1.Instance.InstanceType} + */ + public enum InstanceType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
          +     * Not specified.
          +     * 
          + * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + INSTANCE_TYPE_UNSPECIFIED(0), + /** + * + * + *
          +     * Provisioned instances have dedicated resources, standard usage limits and
          +     * support.
          +     * 
          + * + * PROVISIONED = 1; + */ + PROVISIONED(1), + /** + * + * + *
          +     * Free instances provide no guarantee for dedicated resources,
          +     * [node_count, processing_units] should be 0. They come
          +     * with stricter usage limits and limited support.
          +     * 
          + * + * FREE_INSTANCE = 2; + */ + FREE_INSTANCE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
          +     * Not specified.
          +     * 
          + * + * INSTANCE_TYPE_UNSPECIFIED = 0; + */ + public static final int INSTANCE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
          +     * Provisioned instances have dedicated resources, standard usage limits and
          +     * support.
          +     * 
          + * + * PROVISIONED = 1; + */ + public static final int PROVISIONED_VALUE = 1; + /** + * + * + *
          +     * Free instances provide no guarantee for dedicated resources,
          +     * [node_count, processing_units] should be 0. They come
          +     * with stricter usage limits and limited support.
          +     * 
          + * + * FREE_INSTANCE = 2; + */ + public static final int FREE_INSTANCE_VALUE = 2; + + 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 InstanceType 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 InstanceType forNumber(int value) { + switch (value) { + case 0: + return INSTANCE_TYPE_UNSPECIFIED; + case 1: + return PROVISIONED; + case 2: + return FREE_INSTANCE; + 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 InstanceType findValueByNumber(int number) { + return InstanceType.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 final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.Instance.getDescriptor().getEnumTypes().get(1); + } + + private static final InstanceType[] VALUES = values(); + + public static InstanceType 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 InstanceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.admin.instance.v1.Instance.InstanceType) + } + /** * * @@ -401,7 +568,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.spanner.admin.instance.v1.Instance.getDescriptor().getEnumTypes().get(1); + return com.google.spanner.admin.instance.v1.Instance.getDescriptor().getEnumTypes().get(2); } private static final Edition[] VALUES = values(); @@ -429,8 +596,10 @@ private Edition(int value) { * * *
          -   * Indicates the default backup behavior for new databases within the
          -   * instance.
          +   * Indicates the
          +   * [default backup
          +   * schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules)
          +   * behavior for new databases within the instance.
              * 
          * * Protobuf enum {@code google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType} @@ -450,8 +619,8 @@ public enum DefaultBackupScheduleType implements com.google.protobuf.ProtocolMes * * *
          -     * No default backup schedule will be created automatically on creation of a
          -     * database within the instance.
          +     * A default backup schedule isn't created automatically when a new database
          +     * is created in the instance.
                * 
          * * NONE = 1; @@ -461,11 +630,10 @@ public enum DefaultBackupScheduleType implements com.google.protobuf.ProtocolMes * * *
          -     * A default backup schedule will be created automatically on creation of a
          -     * database within the instance. The default backup schedule creates a full
          -     * backup every 24 hours and retains the backup for a period of 7 days. Once
          -     * created, the default backup schedule can be edited/deleted similar to any
          -     * other backup schedule.
          +     * A default backup schedule is created automatically when a new database
          +     * is created in the instance. The default backup schedule creates a full
          +     * backup every 24 hours. These full backups are retained for 7 days.
          +     * You can edit or delete the default backup schedule once it's created.
                * 
          * * AUTOMATIC = 2; @@ -488,8 +656,8 @@ public enum DefaultBackupScheduleType implements com.google.protobuf.ProtocolMes * * *
          -     * No default backup schedule will be created automatically on creation of a
          -     * database within the instance.
          +     * A default backup schedule isn't created automatically when a new database
          +     * is created in the instance.
                * 
          * * NONE = 1; @@ -499,11 +667,10 @@ public enum DefaultBackupScheduleType implements com.google.protobuf.ProtocolMes * * *
          -     * A default backup schedule will be created automatically on creation of a
          -     * database within the instance. The default backup schedule creates a full
          -     * backup every 24 hours and retains the backup for a period of 7 days. Once
          -     * created, the default backup schedule can be edited/deleted similar to any
          -     * other backup schedule.
          +     * A default backup schedule is created automatically when a new database
          +     * is created in the instance. The default backup schedule creates a full
          +     * backup every 24 hours. These full backups are retained for 7 days.
          +     * You can edit or delete the default backup schedule once it's created.
                * 
          * * AUTOMATIC = 2; @@ -571,7 +738,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.spanner.admin.instance.v1.Instance.getDescriptor().getEnumTypes().get(2); + return com.google.spanner.admin.instance.v1.Instance.getDescriptor().getEnumTypes().get(3); } private static final DefaultBackupScheduleType[] VALUES = values(); @@ -786,9 +953,6 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying node count across replicas (achieved by - * setting asymmetric_autoscaling_options in autoscaling config), the - * node_count here is the maximum node count across all replicas. * * For more information, see * [Compute capacity, nodes, and processing @@ -823,10 +987,6 @@ public int getNodeCount() { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying processing units per replica - * (achieved by setting asymmetric_autoscaling_options in autoscaling config), - * the processing_units here is the maximum processing units across all - * replicas. * * For more information, see * [Compute capacity, nodes and processing @@ -1235,6 +1395,43 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { return map.get(key); } + public static final int INSTANCE_TYPE_FIELD_NUMBER = 10; + private int instanceType_ = 0; + /** + * + * + *
          +   * The `InstanceType` of the current instance.
          +   * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
          +   * The `InstanceType` of the current instance.
          +   * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.Instance.InstanceType getInstanceType() { + com.google.spanner.admin.instance.v1.Instance.InstanceType result = + com.google.spanner.admin.instance.v1.Instance.InstanceType.forNumber(instanceType_); + return result == null + ? com.google.spanner.admin.instance.v1.Instance.InstanceType.UNRECOGNIZED + : result; + } + public static final int ENDPOINT_URIS_FIELD_NUMBER = 8; @SuppressWarnings("serial") @@ -1397,6 +1594,60 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } + public static final int FREE_INSTANCE_METADATA_FIELD_NUMBER = 13; + private com.google.spanner.admin.instance.v1.FreeInstanceMetadata freeInstanceMetadata_; + /** + * + * + *
          +   * Free instance metadata. Only populated for free instances.
          +   * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + * + * @return Whether the freeInstanceMetadata field is set. + */ + @java.lang.Override + public boolean hasFreeInstanceMetadata() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
          +   * Free instance metadata. Only populated for free instances.
          +   * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + * + * @return The freeInstanceMetadata. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata getFreeInstanceMetadata() { + return freeInstanceMetadata_ == null + ? com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDefaultInstance() + : freeInstanceMetadata_; + } + /** + * + * + *
          +   * Free instance metadata. Only populated for free instances.
          +   * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.FreeInstanceMetadataOrBuilder + getFreeInstanceMetadataOrBuilder() { + return freeInstanceMetadata_ == null + ? com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDefaultInstance() + : freeInstanceMetadata_; + } + public static final int EDITION_FIELD_NUMBER = 20; private int edition_ = 0; /** @@ -1444,15 +1695,16 @@ public com.google.spanner.admin.instance.v1.Instance.Edition getEdition() { * * *
          -   * Optional. Controls the default backup behavior for new databases within the
          -   * instance.
          +   * Optional. Controls the default backup schedule behavior for new databases
          +   * within the instance. By default, a backup schedule is created automatically
          +   * when a new database is created in a new instance.
              *
          -   * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -   * backup schedules are not allowed for free instances.
          +   * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +   * as backups and backup schedules aren't supported for free instances.
              *
              * In the `GetInstance` or `ListInstances` response, if the value of
          -   * default_backup_schedule_type is unset or NONE, no default backup
          -   * schedule will be created for new databases within the instance.
          +   * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +   * create a default backup schedule for new databases in the instance.
              * 
          * * @@ -1469,15 +1721,16 @@ public int getDefaultBackupScheduleTypeValue() { * * *
          -   * Optional. Controls the default backup behavior for new databases within the
          -   * instance.
          +   * Optional. Controls the default backup schedule behavior for new databases
          +   * within the instance. By default, a backup schedule is created automatically
          +   * when a new database is created in a new instance.
              *
          -   * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -   * backup schedules are not allowed for free instances.
          +   * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +   * as backups and backup schedules aren't supported for free instances.
              *
              * In the `GetInstance` or `ListInstances` response, if the value of
          -   * default_backup_schedule_type is unset or NONE, no default backup
          -   * schedule will be created for new databases within the instance.
          +   * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +   * create a default backup schedule for new databases in the instance.
              * 
          * * @@ -1535,12 +1788,20 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (processingUnits_ != 0) { output.writeInt32(9, processingUnits_); } + if (instanceType_ + != com.google.spanner.admin.instance.v1.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, instanceType_); + } if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(11, getCreateTime()); } if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(12, getUpdateTime()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(13, getFreeInstanceMetadata()); + } if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(17, getAutoscalingConfig()); } @@ -1603,12 +1864,21 @@ public int getSerializedSize() { if (processingUnits_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, processingUnits_); } + if (instanceType_ + != com.google.spanner.admin.instance.v1.Instance.InstanceType.INSTANCE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, instanceType_); + } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCreateTime()); } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUpdateTime()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(13, getFreeInstanceMetadata()); + } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getAutoscalingConfig()); } @@ -1656,6 +1926,7 @@ public boolean equals(final java.lang.Object obj) { } if (state_ != other.state_) return false; if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (instanceType_ != other.instanceType_) return false; if (!getEndpointUrisList().equals(other.getEndpointUrisList())) return false; if (hasCreateTime() != other.hasCreateTime()) return false; if (hasCreateTime()) { @@ -1665,6 +1936,10 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateTime()) { if (!getUpdateTime().equals(other.getUpdateTime())) return false; } + if (hasFreeInstanceMetadata() != other.hasFreeInstanceMetadata()) return false; + if (hasFreeInstanceMetadata()) { + if (!getFreeInstanceMetadata().equals(other.getFreeInstanceMetadata())) return false; + } if (edition_ != other.edition_) return false; if (defaultBackupScheduleType_ != other.defaultBackupScheduleType_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; @@ -1702,6 +1977,8 @@ public int hashCode() { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } + hash = (37 * hash) + INSTANCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + instanceType_; if (getEndpointUrisCount() > 0) { hash = (37 * hash) + ENDPOINT_URIS_FIELD_NUMBER; hash = (53 * hash) + getEndpointUrisList().hashCode(); @@ -1714,6 +1991,10 @@ public int hashCode() { hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getUpdateTime().hashCode(); } + if (hasFreeInstanceMetadata()) { + hash = (37 * hash) + FREE_INSTANCE_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getFreeInstanceMetadata().hashCode(); + } hash = (37 * hash) + EDITION_FIELD_NUMBER; hash = (53 * hash) + edition_; hash = (37 * hash) + DEFAULT_BACKUP_SCHEDULE_TYPE_FIELD_NUMBER; @@ -1884,6 +2165,7 @@ private void maybeForceBuilderInitialization() { getAutoscalingConfigFieldBuilder(); getCreateTimeFieldBuilder(); getUpdateTimeFieldBuilder(); + getFreeInstanceMetadataFieldBuilder(); } } @@ -1910,6 +2192,7 @@ public Builder clear() { } state_ = 0; internalGetMutableLabels().clear(); + instanceType_ = 0; endpointUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); createTime_ = null; if (createTimeBuilder_ != null) { @@ -1921,6 +2204,11 @@ public Builder clear() { updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } + freeInstanceMetadata_ = null; + if (freeInstanceMetadataBuilder_ != null) { + freeInstanceMetadataBuilder_.dispose(); + freeInstanceMetadataBuilder_ = null; + } edition_ = 0; defaultBackupScheduleType_ = 0; return this; @@ -2003,21 +2291,31 @@ private void buildPartial0(com.google.spanner.admin.instance.v1.Instance result) result.labels_.makeImmutable(); } if (((from_bitField0_ & 0x00000200) != 0)) { + result.instanceType_ = instanceType_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { endpointUris_.makeImmutable(); result.endpointUris_ = endpointUris_; } - if (((from_bitField0_ & 0x00000400) != 0)) { + if (((from_bitField0_ & 0x00000800) != 0)) { result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); to_bitField0_ |= 0x00000002; } - if (((from_bitField0_ & 0x00000800) != 0)) { + if (((from_bitField0_ & 0x00001000) != 0)) { result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); to_bitField0_ |= 0x00000004; } - if (((from_bitField0_ & 0x00001000) != 0)) { + if (((from_bitField0_ & 0x00002000) != 0)) { + result.freeInstanceMetadata_ = + freeInstanceMetadataBuilder_ == null + ? freeInstanceMetadata_ + : freeInstanceMetadataBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00004000) != 0)) { result.edition_ = edition_; } - if (((from_bitField0_ & 0x00002000) != 0)) { + if (((from_bitField0_ & 0x00008000) != 0)) { result.defaultBackupScheduleType_ = defaultBackupScheduleType_; } result.bitField0_ |= to_bitField0_; @@ -2124,10 +2422,13 @@ public Builder mergeFrom(com.google.spanner.admin.instance.v1.Instance other) { } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); bitField0_ |= 0x00000100; + if (other.instanceType_ != 0) { + setInstanceTypeValue(other.getInstanceTypeValue()); + } if (!other.endpointUris_.isEmpty()) { if (endpointUris_.isEmpty()) { endpointUris_ = other.endpointUris_; - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; } else { ensureEndpointUrisIsMutable(); endpointUris_.addAll(other.endpointUris_); @@ -2140,6 +2441,9 @@ public Builder mergeFrom(com.google.spanner.admin.instance.v1.Instance other) { if (other.hasUpdateTime()) { mergeUpdateTime(other.getUpdateTime()); } + if (other.hasFreeInstanceMetadata()) { + mergeFreeInstanceMetadata(other.getFreeInstanceMetadata()); + } if (other.edition_ != 0) { setEditionValue(other.getEditionValue()); } @@ -2227,18 +2531,31 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 72 + case 80: + { + instanceType_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 case 90: { input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; break; } // case 90 case 98: { input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; break; } // case 98 + case 106: + { + input.readMessage( + getFreeInstanceMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 106 case 138: { input.readMessage( @@ -2263,13 +2580,13 @@ public Builder mergeFrom( case 160: { edition_ = input.readEnum(); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00004000; break; } // case 160 case 184: { defaultBackupScheduleType_ = input.readEnum(); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00008000; break; } // case 184 default: @@ -2671,9 +2988,6 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying node count across replicas (achieved by - * setting asymmetric_autoscaling_options in autoscaling config), the - * node_count here is the maximum node count across all replicas. * * For more information, see * [Compute capacity, nodes, and processing @@ -2704,9 +3018,6 @@ public int getNodeCount() { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying node count across replicas (achieved by - * setting asymmetric_autoscaling_options in autoscaling config), the - * node_count here is the maximum node count across all replicas. * * For more information, see * [Compute capacity, nodes, and processing @@ -2741,9 +3052,6 @@ public Builder setNodeCount(int value) { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying node count across replicas (achieved by - * setting asymmetric_autoscaling_options in autoscaling config), the - * node_count here is the maximum node count across all replicas. * * For more information, see * [Compute capacity, nodes, and processing @@ -2779,10 +3087,6 @@ public Builder clearNodeCount() { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying processing units per replica - * (achieved by setting asymmetric_autoscaling_options in autoscaling config), - * the processing_units here is the maximum processing units across all - * replicas. * * For more information, see * [Compute capacity, nodes and processing @@ -2814,10 +3118,6 @@ public int getProcessingUnits() { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying processing units per replica - * (achieved by setting asymmetric_autoscaling_options in autoscaling config), - * the processing_units here is the maximum processing units across all - * replicas. * * For more information, see * [Compute capacity, nodes and processing @@ -2853,10 +3153,6 @@ public Builder setProcessingUnits(int value) { * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying processing units per replica - * (achieved by setting asymmetric_autoscaling_options in autoscaling config), - * the processing_units here is the maximum processing units across all - * replicas. * * For more information, see * [Compute capacity, nodes and processing @@ -3978,6 +4274,99 @@ public Builder putAllLabels(java.util.Map va return this; } + private int instanceType_ = 0; + /** + * + * + *
          +     * The `InstanceType` of the current instance.
          +     * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @return The enum numeric value on the wire for instanceType. + */ + @java.lang.Override + public int getInstanceTypeValue() { + return instanceType_; + } + /** + * + * + *
          +     * The `InstanceType` of the current instance.
          +     * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @param value The enum numeric value on the wire for instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceTypeValue(int value) { + instanceType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
          +     * The `InstanceType` of the current instance.
          +     * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @return The instanceType. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.Instance.InstanceType getInstanceType() { + com.google.spanner.admin.instance.v1.Instance.InstanceType result = + com.google.spanner.admin.instance.v1.Instance.InstanceType.forNumber(instanceType_); + return result == null + ? com.google.spanner.admin.instance.v1.Instance.InstanceType.UNRECOGNIZED + : result; + } + /** + * + * + *
          +     * The `InstanceType` of the current instance.
          +     * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @param value The instanceType to set. + * @return This builder for chaining. + */ + public Builder setInstanceType( + com.google.spanner.admin.instance.v1.Instance.InstanceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + instanceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
          +     * The `InstanceType` of the current instance.
          +     * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @return This builder for chaining. + */ + public Builder clearInstanceType() { + bitField0_ = (bitField0_ & ~0x00000200); + instanceType_ = 0; + onChanged(); + return this; + } + private com.google.protobuf.LazyStringArrayList endpointUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); @@ -3985,7 +4374,7 @@ private void ensureEndpointUrisIsMutable() { if (!endpointUris_.isModifiable()) { endpointUris_ = new com.google.protobuf.LazyStringArrayList(endpointUris_); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; } /** * @@ -4065,7 +4454,7 @@ public Builder setEndpointUris(int index, java.lang.String value) { } ensureEndpointUrisIsMutable(); endpointUris_.set(index, value); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -4087,7 +4476,7 @@ public Builder addEndpointUris(java.lang.String value) { } ensureEndpointUrisIsMutable(); endpointUris_.add(value); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -4106,7 +4495,7 @@ public Builder addEndpointUris(java.lang.String value) { public Builder addAllEndpointUris(java.lang.Iterable values) { ensureEndpointUrisIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpointUris_); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -4123,7 +4512,7 @@ public Builder addAllEndpointUris(java.lang.Iterable values) { */ public Builder clearEndpointUris() { endpointUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); ; onChanged(); return this; @@ -4147,7 +4536,7 @@ public Builder addEndpointUrisBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureEndpointUrisIsMutable(); endpointUris_.add(value); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -4172,7 +4561,7 @@ public Builder addEndpointUrisBytes(com.google.protobuf.ByteString value) { * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return ((bitField0_ & 0x00000400) != 0); + return ((bitField0_ & 0x00000800) != 0); } /** * @@ -4216,7 +4605,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { } else { createTimeBuilder_.setMessage(value); } - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -4237,7 +4626,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal } else { createTimeBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -4254,7 +4643,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (((bitField0_ & 0x00000400) != 0) + if (((bitField0_ & 0x00000800) != 0) && createTime_ != null && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getCreateTimeBuilder().mergeFrom(value); @@ -4265,7 +4654,7 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { createTimeBuilder_.mergeFrom(value); } if (createTime_ != null) { - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); } return this; @@ -4282,7 +4671,7 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { *
          */ public Builder clearCreateTime() { - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000800); createTime_ = null; if (createTimeBuilder_ != null) { createTimeBuilder_.dispose(); @@ -4303,7 +4692,7 @@ public Builder clearCreateTime() { *
          */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); return getCreateTimeFieldBuilder().getBuilder(); } @@ -4375,7 +4764,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * @return Whether the updateTime field is set. */ public boolean hasUpdateTime() { - return ((bitField0_ & 0x00000800) != 0); + return ((bitField0_ & 0x00001000) != 0); } /** * @@ -4419,7 +4808,7 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { } else { updateTimeBuilder_.setMessage(value); } - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; onChanged(); return this; } @@ -4440,7 +4829,7 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal } else { updateTimeBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; onChanged(); return this; } @@ -4457,7 +4846,7 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { - if (((bitField0_ & 0x00000800) != 0) + if (((bitField0_ & 0x00001000) != 0) && updateTime_ != null && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getUpdateTimeBuilder().mergeFrom(value); @@ -4468,7 +4857,7 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { updateTimeBuilder_.mergeFrom(value); } if (updateTime_ != null) { - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; onChanged(); } return this; @@ -4485,7 +4874,7 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearUpdateTime() { - bitField0_ = (bitField0_ & ~0x00000800); + bitField0_ = (bitField0_ & ~0x00001000); updateTime_ = null; if (updateTimeBuilder_ != null) { updateTimeBuilder_.dispose(); @@ -4506,7 +4895,7 @@ public Builder clearUpdateTime() { * */ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; onChanged(); return getUpdateTimeFieldBuilder().getBuilder(); } @@ -4558,6 +4947,206 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTimeBuilder_; } + private com.google.spanner.admin.instance.v1.FreeInstanceMetadata freeInstanceMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.instance.v1.FreeInstanceMetadata, + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.Builder, + com.google.spanner.admin.instance.v1.FreeInstanceMetadataOrBuilder> + freeInstanceMetadataBuilder_; + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + * + * @return Whether the freeInstanceMetadata field is set. + */ + public boolean hasFreeInstanceMetadata() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + * + * @return The freeInstanceMetadata. + */ + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata getFreeInstanceMetadata() { + if (freeInstanceMetadataBuilder_ == null) { + return freeInstanceMetadata_ == null + ? com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDefaultInstance() + : freeInstanceMetadata_; + } else { + return freeInstanceMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + public Builder setFreeInstanceMetadata( + com.google.spanner.admin.instance.v1.FreeInstanceMetadata value) { + if (freeInstanceMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + freeInstanceMetadata_ = value; + } else { + freeInstanceMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + public Builder setFreeInstanceMetadata( + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.Builder builderForValue) { + if (freeInstanceMetadataBuilder_ == null) { + freeInstanceMetadata_ = builderForValue.build(); + } else { + freeInstanceMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + public Builder mergeFreeInstanceMetadata( + com.google.spanner.admin.instance.v1.FreeInstanceMetadata value) { + if (freeInstanceMetadataBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && freeInstanceMetadata_ != null + && freeInstanceMetadata_ + != com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDefaultInstance()) { + getFreeInstanceMetadataBuilder().mergeFrom(value); + } else { + freeInstanceMetadata_ = value; + } + } else { + freeInstanceMetadataBuilder_.mergeFrom(value); + } + if (freeInstanceMetadata_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + public Builder clearFreeInstanceMetadata() { + bitField0_ = (bitField0_ & ~0x00002000); + freeInstanceMetadata_ = null; + if (freeInstanceMetadataBuilder_ != null) { + freeInstanceMetadataBuilder_.dispose(); + freeInstanceMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + public com.google.spanner.admin.instance.v1.FreeInstanceMetadata.Builder + getFreeInstanceMetadataBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getFreeInstanceMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + public com.google.spanner.admin.instance.v1.FreeInstanceMetadataOrBuilder + getFreeInstanceMetadataOrBuilder() { + if (freeInstanceMetadataBuilder_ != null) { + return freeInstanceMetadataBuilder_.getMessageOrBuilder(); + } else { + return freeInstanceMetadata_ == null + ? com.google.spanner.admin.instance.v1.FreeInstanceMetadata.getDefaultInstance() + : freeInstanceMetadata_; + } + } + /** + * + * + *
          +     * Free instance metadata. Only populated for free instances.
          +     * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.instance.v1.FreeInstanceMetadata, + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.Builder, + com.google.spanner.admin.instance.v1.FreeInstanceMetadataOrBuilder> + getFreeInstanceMetadataFieldBuilder() { + if (freeInstanceMetadataBuilder_ == null) { + freeInstanceMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.admin.instance.v1.FreeInstanceMetadata, + com.google.spanner.admin.instance.v1.FreeInstanceMetadata.Builder, + com.google.spanner.admin.instance.v1.FreeInstanceMetadataOrBuilder>( + getFreeInstanceMetadata(), getParentForChildren(), isClean()); + freeInstanceMetadata_ = null; + } + return freeInstanceMetadataBuilder_; + } + private int edition_ = 0; /** * @@ -4592,7 +5181,7 @@ public int getEditionValue() { */ public Builder setEditionValue(int value) { edition_ = value; - bitField0_ |= 0x00001000; + bitField0_ |= 0x00004000; onChanged(); return this; } @@ -4635,7 +5224,7 @@ public Builder setEdition(com.google.spanner.admin.instance.v1.Instance.Edition if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00001000; + bitField0_ |= 0x00004000; edition_ = value.getNumber(); onChanged(); return this; @@ -4654,7 +5243,7 @@ public Builder setEdition(com.google.spanner.admin.instance.v1.Instance.Edition * @return This builder for chaining. */ public Builder clearEdition() { - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00004000); edition_ = 0; onChanged(); return this; @@ -4665,15 +5254,16 @@ public Builder clearEdition() { * * *
          -     * Optional. Controls the default backup behavior for new databases within the
          -     * instance.
          +     * Optional. Controls the default backup schedule behavior for new databases
          +     * within the instance. By default, a backup schedule is created automatically
          +     * when a new database is created in a new instance.
                *
          -     * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -     * backup schedules are not allowed for free instances.
          +     * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +     * as backups and backup schedules aren't supported for free instances.
                *
                * In the `GetInstance` or `ListInstances` response, if the value of
          -     * default_backup_schedule_type is unset or NONE, no default backup
          -     * schedule will be created for new databases within the instance.
          +     * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +     * create a default backup schedule for new databases in the instance.
                * 
          * * @@ -4690,15 +5280,16 @@ public int getDefaultBackupScheduleTypeValue() { * * *
          -     * Optional. Controls the default backup behavior for new databases within the
          -     * instance.
          +     * Optional. Controls the default backup schedule behavior for new databases
          +     * within the instance. By default, a backup schedule is created automatically
          +     * when a new database is created in a new instance.
                *
          -     * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -     * backup schedules are not allowed for free instances.
          +     * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +     * as backups and backup schedules aren't supported for free instances.
                *
                * In the `GetInstance` or `ListInstances` response, if the value of
          -     * default_backup_schedule_type is unset or NONE, no default backup
          -     * schedule will be created for new databases within the instance.
          +     * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +     * create a default backup schedule for new databases in the instance.
                * 
          * * @@ -4710,7 +5301,7 @@ public int getDefaultBackupScheduleTypeValue() { */ public Builder setDefaultBackupScheduleTypeValue(int value) { defaultBackupScheduleType_ = value; - bitField0_ |= 0x00002000; + bitField0_ |= 0x00008000; onChanged(); return this; } @@ -4718,15 +5309,16 @@ public Builder setDefaultBackupScheduleTypeValue(int value) { * * *
          -     * Optional. Controls the default backup behavior for new databases within the
          -     * instance.
          +     * Optional. Controls the default backup schedule behavior for new databases
          +     * within the instance. By default, a backup schedule is created automatically
          +     * when a new database is created in a new instance.
                *
          -     * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -     * backup schedules are not allowed for free instances.
          +     * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +     * as backups and backup schedules aren't supported for free instances.
                *
                * In the `GetInstance` or `ListInstances` response, if the value of
          -     * default_backup_schedule_type is unset or NONE, no default backup
          -     * schedule will be created for new databases within the instance.
          +     * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +     * create a default backup schedule for new databases in the instance.
                * 
          * * @@ -4749,15 +5341,16 @@ public Builder setDefaultBackupScheduleTypeValue(int value) { * * *
          -     * Optional. Controls the default backup behavior for new databases within the
          -     * instance.
          +     * Optional. Controls the default backup schedule behavior for new databases
          +     * within the instance. By default, a backup schedule is created automatically
          +     * when a new database is created in a new instance.
                *
          -     * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -     * backup schedules are not allowed for free instances.
          +     * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +     * as backups and backup schedules aren't supported for free instances.
                *
                * In the `GetInstance` or `ListInstances` response, if the value of
          -     * default_backup_schedule_type is unset or NONE, no default backup
          -     * schedule will be created for new databases within the instance.
          +     * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +     * create a default backup schedule for new databases in the instance.
                * 
          * * @@ -4772,7 +5365,7 @@ public Builder setDefaultBackupScheduleType( if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00002000; + bitField0_ |= 0x00008000; defaultBackupScheduleType_ = value.getNumber(); onChanged(); return this; @@ -4781,15 +5374,16 @@ public Builder setDefaultBackupScheduleType( * * *
          -     * Optional. Controls the default backup behavior for new databases within the
          -     * instance.
          +     * Optional. Controls the default backup schedule behavior for new databases
          +     * within the instance. By default, a backup schedule is created automatically
          +     * when a new database is created in a new instance.
                *
          -     * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -     * backup schedules are not allowed for free instances.
          +     * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +     * as backups and backup schedules aren't supported for free instances.
                *
                * In the `GetInstance` or `ListInstances` response, if the value of
          -     * default_backup_schedule_type is unset or NONE, no default backup
          -     * schedule will be created for new databases within the instance.
          +     * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +     * create a default backup schedule for new databases in the instance.
                * 
          * * @@ -4799,7 +5393,7 @@ public Builder setDefaultBackupScheduleType( * @return This builder for chaining. */ public Builder clearDefaultBackupScheduleType() { - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00008000); defaultBackupScheduleType_ = 0; onChanged(); return this; diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java index fe9c5c59c31..8840002694a 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfig.java @@ -49,6 +49,8 @@ private InstanceConfig() { etag_ = ""; leaderOptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); state_ = 0; + freeInstanceAvailability_ = 0; + quorumType_ = 0; } @java.lang.Override @@ -108,7 +110,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
          -     * Google managed configuration.
          +     * Google-managed configuration.
                * 
          * * GOOGLE_MANAGED = 1; @@ -118,7 +120,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
          -     * User managed configuration.
          +     * User-managed configuration.
                * 
          * * USER_MANAGED = 2; @@ -141,7 +143,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
          -     * Google managed configuration.
          +     * Google-managed configuration.
                * 
          * * GOOGLE_MANAGED = 1; @@ -151,7 +153,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
          -     * User managed configuration.
          +     * User-managed configuration.
                * 
          * * USER_MANAGED = 2; @@ -404,6 +406,420 @@ private State(int value) { // @@protoc_insertion_point(enum_scope:google.spanner.admin.instance.v1.InstanceConfig.State) } + /** + * + * + *
          +   * Describes the availability for free instances to be created in an instance
          +   * configuration.
          +   * 
          + * + * Protobuf enum {@code google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability} + */ + public enum FreeInstanceAvailability implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
          +     * Not specified.
          +     * 
          + * + * FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0; + */ + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED(0), + /** + * + * + *
          +     * Indicates that free instances are available to be created in this
          +     * instance configuration.
          +     * 
          + * + * AVAILABLE = 1; + */ + AVAILABLE(1), + /** + * + * + *
          +     * Indicates that free instances are not supported in this instance
          +     * configuration.
          +     * 
          + * + * UNSUPPORTED = 2; + */ + UNSUPPORTED(2), + /** + * + * + *
          +     * Indicates that free instances are currently not available to be created
          +     * in this instance configuration.
          +     * 
          + * + * DISABLED = 3; + */ + DISABLED(3), + /** + * + * + *
          +     * Indicates that additional free instances cannot be created in this
          +     * instance configuration because the project has reached its limit of free
          +     * instances.
          +     * 
          + * + * QUOTA_EXCEEDED = 4; + */ + QUOTA_EXCEEDED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
          +     * Not specified.
          +     * 
          + * + * FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0; + */ + public static final int FREE_INSTANCE_AVAILABILITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
          +     * Indicates that free instances are available to be created in this
          +     * instance configuration.
          +     * 
          + * + * AVAILABLE = 1; + */ + public static final int AVAILABLE_VALUE = 1; + /** + * + * + *
          +     * Indicates that free instances are not supported in this instance
          +     * configuration.
          +     * 
          + * + * UNSUPPORTED = 2; + */ + public static final int UNSUPPORTED_VALUE = 2; + /** + * + * + *
          +     * Indicates that free instances are currently not available to be created
          +     * in this instance configuration.
          +     * 
          + * + * DISABLED = 3; + */ + public static final int DISABLED_VALUE = 3; + /** + * + * + *
          +     * Indicates that additional free instances cannot be created in this
          +     * instance configuration because the project has reached its limit of free
          +     * instances.
          +     * 
          + * + * QUOTA_EXCEEDED = 4; + */ + public static final int QUOTA_EXCEEDED_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 FreeInstanceAvailability 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 FreeInstanceAvailability forNumber(int value) { + switch (value) { + case 0: + return FREE_INSTANCE_AVAILABILITY_UNSPECIFIED; + case 1: + return AVAILABLE; + case 2: + return UNSUPPORTED; + case 3: + return DISABLED; + case 4: + return QUOTA_EXCEEDED; + 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 FreeInstanceAvailability findValueByNumber(int number) { + return FreeInstanceAvailability.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 final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.InstanceConfig.getDescriptor() + .getEnumTypes() + .get(2); + } + + private static final FreeInstanceAvailability[] VALUES = values(); + + public static FreeInstanceAvailability 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 FreeInstanceAvailability(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability) + } + + /** + * + * + *
          +   * Indicates the quorum type of this instance configuration.
          +   * 
          + * + * Protobuf enum {@code google.spanner.admin.instance.v1.InstanceConfig.QuorumType} + */ + public enum QuorumType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
          +     * Quorum type not specified.
          +     * 
          + * + * QUORUM_TYPE_UNSPECIFIED = 0; + */ + QUORUM_TYPE_UNSPECIFIED(0), + /** + * + * + *
          +     * An instance configuration tagged with `REGION` quorum type forms a write
          +     * quorum in a single region.
          +     * 
          + * + * REGION = 1; + */ + REGION(1), + /** + * + * + *
          +     * An instance configuration tagged with the `DUAL_REGION` quorum type forms
          +     * a write quorum with exactly two read-write regions in a multi-region
          +     * configuration.
          +     *
          +     * This instance configuration requires failover in the event of
          +     * regional failures.
          +     * 
          + * + * DUAL_REGION = 2; + */ + DUAL_REGION(2), + /** + * + * + *
          +     * An instance configuration tagged with the `MULTI_REGION` quorum type
          +     * forms a write quorum from replicas that are spread across more than one
          +     * region in a multi-region configuration.
          +     * 
          + * + * MULTI_REGION = 3; + */ + MULTI_REGION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
          +     * Quorum type not specified.
          +     * 
          + * + * QUORUM_TYPE_UNSPECIFIED = 0; + */ + public static final int QUORUM_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
          +     * An instance configuration tagged with `REGION` quorum type forms a write
          +     * quorum in a single region.
          +     * 
          + * + * REGION = 1; + */ + public static final int REGION_VALUE = 1; + /** + * + * + *
          +     * An instance configuration tagged with the `DUAL_REGION` quorum type forms
          +     * a write quorum with exactly two read-write regions in a multi-region
          +     * configuration.
          +     *
          +     * This instance configuration requires failover in the event of
          +     * regional failures.
          +     * 
          + * + * DUAL_REGION = 2; + */ + public static final int DUAL_REGION_VALUE = 2; + /** + * + * + *
          +     * An instance configuration tagged with the `MULTI_REGION` quorum type
          +     * forms a write quorum from replicas that are spread across more than one
          +     * region in a multi-region configuration.
          +     * 
          + * + * MULTI_REGION = 3; + */ + public static final int MULTI_REGION_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 QuorumType 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 QuorumType forNumber(int value) { + switch (value) { + case 0: + return QUORUM_TYPE_UNSPECIFIED; + case 1: + return REGION; + case 2: + return DUAL_REGION; + case 3: + return MULTI_REGION; + 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 QuorumType findValueByNumber(int number) { + return QuorumType.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 final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.admin.instance.v1.InstanceConfig.getDescriptor() + .getEnumTypes() + .get(3); + } + + private static final QuorumType[] VALUES = values(); + + public static QuorumType 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 QuorumType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.admin.instance.v1.InstanceConfig.QuorumType) + } + public static final int NAME_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -567,6 +983,11 @@ public com.google.spanner.admin.instance.v1.InstanceConfig.Type getConfigType() *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -581,6 +1002,11 @@ public java.util.List getRepli *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -596,6 +1022,11 @@ public java.util.List getRepli *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -610,6 +1041,11 @@ public int getReplicasCount() { *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -624,6 +1060,11 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo getReplicas(int index) { *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -641,8 +1082,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBu * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -658,8 +1099,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBu * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -675,8 +1116,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBu * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -691,8 +1132,8 @@ public int getOptionalReplicasCount() { * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -707,8 +1148,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo getOptionalReplicas(int * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -730,9 +1171,9 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getOptionalRepl * *
              * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -   * based on which this configuration is created. Only set for user managed
          +   * based on which this configuration is created. Only set for user-managed
              * configurations. `base_config` must refer to a configuration of type
          -   * GOOGLE_MANAGED in the same project as this configuration.
          +   * `GOOGLE_MANAGED` in the same project as this configuration.
              * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -756,9 +1197,9 @@ public java.lang.String getBaseConfig() { * *
              * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -   * based on which this configuration is created. Only set for user managed
          +   * based on which this configuration is created. Only set for user-managed
              * configurations. `base_config` must refer to a configuration of type
          -   * GOOGLE_MANAGED in the same project as this configuration.
          +   * `GOOGLE_MANAGED` in the same project as this configuration.
              * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -1110,56 +1551,162 @@ public com.google.protobuf.ByteString getLeaderOptionsBytes(int index) { * configuration. *
          * - * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int STATE_FIELD_NUMBER = 11; + private int state_ = 0; + /** + * + * + *
          +   * Output only. The current instance configuration state. Applicable only for
          +   * `USER_MANAGED` configurations.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
          +   * Output only. The current instance configuration state. Applicable only for
          +   * `USER_MANAGED` configurations.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.State getState() { + com.google.spanner.admin.instance.v1.InstanceConfig.State result = + com.google.spanner.admin.instance.v1.InstanceConfig.State.forNumber(state_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.State.UNRECOGNIZED + : result; + } + + public static final int FREE_INSTANCE_AVAILABILITY_FIELD_NUMBER = 12; + private int freeInstanceAvailability_ = 0; + /** + * + * + *
          +   * Output only. Describes whether free instances are available to be created
          +   * in this instance configuration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for freeInstanceAvailability. + */ + @java.lang.Override + public int getFreeInstanceAvailabilityValue() { + return freeInstanceAvailability_; + } + /** + * + * + *
          +   * Output only. Describes whether free instances are available to be created
          +   * in this instance configuration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The freeInstanceAvailability. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + getFreeInstanceAvailability() { + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability result = + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability.forNumber( + freeInstanceAvailability_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability.UNRECOGNIZED + : result; + } + + public static final int QUORUM_TYPE_FIELD_NUMBER = 18; + private int quorumType_ = 0; + /** + * + * + *
          +   * Output only. The `QuorumType` of the instance configuration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The reconciling. + * @return The enum numeric value on the wire for quorumType. */ @java.lang.Override - public boolean getReconciling() { - return reconciling_; + public int getQuorumTypeValue() { + return quorumType_; } - - public static final int STATE_FIELD_NUMBER = 11; - private int state_ = 0; /** * * *
          -   * Output only. The current instance configuration state. Applicable only for
          -   * `USER_MANAGED` configurations.
          +   * Output only. The `QuorumType` of the instance configuration.
              * 
          * * - * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * - * @return The enum numeric value on the wire for state. + * @return The quorumType. */ @java.lang.Override - public int getStateValue() { - return state_; + public com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType getQuorumType() { + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType result = + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.forNumber(quorumType_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.UNRECOGNIZED + : result; } + + public static final int STORAGE_LIMIT_PER_PROCESSING_UNIT_FIELD_NUMBER = 19; + private long storageLimitPerProcessingUnit_ = 0L; /** * * *
          -   * Output only. The current instance configuration state. Applicable only for
          -   * `USER_MANAGED` configurations.
          +   * Output only. The storage limit in bytes per processing unit.
              * 
          * * - * .google.spanner.admin.instance.v1.InstanceConfig.State state = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int64 storage_limit_per_processing_unit = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * - * @return The state. + * @return The storageLimitPerProcessingUnit. */ @java.lang.Override - public com.google.spanner.admin.instance.v1.InstanceConfig.State getState() { - com.google.spanner.admin.instance.v1.InstanceConfig.State result = - com.google.spanner.admin.instance.v1.InstanceConfig.State.forNumber(state_); - return result == null - ? com.google.spanner.admin.instance.v1.InstanceConfig.State.UNRECOGNIZED - : result; + public long getStorageLimitPerProcessingUnit() { + return storageLimitPerProcessingUnit_; } private byte memoizedIsInitialized = -1; @@ -1211,6 +1758,20 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(11, state_); } + if (freeInstanceAvailability_ + != com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + .FREE_INSTANCE_AVAILABILITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(12, freeInstanceAvailability_); + } + if (quorumType_ + != com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.QUORUM_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(18, quorumType_); + } + if (storageLimitPerProcessingUnit_ != 0L) { + output.writeInt64(19, storageLimitPerProcessingUnit_); + } getUnknownFields().writeTo(output); } @@ -1268,6 +1829,22 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, state_); } + if (freeInstanceAvailability_ + != com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + .FREE_INSTANCE_AVAILABILITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, freeInstanceAvailability_); + } + if (quorumType_ + != com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.QUORUM_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(18, quorumType_); + } + if (storageLimitPerProcessingUnit_ != 0L) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 19, storageLimitPerProcessingUnit_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1295,6 +1872,10 @@ public boolean equals(final java.lang.Object obj) { if (!getLeaderOptionsList().equals(other.getLeaderOptionsList())) return false; if (getReconciling() != other.getReconciling()) return false; if (state_ != other.state_) return false; + if (freeInstanceAvailability_ != other.freeInstanceAvailability_) return false; + if (quorumType_ != other.quorumType_) return false; + if (getStorageLimitPerProcessingUnit() != other.getStorageLimitPerProcessingUnit()) + return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1336,6 +1917,12 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; + hash = (37 * hash) + FREE_INSTANCE_AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + freeInstanceAvailability_; + hash = (37 * hash) + QUORUM_TYPE_FIELD_NUMBER; + hash = (53 * hash) + quorumType_; + hash = (37 * hash) + STORAGE_LIMIT_PER_PROCESSING_UNIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStorageLimitPerProcessingUnit()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1521,6 +2108,9 @@ public Builder clear() { leaderOptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); reconciling_ = false; state_ = 0; + freeInstanceAvailability_ = 0; + quorumType_ = 0; + storageLimitPerProcessingUnit_ = 0L; return this; } @@ -1609,6 +2199,15 @@ private void buildPartial0(com.google.spanner.admin.instance.v1.InstanceConfig r if (((from_bitField0_ & 0x00000400) != 0)) { result.state_ = state_; } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.freeInstanceAvailability_ = freeInstanceAvailability_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.quorumType_ = quorumType_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.storageLimitPerProcessingUnit_ = storageLimitPerProcessingUnit_; + } } @java.lang.Override @@ -1752,6 +2351,15 @@ public Builder mergeFrom(com.google.spanner.admin.instance.v1.InstanceConfig oth if (other.state_ != 0) { setStateValue(other.getStateValue()); } + if (other.freeInstanceAvailability_ != 0) { + setFreeInstanceAvailabilityValue(other.getFreeInstanceAvailabilityValue()); + } + if (other.quorumType_ != 0) { + setQuorumTypeValue(other.getQuorumTypeValue()); + } + if (other.getStorageLimitPerProcessingUnit() != 0L) { + setStorageLimitPerProcessingUnit(other.getStorageLimitPerProcessingUnit()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1867,6 +2475,24 @@ public Builder mergeFrom( bitField0_ |= 0x00000400; break; } // case 88 + case 96: + { + freeInstanceAvailability_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 144: + { + quorumType_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 144 + case 152: + { + storageLimitPerProcessingUnit_ = input.readInt64(); + bitField0_ |= 0x00002000; + break; + } // case 152 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2248,6 +2874,11 @@ private void ensureReplicasIsMutable() { *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2265,6 +2896,11 @@ public java.util.List getRepli *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2282,6 +2918,11 @@ public int getReplicasCount() { *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2299,6 +2940,11 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo getReplicas(int index) { *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2322,6 +2968,11 @@ public Builder setReplicas(int index, com.google.spanner.admin.instance.v1.Repli *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2343,6 +2994,11 @@ public Builder setReplicas( *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2366,6 +3022,11 @@ public Builder addReplicas(com.google.spanner.admin.instance.v1.ReplicaInfo valu *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2389,6 +3050,11 @@ public Builder addReplicas(int index, com.google.spanner.admin.instance.v1.Repli *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2410,6 +3076,11 @@ public Builder addReplicas( *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2431,6 +3102,11 @@ public Builder addReplicas( *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2452,6 +3128,11 @@ public Builder addAllReplicas( *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2472,6 +3153,11 @@ public Builder clearReplicas() { *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2492,6 +3178,11 @@ public Builder removeReplicas(int index) { *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2505,6 +3196,11 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder getReplicasBuild *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2523,6 +3219,11 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBu *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2541,6 +3242,11 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getReplicasOrBu *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2555,6 +3261,11 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addReplicasBuild *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2569,6 +3280,11 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addReplicasBuild *
                * The geographic placement of nodes in this instance configuration and their
                * replication properties.
          +     *
          +     * To create user-managed configurations, input
          +     * `replicas` must include all replicas in `replicas` of the `base_config`
          +     * and include one or more replicas in the `optional_replicas` of the
          +     * `base_config`.
                * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -2617,8 +3333,8 @@ private void ensureOptionalReplicasIsMutable() { * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2637,8 +3353,8 @@ private void ensureOptionalReplicasIsMutable() { * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2656,8 +3372,8 @@ public int getOptionalReplicasCount() { * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2675,8 +3391,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo getOptionalReplicas(int * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2701,8 +3417,8 @@ public Builder setOptionalReplicas( * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2724,8 +3440,8 @@ public Builder setOptionalReplicas( * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2749,8 +3465,8 @@ public Builder addOptionalReplicas(com.google.spanner.admin.instance.v1.ReplicaI * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2775,8 +3491,8 @@ public Builder addOptionalReplicas( * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2798,8 +3514,8 @@ public Builder addOptionalReplicas( * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2821,8 +3537,8 @@ public Builder addOptionalReplicas( * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2844,8 +3560,8 @@ public Builder addAllOptionalReplicas( * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2866,8 +3582,8 @@ public Builder clearOptionalReplicas() { * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2888,8 +3604,8 @@ public Builder removeOptionalReplicas(int index) { * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2904,8 +3620,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder getOptionalRepli * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2924,8 +3640,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getOptionalRepl * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2944,8 +3660,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfoOrBuilder getOptionalRepl * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2960,8 +3676,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addOptionalRepli * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -2977,8 +3693,8 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addOptionalRepli * * *
          -     * Output only. The available optional replicas to choose from for user
          -     * managed configurations. Populated for Google managed configurations.
          +     * Output only. The available optional replicas to choose from for
          +     * user-managed configurations. Populated for Google-managed configurations.
                * 
          * * @@ -3016,9 +3732,9 @@ public com.google.spanner.admin.instance.v1.ReplicaInfo.Builder addOptionalRepli * *
                * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -     * based on which this configuration is created. Only set for user managed
          +     * based on which this configuration is created. Only set for user-managed
                * configurations. `base_config` must refer to a configuration of type
          -     * GOOGLE_MANAGED in the same project as this configuration.
          +     * `GOOGLE_MANAGED` in the same project as this configuration.
                * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -3041,9 +3757,9 @@ public java.lang.String getBaseConfig() { * *
                * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -     * based on which this configuration is created. Only set for user managed
          +     * based on which this configuration is created. Only set for user-managed
                * configurations. `base_config` must refer to a configuration of type
          -     * GOOGLE_MANAGED in the same project as this configuration.
          +     * `GOOGLE_MANAGED` in the same project as this configuration.
                * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -3066,9 +3782,9 @@ public com.google.protobuf.ByteString getBaseConfigBytes() { * *
                * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -     * based on which this configuration is created. Only set for user managed
          +     * based on which this configuration is created. Only set for user-managed
                * configurations. `base_config` must refer to a configuration of type
          -     * GOOGLE_MANAGED in the same project as this configuration.
          +     * `GOOGLE_MANAGED` in the same project as this configuration.
                * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -3090,9 +3806,9 @@ public Builder setBaseConfig(java.lang.String value) { * *
                * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -     * based on which this configuration is created. Only set for user managed
          +     * based on which this configuration is created. Only set for user-managed
                * configurations. `base_config` must refer to a configuration of type
          -     * GOOGLE_MANAGED in the same project as this configuration.
          +     * `GOOGLE_MANAGED` in the same project as this configuration.
                * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -3110,9 +3826,9 @@ public Builder clearBaseConfig() { * *
                * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -     * based on which this configuration is created. Only set for user managed
          +     * based on which this configuration is created. Only set for user-managed
                * configurations. `base_config` must refer to a configuration of type
          -     * GOOGLE_MANAGED in the same project as this configuration.
          +     * `GOOGLE_MANAGED` in the same project as this configuration.
                * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -3939,6 +4655,279 @@ public Builder clearState() { return this; } + private int freeInstanceAvailability_ = 0; + /** + * + * + *
          +     * Output only. Describes whether free instances are available to be created
          +     * in this instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for freeInstanceAvailability. + */ + @java.lang.Override + public int getFreeInstanceAvailabilityValue() { + return freeInstanceAvailability_; + } + /** + * + * + *
          +     * Output only. Describes whether free instances are available to be created
          +     * in this instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for freeInstanceAvailability to set. + * @return This builder for chaining. + */ + public Builder setFreeInstanceAvailabilityValue(int value) { + freeInstanceAvailability_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. Describes whether free instances are available to be created
          +     * in this instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The freeInstanceAvailability. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + getFreeInstanceAvailability() { + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability result = + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability.forNumber( + freeInstanceAvailability_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + .UNRECOGNIZED + : result; + } + /** + * + * + *
          +     * Output only. Describes whether free instances are available to be created
          +     * in this instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The freeInstanceAvailability to set. + * @return This builder for chaining. + */ + public Builder setFreeInstanceAvailability( + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + freeInstanceAvailability_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. Describes whether free instances are available to be created
          +     * in this instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFreeInstanceAvailability() { + bitField0_ = (bitField0_ & ~0x00000800); + freeInstanceAvailability_ = 0; + onChanged(); + return this; + } + + private int quorumType_ = 0; + /** + * + * + *
          +     * Output only. The `QuorumType` of the instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for quorumType. + */ + @java.lang.Override + public int getQuorumTypeValue() { + return quorumType_; + } + /** + * + * + *
          +     * Output only. The `QuorumType` of the instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for quorumType to set. + * @return This builder for chaining. + */ + public Builder setQuorumTypeValue(int value) { + quorumType_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. The `QuorumType` of the instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The quorumType. + */ + @java.lang.Override + public com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType getQuorumType() { + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType result = + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.forNumber(quorumType_); + return result == null + ? com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType.UNRECOGNIZED + : result; + } + /** + * + * + *
          +     * Output only. The `QuorumType` of the instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The quorumType to set. + * @return This builder for chaining. + */ + public Builder setQuorumType( + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + quorumType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. The `QuorumType` of the instance configuration.
          +     * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearQuorumType() { + bitField0_ = (bitField0_ & ~0x00001000); + quorumType_ = 0; + onChanged(); + return this; + } + + private long storageLimitPerProcessingUnit_; + /** + * + * + *
          +     * Output only. The storage limit in bytes per processing unit.
          +     * 
          + * + * + * int64 storage_limit_per_processing_unit = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The storageLimitPerProcessingUnit. + */ + @java.lang.Override + public long getStorageLimitPerProcessingUnit() { + return storageLimitPerProcessingUnit_; + } + /** + * + * + *
          +     * Output only. The storage limit in bytes per processing unit.
          +     * 
          + * + * + * int64 storage_limit_per_processing_unit = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The storageLimitPerProcessingUnit to set. + * @return This builder for chaining. + */ + public Builder setStorageLimitPerProcessingUnit(long value) { + + storageLimitPerProcessingUnit_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
          +     * Output only. The storage limit in bytes per processing unit.
          +     * 
          + * + * + * int64 storage_limit_per_processing_unit = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearStorageLimitPerProcessingUnit() { + bitField0_ = (bitField0_ & ~0x00002000); + storageLimitPerProcessingUnit_ = 0L; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java index ed36ecec926..f5e931c1d7a 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceConfigOrBuilder.java @@ -119,6 +119,11 @@ public interface InstanceConfigOrBuilder *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -130,6 +135,11 @@ public interface InstanceConfigOrBuilder *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -141,6 +151,11 @@ public interface InstanceConfigOrBuilder *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -152,6 +167,11 @@ public interface InstanceConfigOrBuilder *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -164,6 +184,11 @@ public interface InstanceConfigOrBuilder *
              * The geographic placement of nodes in this instance configuration and their
              * replication properties.
          +   *
          +   * To create user-managed configurations, input
          +   * `replicas` must include all replicas in `replicas` of the `base_config`
          +   * and include one or more replicas in the `optional_replicas` of the
          +   * `base_config`.
              * 
          * * repeated .google.spanner.admin.instance.v1.ReplicaInfo replicas = 3; @@ -174,8 +199,8 @@ public interface InstanceConfigOrBuilder * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -187,8 +212,8 @@ public interface InstanceConfigOrBuilder * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -200,8 +225,8 @@ public interface InstanceConfigOrBuilder * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -213,8 +238,8 @@ public interface InstanceConfigOrBuilder * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -227,8 +252,8 @@ public interface InstanceConfigOrBuilder * * *
          -   * Output only. The available optional replicas to choose from for user
          -   * managed configurations. Populated for Google managed configurations.
          +   * Output only. The available optional replicas to choose from for
          +   * user-managed configurations. Populated for Google-managed configurations.
              * 
          * * @@ -242,9 +267,9 @@ public interface InstanceConfigOrBuilder * *
              * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -   * based on which this configuration is created. Only set for user managed
          +   * based on which this configuration is created. Only set for user-managed
              * configurations. `base_config` must refer to a configuration of type
          -   * GOOGLE_MANAGED in the same project as this configuration.
          +   * `GOOGLE_MANAGED` in the same project as this configuration.
              * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -257,9 +282,9 @@ public interface InstanceConfigOrBuilder * *
              * Base configuration name, e.g. projects/<project_name>/instanceConfigs/nam3,
          -   * based on which this configuration is created. Only set for user managed
          +   * based on which this configuration is created. Only set for user-managed
              * configurations. `base_config` must refer to a configuration of type
          -   * GOOGLE_MANAGED in the same project as this configuration.
          +   * `GOOGLE_MANAGED` in the same project as this configuration.
              * 
          * * string base_config = 7 [(.google.api.resource_reference) = { ... } @@ -571,4 +596,80 @@ java.lang.String getLabelsOrDefault( * @return The state. */ com.google.spanner.admin.instance.v1.InstanceConfig.State getState(); + + /** + * + * + *
          +   * Output only. Describes whether free instances are available to be created
          +   * in this instance configuration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for freeInstanceAvailability. + */ + int getFreeInstanceAvailabilityValue(); + /** + * + * + *
          +   * Output only. Describes whether free instances are available to be created
          +   * in this instance configuration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability free_instance_availability = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The freeInstanceAvailability. + */ + com.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability + getFreeInstanceAvailability(); + + /** + * + * + *
          +   * Output only. The `QuorumType` of the instance configuration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for quorumType. + */ + int getQuorumTypeValue(); + /** + * + * + *
          +   * Output only. The `QuorumType` of the instance configuration.
          +   * 
          + * + * + * .google.spanner.admin.instance.v1.InstanceConfig.QuorumType quorum_type = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The quorumType. + */ + com.google.spanner.admin.instance.v1.InstanceConfig.QuorumType getQuorumType(); + + /** + * + * + *
          +   * Output only. The storage limit in bytes per processing unit.
          +   * 
          + * + * + * int64 storage_limit_per_processing_unit = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The storageLimitPerProcessingUnit. + */ + long getStorageLimitPerProcessingUnit(); } diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceOrBuilder.java index 6ebc4e67d45..78eaaf46528 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstanceOrBuilder.java @@ -133,9 +133,6 @@ public interface InstanceOrBuilder * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying node count across replicas (achieved by - * setting asymmetric_autoscaling_options in autoscaling config), the - * node_count here is the maximum node count across all replicas. * * For more information, see * [Compute capacity, nodes, and processing @@ -165,10 +162,6 @@ public interface InstanceOrBuilder * This might be zero in API responses for instances that are not yet in the * `READY` state. * - * If the instance has varying processing units per replica - * (achieved by setting asymmetric_autoscaling_options in autoscaling config), - * the processing_units here is the maximum processing units across all - * replicas. * * For more information, see * [Compute capacity, nodes and processing @@ -500,6 +493,31 @@ java.lang.String getLabelsOrDefault( */ java.lang.String getLabelsOrThrow(java.lang.String key); + /** + * + * + *
          +   * The `InstanceType` of the current instance.
          +   * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @return The enum numeric value on the wire for instanceType. + */ + int getInstanceTypeValue(); + /** + * + * + *
          +   * The `InstanceType` of the current instance.
          +   * 
          + * + * .google.spanner.admin.instance.v1.Instance.InstanceType instance_type = 10; + * + * @return The instanceType. + */ + com.google.spanner.admin.instance.v1.Instance.InstanceType getInstanceType(); + /** * * @@ -627,6 +645,45 @@ java.lang.String getLabelsOrDefault( */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + /** + * + * + *
          +   * Free instance metadata. Only populated for free instances.
          +   * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + * + * @return Whether the freeInstanceMetadata field is set. + */ + boolean hasFreeInstanceMetadata(); + /** + * + * + *
          +   * Free instance metadata. Only populated for free instances.
          +   * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + * + * @return The freeInstanceMetadata. + */ + com.google.spanner.admin.instance.v1.FreeInstanceMetadata getFreeInstanceMetadata(); + /** + * + * + *
          +   * Free instance metadata. Only populated for free instances.
          +   * 
          + * + * .google.spanner.admin.instance.v1.FreeInstanceMetadata free_instance_metadata = 13; + * + */ + com.google.spanner.admin.instance.v1.FreeInstanceMetadataOrBuilder + getFreeInstanceMetadataOrBuilder(); + /** * * @@ -660,15 +717,16 @@ java.lang.String getLabelsOrDefault( * * *
          -   * Optional. Controls the default backup behavior for new databases within the
          -   * instance.
          +   * Optional. Controls the default backup schedule behavior for new databases
          +   * within the instance. By default, a backup schedule is created automatically
          +   * when a new database is created in a new instance.
              *
          -   * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -   * backup schedules are not allowed for free instances.
          +   * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +   * as backups and backup schedules aren't supported for free instances.
              *
              * In the `GetInstance` or `ListInstances` response, if the value of
          -   * default_backup_schedule_type is unset or NONE, no default backup
          -   * schedule will be created for new databases within the instance.
          +   * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +   * create a default backup schedule for new databases in the instance.
              * 
          * * @@ -682,15 +740,16 @@ java.lang.String getLabelsOrDefault( * * *
          -   * Optional. Controls the default backup behavior for new databases within the
          -   * instance.
          +   * Optional. Controls the default backup schedule behavior for new databases
          +   * within the instance. By default, a backup schedule is created automatically
          +   * when a new database is created in a new instance.
              *
          -   * Note that `AUTOMATIC` is not permitted for free instances, as backups and
          -   * backup schedules are not allowed for free instances.
          +   * Note that the `AUTOMATIC` value isn't permitted for free instances,
          +   * as backups and backup schedules aren't supported for free instances.
              *
              * In the `GetInstance` or `ListInstances` response, if the value of
          -   * default_backup_schedule_type is unset or NONE, no default backup
          -   * schedule will be created for new databases within the instance.
          +   * `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't
          +   * create a default backup schedule for new databases in the instance.
              * 
          * * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java index bd5ea351202..3325b4816fa 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartition.java @@ -467,8 +467,8 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { *
              * The number of nodes allocated to this instance partition.
              *
          -   * Users can set the node_count field to specify the target number of nodes
          -   * allocated to the instance partition.
          +   * Users can set the `node_count` field to specify the target number of
          +   * nodes allocated to the instance partition.
              *
              * This may be zero in API responses for instance partitions that are not
              * yet in state `READY`.
          @@ -488,8 +488,8 @@ public boolean hasNodeCount() {
              * 
              * The number of nodes allocated to this instance partition.
              *
          -   * Users can set the node_count field to specify the target number of nodes
          -   * allocated to the instance partition.
          +   * Users can set the `node_count` field to specify the target number of
          +   * nodes allocated to the instance partition.
              *
              * This may be zero in API responses for instance partitions that are not
              * yet in state `READY`.
          @@ -514,11 +514,11 @@ public int getNodeCount() {
              * 
              * The number of processing units allocated to this instance partition.
              *
          -   * Users can set the processing_units field to specify the target number of
          -   * processing units allocated to the instance partition.
          +   * Users can set the `processing_units` field to specify the target number
          +   * of processing units allocated to the instance partition.
              *
          -   * This may be zero in API responses for instance partitions that are not
          -   * yet in state `READY`.
          +   * This might be zero in API responses for instance partitions that are not
          +   * yet in the `READY` state.
              * 
          * * int32 processing_units = 6; @@ -535,11 +535,11 @@ public boolean hasProcessingUnits() { *
              * The number of processing units allocated to this instance partition.
              *
          -   * Users can set the processing_units field to specify the target number of
          -   * processing units allocated to the instance partition.
          +   * Users can set the `processing_units` field to specify the target number
          +   * of processing units allocated to the instance partition.
              *
          -   * This may be zero in API responses for instance partitions that are not
          -   * yet in state `READY`.
          +   * This might be zero in API responses for instance partitions that are not
          +   * yet in the `READY` state.
              * 
          * * int32 processing_units = 6; @@ -785,17 +785,22 @@ public com.google.protobuf.ByteString getReferencingDatabasesBytes(int index) { * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @return A list containing the referencingBackups. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getReferencingBackupsList() { return referencingBackups_; } @@ -803,17 +808,22 @@ public com.google.protobuf.ProtocolStringList getReferencingBackupsList() { * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @return The count of referencingBackups. */ + @java.lang.Deprecated public int getReferencingBackupsCount() { return referencingBackups_.size(); } @@ -821,18 +831,23 @@ public int getReferencingBackupsCount() { * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param index The index of the element to return. * @return The referencingBackups at the given index. */ + @java.lang.Deprecated public java.lang.String getReferencingBackups(int index) { return referencingBackups_.get(index); } @@ -840,18 +855,23 @@ public java.lang.String getReferencingBackups(int index) { * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param index The index of the value to return. * @return The bytes of the referencingBackups at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getReferencingBackupsBytes(int index) { return referencingBackups_.getByteString(index); } @@ -1988,8 +2008,8 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { *
                * The number of nodes allocated to this instance partition.
                *
          -     * Users can set the node_count field to specify the target number of nodes
          -     * allocated to the instance partition.
          +     * Users can set the `node_count` field to specify the target number of
          +     * nodes allocated to the instance partition.
                *
                * This may be zero in API responses for instance partitions that are not
                * yet in state `READY`.
          @@ -2008,8 +2028,8 @@ public boolean hasNodeCount() {
                * 
                * The number of nodes allocated to this instance partition.
                *
          -     * Users can set the node_count field to specify the target number of nodes
          -     * allocated to the instance partition.
          +     * Users can set the `node_count` field to specify the target number of
          +     * nodes allocated to the instance partition.
                *
                * This may be zero in API responses for instance partitions that are not
                * yet in state `READY`.
          @@ -2031,8 +2051,8 @@ public int getNodeCount() {
                * 
                * The number of nodes allocated to this instance partition.
                *
          -     * Users can set the node_count field to specify the target number of nodes
          -     * allocated to the instance partition.
          +     * Users can set the `node_count` field to specify the target number of
          +     * nodes allocated to the instance partition.
                *
                * This may be zero in API responses for instance partitions that are not
                * yet in state `READY`.
          @@ -2056,8 +2076,8 @@ public Builder setNodeCount(int value) {
                * 
                * The number of nodes allocated to this instance partition.
                *
          -     * Users can set the node_count field to specify the target number of nodes
          -     * allocated to the instance partition.
          +     * Users can set the `node_count` field to specify the target number of
          +     * nodes allocated to the instance partition.
                *
                * This may be zero in API responses for instance partitions that are not
                * yet in state `READY`.
          @@ -2082,11 +2102,11 @@ public Builder clearNodeCount() {
                * 
                * The number of processing units allocated to this instance partition.
                *
          -     * Users can set the processing_units field to specify the target number of
          -     * processing units allocated to the instance partition.
          +     * Users can set the `processing_units` field to specify the target number
          +     * of processing units allocated to the instance partition.
                *
          -     * This may be zero in API responses for instance partitions that are not
          -     * yet in state `READY`.
          +     * This might be zero in API responses for instance partitions that are not
          +     * yet in the `READY` state.
                * 
          * * int32 processing_units = 6; @@ -2102,11 +2122,11 @@ public boolean hasProcessingUnits() { *
                * The number of processing units allocated to this instance partition.
                *
          -     * Users can set the processing_units field to specify the target number of
          -     * processing units allocated to the instance partition.
          +     * Users can set the `processing_units` field to specify the target number
          +     * of processing units allocated to the instance partition.
                *
          -     * This may be zero in API responses for instance partitions that are not
          -     * yet in state `READY`.
          +     * This might be zero in API responses for instance partitions that are not
          +     * yet in the `READY` state.
                * 
          * * int32 processing_units = 6; @@ -2125,11 +2145,11 @@ public int getProcessingUnits() { *
                * The number of processing units allocated to this instance partition.
                *
          -     * Users can set the processing_units field to specify the target number of
          -     * processing units allocated to the instance partition.
          +     * Users can set the `processing_units` field to specify the target number
          +     * of processing units allocated to the instance partition.
                *
          -     * This may be zero in API responses for instance partitions that are not
          -     * yet in state `READY`.
          +     * This might be zero in API responses for instance partitions that are not
          +     * yet in the `READY` state.
                * 
          * * int32 processing_units = 6; @@ -2150,11 +2170,11 @@ public Builder setProcessingUnits(int value) { *
                * The number of processing units allocated to this instance partition.
                *
          -     * Users can set the processing_units field to specify the target number of
          -     * processing units allocated to the instance partition.
          +     * Users can set the `processing_units` field to specify the target number
          +     * of processing units allocated to the instance partition.
                *
          -     * This may be zero in API responses for instance partitions that are not
          -     * yet in state `READY`.
          +     * This might be zero in API responses for instance partitions that are not
          +     * yet in the `READY` state.
                * 
          * * int32 processing_units = 6; @@ -2919,17 +2939,22 @@ private void ensureReferencingBackupsIsMutable() { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @return A list containing the referencingBackups. */ + @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getReferencingBackupsList() { referencingBackups_.makeImmutable(); return referencingBackups_; @@ -2938,17 +2963,22 @@ public com.google.protobuf.ProtocolStringList getReferencingBackupsList() { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @return The count of referencingBackups. */ + @java.lang.Deprecated public int getReferencingBackupsCount() { return referencingBackups_.size(); } @@ -2956,18 +2986,23 @@ public int getReferencingBackupsCount() { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param index The index of the element to return. * @return The referencingBackups at the given index. */ + @java.lang.Deprecated public java.lang.String getReferencingBackups(int index) { return referencingBackups_.get(index); } @@ -2975,18 +3010,23 @@ public java.lang.String getReferencingBackups(int index) { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param index The index of the value to return. * @return The bytes of the referencingBackups at the given index. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getReferencingBackupsBytes(int index) { return referencingBackups_.getByteString(index); } @@ -2994,19 +3034,24 @@ public com.google.protobuf.ByteString getReferencingBackupsBytes(int index) { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param index The index to set the value at. * @param value The referencingBackups to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setReferencingBackups(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -3021,18 +3066,23 @@ public Builder setReferencingBackups(int index, java.lang.String value) { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param value The referencingBackups to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addReferencingBackups(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -3047,18 +3097,23 @@ public Builder addReferencingBackups(java.lang.String value) { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param values The referencingBackups to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addAllReferencingBackups(java.lang.Iterable values) { ensureReferencingBackupsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, referencingBackups_); @@ -3070,17 +3125,22 @@ public Builder addAllReferencingBackups(java.lang.Iterable val * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearReferencingBackups() { referencingBackups_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000200); @@ -3092,18 +3152,23 @@ public Builder clearReferencingBackups() { * * *
          +     * Output only. Deprecated: This field is not populated.
                * Output only. The names of the backups that reference this instance
                * partition. Referencing backups should share the parent instance. The
                * existence of any referencing backup prevents the instance partition from
                * being deleted.
                * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param value The bytes of the referencingBackups to add. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder addReferencingBackupsBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java index 8299ee692be..a620baac70d 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/InstancePartitionOrBuilder.java @@ -127,8 +127,8 @@ public interface InstancePartitionOrBuilder *
              * The number of nodes allocated to this instance partition.
              *
          -   * Users can set the node_count field to specify the target number of nodes
          -   * allocated to the instance partition.
          +   * Users can set the `node_count` field to specify the target number of
          +   * nodes allocated to the instance partition.
              *
              * This may be zero in API responses for instance partitions that are not
              * yet in state `READY`.
          @@ -145,8 +145,8 @@ public interface InstancePartitionOrBuilder
              * 
              * The number of nodes allocated to this instance partition.
              *
          -   * Users can set the node_count field to specify the target number of nodes
          -   * allocated to the instance partition.
          +   * Users can set the `node_count` field to specify the target number of
          +   * nodes allocated to the instance partition.
              *
              * This may be zero in API responses for instance partitions that are not
              * yet in state `READY`.
          @@ -164,11 +164,11 @@ public interface InstancePartitionOrBuilder
              * 
              * The number of processing units allocated to this instance partition.
              *
          -   * Users can set the processing_units field to specify the target number of
          -   * processing units allocated to the instance partition.
          +   * Users can set the `processing_units` field to specify the target number
          +   * of processing units allocated to the instance partition.
              *
          -   * This may be zero in API responses for instance partitions that are not
          -   * yet in state `READY`.
          +   * This might be zero in API responses for instance partitions that are not
          +   * yet in the `READY` state.
              * 
          * * int32 processing_units = 6; @@ -182,11 +182,11 @@ public interface InstancePartitionOrBuilder *
              * The number of processing units allocated to this instance partition.
              *
          -   * Users can set the processing_units field to specify the target number of
          -   * processing units allocated to the instance partition.
          +   * Users can set the `processing_units` field to specify the target number
          +   * of processing units allocated to the instance partition.
              *
          -   * This may be zero in API responses for instance partitions that are not
          -   * yet in state `READY`.
          +   * This might be zero in API responses for instance partitions that are not
          +   * yet in the `READY` state.
              * 
          * * int32 processing_units = 6; @@ -374,67 +374,87 @@ public interface InstancePartitionOrBuilder * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @return A list containing the referencingBackups. */ + @java.lang.Deprecated java.util.List getReferencingBackupsList(); /** * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @return The count of referencingBackups. */ + @java.lang.Deprecated int getReferencingBackupsCount(); /** * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param index The index of the element to return. * @return The referencingBackups at the given index. */ + @java.lang.Deprecated java.lang.String getReferencingBackups(int index); /** * * *
          +   * Output only. Deprecated: This field is not populated.
              * Output only. The names of the backups that reference this instance
              * partition. Referencing backups should share the parent instance. The
              * existence of any referencing backup prevents the instance partition from
              * being deleted.
              * 
          * - * repeated string referencing_backups = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated string referencing_backups = 11 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * * + * @deprecated google.spanner.admin.instance.v1.InstancePartition.referencing_backups is + * deprecated. See google/spanner/admin/instance/v1/spanner_instance_admin.proto;l=1781 * @param index The index of the value to return. * @return The bytes of the referencingBackups at the given index. */ + @java.lang.Deprecated com.google.protobuf.ByteString getReferencingBackupsBytes(int index); /** diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequest.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequest.java index 7790d99d7a3..f9084b565ba 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequest.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequest.java @@ -141,8 +141,7 @@ public com.google.protobuf.ByteString getParentBytes() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -206,8 +205,7 @@ public java.lang.String getFilter() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -898,8 +896,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -962,8 +959,7 @@ public java.lang.String getFilter() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1026,8 +1022,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1089,8 +1084,7 @@ public Builder setFilter(java.lang.String value) { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1148,8 +1142,7 @@ public Builder clearFilter() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequestOrBuilder.java index 8aa43b97043..cb23836447e 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequestOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsRequestOrBuilder.java @@ -67,8 +67,7 @@ public interface ListInstanceConfigOperationsRequestOrBuilder * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -121,8 +120,7 @@ public interface ListInstanceConfigOperationsRequestOrBuilder * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponse.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponse.java index eb10ad4f5b8..227e7ba9569 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponse.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponse.java @@ -76,10 +76,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -93,10 +93,10 @@ public java.util.List getOperationsList() { * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -111,10 +111,10 @@ public java.util.List getOperationsList() { * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -128,10 +128,10 @@ public int getOperationsCount() { * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -145,10 +145,10 @@ public com.google.longrunning.Operation getOperations(int index) { * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -662,10 +662,10 @@ private void ensureOperationsIsMutable() { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -682,10 +682,10 @@ public java.util.List getOperationsList() { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -702,10 +702,10 @@ public int getOperationsCount() { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -722,10 +722,10 @@ public com.google.longrunning.Operation getOperations(int index) { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -748,10 +748,10 @@ public Builder setOperations(int index, com.google.longrunning.Operation value) * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -772,10 +772,10 @@ public Builder setOperations( * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -798,10 +798,10 @@ public Builder addOperations(com.google.longrunning.Operation value) { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -824,10 +824,10 @@ public Builder addOperations(int index, com.google.longrunning.Operation value) * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -847,10 +847,10 @@ public Builder addOperations(com.google.longrunning.Operation.Builder builderFor * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -871,10 +871,10 @@ public Builder addOperations( * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -895,10 +895,10 @@ public Builder addAllOperations( * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -918,10 +918,10 @@ public Builder clearOperations() { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -941,10 +941,10 @@ public Builder removeOperations(int index) { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -957,10 +957,10 @@ public com.google.longrunning.Operation.Builder getOperationsBuilder(int index) * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -977,10 +977,10 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -998,10 +998,10 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1015,10 +1015,10 @@ public com.google.longrunning.Operation.Builder addOperationsBuilder() { * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1032,10 +1032,10 @@ public com.google.longrunning.Operation.Builder addOperationsBuilder(int index) * * *
          -     * The list of matching instance configuration [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance configuration long-running operations. Each
          +     * operation's name will be
                * prefixed by the name of the instance configuration. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponseOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponseOrBuilder.java index 0636115bd47..29bdde29607 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponseOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstanceConfigOperationsResponseOrBuilder.java @@ -28,10 +28,10 @@ public interface ListInstanceConfigOperationsResponseOrBuilder * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -42,10 +42,10 @@ public interface ListInstanceConfigOperationsResponseOrBuilder * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -56,10 +56,10 @@ public interface ListInstanceConfigOperationsResponseOrBuilder * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -70,10 +70,10 @@ public interface ListInstanceConfigOperationsResponseOrBuilder * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -84,10 +84,10 @@ public interface ListInstanceConfigOperationsResponseOrBuilder * * *
          -   * The list of matching instance configuration [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance configuration long-running operations. Each
          +   * operation's name will be
              * prefixed by the name of the instance configuration. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequest.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequest.java index 0ed4d357a7e..f8416eda4d0 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequest.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequest.java @@ -143,8 +143,7 @@ public com.google.protobuf.ByteString getParentBytes() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -208,8 +207,7 @@ public java.lang.String getFilter() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -349,7 +347,8 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -370,7 +369,8 @@ public boolean hasInstancePartitionDeadline() { * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -393,7 +393,8 @@ public com.google.protobuf.Timestamp getInstancePartitionDeadline() { * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1024,8 +1025,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1088,8 +1088,7 @@ public java.lang.String getFilter() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1152,8 +1151,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1215,8 +1213,7 @@ public Builder setFilter(java.lang.String value) { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1274,8 +1271,7 @@ public Builder clearFilter() { * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -1522,7 +1518,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1542,7 +1539,8 @@ public boolean hasInstancePartitionDeadline() { * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1568,7 +1566,8 @@ public com.google.protobuf.Timestamp getInstancePartitionDeadline() { * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1596,7 +1595,8 @@ public Builder setInstancePartitionDeadline(com.google.protobuf.Timestamp value) * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1622,7 +1622,8 @@ public Builder setInstancePartitionDeadline( * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1655,7 +1656,8 @@ public Builder mergeInstancePartitionDeadline(com.google.protobuf.Timestamp valu * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1680,7 +1682,8 @@ public Builder clearInstancePartitionDeadline() { * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1700,7 +1703,8 @@ public com.google.protobuf.Timestamp.Builder getInstancePartitionDeadlineBuilder * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -1724,7 +1728,8 @@ public com.google.protobuf.TimestampOrBuilder getInstancePartitionDeadlineOrBuil * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequestOrBuilder.java index 417d98e4217..8d3858fffbc 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequestOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsRequestOrBuilder.java @@ -67,8 +67,7 @@ public interface ListInstancePartitionOperationsRequestOrBuilder * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -121,8 +120,7 @@ public interface ListInstancePartitionOperationsRequestOrBuilder * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. * Colon `:` is the contains operator. Filter rules are not case sensitive. * - * The following fields in the [Operation][google.longrunning.Operation] - * are eligible for filtering: + * The following fields in the Operation are eligible for filtering: * * * `name` - The name of the long-running operation * * `done` - False if the operation is in progress, else true. @@ -218,7 +216,8 @@ public interface ListInstancePartitionOperationsRequestOrBuilder * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -236,7 +235,8 @@ public interface ListInstancePartitionOperationsRequestOrBuilder * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * @@ -254,7 +254,8 @@ public interface ListInstancePartitionOperationsRequestOrBuilder * Optional. Deadline used while retrieving metadata for instance partition * operations. Instance partitions whose operation metadata cannot be * retrieved within this deadline will be added to - * [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + * [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + * in * [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. *
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponse.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponse.java index 6a146626001..d145bca064d 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponse.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponse.java @@ -77,10 +77,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -94,10 +94,10 @@ public java.util.List getOperationsList() { * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -112,10 +112,10 @@ public java.util.List getOperationsList() { * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -129,10 +129,10 @@ public int getOperationsCount() { * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -146,10 +146,10 @@ public com.google.longrunning.Operation getOperations(int index) { * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -784,10 +784,10 @@ private void ensureOperationsIsMutable() { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -804,10 +804,10 @@ public java.util.List getOperationsList() { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -824,10 +824,10 @@ public int getOperationsCount() { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -844,10 +844,10 @@ public com.google.longrunning.Operation getOperations(int index) { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -870,10 +870,10 @@ public Builder setOperations(int index, com.google.longrunning.Operation value) * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -894,10 +894,10 @@ public Builder setOperations( * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -920,10 +920,10 @@ public Builder addOperations(com.google.longrunning.Operation value) { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -946,10 +946,10 @@ public Builder addOperations(int index, com.google.longrunning.Operation value) * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -969,10 +969,10 @@ public Builder addOperations(com.google.longrunning.Operation.Builder builderFor * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -993,10 +993,10 @@ public Builder addOperations( * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1017,10 +1017,10 @@ public Builder addAllOperations( * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1040,10 +1040,10 @@ public Builder clearOperations() { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1063,10 +1063,10 @@ public Builder removeOperations(int index) { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1079,10 +1079,10 @@ public com.google.longrunning.Operation.Builder getOperationsBuilder(int index) * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1099,10 +1099,10 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1120,10 +1120,10 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1137,10 +1137,10 @@ public com.google.longrunning.Operation.Builder addOperationsBuilder() { * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * @@ -1154,10 +1154,10 @@ public com.google.longrunning.Operation.Builder addOperationsBuilder(int index) * * *
          -     * The list of matching instance partition [long-running
          -     * operations][google.longrunning.Operation]. Each operation's name will be
          +     * The list of matching instance partition long-running operations. Each
          +     * operation's name will be
                * prefixed by the instance partition's name. The operation's
          -     * [metadata][google.longrunning.Operation.metadata] field type
          +     * metadata field type
                * `metadata.type_url` describes the type of the metadata.
                * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponseOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponseOrBuilder.java index 532d290414a..84cdafefa5b 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponseOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionOperationsResponseOrBuilder.java @@ -28,10 +28,10 @@ public interface ListInstancePartitionOperationsResponseOrBuilder * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -42,10 +42,10 @@ public interface ListInstancePartitionOperationsResponseOrBuilder * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -56,10 +56,10 @@ public interface ListInstancePartitionOperationsResponseOrBuilder * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -70,10 +70,10 @@ public interface ListInstancePartitionOperationsResponseOrBuilder * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * @@ -84,10 +84,10 @@ public interface ListInstancePartitionOperationsResponseOrBuilder * * *
          -   * The list of matching instance partition [long-running
          -   * operations][google.longrunning.Operation]. Each operation's name will be
          +   * The list of matching instance partition long-running operations. Each
          +   * operation's name will be
              * prefixed by the instance partition's name. The operation's
          -   * [metadata][google.longrunning.Operation.metadata] field type
          +   * metadata field type
              * `metadata.type_url` describes the type of the metadata.
              * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequest.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequest.java index dd4b5784fbd..db26b6f2ce8 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequest.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequest.java @@ -75,7 +75,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
              * Required. The instance whose instance partitions should be listed. Values
          -   * are of the form `projects/<project>/instances/<instance>`.
          +   * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +   * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +   * `projects/myproject/instances/-`.
              * 
          * * @@ -101,7 +103,9 @@ public java.lang.String getParent() { * *
              * Required. The instance whose instance partitions should be listed. Values
          -   * are of the form `projects/<project>/instances/<instance>`.
          +   * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +   * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +   * `projects/myproject/instances/-`.
              * 
          * * @@ -724,7 +728,9 @@ public Builder mergeFrom( * *
                * Required. The instance whose instance partitions should be listed. Values
          -     * are of the form `projects/<project>/instances/<instance>`.
          +     * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +     * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +     * `projects/myproject/instances/-`.
                * 
          * * @@ -749,7 +755,9 @@ public java.lang.String getParent() { * *
                * Required. The instance whose instance partitions should be listed. Values
          -     * are of the form `projects/<project>/instances/<instance>`.
          +     * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +     * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +     * `projects/myproject/instances/-`.
                * 
          * * @@ -774,7 +782,9 @@ public com.google.protobuf.ByteString getParentBytes() { * *
                * Required. The instance whose instance partitions should be listed. Values
          -     * are of the form `projects/<project>/instances/<instance>`.
          +     * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +     * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +     * `projects/myproject/instances/-`.
                * 
          * * @@ -798,7 +808,9 @@ public Builder setParent(java.lang.String value) { * *
                * Required. The instance whose instance partitions should be listed. Values
          -     * are of the form `projects/<project>/instances/<instance>`.
          +     * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +     * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +     * `projects/myproject/instances/-`.
                * 
          * * @@ -818,7 +830,9 @@ public Builder clearParent() { * *
                * Required. The instance whose instance partitions should be listed. Values
          -     * are of the form `projects/<project>/instances/<instance>`.
          +     * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +     * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +     * `projects/myproject/instances/-`.
                * 
          * * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequestOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequestOrBuilder.java index c305bad2129..63cdee2ba60 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequestOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsRequestOrBuilder.java @@ -29,7 +29,9 @@ public interface ListInstancePartitionsRequestOrBuilder * *
              * Required. The instance whose instance partitions should be listed. Values
          -   * are of the form `projects/<project>/instances/<instance>`.
          +   * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +   * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +   * `projects/myproject/instances/-`.
              * 
          * * @@ -44,7 +46,9 @@ public interface ListInstancePartitionsRequestOrBuilder * *
              * Required. The instance whose instance partitions should be listed. Values
          -   * are of the form `projects/<project>/instances/<instance>`.
          +   * are of the form `projects/<project>/instances/<instance>`. Use `{instance}
          +   * = '-'` to list instance partitions for all Instances in a project, e.g.,
          +   * `projects/myproject/instances/-`.
              * 
          * * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponse.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponse.java index 77fadf1fe14..743c8c48393 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponse.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponse.java @@ -210,9 +210,9 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * @@ -227,9 +227,9 @@ public com.google.protobuf.ProtocolStringList getUnreachableList() { * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * @@ -244,9 +244,9 @@ public int getUnreachableCount() { * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * @@ -262,9 +262,9 @@ public java.lang.String getUnreachable(int index) { * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * @@ -1253,9 +1253,9 @@ private void ensureUnreachableIsMutable() { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1271,9 +1271,9 @@ public com.google.protobuf.ProtocolStringList getUnreachableList() { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1288,9 +1288,9 @@ public int getUnreachableCount() { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1306,9 +1306,9 @@ public java.lang.String getUnreachable(int index) { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1324,9 +1324,9 @@ public com.google.protobuf.ByteString getUnreachableBytes(int index) { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1350,9 +1350,9 @@ public Builder setUnreachable(int index, java.lang.String value) { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1375,9 +1375,9 @@ public Builder addUnreachable(java.lang.String value) { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1397,9 +1397,9 @@ public Builder addAllUnreachable(java.lang.Iterable values) { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * @@ -1418,9 +1418,9 @@ public Builder clearUnreachable() { * * *
          -     * The list of unreachable instance partitions.
          -     * It includes the names of instance partitions whose metadata could
          -     * not be retrieved within
          +     * The list of unreachable instances or instance partitions.
          +     * It includes the names of instances or instance partitions whose metadata
          +     * could not be retrieved within
                * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
                * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponseOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponseOrBuilder.java index 2ad1ffb742a..2197a85a70a 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponseOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ListInstancePartitionsResponseOrBuilder.java @@ -116,9 +116,9 @@ com.google.spanner.admin.instance.v1.InstancePartitionOrBuilder getInstanceParti * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * @@ -131,9 +131,9 @@ com.google.spanner.admin.instance.v1.InstancePartitionOrBuilder getInstanceParti * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * @@ -146,9 +146,9 @@ com.google.spanner.admin.instance.v1.InstancePartitionOrBuilder getInstanceParti * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * @@ -162,9 +162,9 @@ com.google.spanner.admin.instance.v1.InstancePartitionOrBuilder getInstanceParti * * *
          -   * The list of unreachable instance partitions.
          -   * It includes the names of instance partitions whose metadata could
          -   * not be retrieved within
          +   * The list of unreachable instances or instance partitions.
          +   * It includes the names of instances or instance partitions whose metadata
          +   * could not be retrieved within
              * [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
              * 
          * diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfo.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfo.java index 1c633dded9a..90a336cc4e1 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfo.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfo.java @@ -279,7 +279,7 @@ private ReplicaType(int value) { * * *
          -   * The location of the serving resources, e.g. "us-central1".
          +   * The location of the serving resources, e.g., "us-central1".
              * 
          * * string location = 1; @@ -302,7 +302,7 @@ public java.lang.String getLocation() { * * *
          -   * The location of the serving resources, e.g. "us-central1".
          +   * The location of the serving resources, e.g., "us-central1".
              * 
          * * string location = 1; @@ -767,7 +767,7 @@ public Builder mergeFrom( * * *
          -     * The location of the serving resources, e.g. "us-central1".
          +     * The location of the serving resources, e.g., "us-central1".
                * 
          * * string location = 1; @@ -789,7 +789,7 @@ public java.lang.String getLocation() { * * *
          -     * The location of the serving resources, e.g. "us-central1".
          +     * The location of the serving resources, e.g., "us-central1".
                * 
          * * string location = 1; @@ -811,7 +811,7 @@ public com.google.protobuf.ByteString getLocationBytes() { * * *
          -     * The location of the serving resources, e.g. "us-central1".
          +     * The location of the serving resources, e.g., "us-central1".
                * 
          * * string location = 1; @@ -832,7 +832,7 @@ public Builder setLocation(java.lang.String value) { * * *
          -     * The location of the serving resources, e.g. "us-central1".
          +     * The location of the serving resources, e.g., "us-central1".
                * 
          * * string location = 1; @@ -849,7 +849,7 @@ public Builder clearLocation() { * * *
          -     * The location of the serving resources, e.g. "us-central1".
          +     * The location of the serving resources, e.g., "us-central1".
                * 
          * * string location = 1; diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfoOrBuilder.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfoOrBuilder.java index ec4219e4c17..767e0de3089 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfoOrBuilder.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/ReplicaInfoOrBuilder.java @@ -28,7 +28,7 @@ public interface ReplicaInfoOrBuilder * * *
          -   * The location of the serving resources, e.g. "us-central1".
          +   * The location of the serving resources, e.g., "us-central1".
              * 
          * * string location = 1; @@ -40,7 +40,7 @@ public interface ReplicaInfoOrBuilder * * *
          -   * The location of the serving resources, e.g. "us-central1".
          +   * The location of the serving resources, e.g., "us-central1".
              * 
          * * string location = 1; diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java index b286514fd32..b525827c82e 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/SpannerInstanceAdminProto.java @@ -136,6 +136,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_spanner_admin_instance_v1_UpdateInstanceMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_spanner_admin_instance_v1_UpdateInstanceMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_spanner_admin_instance_v1_CreateInstanceConfigMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -225,7 +229,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "min.instance.v1.ReplicaInfo.ReplicaType\022" + "\037\n\027default_leader_location\030\003 \001(\010\"O\n\013Repl" + "icaType\022\024\n\020TYPE_UNSPECIFIED\020\000\022\016\n\nREAD_WR" - + "ITE\020\001\022\r\n\tREAD_ONLY\020\002\022\013\n\007WITNESS\020\003\"\276\006\n\016In" + + "ITE\020\001\022\r\n\tREAD_ONLY\020\002\022\013\n\007WITNESS\020\003\"\300\n\n\016In" + "stanceConfig\022\014\n\004name\030\001 \001(\t\022\024\n\014display_na" + "me\030\002 \001(\t\022O\n\013config_type\030\005 \001(\01625.google.s" + "panner.admin.instance.v1.InstanceConfig." @@ -239,361 +243,390 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "nfig.LabelsEntry\022\014\n\004etag\030\t \001(\t\022\026\n\016leader" + "_options\030\004 \003(\t\022\030\n\013reconciling\030\n \001(\010B\003\340A\003" + "\022J\n\005state\030\013 \001(\01626.google.spanner.admin.i" - + "nstance.v1.InstanceConfig.StateB\003\340A\003\032-\n\013" - + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" - + "\0028\001\"B\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\022\n\016GOO" - + "GLE_MANAGED\020\001\022\020\n\014USER_MANAGED\020\002\"7\n\005State" - + "\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n" - + "\005READY\020\002:`\352A]\n%spanner.googleapis.com/In" - + "stanceConfig\0224projects/{project}/instanc" - + "eConfigs/{instance_config}\"\262\001\n\026ReplicaCo" - + "mputeCapacity\022R\n\021replica_selection\030\001 \001(\013" - + "22.google.spanner.admin.instance.v1.Repl" - + "icaSelectionB\003\340A\002\022\024\n\nnode_count\030\002 \001(\005H\000\022" - + "\032\n\020processing_units\030\003 \001(\005H\000B\022\n\020compute_c" - + "apacity\"\270\010\n\021AutoscalingConfig\022f\n\022autosca" + + "nstance.v1.InstanceConfig.StateB\003\340A\003\022r\n\032" + + "free_instance_availability\030\014 \001(\0162I.googl" + + "e.spanner.admin.instance.v1.InstanceConf" + + "ig.FreeInstanceAvailabilityB\003\340A\003\022U\n\013quor" + + "um_type\030\022 \001(\0162;.google.spanner.admin.ins" + + "tance.v1.InstanceConfig.QuorumTypeB\003\340A\003\022" + + ".\n!storage_limit_per_processing_unit\030\023 \001" + + "(\003B\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001\"B\n\004Type\022\024\n\020TYPE_UNSPECIFI" + + "ED\020\000\022\022\n\016GOOGLE_MANAGED\020\001\022\020\n\014USER_MANAGED" + + "\020\002\"7\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CR" + + "EATING\020\001\022\t\n\005READY\020\002\"\210\001\n\030FreeInstanceAvai" + + "lability\022*\n&FREE_INSTANCE_AVAILABILITY_U" + + "NSPECIFIED\020\000\022\r\n\tAVAILABLE\020\001\022\017\n\013UNSUPPORT" + + "ED\020\002\022\014\n\010DISABLED\020\003\022\022\n\016QUOTA_EXCEEDED\020\004\"X" + + "\n\nQuorumType\022\033\n\027QUORUM_TYPE_UNSPECIFIED\020" + + "\000\022\n\n\006REGION\020\001\022\017\n\013DUAL_REGION\020\002\022\020\n\014MULTI_" + + "REGION\020\003:\201\001\352A~\n%spanner.googleapis.com/I" + + "nstanceConfig\0224projects/{project}/instan" + + "ceConfigs/{instance_config}*\017instanceCon" + + "figs2\016instanceConfig\"\262\001\n\026ReplicaComputeC" + + "apacity\022R\n\021replica_selection\030\001 \001(\01322.goo" + + "gle.spanner.admin.instance.v1.ReplicaSel" + + "ectionB\003\340A\002\022\024\n\nnode_count\030\002 \001(\005H\000\022\032\n\020pro" + + "cessing_units\030\003 \001(\005H\000B\022\n\020compute_capacit" + + "y\"\270\010\n\021AutoscalingConfig\022f\n\022autoscaling_l" + + "imits\030\001 \001(\0132E.google.spanner.admin.insta" + + "nce.v1.AutoscalingConfig.AutoscalingLimi" + + "tsB\003\340A\002\022h\n\023autoscaling_targets\030\002 \001(\0132F.g" + + "oogle.spanner.admin.instance.v1.Autoscal" + + "ingConfig.AutoscalingTargetsB\003\340A\002\022|\n\036asy" + + "mmetric_autoscaling_options\030\003 \003(\0132O.goog" + + "le.spanner.admin.instance.v1.Autoscaling" + + "Config.AsymmetricAutoscalingOptionB\003\340A\001\032" + + "\227\001\n\021AutoscalingLimits\022\023\n\tmin_nodes\030\001 \001(\005" + + "H\000\022\036\n\024min_processing_units\030\002 \001(\005H\000\022\023\n\tma" + + "x_nodes\030\003 \001(\005H\001\022\036\n\024max_processing_units\030" + + "\004 \001(\005H\001B\013\n\tmin_limitB\013\n\tmax_limit\032r\n\022Aut" + + "oscalingTargets\0222\n%high_priority_cpu_uti" + + "lization_percent\030\001 \001(\005B\003\340A\002\022(\n\033storage_u" + + "tilization_percent\030\002 \001(\005B\003\340A\002\032\304\003\n\033Asymme" + + "tricAutoscalingOption\022R\n\021replica_selecti" + + "on\030\001 \001(\01322.google.spanner.admin.instance" + + ".v1.ReplicaSelectionB\003\340A\002\022\202\001\n\toverrides\030" + + "\002 \001(\0132j.google.spanner.admin.instance.v1" + + ".AutoscalingConfig.AsymmetricAutoscaling" + + "Option.AutoscalingConfigOverridesB\003\340A\001\032\313" + + "\001\n\032AutoscalingConfigOverrides\022f\n\022autosca" + "ling_limits\030\001 \001(\0132E.google.spanner.admin" + ".instance.v1.AutoscalingConfig.Autoscali" - + "ngLimitsB\003\340A\002\022h\n\023autoscaling_targets\030\002 \001" - + "(\0132F.google.spanner.admin.instance.v1.Au" - + "toscalingConfig.AutoscalingTargetsB\003\340A\002\022" - + "|\n\036asymmetric_autoscaling_options\030\003 \003(\0132" - + "O.google.spanner.admin.instance.v1.Autos" - + "calingConfig.AsymmetricAutoscalingOption" - + "B\003\340A\001\032\227\001\n\021AutoscalingLimits\022\023\n\tmin_nodes" - + "\030\001 \001(\005H\000\022\036\n\024min_processing_units\030\002 \001(\005H\000" - + "\022\023\n\tmax_nodes\030\003 \001(\005H\001\022\036\n\024max_processing_" - + "units\030\004 \001(\005H\001B\013\n\tmin_limitB\013\n\tmax_limit\032" - + "r\n\022AutoscalingTargets\0222\n%high_priority_c" - + "pu_utilization_percent\030\001 \001(\005B\003\340A\002\022(\n\033sto" - + "rage_utilization_percent\030\002 \001(\005B\003\340A\002\032\304\003\n\033" - + "AsymmetricAutoscalingOption\022R\n\021replica_s" - + "election\030\001 \001(\01322.google.spanner.admin.in" - + "stance.v1.ReplicaSelectionB\003\340A\002\022\202\001\n\tover" - + "rides\030\002 \001(\0132j.google.spanner.admin.insta" - + "nce.v1.AutoscalingConfig.AsymmetricAutos" - + "calingOption.AutoscalingConfigOverridesB" - + "\003\340A\001\032\313\001\n\032AutoscalingConfigOverrides\022f\n\022a" - + "utoscaling_limits\030\001 \001(\0132E.google.spanner" - + ".admin.instance.v1.AutoscalingConfig.Aut" - + "oscalingLimitsB\003\340A\001\022E\n8autoscaling_targe" - + "t_high_priority_cpu_utilization_percent\030" - + "\002 \001(\005B\003\340A\001\"\232\t\n\010Instance\022\021\n\004name\030\001 \001(\tB\003\340" - + "A\002\022=\n\006config\030\002 \001(\tB-\340A\002\372A\'\n%spanner.goog" - + "leapis.com/InstanceConfig\022\031\n\014display_nam" - + "e\030\003 \001(\tB\003\340A\002\022\022\n\nnode_count\030\005 \001(\005\022\030\n\020proc" - + "essing_units\030\t \001(\005\022_\n\030replica_compute_ca" - + "pacity\030\023 \003(\01328.google.spanner.admin.inst" - + "ance.v1.ReplicaComputeCapacityB\003\340A\003\022T\n\022a" - + "utoscaling_config\030\021 \001(\01323.google.spanner" - + ".admin.instance.v1.AutoscalingConfigB\003\340A" - + "\001\022D\n\005state\030\006 \001(\01620.google.spanner.admin." - + "instance.v1.Instance.StateB\003\340A\003\022F\n\006label" - + "s\030\007 \003(\01326.google.spanner.admin.instance." - + "v1.Instance.LabelsEntry\022\025\n\rendpoint_uris" - + "\030\010 \003(\t\0224\n\013create_time\030\013 \001(\0132\032.google.pro" - + "tobuf.TimestampB\003\340A\003\0224\n\013update_time\030\014 \001(" - + "\0132\032.google.protobuf.TimestampB\003\340A\003\022H\n\007ed" - + "ition\030\024 \001(\01622.google.spanner.admin.insta" - + "nce.v1.Instance.EditionB\003\340A\001\022o\n\034default_" - + "backup_schedule_type\030\027 \001(\0162D.google.span" - + "ner.admin.instance.v1.Instance.DefaultBa" - + "ckupScheduleTypeB\003\340A\001\032-\n\013LabelsEntry\022\013\n\003" - + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"7\n\005State\022\025\n" - + "\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005RE" - + "ADY\020\002\"U\n\007Edition\022\027\n\023EDITION_UNSPECIFIED\020" - + "\000\022\014\n\010STANDARD\020\001\022\016\n\nENTERPRISE\020\002\022\023\n\017ENTER" - + "PRISE_PLUS\020\003\"b\n\031DefaultBackupScheduleTyp" - + "e\022,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPEC" - + "IFIED\020\000\022\010\n\004NONE\020\001\022\r\n\tAUTOMATIC\020\002:M\352AJ\n\037s" - + "panner.googleapis.com/Instance\022\'projects" - + "/{project}/instances/{instance}\"\210\001\n\032List" - + "InstanceConfigsRequest\022C\n\006parent\030\001 \001(\tB3" - + "\340A\002\372A-\n+cloudresourcemanager.googleapis." - + "com/Project\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_t" - + "oken\030\003 \001(\t\"\202\001\n\033ListInstanceConfigsRespon" - + "se\022J\n\020instance_configs\030\001 \003(\01320.google.sp" - + "anner.admin.instance.v1.InstanceConfig\022\027" - + "\n\017next_page_token\030\002 \001(\t\"W\n\030GetInstanceCo" - + "nfigRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%spann" - + "er.googleapis.com/InstanceConfig\"\352\001\n\033Cre" - + "ateInstanceConfigRequest\022C\n\006parent\030\001 \001(\t" - + "B3\340A\002\372A-\n+cloudresourcemanager.googleapi" - + "s.com/Project\022\037\n\022instance_config_id\030\002 \001(" - + "\tB\003\340A\002\022N\n\017instance_config\030\003 \001(\01320.google" - + ".spanner.admin.instance.v1.InstanceConfi" - + "gB\003\340A\002\022\025\n\rvalidate_only\030\004 \001(\010\"\272\001\n\033Update" - + "InstanceConfigRequest\022N\n\017instance_config" - + "\030\001 \001(\01320.google.spanner.admin.instance.v" - + "1.InstanceConfigB\003\340A\002\0224\n\013update_mask\030\002 \001" - + "(\0132\032.google.protobuf.FieldMaskB\003\340A\002\022\025\n\rv" - + "alidate_only\030\003 \001(\010\"\177\n\033DeleteInstanceConf" - + "igRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%spanner" - + ".googleapis.com/InstanceConfig\022\014\n\004etag\030\002" - + " \001(\t\022\025\n\rvalidate_only\030\003 \001(\010\"\241\001\n#ListInst" - + "anceConfigOperationsRequest\022C\n\006parent\030\001 " - + "\001(\tB3\340A\002\372A-\n+cloudresourcemanager.google" - + "apis.com/Project\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage" - + "_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"r\n$ListI" - + "nstanceConfigOperationsResponse\0221\n\nopera" - + "tions\030\001 \003(\0132\035.google.longrunning.Operati" - + "on\022\027\n\017next_page_token\030\002 \001(\t\"{\n\022GetInstan" - + "ceRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037spanner" - + ".googleapis.com/Instance\022.\n\nfield_mask\030\002" - + " \001(\0132\032.google.protobuf.FieldMask\"\271\001\n\025Cre" - + "ateInstanceRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372" - + "A-\n+cloudresourcemanager.googleapis.com/" - + "Project\022\030\n\013instance_id\030\002 \001(\tB\003\340A\002\022A\n\010ins" - + "tance\030\003 \001(\0132*.google.spanner.admin.insta" - + "nce.v1.InstanceB\003\340A\002\"\311\001\n\024ListInstancesRe" - + "quest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudreso" - + "urcemanager.googleapis.com/Project\022\021\n\tpa" - + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006fil" - + "ter\030\004 \001(\t\0225\n\021instance_deadline\030\005 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\"\204\001\n\025ListInstanc" - + "esResponse\022=\n\tinstances\030\001 \003(\0132*.google.s" - + "panner.admin.instance.v1.Instance\022\027\n\017nex" - + "t_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"" - + "\217\001\n\025UpdateInstanceRequest\022A\n\010instance\030\001 " - + "\001(\0132*.google.spanner.admin.instance.v1.I" - + "nstanceB\003\340A\002\0223\n\nfield_mask\030\002 \001(\0132\032.googl" - + "e.protobuf.FieldMaskB\003\340A\002\"N\n\025DeleteInsta" - + "nceRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037spanne" - + "r.googleapis.com/Instance\"\277\002\n\026CreateInst" - + "anceMetadata\022<\n\010instance\030\001 \001(\0132*.google." - + "spanner.admin.instance.v1.Instance\022.\n\nst" - + "art_time\030\002 \001(\0132\032.google.protobuf.Timesta" - + "mp\022/\n\013cancel_time\030\003 \001(\0132\032.google.protobu" - + "f.Timestamp\022,\n\010end_time\030\004 \001(\0132\032.google.p" - + "rotobuf.Timestamp\022X\n\033expected_fulfillmen" - + "t_period\030\005 \001(\01623.google.spanner.admin.in" - + "stance.v1.FulfillmentPeriod\"\277\002\n\026UpdateIn" - + "stanceMetadata\022<\n\010instance\030\001 \001(\0132*.googl" - + "e.spanner.admin.instance.v1.Instance\022.\n\n" - + "start_time\030\002 \001(\0132\032.google.protobuf.Times" - + "tamp\022/\n\013cancel_time\030\003 \001(\0132\032.google.proto" - + "buf.Timestamp\022,\n\010end_time\030\004 \001(\0132\032.google" - + ".protobuf.Timestamp\022X\n\033expected_fulfillm" - + "ent_period\030\005 \001(\01623.google.spanner.admin." - + "instance.v1.FulfillmentPeriod\"\341\001\n\034Create" - + "InstanceConfigMetadata\022I\n\017instance_confi" - + "g\030\001 \001(\01320.google.spanner.admin.instance." - + "v1.InstanceConfig\022E\n\010progress\030\002 \001(\01323.go" - + "ogle.spanner.admin.instance.v1.Operation" - + "Progress\022/\n\013cancel_time\030\003 \001(\0132\032.google.p" - + "rotobuf.Timestamp\"\341\001\n\034UpdateInstanceConf" - + "igMetadata\022I\n\017instance_config\030\001 \001(\01320.go" - + "ogle.spanner.admin.instance.v1.InstanceC" - + "onfig\022E\n\010progress\030\002 \001(\01323.google.spanner" - + ".admin.instance.v1.OperationProgress\022/\n\013" - + "cancel_time\030\003 \001(\0132\032.google.protobuf.Time" - + "stamp\"\216\005\n\021InstancePartition\022\021\n\004name\030\001 \001(" - + "\tB\003\340A\002\022=\n\006config\030\002 \001(\tB-\340A\002\372A\'\n%spanner." - + "googleapis.com/InstanceConfig\022\031\n\014display" - + "_name\030\003 \001(\tB\003\340A\002\022\024\n\nnode_count\030\005 \001(\005H\000\022\032" - + "\n\020processing_units\030\006 \001(\005H\000\022M\n\005state\030\007 \001(" - + "\01629.google.spanner.admin.instance.v1.Ins" - + "tancePartition.StateB\003\340A\003\0224\n\013create_time" - + "\030\010 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022" - + "4\n\013update_time\030\t \001(\0132\032.google.protobuf.T" - + "imestampB\003\340A\003\022\"\n\025referencing_databases\030\n" - + " \003(\tB\003\340A\003\022 \n\023referencing_backups\030\013 \003(\tB\003" - + "\340A\003\022\014\n\004etag\030\014 \001(\t\"7\n\005State\022\025\n\021STATE_UNSP" - + "ECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002:~\352A{\n" - + "(spanner.googleapis.com/InstancePartitio" - + "n\022Oprojects/{project}/instances/{instanc" - + "e}/instancePartitions/{instance_partitio" - + "n}B\022\n\020compute_capacity\"\201\002\n\037CreateInstanc" - + "ePartitionMetadata\022O\n\022instance_partition" - + "\030\001 \001(\01323.google.spanner.admin.instance.v" - + "1.InstancePartition\022.\n\nstart_time\030\002 \001(\0132" - + "\032.google.protobuf.Timestamp\022/\n\013cancel_ti" - + "me\030\003 \001(\0132\032.google.protobuf.Timestamp\022,\n\010" - + "end_time\030\004 \001(\0132\032.google.protobuf.Timesta" - + "mp\"\323\001\n\036CreateInstancePartitionRequest\0227\n" - + "\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapi" - + "s.com/Instance\022\"\n\025instance_partition_id\030" - + "\002 \001(\tB\003\340A\002\022T\n\022instance_partition\030\003 \001(\01323" + + "ngLimitsB\003\340A\001\022E\n8autoscaling_target_high" + + "_priority_cpu_utilization_percent\030\002 \001(\005B" + + "\003\340A\001\"\252\013\n\010Instance\022\021\n\004name\030\001 \001(\tB\003\340A\002\022=\n\006" + + "config\030\002 \001(\tB-\340A\002\372A\'\n%spanner.googleapis" + + ".com/InstanceConfig\022\031\n\014display_name\030\003 \001(" + + "\tB\003\340A\002\022\022\n\nnode_count\030\005 \001(\005\022\030\n\020processing" + + "_units\030\t \001(\005\022_\n\030replica_compute_capacity" + + "\030\023 \003(\01328.google.spanner.admin.instance.v" + + "1.ReplicaComputeCapacityB\003\340A\003\022T\n\022autosca" + + "ling_config\030\021 \001(\01323.google.spanner.admin" + + ".instance.v1.AutoscalingConfigB\003\340A\001\022D\n\005s" + + "tate\030\006 \001(\01620.google.spanner.admin.instan" + + "ce.v1.Instance.StateB\003\340A\003\022F\n\006labels\030\007 \003(" + + "\01326.google.spanner.admin.instance.v1.Ins" + + "tance.LabelsEntry\022N\n\rinstance_type\030\n \001(\016" + + "27.google.spanner.admin.instance.v1.Inst" + + "ance.InstanceType\022\025\n\rendpoint_uris\030\010 \003(\t" + + "\0224\n\013create_time\030\013 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\0224\n\013update_time\030\014 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003\022V\n\026free_ins" + + "tance_metadata\030\r \001(\01326.google.spanner.ad" + + "min.instance.v1.FreeInstanceMetadata\022H\n\007" + + "edition\030\024 \001(\01622.google.spanner.admin.ins" + + "tance.v1.Instance.EditionB\003\340A\001\022o\n\034defaul" + + "t_backup_schedule_type\030\027 \001(\0162D.google.sp" + + "anner.admin.instance.v1.Instance.Default" + + "BackupScheduleTypeB\003\340A\001\032-\n\013LabelsEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"7\n\005State\022" + + "\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005" + + "READY\020\002\"Q\n\014InstanceType\022\035\n\031INSTANCE_TYPE" + + "_UNSPECIFIED\020\000\022\017\n\013PROVISIONED\020\001\022\021\n\rFREE_" + + "INSTANCE\020\002\"U\n\007Edition\022\027\n\023EDITION_UNSPECI" + + "FIED\020\000\022\014\n\010STANDARD\020\001\022\016\n\nENTERPRISE\020\002\022\023\n\017" + + "ENTERPRISE_PLUS\020\003\"b\n\031DefaultBackupSchedu" + + "leType\022,\n(DEFAULT_BACKUP_SCHEDULE_TYPE_U" + + "NSPECIFIED\020\000\022\010\n\004NONE\020\001\022\r\n\tAUTOMATIC\020\002:b\352" + + "A_\n\037spanner.googleapis.com/Instance\022\'pro" + + "jects/{project}/instances/{instance}*\tin" + + "stances2\010instance\"\210\001\n\032ListInstanceConfig" + + "sRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudr" + + "esourcemanager.googleapis.com/Project\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\202\001\n" + + "\033ListInstanceConfigsResponse\022J\n\020instance" + + "_configs\030\001 \003(\01320.google.spanner.admin.in" + + "stance.v1.InstanceConfig\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\"W\n\030GetInstanceConfigRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n%spanner.googleapis." + + "com/InstanceConfig\"\352\001\n\033CreateInstanceCon" + + "figRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+clou" + + "dresourcemanager.googleapis.com/Project\022" + + "\037\n\022instance_config_id\030\002 \001(\tB\003\340A\002\022N\n\017inst" + + "ance_config\030\003 \001(\01320.google.spanner.admin" + + ".instance.v1.InstanceConfigB\003\340A\002\022\025\n\rvali" + + "date_only\030\004 \001(\010\"\272\001\n\033UpdateInstanceConfig" + + "Request\022N\n\017instance_config\030\001 \001(\01320.googl" + + "e.spanner.admin.instance.v1.InstanceConf" + + "igB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.pr" + + "otobuf.FieldMaskB\003\340A\002\022\025\n\rvalidate_only\030\003" + + " \001(\010\"\177\n\033DeleteInstanceConfigRequest\022;\n\004n" + + "ame\030\001 \001(\tB-\340A\002\372A\'\n%spanner.googleapis.co" + + "m/InstanceConfig\022\014\n\004etag\030\002 \001(\t\022\025\n\rvalida" + + "te_only\030\003 \001(\010\"\241\001\n#ListInstanceConfigOper" + + "ationsRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+c" + + "loudresourcemanager.googleapis.com/Proje" + + "ct\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n" + + "\npage_token\030\004 \001(\t\"r\n$ListInstanceConfigO" + + "perationsResponse\0221\n\noperations\030\001 \003(\0132\035." + + "google.longrunning.Operation\022\027\n\017next_pag" + + "e_token\030\002 \001(\t\"{\n\022GetInstanceRequest\0225\n\004n" + + "ame\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapis.co" + + "m/Instance\022.\n\nfield_mask\030\002 \001(\0132\032.google." + + "protobuf.FieldMask\"\271\001\n\025CreateInstanceReq" + + "uest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudresou" + + "rcemanager.googleapis.com/Project\022\030\n\013ins" + + "tance_id\030\002 \001(\tB\003\340A\002\022A\n\010instance\030\003 \001(\0132*." + + "google.spanner.admin.instance.v1.Instanc" + + "eB\003\340A\002\"\311\001\n\024ListInstancesRequest\022C\n\006paren" + + "t\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.go" + + "ogleapis.com/Project\022\021\n\tpage_size\030\002 \001(\005\022" + + "\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\0225\n\021i" + + "nstance_deadline\030\005 \001(\0132\032.google.protobuf" + + ".Timestamp\"\204\001\n\025ListInstancesResponse\022=\n\t" + + "instances\030\001 \003(\0132*.google.spanner.admin.i" + + "nstance.v1.Instance\022\027\n\017next_page_token\030\002" + + " \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\217\001\n\025UpdateInst" + + "anceRequest\022A\n\010instance\030\001 \001(\0132*.google.s" + + "panner.admin.instance.v1.InstanceB\003\340A\002\0223" + + "\n\nfield_mask\030\002 \001(\0132\032.google.protobuf.Fie" + + "ldMaskB\003\340A\002\"N\n\025DeleteInstanceRequest\0225\n\004" + + "name\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapis.c" + + "om/Instance\"\277\002\n\026CreateInstanceMetadata\022<" + + "\n\010instance\030\001 \001(\0132*.google.spanner.admin." + + "instance.v1.Instance\022.\n\nstart_time\030\002 \001(\013" + + "2\032.google.protobuf.Timestamp\022/\n\013cancel_t" + + "ime\030\003 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\004 \001(\0132\032.google.protobuf.Timest" + + "amp\022X\n\033expected_fulfillment_period\030\005 \001(\016" + + "23.google.spanner.admin.instance.v1.Fulf" + + "illmentPeriod\"\277\002\n\026UpdateInstanceMetadata" + + "\022<\n\010instance\030\001 \001(\0132*.google.spanner.admi" + + "n.instance.v1.Instance\022.\n\nstart_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022/\n\013cancel" + + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\022" + + ",\n\010end_time\030\004 \001(\0132\032.google.protobuf.Time" + + "stamp\022X\n\033expected_fulfillment_period\030\005 \001" + + "(\01623.google.spanner.admin.instance.v1.Fu" + + "lfillmentPeriod\"\316\002\n\024FreeInstanceMetadata" + + "\0224\n\013expire_time\030\001 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\0225\n\014upgrade_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\003\340A\003\022^\n\017expire_" + + "behavior\030\003 \001(\0162E.google.spanner.admin.in" + + "stance.v1.FreeInstanceMetadata.ExpireBeh" + + "avior\"i\n\016ExpireBehavior\022\037\n\033EXPIRE_BEHAVI" + + "OR_UNSPECIFIED\020\000\022\027\n\023FREE_TO_PROVISIONED\020" + + "\001\022\035\n\031REMOVE_AFTER_GRACE_PERIOD\020\002\"\341\001\n\034Cre" + + "ateInstanceConfigMetadata\022I\n\017instance_co" + + "nfig\030\001 \001(\01320.google.spanner.admin.instan" + + "ce.v1.InstanceConfig\022E\n\010progress\030\002 \001(\01323" + + ".google.spanner.admin.instance.v1.Operat" + + "ionProgress\022/\n\013cancel_time\030\003 \001(\0132\032.googl" + + "e.protobuf.Timestamp\"\341\001\n\034UpdateInstanceC" + + "onfigMetadata\022I\n\017instance_config\030\001 \001(\01320" + ".google.spanner.admin.instance.v1.Instan" - + "cePartitionB\003\340A\002\"n\n\036DeleteInstancePartit" - + "ionRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(spanne" - + "r.googleapis.com/InstancePartition\022\014\n\004et" - + "ag\030\002 \001(\t\"]\n\033GetInstancePartitionRequest\022" - + ">\n\004name\030\001 \001(\tB0\340A\002\372A*\n(spanner.googleapi" - + "s.com/InstancePartition\"\253\001\n\036UpdateInstan" - + "cePartitionRequest\022T\n\022instance_partition" - + "\030\001 \001(\01323.google.spanner.admin.instance.v" - + "1.InstancePartitionB\003\340A\002\0223\n\nfield_mask\030\002" - + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"\201\002" - + "\n\037UpdateInstancePartitionMetadata\022O\n\022ins" - + "tance_partition\030\001 \001(\01323.google.spanner.a" - + "dmin.instance.v1.InstancePartition\022.\n\nst" - + "art_time\030\002 \001(\0132\032.google.protobuf.Timesta" - + "mp\022/\n\013cancel_time\030\003 \001(\0132\032.google.protobu" - + "f.Timestamp\022,\n\010end_time\030\004 \001(\0132\032.google.p" - + "rotobuf.Timestamp\"\305\001\n\035ListInstancePartit" - + "ionsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spa" - + "nner.googleapis.com/Instance\022\021\n\tpage_siz" - + "e\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022D\n\033instance_" - + "partition_deadline\030\004 \001(\0132\032.google.protob" - + "uf.TimestampB\003\340A\001\"\240\001\n\036ListInstancePartit" - + "ionsResponse\022P\n\023instance_partitions\030\001 \003(" - + "\01323.google.spanner.admin.instance.v1.Ins" - + "tancePartition\022\027\n\017next_page_token\030\002 \001(\t\022" - + "\023\n\013unreachable\030\003 \003(\t\"\355\001\n&ListInstancePar" - + "titionOperationsRequest\0227\n\006parent\030\001 \001(\tB" - + "\'\340A\002\372A!\n\037spanner.googleapis.com/Instance" - + "\022\023\n\006filter\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005" - + "B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\022D\n\033instan" - + "ce_partition_deadline\030\005 \001(\0132\032.google.pro" - + "tobuf.TimestampB\003\340A\001\"\236\001\n\'ListInstancePar" - + "titionOperationsResponse\0221\n\noperations\030\001" - + " \003(\0132\035.google.longrunning.Operation\022\027\n\017n" - + "ext_page_token\030\002 \001(\t\022\'\n\037unreachable_inst" - + "ance_partitions\030\003 \003(\t\"\222\001\n\023MoveInstanceRe" - + "quest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.goo" - + "gleapis.com/Instance\022D\n\rtarget_config\030\002 " - + "\001(\tB-\340A\002\372A\'\n%spanner.googleapis.com/Inst" - + "anceConfig\"\026\n\024MoveInstanceResponse\"\245\001\n\024M" - + "oveInstanceMetadata\022\025\n\rtarget_config\030\001 \001" - + "(\t\022E\n\010progress\030\002 \001(\01323.google.spanner.ad" - + "min.instance.v1.OperationProgress\022/\n\013can" + + "ceConfig\022E\n\010progress\030\002 \001(\01323.google.span" + + "ner.admin.instance.v1.OperationProgress\022" + + "/\n\013cancel_time\030\003 \001(\0132\032.google.protobuf.T" + + "imestamp\"\271\005\n\021InstancePartition\022\021\n\004name\030\001" + + " \001(\tB\003\340A\002\022=\n\006config\030\002 \001(\tB-\340A\002\372A\'\n%spann" + + "er.googleapis.com/InstanceConfig\022\031\n\014disp" + + "lay_name\030\003 \001(\tB\003\340A\002\022\024\n\nnode_count\030\005 \001(\005H" + + "\000\022\032\n\020processing_units\030\006 \001(\005H\000\022M\n\005state\030\007" + + " \001(\01629.google.spanner.admin.instance.v1." + + "InstancePartition.StateB\003\340A\003\0224\n\013create_t" + + "ime\030\010 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\0224\n\013update_time\030\t \001(\0132\032.google.protobu" + + "f.TimestampB\003\340A\003\022\"\n\025referencing_database" + + "s\030\n \003(\tB\003\340A\003\022\"\n\023referencing_backups\030\013 \003(" + + "\tB\005\030\001\340A\003\022\014\n\004etag\030\014 \001(\t\"7\n\005State\022\025\n\021STATE" + + "_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002:" + + "\246\001\352A\242\001\n(spanner.googleapis.com/InstanceP" + + "artition\022Oprojects/{project}/instances/{" + + "instance}/instancePartitions/{instance_p" + + "artition}*\022instancePartitions2\021instanceP" + + "artitionB\022\n\020compute_capacity\"\201\002\n\037CreateI" + + "nstancePartitionMetadata\022O\n\022instance_par" + + "tition\030\001 \001(\01323.google.spanner.admin.inst" + + "ance.v1.InstancePartition\022.\n\nstart_time\030" + + "\002 \001(\0132\032.google.protobuf.Timestamp\022/\n\013can" + "cel_time\030\003 \001(\0132\032.google.protobuf.Timesta" - + "mp2\332\'\n\rInstanceAdmin\022\314\001\n\023ListInstanceCon" - + "figs\022<.google.spanner.admin.instance.v1." - + "ListInstanceConfigsRequest\032=.google.span" - + "ner.admin.instance.v1.ListInstanceConfig" - + "sResponse\"8\332A\006parent\202\323\344\223\002)\022\'/v1/{parent=" - + "projects/*}/instanceConfigs\022\271\001\n\021GetInsta" - + "nceConfig\022:.google.spanner.admin.instanc" - + "e.v1.GetInstanceConfigRequest\0320.google.s" - + "panner.admin.instance.v1.InstanceConfig\"" - + "6\332A\004name\202\323\344\223\002)\022\'/v1/{name=projects/*/ins" - + "tanceConfigs/*}\022\310\002\n\024CreateInstanceConfig" - + "\022=.google.spanner.admin.instance.v1.Crea" - + "teInstanceConfigRequest\032\035.google.longrun" - + "ning.Operation\"\321\001\312Ap\n/google.spanner.adm" - + "in.instance.v1.InstanceConfig\022=google.sp" - + "anner.admin.instance.v1.CreateInstanceCo" - + "nfigMetadata\332A)parent,instance_config,in" - + "stance_config_id\202\323\344\223\002,\"\'/v1/{parent=proj" - + "ects/*}/instanceConfigs:\001*\022\312\002\n\024UpdateIns" - + "tanceConfig\022=.google.spanner.admin.insta" - + "nce.v1.UpdateInstanceConfigRequest\032\035.goo" - + "gle.longrunning.Operation\"\323\001\312Ap\n/google." - + "spanner.admin.instance.v1.InstanceConfig" - + "\022=google.spanner.admin.instance.v1.Updat" - + "eInstanceConfigMetadata\332A\033instance_confi" - + "g,update_mask\202\323\344\223\002<27/v1/{instance_confi" - + "g.name=projects/*/instanceConfigs/*}:\001*\022" - + "\245\001\n\024DeleteInstanceConfig\022=.google.spanne" - + "r.admin.instance.v1.DeleteInstanceConfig" - + "Request\032\026.google.protobuf.Empty\"6\332A\004name" - + "\202\323\344\223\002)*\'/v1/{name=projects/*/instanceCon" - + "figs/*}\022\360\001\n\034ListInstanceConfigOperations" - + "\022E.google.spanner.admin.instance.v1.List" - + "InstanceConfigOperationsRequest\032F.google" - + ".spanner.admin.instance.v1.ListInstanceC" - + "onfigOperationsResponse\"A\332A\006parent\202\323\344\223\0022" - + "\0220/v1/{parent=projects/*}/instanceConfig" - + "Operations\022\264\001\n\rListInstances\0226.google.sp" - + "anner.admin.instance.v1.ListInstancesReq" - + "uest\0327.google.spanner.admin.instance.v1." - + "ListInstancesResponse\"2\332A\006parent\202\323\344\223\002#\022!" - + "/v1/{parent=projects/*}/instances\022\344\001\n\026Li" - + "stInstancePartitions\022?.google.spanner.ad" - + "min.instance.v1.ListInstancePartitionsRe" - + "quest\032@.google.spanner.admin.instance.v1" - + ".ListInstancePartitionsResponse\"G\332A\006pare" - + "nt\202\323\344\223\0028\0226/v1/{parent=projects/*/instanc" - + "es/*}/instancePartitions\022\241\001\n\013GetInstance" - + "\0224.google.spanner.admin.instance.v1.GetI" - + "nstanceRequest\032*.google.spanner.admin.in" - + "stance.v1.Instance\"0\332A\004name\202\323\344\223\002#\022!/v1/{" - + "name=projects/*/instances/*}\022\234\002\n\016CreateI" - + "nstance\0227.google.spanner.admin.instance." - + "v1.CreateInstanceRequest\032\035.google.longru" - + "nning.Operation\"\261\001\312Ad\n)google.spanner.ad" - + "min.instance.v1.Instance\0227google.spanner" - + ".admin.instance.v1.CreateInstanceMetadat" - + "a\332A\033parent,instance_id,instance\202\323\344\223\002&\"!/" - + "v1/{parent=projects/*}/instances:\001*\022\235\002\n\016" - + "UpdateInstance\0227.google.spanner.admin.in" - + "stance.v1.UpdateInstanceRequest\032\035.google" - + ".longrunning.Operation\"\262\001\312Ad\n)google.spa" - + "nner.admin.instance.v1.Instance\0227google." - + "spanner.admin.instance.v1.UpdateInstance" - + "Metadata\332A\023instance,field_mask\202\323\344\223\002/2*/v" - + "1/{instance.name=projects/*/instances/*}" - + ":\001*\022\223\001\n\016DeleteInstance\0227.google.spanner." - + "admin.instance.v1.DeleteInstanceRequest\032" - + "\026.google.protobuf.Empty\"0\332A\004name\202\323\344\223\002#*!" - + "/v1/{name=projects/*/instances/*}\022\232\001\n\014Se" - + "tIamPolicy\022\".google.iam.v1.SetIamPolicyR" - + "equest\032\025.google.iam.v1.Policy\"O\332A\017resour" - + "ce,policy\202\323\344\223\0027\"2/v1/{resource=projects/" - + "*/instances/*}:setIamPolicy:\001*\022\223\001\n\014GetIa" - + "mPolicy\022\".google.iam.v1.GetIamPolicyRequ" - + "est\032\025.google.iam.v1.Policy\"H\332A\010resource\202" - + "\323\344\223\0027\"2/v1/{resource=projects/*/instance" - + "s/*}:getIamPolicy:\001*\022\305\001\n\022TestIamPermissi" - + "ons\022(.google.iam.v1.TestIamPermissionsRe" - + "quest\032).google.iam.v1.TestIamPermissions" - + "Response\"Z\332A\024resource,permissions\202\323\344\223\002=\"" - + "8/v1/{resource=projects/*/instances/*}:t" - + "estIamPermissions:\001*\022\321\001\n\024GetInstancePart" - + "ition\022=.google.spanner.admin.instance.v1" - + ".GetInstancePartitionRequest\0323.google.sp" - + "anner.admin.instance.v1.InstancePartitio" - + "n\"E\332A\004name\202\323\344\223\0028\0226/v1/{name=projects/*/i" - + "nstances/*/instancePartitions/*}\022\351\002\n\027Cre" - + "ateInstancePartition\022@.google.spanner.ad" - + "min.instance.v1.CreateInstancePartitionR" - + "equest\032\035.google.longrunning.Operation\"\354\001" - + "\312Av\n2google.spanner.admin.instance.v1.In" - + "stancePartition\022@google.spanner.admin.in" - + "stance.v1.CreateInstancePartitionMetadat" - + "a\332A/parent,instance_partition,instance_p" - + "artition_id\202\323\344\223\002;\"6/v1/{parent=projects/" - + "*/instances/*}/instancePartitions:\001*\022\272\001\n" - + "\027DeleteInstancePartition\022@.google.spanne" - + "r.admin.instance.v1.DeleteInstancePartit" - + "ionRequest\032\026.google.protobuf.Empty\"E\332A\004n" - + "ame\202\323\344\223\0028*6/v1/{name=projects/*/instance" - + "s/*/instancePartitions/*}\022\352\002\n\027UpdateInst" - + "ancePartition\022@.google.spanner.admin.ins" - + "tance.v1.UpdateInstancePartitionRequest\032" - + "\035.google.longrunning.Operation\"\355\001\312Av\n2go" - + "ogle.spanner.admin.instance.v1.InstanceP" - + "artition\022@google.spanner.admin.instance." - + "v1.UpdateInstancePartitionMetadata\332A\035ins" - + "tance_partition,field_mask\202\323\344\223\002N2I/v1/{i" - + "nstance_partition.name=projects/*/instan" - + "ces/*/instancePartitions/*}:\001*\022\210\002\n\037ListI" - + "nstancePartitionOperations\022H.google.span" + + "mp\022,\n\010end_time\030\004 \001(\0132\032.google.protobuf.T" + + "imestamp\"\323\001\n\036CreateInstancePartitionRequ" + + "est\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037spanner.goo" + + "gleapis.com/Instance\022\"\n\025instance_partiti" + + "on_id\030\002 \001(\tB\003\340A\002\022T\n\022instance_partition\030\003" + + " \001(\01323.google.spanner.admin.instance.v1." + + "InstancePartitionB\003\340A\002\"n\n\036DeleteInstance" + + "PartitionRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(" + + "spanner.googleapis.com/InstancePartition" + + "\022\014\n\004etag\030\002 \001(\t\"]\n\033GetInstancePartitionRe" + + "quest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(spanner.goo" + + "gleapis.com/InstancePartition\"\253\001\n\036Update" + + "InstancePartitionRequest\022T\n\022instance_par" + + "tition\030\001 \001(\01323.google.spanner.admin.inst" + + "ance.v1.InstancePartitionB\003\340A\002\0223\n\nfield_" + + "mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003" + + "\340A\002\"\201\002\n\037UpdateInstancePartitionMetadata\022" + + "O\n\022instance_partition\030\001 \001(\01323.google.spa" + + "nner.admin.instance.v1.InstancePartition" + + "\022.\n\nstart_time\030\002 \001(\0132\032.google.protobuf.T" + + "imestamp\022/\n\013cancel_time\030\003 \001(\0132\032.google.p" + + "rotobuf.Timestamp\022,\n\010end_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\"\305\001\n\035ListInstance" + + "PartitionsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A" + + "!\n\037spanner.googleapis.com/Instance\022\021\n\tpa" + + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022D\n\033ins" + + "tance_partition_deadline\030\004 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\001\"\240\001\n\036ListInstance" + + "PartitionsResponse\022P\n\023instance_partition" + + "s\030\001 \003(\01323.google.spanner.admin.instance." + + "v1.InstancePartition\022\027\n\017next_page_token\030" + + "\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\355\001\n&ListInsta" + + "ncePartitionOperationsRequest\0227\n\006parent\030" + + "\001 \001(\tB\'\340A\002\372A!\n\037spanner.googleapis.com/In" + + "stance\022\023\n\006filter\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size" + + "\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\022D\n\033" + + "instance_partition_deadline\030\005 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\001\"\236\001\n\'ListInsta" + + "ncePartitionOperationsResponse\0221\n\noperat" + + "ions\030\001 \003(\0132\035.google.longrunning.Operatio" + + "n\022\027\n\017next_page_token\030\002 \001(\t\022\'\n\037unreachabl" + + "e_instance_partitions\030\003 \003(\t\"\222\001\n\023MoveInst" + + "anceRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037spann" + + "er.googleapis.com/Instance\022D\n\rtarget_con" + + "fig\030\002 \001(\tB-\340A\002\372A\'\n%spanner.googleapis.co" + + "m/InstanceConfig\"\026\n\024MoveInstanceResponse" + + "\"\245\001\n\024MoveInstanceMetadata\022\025\n\rtarget_conf" + + "ig\030\001 \001(\t\022E\n\010progress\030\002 \001(\01323.google.span" + + "ner.admin.instance.v1.OperationProgress\022" + + "/\n\013cancel_time\030\003 \001(\0132\032.google.protobuf.T" + + "imestamp2\332\'\n\rInstanceAdmin\022\314\001\n\023ListInsta" + + "nceConfigs\022<.google.spanner.admin.instan" + + "ce.v1.ListInstanceConfigsRequest\032=.googl" + + "e.spanner.admin.instance.v1.ListInstance" + + "ConfigsResponse\"8\332A\006parent\202\323\344\223\002)\022\'/v1/{p" + + "arent=projects/*}/instanceConfigs\022\271\001\n\021Ge" + + "tInstanceConfig\022:.google.spanner.admin.i" + + "nstance.v1.GetInstanceConfigRequest\0320.go" + + "ogle.spanner.admin.instance.v1.InstanceC" + + "onfig\"6\332A\004name\202\323\344\223\002)\022\'/v1/{name=projects" + + "/*/instanceConfigs/*}\022\310\002\n\024CreateInstance" + + "Config\022=.google.spanner.admin.instance.v" + + "1.CreateInstanceConfigRequest\032\035.google.l" + + "ongrunning.Operation\"\321\001\312Ap\n/google.spann" + + "er.admin.instance.v1.InstanceConfig\022=goo" + + "gle.spanner.admin.instance.v1.CreateInst" + + "anceConfigMetadata\332A)parent,instance_con" + + "fig,instance_config_id\202\323\344\223\002,\"\'/v1/{paren" + + "t=projects/*}/instanceConfigs:\001*\022\312\002\n\024Upd" + + "ateInstanceConfig\022=.google.spanner.admin" + + ".instance.v1.UpdateInstanceConfigRequest" + + "\032\035.google.longrunning.Operation\"\323\001\312Ap\n/g" + + "oogle.spanner.admin.instance.v1.Instance" + + "Config\022=google.spanner.admin.instance.v1" + + ".UpdateInstanceConfigMetadata\332A\033instance" + + "_config,update_mask\202\323\344\223\002<27/v1/{instance" + + "_config.name=projects/*/instanceConfigs/" + + "*}:\001*\022\245\001\n\024DeleteInstanceConfig\022=.google." + + "spanner.admin.instance.v1.DeleteInstance" + + "ConfigRequest\032\026.google.protobuf.Empty\"6\332" + + "A\004name\202\323\344\223\002)*\'/v1/{name=projects/*/insta" + + "nceConfigs/*}\022\360\001\n\034ListInstanceConfigOper" + + "ations\022E.google.spanner.admin.instance.v" + + "1.ListInstanceConfigOperationsRequest\032F." + + "google.spanner.admin.instance.v1.ListIns" + + "tanceConfigOperationsResponse\"A\332A\006parent" + + "\202\323\344\223\0022\0220/v1/{parent=projects/*}/instance" + + "ConfigOperations\022\264\001\n\rListInstances\0226.goo" + + "gle.spanner.admin.instance.v1.ListInstan" + + "cesRequest\0327.google.spanner.admin.instan" + + "ce.v1.ListInstancesResponse\"2\332A\006parent\202\323" + + "\344\223\002#\022!/v1/{parent=projects/*}/instances\022" + + "\344\001\n\026ListInstancePartitions\022?.google.span" + + "ner.admin.instance.v1.ListInstancePartit" + + "ionsRequest\032@.google.spanner.admin.insta" + + "nce.v1.ListInstancePartitionsResponse\"G\332" + + "A\006parent\202\323\344\223\0028\0226/v1/{parent=projects/*/i" + + "nstances/*}/instancePartitions\022\241\001\n\013GetIn" + + "stance\0224.google.spanner.admin.instance.v" + + "1.GetInstanceRequest\032*.google.spanner.ad" + + "min.instance.v1.Instance\"0\332A\004name\202\323\344\223\002#\022" + + "!/v1/{name=projects/*/instances/*}\022\234\002\n\016C" + + "reateInstance\0227.google.spanner.admin.ins" + + "tance.v1.CreateInstanceRequest\032\035.google." + + "longrunning.Operation\"\261\001\312Ad\n)google.span" + + "ner.admin.instance.v1.Instance\0227google.s" + + "panner.admin.instance.v1.CreateInstanceM" + + "etadata\332A\033parent,instance_id,instance\202\323\344" + + "\223\002&\"!/v1/{parent=projects/*}/instances:\001" + + "*\022\235\002\n\016UpdateInstance\0227.google.spanner.ad" + + "min.instance.v1.UpdateInstanceRequest\032\035." + + "google.longrunning.Operation\"\262\001\312Ad\n)goog" + + "le.spanner.admin.instance.v1.Instance\0227g" + + "oogle.spanner.admin.instance.v1.UpdateIn" + + "stanceMetadata\332A\023instance,field_mask\202\323\344\223" + + "\002/2*/v1/{instance.name=projects/*/instan" + + "ces/*}:\001*\022\223\001\n\016DeleteInstance\0227.google.sp" + + "anner.admin.instance.v1.DeleteInstanceRe" + + "quest\032\026.google.protobuf.Empty\"0\332A\004name\202\323" + + "\344\223\002#*!/v1/{name=projects/*/instances/*}\022" + + "\232\001\n\014SetIamPolicy\022\".google.iam.v1.SetIamP" + + "olicyRequest\032\025.google.iam.v1.Policy\"O\332A\017" + + "resource,policy\202\323\344\223\0027\"2/v1/{resource=pro" + + "jects/*/instances/*}:setIamPolicy:\001*\022\223\001\n" + + "\014GetIamPolicy\022\".google.iam.v1.GetIamPoli" + + "cyRequest\032\025.google.iam.v1.Policy\"H\332A\010res" + + "ource\202\323\344\223\0027\"2/v1/{resource=projects/*/in" + + "stances/*}:getIamPolicy:\001*\022\305\001\n\022TestIamPe" + + "rmissions\022(.google.iam.v1.TestIamPermiss" + + "ionsRequest\032).google.iam.v1.TestIamPermi" + + "ssionsResponse\"Z\332A\024resource,permissions\202" + + "\323\344\223\002=\"8/v1/{resource=projects/*/instance" + + "s/*}:testIamPermissions:\001*\022\321\001\n\024GetInstan" + + "cePartition\022=.google.spanner.admin.insta" + + "nce.v1.GetInstancePartitionRequest\0323.goo" + + "gle.spanner.admin.instance.v1.InstancePa" + + "rtition\"E\332A\004name\202\323\344\223\0028\0226/v1/{name=projec" + + "ts/*/instances/*/instancePartitions/*}\022\351" + + "\002\n\027CreateInstancePartition\022@.google.span" + + "ner.admin.instance.v1.CreateInstancePart" + + "itionRequest\032\035.google.longrunning.Operat" + + "ion\"\354\001\312Av\n2google.spanner.admin.instance" + + ".v1.InstancePartition\022@google.spanner.ad" + + "min.instance.v1.CreateInstancePartitionM" + + "etadata\332A/parent,instance_partition,inst" + + "ance_partition_id\202\323\344\223\002;\"6/v1/{parent=pro" + + "jects/*/instances/*}/instancePartitions:" + + "\001*\022\272\001\n\027DeleteInstancePartition\022@.google." + + "spanner.admin.instance.v1.DeleteInstance" + + "PartitionRequest\032\026.google.protobuf.Empty" + + "\"E\332A\004name\202\323\344\223\0028*6/v1/{name=projects/*/in" + + "stances/*/instancePartitions/*}\022\352\002\n\027Upda" + + "teInstancePartition\022@.google.spanner.adm" + + "in.instance.v1.UpdateInstancePartitionRe" + + "quest\032\035.google.longrunning.Operation\"\355\001\312" + + "Av\n2google.spanner.admin.instance.v1.Ins" + + "tancePartition\022@google.spanner.admin.ins" + + "tance.v1.UpdateInstancePartitionMetadata" + + "\332A\035instance_partition,field_mask\202\323\344\223\002N2I" + + "/v1/{instance_partition.name=projects/*/" + + "instances/*/instancePartitions/*}:\001*\022\210\002\n" + + "\037ListInstancePartitionOperations\022H.googl" + + "e.spanner.admin.instance.v1.ListInstance" + + "PartitionOperationsRequest\032I.google.span" + "ner.admin.instance.v1.ListInstancePartit" - + "ionOperationsRequest\032I.google.spanner.ad" - + "min.instance.v1.ListInstancePartitionOpe" - + "rationsResponse\"P\332A\006parent\202\323\344\223\002A\022?/v1/{p" - + "arent=projects/*/instances/*}/instancePa" - + "rtitionOperations\022\211\002\n\014MoveInstance\0225.goo" - + "gle.spanner.admin.instance.v1.MoveInstan" - + "ceRequest\032\035.google.longrunning.Operation" - + "\"\242\001\312An\n5google.spanner.admin.instance.v1" - + ".MoveInstanceResponse\0225google.spanner.ad" - + "min.instance.v1.MoveInstanceMetadata\202\323\344\223" - + "\002+\"&/v1/{name=projects/*/instances/*}:mo" - + "ve:\001*\032x\312A\026spanner.googleapis.com\322A\\https" - + "://www.googleapis.com/auth/cloud-platfor" - + "m,https://www.googleapis.com/auth/spanne" - + "r.adminB\213\002\n$com.google.spanner.admin.ins" - + "tance.v1B\031SpannerInstanceAdminProtoP\001ZFc" - + "loud.google.com/go/spanner/admin/instanc" - + "e/apiv1/instancepb;instancepb\252\002&Google.C" - + "loud.Spanner.Admin.Instance.V1\312\002&Google\\" - + "Cloud\\Spanner\\Admin\\Instance\\V1\352\002+Google" - + "::Cloud::Spanner::Admin::Instance::V1b\006p" - + "roto3" + + "ionOperationsResponse\"P\332A\006parent\202\323\344\223\002A\022?" + + "/v1/{parent=projects/*/instances/*}/inst" + + "ancePartitionOperations\022\211\002\n\014MoveInstance" + + "\0225.google.spanner.admin.instance.v1.Move" + + "InstanceRequest\032\035.google.longrunning.Ope" + + "ration\"\242\001\312An\n5google.spanner.admin.insta", + "nce.v1.MoveInstanceResponse\0225google.span" + + "ner.admin.instance.v1.MoveInstanceMetada" + + "ta\202\323\344\223\002+\"&/v1/{name=projects/*/instances" + + "/*}:move:\001*\032x\312A\026spanner.googleapis.com\322A" + + "\\https://www.googleapis.com/auth/cloud-p" + + "latform,https://www.googleapis.com/auth/" + + "spanner.adminB\213\002\n$com.google.spanner.adm" + + "in.instance.v1B\031SpannerInstanceAdminProt" + + "oP\001ZFcloud.google.com/go/spanner/admin/i" + + "nstance/apiv1/instancepb;instancepb\252\002&Go" + + "ogle.Cloud.Spanner.Admin.Instance.V1\312\002&G" + + "oogle\\Cloud\\Spanner\\Admin\\Instance\\V1\352\002+" + + "Google::Cloud::Spanner::Admin::Instance:" + + ":V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -636,6 +669,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "LeaderOptions", "Reconciling", "State", + "FreeInstanceAvailability", + "QuorumType", + "StorageLimitPerProcessingUnit", }); internal_static_google_spanner_admin_instance_v1_InstanceConfig_LabelsEntry_descriptor = internal_static_google_spanner_admin_instance_v1_InstanceConfig_descriptor @@ -723,9 +759,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "AutoscalingConfig", "State", "Labels", + "InstanceType", "EndpointUris", "CreateTime", "UpdateTime", + "FreeInstanceMetadata", "Edition", "DefaultBackupScheduleType", }); @@ -867,8 +905,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Instance", "StartTime", "CancelTime", "EndTime", "ExpectedFulfillmentPeriod", }); - internal_static_google_spanner_admin_instance_v1_CreateInstanceConfigMetadata_descriptor = + internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_descriptor = getDescriptor().getMessageTypes().get(21); + internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_admin_instance_v1_FreeInstanceMetadata_descriptor, + new java.lang.String[] { + "ExpireTime", "UpgradeTime", "ExpireBehavior", + }); + internal_static_google_spanner_admin_instance_v1_CreateInstanceConfigMetadata_descriptor = + getDescriptor().getMessageTypes().get(22); internal_static_google_spanner_admin_instance_v1_CreateInstanceConfigMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_CreateInstanceConfigMetadata_descriptor, @@ -876,7 +922,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InstanceConfig", "Progress", "CancelTime", }); internal_static_google_spanner_admin_instance_v1_UpdateInstanceConfigMetadata_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(23); internal_static_google_spanner_admin_instance_v1_UpdateInstanceConfigMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_UpdateInstanceConfigMetadata_descriptor, @@ -884,7 +930,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InstanceConfig", "Progress", "CancelTime", }); internal_static_google_spanner_admin_instance_v1_InstancePartition_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_google_spanner_admin_instance_v1_InstancePartition_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_InstancePartition_descriptor, @@ -903,7 +949,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ComputeCapacity", }); internal_static_google_spanner_admin_instance_v1_CreateInstancePartitionMetadata_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_google_spanner_admin_instance_v1_CreateInstancePartitionMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_CreateInstancePartitionMetadata_descriptor, @@ -911,7 +957,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InstancePartition", "StartTime", "CancelTime", "EndTime", }); internal_static_google_spanner_admin_instance_v1_CreateInstancePartitionRequest_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_google_spanner_admin_instance_v1_CreateInstancePartitionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_CreateInstancePartitionRequest_descriptor, @@ -919,7 +965,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "InstancePartitionId", "InstancePartition", }); internal_static_google_spanner_admin_instance_v1_DeleteInstancePartitionRequest_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_google_spanner_admin_instance_v1_DeleteInstancePartitionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_DeleteInstancePartitionRequest_descriptor, @@ -927,7 +973,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Etag", }); internal_static_google_spanner_admin_instance_v1_GetInstancePartitionRequest_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_google_spanner_admin_instance_v1_GetInstancePartitionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_GetInstancePartitionRequest_descriptor, @@ -935,7 +981,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_spanner_admin_instance_v1_UpdateInstancePartitionRequest_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_google_spanner_admin_instance_v1_UpdateInstancePartitionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_UpdateInstancePartitionRequest_descriptor, @@ -943,7 +989,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InstancePartition", "FieldMask", }); internal_static_google_spanner_admin_instance_v1_UpdateInstancePartitionMetadata_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_google_spanner_admin_instance_v1_UpdateInstancePartitionMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_UpdateInstancePartitionMetadata_descriptor, @@ -951,7 +997,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InstancePartition", "StartTime", "CancelTime", "EndTime", }); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionsRequest_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_ListInstancePartitionsRequest_descriptor, @@ -959,7 +1005,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", "InstancePartitionDeadline", }); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionsResponse_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_ListInstancePartitionsResponse_descriptor, @@ -967,7 +1013,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InstancePartitions", "NextPageToken", "Unreachable", }); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionOperationsRequest_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionOperationsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_ListInstancePartitionOperationsRequest_descriptor, @@ -975,7 +1021,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Filter", "PageSize", "PageToken", "InstancePartitionDeadline", }); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionOperationsResponse_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_google_spanner_admin_instance_v1_ListInstancePartitionOperationsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_ListInstancePartitionOperationsResponse_descriptor, @@ -983,7 +1029,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Operations", "NextPageToken", "UnreachableInstancePartitions", }); internal_static_google_spanner_admin_instance_v1_MoveInstanceRequest_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_google_spanner_admin_instance_v1_MoveInstanceRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_MoveInstanceRequest_descriptor, @@ -991,13 +1037,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "TargetConfig", }); internal_static_google_spanner_admin_instance_v1_MoveInstanceResponse_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(36); internal_static_google_spanner_admin_instance_v1_MoveInstanceResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_MoveInstanceResponse_descriptor, new java.lang.String[] {}); internal_static_google_spanner_admin_instance_v1_MoveInstanceMetadata_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(37); internal_static_google_spanner_admin_instance_v1_MoveInstanceMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_admin_instance_v1_MoveInstanceMetadata_descriptor, diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/UpdateInstanceConfigRequest.java b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/UpdateInstanceConfigRequest.java index 116b52ef5c3..4ff645580da 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/UpdateInstanceConfigRequest.java +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/java/com/google/spanner/admin/instance/v1/UpdateInstanceConfigRequest.java @@ -24,7 +24,7 @@ * *
            * The request for
          - * [UpdateInstanceConfigRequest][InstanceAdmin.UpdateInstanceConfigRequest].
          + * [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig].
            * 
          * * Protobuf type {@code google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} @@ -413,7 +413,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
              * The request for
          -   * [UpdateInstanceConfigRequest][InstanceAdmin.UpdateInstanceConfigRequest].
          +   * [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig].
              * 
          * * Protobuf type {@code google.spanner.admin.instance.v1.UpdateInstanceConfigRequest} diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/common.proto b/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/common.proto index 69717ec228a..11e00368cc8 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/common.proto +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/common.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.spanner.admin.instance.v1; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Spanner.Admin.Instance.V1"; diff --git a/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto index ba6726b31ba..615a86c6f80 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto +++ b/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto @@ -64,6 +64,9 @@ service InstanceAdmin { "https://www.googleapis.com/auth/spanner.admin"; // Lists the supported instance configurations for a given project. + // + // Returns both Google-managed configurations and user-managed + // configurations. rpc ListInstanceConfigs(ListInstanceConfigsRequest) returns (ListInstanceConfigsResponse) { option (google.api.http) = { @@ -81,7 +84,7 @@ service InstanceAdmin { } // Creates an instance configuration and begins preparing it to be used. The - // returned [long-running operation][google.longrunning.Operation] + // returned long-running operation // can be used to track the progress of preparing the new // instance configuration. The instance configuration name is assigned by the // caller. If the named instance configuration already exists, @@ -108,13 +111,13 @@ service InstanceAdmin { // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] // field becomes false. Its state becomes `READY`. // - // The returned [long-running operation][google.longrunning.Operation] will + // The returned long-running operation will // have a name of the format // `/operations/` and can be used to track // creation of the instance configuration. The - // [metadata][google.longrunning.Operation.metadata] field type is + // metadata field type is // [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - // The [response][google.longrunning.Operation.response] field type is + // The response field type is // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if // successful. // @@ -136,7 +139,7 @@ service InstanceAdmin { } // Updates an instance configuration. The returned - // [long-running operation][google.longrunning.Operation] can be used to track + // long-running operation can be used to track // the progress of updating the instance. If the named instance configuration // does not exist, returns `NOT_FOUND`. // @@ -167,13 +170,13 @@ service InstanceAdmin { // [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] // field becomes false. // - // The returned [long-running operation][google.longrunning.Operation] will + // The returned long-running operation will // have a name of the format // `/operations/` and can be used to track // the instance configuration modification. The - // [metadata][google.longrunning.Operation.metadata] field type is + // metadata field type is // [UpdateInstanceConfigMetadata][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata]. - // The [response][google.longrunning.Operation.response] field type is + // The response field type is // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig], if // successful. // @@ -208,12 +211,12 @@ service InstanceAdmin { option (google.api.method_signature) = "name"; } - // Lists the user-managed instance configuration [long-running - // operations][google.longrunning.Operation] in the given project. An instance + // Lists the user-managed instance configuration long-running + // operations in the given project. An instance // configuration operation has a name of the form // `projects//instanceConfigs//operations/`. // The long-running operation - // [metadata][google.longrunning.Operation.metadata] field type + // metadata field type // `metadata.type_url` describes the type of the metadata. Operations returned // include those that have completed/failed/canceled within the last 7 days, // and pending operations. Operations returned are ordered by @@ -253,7 +256,7 @@ service InstanceAdmin { } // Creates an instance and begins preparing it to begin serving. The - // returned [long-running operation][google.longrunning.Operation] + // returned long-running operation // can be used to track the progress of preparing the new // instance. The instance name is assigned by the caller. If the // named instance already exists, `CreateInstance` returns @@ -279,12 +282,12 @@ service InstanceAdmin { // * The instance's allocated resource levels are readable via the API. // * The instance's state becomes `READY`. // - // The returned [long-running operation][google.longrunning.Operation] will + // The returned long-running operation will // have a name of the format `/operations/` and // can be used to track creation of the instance. The - // [metadata][google.longrunning.Operation.metadata] field type is + // metadata field type is // [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. - // The [response][google.longrunning.Operation.response] field type is + // The response field type is // [Instance][google.spanner.admin.instance.v1.Instance], if successful. rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { @@ -300,8 +303,7 @@ service InstanceAdmin { } // Updates an instance, and begins allocating or releasing resources - // as requested. The returned [long-running - // operation][google.longrunning.Operation] can be used to track the + // as requested. The returned long-running operation can be used to track the // progress of updating the instance. If the named instance does not // exist, returns `NOT_FOUND`. // @@ -329,12 +331,12 @@ service InstanceAdmin { // tables. // * The instance's new resource levels are readable via the API. // - // The returned [long-running operation][google.longrunning.Operation] will + // The returned long-running operation will // have a name of the format `/operations/` and // can be used to track the instance modification. The - // [metadata][google.longrunning.Operation.metadata] field type is + // metadata field type is // [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata]. - // The [response][google.longrunning.Operation.response] field type is + // The response field type is // [Instance][google.spanner.admin.instance.v1.Instance], if successful. // // Authorization requires `spanner.instances.update` permission on @@ -423,7 +425,7 @@ service InstanceAdmin { } // Creates an instance partition and begins preparing it to be used. The - // returned [long-running operation][google.longrunning.Operation] + // returned long-running operation // can be used to track the progress of preparing the new instance partition. // The instance partition name is assigned by the caller. If the named // instance partition already exists, `CreateInstancePartition` returns @@ -450,13 +452,13 @@ service InstanceAdmin { // API. // * The instance partition's state becomes `READY`. // - // The returned [long-running operation][google.longrunning.Operation] will + // The returned long-running operation will // have a name of the format // `/operations/` and can be used to // track creation of the instance partition. The - // [metadata][google.longrunning.Operation.metadata] field type is + // metadata field type is // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - // The [response][google.longrunning.Operation.response] field type is + // The response field type is // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if // successful. rpc CreateInstancePartition(CreateInstancePartitionRequest) @@ -489,8 +491,7 @@ service InstanceAdmin { } // Updates an instance partition, and begins allocating or releasing resources - // as requested. The returned [long-running - // operation][google.longrunning.Operation] can be used to track the + // as requested. The returned long-running operation can be used to track the // progress of updating the instance partition. If the named instance // partition does not exist, returns `NOT_FOUND`. // @@ -519,13 +520,13 @@ service InstanceAdmin { // partition's tables. // * The instance partition's new resource levels are readable via the API. // - // The returned [long-running operation][google.longrunning.Operation] will + // The returned long-running operation will // have a name of the format // `/operations/` and can be used to // track the instance partition modification. The - // [metadata][google.longrunning.Operation.metadata] field type is + // metadata field type is // [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata]. - // The [response][google.longrunning.Operation.response] field type is + // The response field type is // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if // successful. // @@ -545,12 +546,11 @@ service InstanceAdmin { }; } - // Lists instance partition [long-running - // operations][google.longrunning.Operation] in the given instance. + // Lists instance partition long-running operations in the given instance. // An instance partition operation has a name of the form // `projects//instances//instancePartitions//operations/`. // The long-running operation - // [metadata][google.longrunning.Operation.metadata] field type + // metadata field type // `metadata.type_url` describes the type of the metadata. Operations returned // include those that have completed/failed/canceled within the last 7 days, // and pending operations. Operations returned are ordered by @@ -569,7 +569,7 @@ service InstanceAdmin { } // Moves an instance to the target instance configuration. You can use the - // returned [long-running operation][google.longrunning.Operation] to track + // returned long-running operation to track // the progress of moving the instance. // // `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of @@ -600,13 +600,13 @@ service InstanceAdmin { // transaction abort rate. However, moving an instance doesn't cause any // downtime. // - // The returned [long-running operation][google.longrunning.Operation] has + // The returned long-running operation has // a name of the format // `/operations/` and can be used to track // the move instance operation. The - // [metadata][google.longrunning.Operation.metadata] field type is + // metadata field type is // [MoveInstanceMetadata][google.spanner.admin.instance.v1.MoveInstanceMetadata]. - // The [response][google.longrunning.Operation.response] field type is + // The response field type is // [Instance][google.spanner.admin.instance.v1.Instance], // if successful. // Cancelling the operation sets its metadata's @@ -676,7 +676,7 @@ message ReplicaInfo { WITNESS = 3; } - // The location of the serving resources, e.g. "us-central1". + // The location of the serving resources, e.g., "us-central1". string location = 1; // The type of replica. @@ -695,6 +695,8 @@ message InstanceConfig { option (google.api.resource) = { type: "spanner.googleapis.com/InstanceConfig" pattern: "projects/{project}/instanceConfigs/{instance_config}" + plural: "instanceConfigs" + singular: "instanceConfig" }; // The type of this configuration. @@ -702,10 +704,10 @@ message InstanceConfig { // Unspecified. TYPE_UNSPECIFIED = 0; - // Google managed configuration. + // Google-managed configuration. GOOGLE_MANAGED = 1; - // User managed configuration. + // User-managed configuration. USER_MANAGED = 2; } @@ -722,6 +724,53 @@ message InstanceConfig { READY = 2; } + // Describes the availability for free instances to be created in an instance + // configuration. + enum FreeInstanceAvailability { + // Not specified. + FREE_INSTANCE_AVAILABILITY_UNSPECIFIED = 0; + + // Indicates that free instances are available to be created in this + // instance configuration. + AVAILABLE = 1; + + // Indicates that free instances are not supported in this instance + // configuration. + UNSUPPORTED = 2; + + // Indicates that free instances are currently not available to be created + // in this instance configuration. + DISABLED = 3; + + // Indicates that additional free instances cannot be created in this + // instance configuration because the project has reached its limit of free + // instances. + QUOTA_EXCEEDED = 4; + } + + // Indicates the quorum type of this instance configuration. + enum QuorumType { + // Quorum type not specified. + QUORUM_TYPE_UNSPECIFIED = 0; + + // An instance configuration tagged with `REGION` quorum type forms a write + // quorum in a single region. + REGION = 1; + + // An instance configuration tagged with the `DUAL_REGION` quorum type forms + // a write quorum with exactly two read-write regions in a multi-region + // configuration. + // + // This instance configuration requires failover in the event of + // regional failures. + DUAL_REGION = 2; + + // An instance configuration tagged with the `MULTI_REGION` quorum type + // forms a write quorum from replicas that are spread across more than one + // region in a multi-region configuration. + MULTI_REGION = 3; + } + // A unique identifier for the instance configuration. Values // are of the form // `projects//instanceConfigs/[a-z][-a-z0-9]*`. @@ -738,17 +787,22 @@ message InstanceConfig { // The geographic placement of nodes in this instance configuration and their // replication properties. + // + // To create user-managed configurations, input + // `replicas` must include all replicas in `replicas` of the `base_config` + // and include one or more replicas in the `optional_replicas` of the + // `base_config`. repeated ReplicaInfo replicas = 3; - // Output only. The available optional replicas to choose from for user - // managed configurations. Populated for Google managed configurations. + // Output only. The available optional replicas to choose from for + // user-managed configurations. Populated for Google-managed configurations. repeated ReplicaInfo optional_replicas = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Base configuration name, e.g. projects//instanceConfigs/nam3, - // based on which this configuration is created. Only set for user managed + // based on which this configuration is created. Only set for user-managed // configurations. `base_config` must refer to a configuration of type - // GOOGLE_MANAGED in the same project as this configuration. + // `GOOGLE_MANAGED` in the same project as this configuration. string base_config = 7 [(google.api.resource_reference) = { type: "spanner.googleapis.com/InstanceConfig" }]; @@ -801,6 +855,18 @@ message InstanceConfig { // Output only. The current instance configuration state. Applicable only for // `USER_MANAGED` configurations. State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes whether free instances are available to be created + // in this instance configuration. + FreeInstanceAvailability free_instance_availability = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The `QuorumType` of the instance configuration. + QuorumType quorum_type = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The storage limit in bytes per processing unit. + int64 storage_limit_per_processing_unit = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // ReplicaComputeCapacity describes the amount of server resources that are @@ -877,7 +943,7 @@ message AutoscalingConfig { // Required. The target storage utilization percentage that the autoscaler // should be trying to achieve for the instance. This number is on a scale // from 0 (no utilization) to 100 (full utilization). The valid range is - // [10, 100] inclusive. + // [10, 99] inclusive. int32 storage_utilization_percent = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -939,6 +1005,8 @@ message Instance { option (google.api.resource) = { type: "spanner.googleapis.com/Instance" pattern: "projects/{project}/instances/{instance}" + plural: "instances" + singular: "instance" }; // Indicates the current state of the instance. @@ -956,6 +1024,24 @@ message Instance { READY = 2; } + // The type of this instance. The type can be used to distinguish product + // variants, that can affect aspects like: usage restrictions, quotas and + // billing. Currently this is used to distinguish FREE_INSTANCE vs PROVISIONED + // instances. + enum InstanceType { + // Not specified. + INSTANCE_TYPE_UNSPECIFIED = 0; + + // Provisioned instances have dedicated resources, standard usage limits and + // support. + PROVISIONED = 1; + + // Free instances provide no guarantee for dedicated resources, + // [node_count, processing_units] should be 0. They come + // with stricter usage limits and limited support. + FREE_INSTANCE = 2; + } + // The edition selected for this instance. Different editions provide // different capabilities at different price points. enum Edition { @@ -972,21 +1058,22 @@ message Instance { ENTERPRISE_PLUS = 3; } - // Indicates the default backup behavior for new databases within the - // instance. + // Indicates the + // [default backup + // schedule](https://cloud.google.com/spanner/docs/backup#default-backup-schedules) + // behavior for new databases within the instance. enum DefaultBackupScheduleType { // Not specified. DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0; - // No default backup schedule will be created automatically on creation of a - // database within the instance. + // A default backup schedule isn't created automatically when a new database + // is created in the instance. NONE = 1; - // A default backup schedule will be created automatically on creation of a - // database within the instance. The default backup schedule creates a full - // backup every 24 hours and retains the backup for a period of 7 days. Once - // created, the default backup schedule can be edited/deleted similar to any - // other backup schedule. + // A default backup schedule is created automatically when a new database + // is created in the instance. The default backup schedule creates a full + // backup every 24 hours. These full backups are retained for 7 days. + // You can edit or delete the default backup schedule once it's created. AUTOMATIC = 2; } @@ -1023,9 +1110,6 @@ message Instance { // This might be zero in API responses for instances that are not yet in the // `READY` state. // - // If the instance has varying node count across replicas (achieved by - // setting asymmetric_autoscaling_options in autoscaling config), the - // node_count here is the maximum node count across all replicas. // // For more information, see // [Compute capacity, nodes, and processing @@ -1045,10 +1129,6 @@ message Instance { // This might be zero in API responses for instances that are not yet in the // `READY` state. // - // If the instance has varying processing units per replica - // (achieved by setting asymmetric_autoscaling_options in autoscaling config), - // the processing_units here is the maximum processing units across all - // replicas. // // For more information, see // [Compute capacity, nodes and processing @@ -1098,6 +1178,9 @@ message Instance { // allow "_" in a future release. map labels = 7; + // The `InstanceType` of the current instance. + InstanceType instance_type = 10; + // Deprecated. This field is not populated. repeated string endpoint_uris = 8; @@ -1109,18 +1192,22 @@ message Instance { google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Free instance metadata. Only populated for free instances. + FreeInstanceMetadata free_instance_metadata = 13; + // Optional. The `Edition` of the current instance. Edition edition = 20 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Controls the default backup behavior for new databases within the - // instance. + // Optional. Controls the default backup schedule behavior for new databases + // within the instance. By default, a backup schedule is created automatically + // when a new database is created in a new instance. // - // Note that `AUTOMATIC` is not permitted for free instances, as backups and - // backup schedules are not allowed for free instances. + // Note that the `AUTOMATIC` value isn't permitted for free instances, + // as backups and backup schedules aren't supported for free instances. // // In the `GetInstance` or `ListInstances` response, if the value of - // default_backup_schedule_type is unset or NONE, no default backup - // schedule will be created for new databases within the instance. + // `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't + // create a default backup schedule for new databases in the instance. DefaultBackupScheduleType default_backup_schedule_type = 23 [(google.api.field_behavior) = OPTIONAL]; } @@ -1175,7 +1262,7 @@ message GetInstanceConfigRequest { } // The request for -// [CreateInstanceConfigRequest][InstanceAdmin.CreateInstanceConfigRequest]. +// [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. message CreateInstanceConfigRequest { // Required. The name of the project in which to create the instance // configuration. Values are of the form `projects/`. @@ -1192,10 +1279,10 @@ message CreateInstanceConfigRequest { // conflicts with Google-managed configurations. string instance_config_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The InstanceConfig proto of the configuration to create. - // instance_config.name must be + // Required. The `InstanceConfig` proto of the configuration to create. + // `instance_config.name` must be // `/instanceConfigs/`. - // instance_config.base_config must be a Google managed configuration name, + // `instance_config.base_config` must be a Google-managed configuration name, // e.g. /instanceConfigs/us-east1, /instanceConfigs/nam3. InstanceConfig instance_config = 3 [(google.api.field_behavior) = REQUIRED]; @@ -1205,7 +1292,7 @@ message CreateInstanceConfigRequest { } // The request for -// [UpdateInstanceConfigRequest][InstanceAdmin.UpdateInstanceConfigRequest]. +// [UpdateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstanceConfig]. message UpdateInstanceConfigRequest { // Required. The user instance configuration to update, which must always // include the instance configuration name. Otherwise, only fields mentioned @@ -1231,7 +1318,7 @@ message UpdateInstanceConfigRequest { } // The request for -// [DeleteInstanceConfigRequest][InstanceAdmin.DeleteInstanceConfigRequest]. +// [DeleteInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstanceConfig]. message DeleteInstanceConfigRequest { // Required. The name of the instance configuration to be deleted. // Values are of the form @@ -1277,8 +1364,7 @@ message ListInstanceConfigOperationsRequest { // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. // Colon `:` is the contains operator. Filter rules are not case sensitive. // - // The following fields in the [Operation][google.longrunning.Operation] - // are eligible for filtering: + // The following fields in the Operation are eligible for filtering: // // * `name` - The name of the long-running operation // * `done` - False if the operation is in progress, else true. @@ -1329,10 +1415,10 @@ message ListInstanceConfigOperationsRequest { // The response for // [ListInstanceConfigOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigOperations]. message ListInstanceConfigOperationsResponse { - // The list of matching instance configuration [long-running - // operations][google.longrunning.Operation]. Each operation's name will be + // The list of matching instance configuration long-running operations. Each + // operation's name will be // prefixed by the name of the instance configuration. The operation's - // [metadata][google.longrunning.Operation.metadata] field type + // metadata field type // `metadata.type_url` describes the type of the metadata. repeated google.longrunning.Operation operations = 1; @@ -1530,6 +1616,41 @@ message UpdateInstanceMetadata { FulfillmentPeriod expected_fulfillment_period = 5; } +// Free instance specific metadata that is kept even after an instance has been +// upgraded for tracking purposes. +message FreeInstanceMetadata { + // Allows users to change behavior when a free instance expires. + enum ExpireBehavior { + // Not specified. + EXPIRE_BEHAVIOR_UNSPECIFIED = 0; + + // When the free instance expires, upgrade the instance to a provisioned + // instance. + FREE_TO_PROVISIONED = 1; + + // When the free instance expires, disable the instance, and delete it + // after the grace period passes if it has not been upgraded. + REMOVE_AFTER_GRACE_PERIOD = 2; + } + + // Output only. Timestamp after which the instance will either be upgraded or + // scheduled for deletion after a grace period. ExpireBehavior is used to + // choose between upgrading or scheduling the free instance for deletion. This + // timestamp is set during the creation of a free instance. + google.protobuf.Timestamp expire_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, the timestamp at which the free instance was + // upgraded to a provisioned instance. + google.protobuf.Timestamp upgrade_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Specifies the expiration behavior of a free instance. The default of + // ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during + // or after creation, and before expiration. + ExpireBehavior expire_behavior = 3; +} + // Metadata type for the operation returned by // [CreateInstanceConfig][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig]. message CreateInstanceConfigMetadata { @@ -1566,6 +1687,8 @@ message InstancePartition { option (google.api.resource) = { type: "spanner.googleapis.com/InstancePartition" pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}" + plural: "instancePartitions" + singular: "instancePartition" }; // Indicates the current state of the instance partition. @@ -1607,15 +1730,16 @@ message InstancePartition { string display_name = 3 [(google.api.field_behavior) = REQUIRED]; // Compute capacity defines amount of server and storage resources that are - // available to the databases in an instance partition. At most one of either - // node_count or processing_units should be present in the message. See [the - // documentation](https://cloud.google.com/spanner/docs/compute-capacity) - // for more information about nodes and processing units. + // available to the databases in an instance partition. At most, one of either + // `node_count` or` processing_units` should be present in the message. For + // more information, see + // [Compute capacity, nodes, and processing + // units](https://cloud.google.com/spanner/docs/compute-capacity). oneof compute_capacity { // The number of nodes allocated to this instance partition. // - // Users can set the node_count field to specify the target number of nodes - // allocated to the instance partition. + // Users can set the `node_count` field to specify the target number of + // nodes allocated to the instance partition. // // This may be zero in API responses for instance partitions that are not // yet in state `READY`. @@ -1623,11 +1747,11 @@ message InstancePartition { // The number of processing units allocated to this instance partition. // - // Users can set the processing_units field to specify the target number of - // processing units allocated to the instance partition. + // Users can set the `processing_units` field to specify the target number + // of processing units allocated to the instance partition. // - // This may be zero in API responses for instance partitions that are not - // yet in state `READY`. + // This might be zero in API responses for instance partitions that are not + // yet in the `READY` state. int32 processing_units = 6; } @@ -1650,12 +1774,13 @@ message InstancePartition { repeated string referencing_databases = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Deprecated: This field is not populated. // Output only. The names of the backups that reference this instance // partition. Referencing backups should share the parent instance. The // existence of any referencing backup prevents the instance partition from // being deleted. repeated string referencing_backups = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; // Used for optimistic concurrency control as a way // to help prevent simultaneous updates of a instance partition from @@ -1793,7 +1918,9 @@ message UpdateInstancePartitionMetadata { // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]. message ListInstancePartitionsRequest { // Required. The instance whose instance partitions should be listed. Values - // are of the form `projects//instances/`. + // are of the form `projects//instances/`. Use `{instance} + // = '-'` to list instance partitions for all Instances in a project, e.g., + // `projects/myproject/instances/-`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1832,9 +1959,9 @@ message ListInstancePartitionsResponse { // call to fetch more of the matching instance partitions. string next_page_token = 2; - // The list of unreachable instance partitions. - // It includes the names of instance partitions whose metadata could - // not be retrieved within + // The list of unreachable instances or instance partitions. + // It includes the names of instances or instance partitions whose metadata + // could not be retrieved within // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline]. repeated string unreachable = 3; } @@ -1859,8 +1986,7 @@ message ListInstancePartitionOperationsRequest { // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. // Colon `:` is the contains operator. Filter rules are not case sensitive. // - // The following fields in the [Operation][google.longrunning.Operation] - // are eligible for filtering: + // The following fields in the Operation are eligible for filtering: // // * `name` - The name of the long-running operation // * `done` - False if the operation is in progress, else true. @@ -1910,7 +2036,8 @@ message ListInstancePartitionOperationsRequest { // Optional. Deadline used while retrieving metadata for instance partition // operations. Instance partitions whose operation metadata cannot be // retrieved within this deadline will be added to - // [unreachable][ListInstancePartitionOperationsResponse.unreachable] in + // [unreachable_instance_partitions][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.unreachable_instance_partitions] + // in // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]. google.protobuf.Timestamp instance_partition_deadline = 5 [(google.api.field_behavior) = OPTIONAL]; @@ -1919,10 +2046,10 @@ message ListInstancePartitionOperationsRequest { // The response for // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]. message ListInstancePartitionOperationsResponse { - // The list of matching instance partition [long-running - // operations][google.longrunning.Operation]. Each operation's name will be + // The list of matching instance partition long-running operations. Each + // operation's name will be // prefixed by the instance partition's name. The operation's - // [metadata][google.longrunning.Operation.metadata] field type + // metadata field type // `metadata.type_url` describes the type of the metadata. repeated google.longrunning.Operation operations = 1; From aa70fb76c72ecb8fa6148e10d93a9561448aa62a Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Thu, 26 Dec 2024 17:41:14 +0530 Subject: [PATCH 33/43] feat: support for UUID type --- .../cloud/spanner/AbstractResultSet.java | 11 + .../cloud/spanner/AbstractStructReader.java | 31 ++ .../cloud/spanner/ForwardingStructReader.java | 25 + .../com/google/cloud/spanner/GrpcStruct.java | 27 ++ .../com/google/cloud/spanner/ResultSets.java | 21 + .../java/com/google/cloud/spanner/Struct.java | 15 + .../google/cloud/spanner/StructReader.java | 9 + .../java/com/google/cloud/spanner/Type.java | 9 + .../java/com/google/cloud/spanner/Value.java | 59 +++ .../com/google/cloud/spanner/ValueBinder.java | 10 + .../connection/DirectExecuteResultSet.java | 24 + .../ReplaceableForwardingResultSet.java | 25 + .../AbstractStructReaderTypesTest.java | 25 + .../cloud/spanner/GrpcResultSetTest.java | 41 +- .../cloud/spanner/MockSpannerServiceImpl.java | 17 + .../google/cloud/spanner/ResultSetsTest.java | 28 ++ .../com/google/cloud/spanner/TypeTest.java | 25 + .../google/cloud/spanner/ValueBinderTest.java | 7 + .../com/google/cloud/spanner/ValueTest.java | 47 ++ .../connection/ChecksumResultSetTest.java | 16 + .../connection/RandomResultSetGenerator.java | 10 + .../google/cloud/spanner/it/ITQueryTest.java | 63 +++ .../google/cloud/spanner/it/ITUuidTest.java | 452 ++++++++++++++++++ 23 files changed, 996 insertions(+), 1 deletion(-) create mode 100644 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java index 3dca970f96e..957bc806430 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java @@ -38,6 +38,7 @@ import java.util.Iterator; import java.util.List; import java.util.Objects; +import java.util.UUID; import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -430,6 +431,11 @@ protected Date getDateInternal(int columnIndex) { return currRow().getDateInternal(columnIndex); } + @Override + protected UUID getUuidInternal(int columnIndex) { + return currRow().getUuidInternal(columnIndex); + } + @Override protected Value getValueInternal(int columnIndex) { return currRow().getValueInternal(columnIndex); @@ -522,6 +528,11 @@ protected List getDateListInternal(int columnIndex) { return currRow().getDateListInternal(columnIndex); } + @Override + protected List getUuidListInternal(int columnIndex) { + return currRow().getUuidListInternal(columnIndex); + } + @Override protected List getStructListInternal(int columnIndex) { return currRow().getStructListInternal(columnIndex); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java index d13c61aaf01..8841d4a6694 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java @@ -28,6 +28,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -67,6 +68,8 @@ protected String getPgJsonbInternal(int columnIndex) { protected abstract Date getDateInternal(int columnIndex); + protected abstract UUID getUuidInternal(int columnIndex); + protected T getProtoMessageInternal(int columnIndex, T message) { throw new UnsupportedOperationException("Not implemented"); } @@ -128,6 +131,8 @@ protected List getPgJsonbListInternal(int columnIndex) { protected abstract List getDateListInternal(int columnIndex); + protected abstract List getUuidListInternal(int columnIndex); + protected abstract List getStructListInternal(int columnIndex); @Override @@ -299,6 +304,19 @@ public Date getDate(String columnName) { return getDateInternal(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + checkNonNullOfType(columnIndex, Type.uuid(), columnIndex); + return getUuidInternal(columnIndex); + } + + @Override + public UUID getUuid(String columnName) { + final int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, Type.uuid(), columnName); + return getUuid(columnIndex); + } + @Override public T getProtoEnum( int columnIndex, Function method) { @@ -583,6 +601,19 @@ public List getDateList(String columnName) { return getDateListInternal(columnIndex); } + @Override + public List getUuidList(int columnIndex) { + checkNonNullOfType(columnIndex, Type.array(Type.uuid()), columnIndex); + return getUuidListInternal(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + final int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, Type.array(Type.uuid()), columnName); + return getUuidList(columnIndex); + } + @Override public List getStructList(int columnIndex) { checkNonNullArrayOfStruct(columnIndex, columnIndex); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java index b3e37ffcddb..edbf0d564d2 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java @@ -26,6 +26,7 @@ import com.google.protobuf.ProtocolMessageEnum; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** Forwarding implements of StructReader */ @@ -225,12 +226,24 @@ public Date getDate(int columnIndex) { return delegate.get().getDate(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + checkValidState(); + return delegate.get().getUuid(columnIndex); + } + @Override public Date getDate(String columnName) { checkValidState(); return delegate.get().getDate(columnName); } + @Override + public UUID getUuid(String columnName) { + checkValidState(); + return delegate.get().getUuid(columnName); + } + @Override public boolean[] getBooleanArray(int columnIndex) { checkValidState(); @@ -409,6 +422,18 @@ public List getDateList(String columnName) { return delegate.get().getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + checkValidState(); + return delegate.get().getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + checkValidState(); + return delegate.get().getUuidList(columnName); + } + @Override public List getProtoMessageList(int columnIndex, T message) { checkValidState(); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java index 4d07a12880c..ec052e4044e 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java @@ -49,6 +49,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; import java.util.stream.Collectors; @@ -131,6 +132,9 @@ private Object writeReplace() { case DATE: builder.set(fieldName).to((Date) value); break; + case UUID: + builder.set(fieldName).to((UUID) value); + break; case ARRAY: final Type elementType = fieldType.getArrayElementType(); switch (elementType.getCode()) { @@ -184,6 +188,9 @@ private Object writeReplace() { case DATE: builder.set(fieldName).toDateArray((Iterable) value); break; + case UUID: + builder.set(fieldName).toUuidArray((Iterable) value); + break; case STRUCT: builder.set(fieldName).toStructArray(elementType, (Iterable) value); break; @@ -298,6 +305,9 @@ private static Object decodeValue(Type fieldType, com.google.protobuf.Value prot case DATE: checkType(fieldType, proto, KindCase.STRING_VALUE); return Date.parseDate(proto.getStringValue()); + case UUID: + checkType(fieldType, proto, KindCase.STRING_VALUE); + return UUID.fromString(proto.getStringValue()); case ARRAY: checkType(fieldType, proto, KindCase.LIST_VALUE); ListValue listValue = proto.getListValue(); @@ -347,6 +357,7 @@ static Object decodeArrayValue(Type elementType, ListValue listValue) { case BYTES: case TIMESTAMP: case DATE: + case UUID: case STRUCT: case PROTO: return Lists.transform(listValue.getValuesList(), input -> decodeValue(elementType, input)); @@ -503,6 +514,12 @@ protected Date getDateInternal(int columnIndex) { return (Date) rowData.get(columnIndex); } + @Override + protected UUID getUuidInternal(int columnIndex) { + ensureDecoded(columnIndex); + return (UUID) rowData.get(columnIndex); + } + private boolean isUnrecognizedType(int columnIndex) { return type.getStructFields().get(columnIndex).getType().getCode() == Code.UNRECOGNIZED; } @@ -624,6 +641,8 @@ protected Value getValueInternal(int columnIndex) { return Value.timestamp(isNull ? null : getTimestampInternal(columnIndex)); case DATE: return Value.date(isNull ? null : getDateInternal(columnIndex)); + case UUID: + return Value.uuid(isNull ? null : getUuidInternal(columnIndex)); case STRUCT: return Value.struct(isNull ? null : getStructInternal(columnIndex)); case UNRECOGNIZED: @@ -664,6 +683,8 @@ protected Value getValueInternal(int columnIndex) { return Value.timestampArray(isNull ? null : getTimestampListInternal(columnIndex)); case DATE: return Value.dateArray(isNull ? null : getDateListInternal(columnIndex)); + case UUID: + return Value.uuidArray(isNull ? null : getUuidListInternal(columnIndex)); case STRUCT: return Value.structArray( elementType, isNull ? null : getStructListInternal(columnIndex)); @@ -847,6 +868,12 @@ protected List getDateListInternal(int columnIndex) { return Collections.unmodifiableList((List) rowData.get(columnIndex)); } + @Override + protected List getUuidListInternal(int columnIndex) { + ensureDecoded(columnIndex); + return Collections.unmodifiableList((List) rowData.get(columnIndex)); + } + @Override @SuppressWarnings("unchecked") // We know ARRAY> produces a List. protected List getStructListInternal(int columnIndex) { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java index 3d12cf5ad2c..39b73fec3a5 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java @@ -35,6 +35,7 @@ import com.google.spanner.v1.ResultSetStats; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** Utility methods for working with {@link com.google.cloud.spanner.ResultSet}. */ @@ -321,11 +322,21 @@ public Date getDate(int columnIndex) { return getCurrentRowAsStruct().getDate(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + return getCurrentRowAsStruct().getUuid(columnIndex); + } + @Override public Date getDate(String columnName) { return getCurrentRowAsStruct().getDate(columnName); } + @Override + public UUID getUuid(String columnName) { + return getCurrentRowAsStruct().getUuid(columnName); + } + @Override public T getProtoMessage(int columnIndex, T message) { return getCurrentRowAsStruct().getProtoMessage(columnIndex, message); @@ -508,6 +519,16 @@ public List getDateList(String columnName) { return getCurrentRowAsStruct().getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + return getCurrentRowAsStruct().getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnNameÏ) { + return getCurrentRowAsStruct().getUuidList(columnNameÏ); + } + @Override public List getProtoMessageList(int columnIndex, T message) { return getCurrentRowAsStruct().getProtoMessageList(columnIndex, message); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java index 112ecc8120c..d44a12e7291 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.UUID; import java.util.function.Function; import javax.annotation.concurrent.Immutable; @@ -226,6 +227,11 @@ protected Date getDateInternal(int columnIndex) { return values.get(columnIndex).getDate(); } + @Override + protected UUID getUuidInternal(int columnIndex) { + return values.get(columnIndex).getUuid(); + } + @Override protected T getProtoMessageInternal(int columnIndex, T message) { return values.get(columnIndex).getProtoMessage(message); @@ -334,6 +340,11 @@ protected List getDateListInternal(int columnIndex) { return values.get(columnIndex).getDateArray(); } + @Override + protected List getUuidListInternal(int columnIndex) { + return values.get(columnIndex).getUuidArray(); + } + @Override protected List getStructListInternal(int columnIndex) { return values.get(columnIndex).getStructArray(); @@ -420,6 +431,8 @@ private Object getAsObject(int columnIndex) { return getTimestampInternal(columnIndex); case DATE: return getDateInternal(columnIndex); + case UUID: + return getUuidInternal(columnIndex); case STRUCT: return getStructInternal(columnIndex); case ARRAY: @@ -451,6 +464,8 @@ private Object getAsObject(int columnIndex) { return getTimestampListInternal(columnIndex); case DATE: return getDateListInternal(columnIndex); + case UUID: + return getUuidListInternal(columnIndex); case STRUCT: return getStructListInternal(columnIndex); default: diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java index f9967db0451..ce2ca3209c7 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java @@ -23,6 +23,7 @@ import com.google.protobuf.ProtocolMessageEnum; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -291,12 +292,16 @@ default T getProtoEnum( */ Date getDate(int columnIndex); + UUID getUuid(int columnIndex); + /** * @param columnName name of the column * @return the value of a non-{@code NULL} column with type {@link Type#date()}. */ Date getDate(String columnName); + UUID getUuid(String columnName); + /** * @param columnIndex index of the column * @return the value of a nullable column as a {@link Value}. @@ -625,6 +630,10 @@ default List getProtoEnumList( */ List getDateList(String columnName); + List getUuidList(int columnIndex); + + List getUuidList(String columnNameÏ); + /** * @param columnIndex index of the column * @return the value of a non-{@code NULL} column with type {@code Type.array(Type.struct(...))} diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java index 748cb7f87ec..2db28dad727 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java @@ -59,6 +59,7 @@ public final class Type implements Serializable { private static final Type TYPE_BYTES = new Type(Code.BYTES, null, null); private static final Type TYPE_TIMESTAMP = new Type(Code.TIMESTAMP, null, null); private static final Type TYPE_DATE = new Type(Code.DATE, null, null); + private static final Type TYPE_UUID = new Type(Code.UUID, null, null); private static final Type TYPE_ARRAY_BOOL = new Type(Code.ARRAY, TYPE_BOOL, null); private static final Type TYPE_ARRAY_INT64 = new Type(Code.ARRAY, TYPE_INT64, null); private static final Type TYPE_ARRAY_FLOAT32 = new Type(Code.ARRAY, TYPE_FLOAT32, null); @@ -72,6 +73,7 @@ public final class Type implements Serializable { private static final Type TYPE_ARRAY_BYTES = new Type(Code.ARRAY, TYPE_BYTES, null); private static final Type TYPE_ARRAY_TIMESTAMP = new Type(Code.ARRAY, TYPE_TIMESTAMP, null); private static final Type TYPE_ARRAY_DATE = new Type(Code.ARRAY, TYPE_DATE, null); + private static final Type TYPE_ARRAY_UUID = new Type(Code.ARRAY, TYPE_UUID, null); private static final int AMBIGUOUS_FIELD = -1; private static final long serialVersionUID = -3076152125004114582L; @@ -183,6 +185,8 @@ public static Type date() { return TYPE_DATE; } + public static Type uuid() { return TYPE_UUID;} + /** Returns a descriptor for an array of {@code elementType}. */ public static Type array(Type elementType) { Preconditions.checkNotNull(elementType); @@ -213,6 +217,8 @@ public static Type array(Type elementType) { return TYPE_ARRAY_TIMESTAMP; case DATE: return TYPE_ARRAY_DATE; + case UUID: + return TYPE_ARRAY_UUID; default: return new Type(Code.ARRAY, elementType, null); } @@ -295,6 +301,7 @@ public enum Code { BYTES(TypeCode.BYTES, "bytea"), TIMESTAMP(TypeCode.TIMESTAMP, "timestamp with time zone"), DATE(TypeCode.DATE, "date"), + UUID(TypeCode.UUID, "uuid"), ARRAY(TypeCode.ARRAY, "array"), STRUCT(TypeCode.STRUCT, "struct"); @@ -610,6 +617,8 @@ static Type fromProto(com.google.spanner.v1.Type proto) { return timestamp(); case DATE: return date(); + case UUID: + return uuid(); case PROTO: return proto(proto.getProtoTypeFqn()); case ENUM: diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java index c2c851d6dd8..9b236765ed7 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java @@ -47,6 +47,7 @@ import java.util.Collections; import java.util.List; import java.util.Objects; +import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nonnull; @@ -386,6 +387,8 @@ public static Value date(@Nullable Date v) { return new DateImpl(v == null, v); } + public static Value uuid(@Nullable UUID v) { return new UuidImpl(v == null, v); } + /** Returns a non-{@code NULL} {#code STRUCT} value. */ public static Value struct(Struct v) { Preconditions.checkNotNull(v, "Illegal call to create a NULL struct value."); @@ -776,6 +779,10 @@ public static Value dateArray(@Nullable Iterable v) { return new DateArrayImpl(v == null, v == null ? null : immutableCopyOf(v)); } + public static Value uuidArray(@Nullable Iterable v) { + return new UuidArrayImpl(v == null, v == null ? null : immutableCopyOf(v)); + } + /** * Returns an {@code ARRAY>} value. * @@ -915,6 +922,8 @@ public T getProtoEnum( */ public abstract Date getDate(); + public abstract UUID getUuid(); + /** * Returns the value of a {@code STRUCT}-typed instance. * @@ -1035,6 +1044,8 @@ public List getProtoEnumArray( */ public abstract List getDateArray(); + public abstract List getUuidArray(); + /** * Returns the value of an {@code ARRAY>}-typed instance. While the returned list * itself will never be {@code null}, elements of that list may be null. @@ -1314,6 +1325,11 @@ public Date getDate() { throw defaultGetter(Type.date()); } + @Override + public UUID getUuid() { + throw defaultGetter(Type.uuid()); + } + @Override public Struct getStruct() { if (getType().getCode() != Type.Code.STRUCT) { @@ -1378,6 +1394,9 @@ public List getDateArray() { throw defaultGetter(Type.array(Type.date())); } + @Override + public List getUuidArray() { throw defaultGetter(Type.array(Type.uuid()));} + @Override public List getStructArray() { if (getType().getCode() != Type.Code.ARRAY @@ -1795,6 +1814,24 @@ void valueToString(StringBuilder b) { } } + private static class UuidImpl extends AbstractObjectValue { + + private UuidImpl(boolean isNull, UUID value) { + super(isNull, Type.uuid(), value); + } + + @Override + public UUID getUuid() { + checkNotNull(); + return value; + } + + @Override + void valueToString(StringBuilder b) { + b.append(value); + } + } + private static class StringImpl extends AbstractObjectValue { private StringImpl(boolean isNull, @Nullable String value) { @@ -2797,6 +2834,24 @@ void appendElement(StringBuilder b, Date element) { } } + private static class UuidArrayImpl extends AbstractArrayValue { + + private UuidArrayImpl(boolean isNull, @Nullable List values) { + super(isNull, Type.uuid(), values); + } + + @Override + public List getUuidArray() { + checkNotNull(); + return value; + } + + @Override + void appendElement(StringBuilder b, UUID element) { + b.append(element); + } + } + private static class NumericArrayImpl extends AbstractArrayValue { private NumericArrayImpl(boolean isNull, @Nullable List values) { @@ -2938,6 +2993,8 @@ private Value getValue(int fieldIndex) { return Value.pgOid(value.getLong(fieldIndex)); case DATE: return Value.date(value.getDate(fieldIndex)); + case UUID: + return Value.uuid(value.getUuid(fieldIndex)); case TIMESTAMP: return Value.timestamp(value.getTimestamp(fieldIndex)); case PROTO: @@ -2976,6 +3033,8 @@ private Value getValue(int fieldIndex) { return Value.pgNumericArray(value.getStringList(fieldIndex)); case DATE: return Value.dateArray(value.getDateList(fieldIndex)); + case UUID: + return Value.uuidArray(value.getUuidList(fieldIndex)); case TIMESTAMP: return Value.timestampArray(value.getTimestampList(fieldIndex)); case STRUCT: diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java index 8386bd5c213..1b297758ee3 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java @@ -24,6 +24,7 @@ import com.google.protobuf.Descriptors.EnumDescriptor; import com.google.protobuf.ProtocolMessageEnum; import java.math.BigDecimal; +import java.util.UUID; import javax.annotation.Nullable; /** @@ -165,6 +166,10 @@ public R to(@Nullable Date value) { return handle(Value.date(value)); } + public R to(@Nullable UUID value) { + return handle(Value.uuid(value)); + } + /** Binds a non-{@code NULL} struct value to {@code Value.struct(value)} */ public R to(Struct value) { return handle(Value.struct(value)); @@ -323,6 +328,11 @@ public R toDateArray(@Nullable Iterable values) { return handle(Value.dateArray(values)); } + /** Binds to {@code Value.uuidArray(values)} */ + public R toUuidArray(@Nullable Iterable values) { + return handle(Value.uuidArray(values)); + } + /** Binds to {@code Value.structArray(fieldTypes, values)} */ public R toStructArray(Type elementType, @Nullable Iterable values) { return handle(Value.structArray(elementType, values)); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java index b5e4060ddd8..2e90397a6bd 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java @@ -32,6 +32,7 @@ import com.google.spanner.v1.ResultSetStats; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -288,6 +289,17 @@ public Date getDate(String columnName) { return delegate.getDate(columnName); } + @Override + public UUID getUuid(int columnIndex) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuid(columnIndex); + } + @Override + public UUID getUuid(String columnName) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuid(columnName); + } + @Override public Value getValue(int columnIndex) { Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); @@ -480,6 +492,18 @@ public List getDateList(String columnName) { return delegate.getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuidList(columnName); + } + @Override public List getProtoMessageList(int columnIndex, T message) { Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java index bd7c794a0fa..57210495eca 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java @@ -34,6 +34,7 @@ import com.google.spanner.v1.ResultSetStats; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -291,12 +292,24 @@ public Date getDate(int columnIndex) { return delegate.getDate(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + checkClosed(); + return delegate.getUuid(columnIndex); + } + @Override public Date getDate(String columnName) { checkClosed(); return delegate.getDate(columnName); } + @Override + public UUID getUuid(String columnName) { + checkClosed(); + return delegate.getUuid(columnName); + } + @Override public Value getValue(int columnIndex) { checkClosed(); @@ -489,6 +502,18 @@ public List getDateList(String columnName) { return delegate.getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + checkClosed(); + return delegate.getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + checkClosed(); + return delegate.getUuidList(columnName); + } + @Override public List getProtoMessageList(int columnIndex, T message) { checkClosed(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java index 595bbcaf26a..d7af5dee958 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java @@ -36,6 +36,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.UUID; import java.util.function.Function; import javax.annotation.Nullable; import org.junit.Before; @@ -103,6 +104,11 @@ protected Date getDateInternal(int columnIndex) { return null; } + @Override + protected UUID getUuidInternal(int columnIndex) { + return null; + } + @Override protected T getProtoMessageInternal(int columnIndex, T message) { return null; @@ -206,6 +212,11 @@ protected List getDateListInternal(int columnIndex) { return null; } + @Override + protected List getUuidListInternal(int columnIndex) { + return null; + } + @Override protected List getStructListInternal(int columnIndex) { return null; @@ -301,6 +312,13 @@ public static Collection parameters() { "getDate", Collections.singletonList("getValue") }, + { + Type.uuid(), + "getUuidInternal", + UUID.randomUUID(), + "getUuid", + Collections.singletonList("getValue") + }, { Type.array(Type.bool()), "getBooleanArrayInternal", @@ -423,6 +441,13 @@ public static Collection parameters() { "getDateList", Collections.singletonList("getValue") }, + { + Type.array(Type.uuid()), + "getUuidListInternal", + Arrays.asList(UUID.randomUUID(), UUID.randomUUID()), + "getUuidList", + Collections.singletonList("getValue") + }, { Type.array(Type.struct(StructField.of("f1", Type.int64()))), "getStructListInternal", diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java index 59a18a3ab79..5889608d845 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java @@ -50,6 +50,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.UUID; import javax.annotation.Nullable; import org.junit.Before; import org.junit.Test; @@ -552,6 +553,8 @@ public void serialization() { Value.timestamp(null), Value.date(Date.fromYearMonthDay(2017, 4, 17)), Value.date(null), + Value.uuid(UUID.randomUUID()), + Value.uuid(null), Value.stringArray(ImmutableList.of("one", "two")), Value.stringArray(null), Value.boolArray(new boolean[] {true, false}), @@ -574,11 +577,14 @@ public void serialization() { ImmutableList.of( Date.fromYearMonthDay(2017, 4, 17), Date.fromYearMonthDay(2017, 5, 18))), Value.dateArray(null), + Value.uuidArray(ImmutableList.of(UUID.randomUUID(), UUID.randomUUID())), + Value.uuidArray(null), Value.struct(s(null, 30)), Value.struct(structType, null), Value.structArray(structType, Arrays.asList(s("def", 10), null)), Value.structArray(structType, Collections.singletonList(null)), - Value.structArray(structType, null)); + Value.structArray(structType, null) + ); } @Test @@ -739,6 +745,23 @@ public void getDate() { assertThat(resultSet.getDate(0)).isEqualTo(Date.fromYearMonthDay(2018, 5, 29)); } + @Test + public void getUuid() { + final UUID uuid = UUID.randomUUID(); + consumer.onPartialResultSet( + PartialResultSet.newBuilder() + .setMetadata(makeMetadata(Type.struct(Type.StructField.of("f", Type.uuid())))) + .addValues(Value.uuid(uuid).toProto()) + .build()); + consumer.onCompleted(); + + Value value = Value.uuid(uuid); + com.google.protobuf.Value diff_value = value.toProto(); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getUuid(0)).isEqualTo(uuid); + } + @Test public void getTimestamp() { consumer.onPartialResultSet( @@ -992,6 +1015,22 @@ public void getDateList() { assertThat(resultSet.getDateList(0)).isEqualTo(dateList); } + @Test + public void getUuidList() { + List uuidList = Arrays.asList(UUID.randomUUID(), UUID.randomUUID()); + + consumer.onPartialResultSet( + PartialResultSet.newBuilder() + .setMetadata( + makeMetadata(Type.struct(Type.StructField.of("f", Type.array(Type.uuid()))))) + .addValues(Value.uuidArray(uuidList).toProto()) + .build()); + consumer.onCompleted(); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getUuidList(0)).isEqualTo(uuidList); + } + @Test public void getJsonList() { List jsonList = new ArrayList<>(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java index 39f1ff180fa..b1ef46d5457 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java @@ -1327,6 +1327,9 @@ private Statement buildStatement( case DATE: builder.bind(fieldName).toDateArray(null); break; + case UUID: + builder.bind(fieldName).toUuidArray(null); + break; case FLOAT32: builder.bind(fieldName).toFloat32Array((Iterable) null); break; @@ -1373,6 +1376,9 @@ private Statement buildStatement( case DATE: builder.bind(fieldName).to((Date) null); break; + case UUID: + builder.bind(fieldName).to((UUID) null); + break; case FLOAT32: builder.bind(fieldName).to((Float) null); break; @@ -1441,6 +1447,14 @@ private Statement buildStatement( GrpcStruct.decodeArrayValue( com.google.cloud.spanner.Type.date(), value.getListValue())); break; + case UUID: + builder + .bind(fieldName) + .toUuidArray( + (Iterable) + GrpcStruct.decodeArrayValue( + com.google.cloud.spanner.Type.uuid(), value.getListValue())); + break; case FLOAT32: builder .bind(fieldName) @@ -1532,6 +1546,9 @@ private Statement buildStatement( case DATE: builder.bind(fieldName).to(Date.parseDate(value.getStringValue())); break; + case UUID: + builder.bind(fieldName).to(UUID.fromString(value.getStringValue())); + break; case FLOAT32: builder.bind(fieldName).to((float) value.getNumberValue()); break; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java index 3ca550caa2d..fb51980a73d 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.UUID; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.atomic.AtomicInteger; @@ -70,6 +71,7 @@ public void resultSetIteration() { int year = 2018; int month = 5; int day = 26; + UUID uuid = UUID.randomUUID(); boolean[] boolArray = {true, false, true, true, false}; long[] longArray = {Long.MAX_VALUE, Long.MIN_VALUE, 0, 1, -1}; double[] doubleArray = {Double.MIN_VALUE, Double.MAX_VALUE, 0, 1, -1, 1.2341}; @@ -92,6 +94,9 @@ public void resultSetIteration() { Date[] dateArray = { Date.fromYearMonthDay(1, 2, 3), Date.fromYearMonthDay(4, 5, 6), Date.fromYearMonthDay(7, 8, 9) }; + UUID[] uuidArray = { + UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID() + }; String[] stringArray = {"abc", "def", "ghi"}; String[] jsonArray = {"{}", "{\"color\":\"red\",\"value\":\"#f00\"}", "[]"}; AbstractMessage[] protoMessageArray = { @@ -114,6 +119,7 @@ public void resultSetIteration() { Type.StructField.of("byteVal", Type.bytes()), Type.StructField.of("timestamp", Type.timestamp()), Type.StructField.of("date", Type.date()), + Type.StructField.of("uuid", Type.uuid()), Type.StructField.of( "protoMessage", Type.proto(protoMessageVal.getDescriptorForType().getFullName())), Type.StructField.of( @@ -126,6 +132,7 @@ public void resultSetIteration() { Type.StructField.of("byteArray", Type.array(Type.bytes())), Type.StructField.of("timestampArray", Type.array(Type.timestamp())), Type.StructField.of("dateArray", Type.array(Type.date())), + Type.StructField.of("uuidArray", Type.array(Type.uuid())), Type.StructField.of("stringArray", Type.array(Type.string())), Type.StructField.of("jsonArray", Type.array(Type.json())), Type.StructField.of("pgJsonbArray", Type.array(Type.pgJsonb())), @@ -163,6 +170,8 @@ public void resultSetIteration() { .to(Timestamp.ofTimeMicroseconds(usecs)) .set("date") .to(Date.fromYearMonthDay(year, month, day)) + .set("uuid") + .to(uuid) .set("protoMessage") .to(protoMessageVal) .set("protoEnum") @@ -183,6 +192,8 @@ public void resultSetIteration() { .to(Value.timestampArray(Arrays.asList(timestampArray))) .set("dateArray") .to(Value.dateArray(Arrays.asList(dateArray))) + .set("uuidArray") + .to(Value.uuidArray(Arrays.asList(uuidArray))) .set("stringArray") .to(Value.stringArray(Arrays.asList(stringArray))) .set("jsonArray") @@ -228,6 +239,8 @@ public void resultSetIteration() { .to(Timestamp.ofTimeMicroseconds(usecs)) .set("date") .to(Date.fromYearMonthDay(year, month, day)) + .set("uuid") + .to(uuid) .set("protoMessage") .to(protoMessageVal) .set("protoEnum") @@ -248,6 +261,8 @@ public void resultSetIteration() { .to(Value.timestampArray(Arrays.asList(timestampArray))) .set("dateArray") .to(Value.dateArray(Arrays.asList(dateArray))) + .set("uuidArray") + .to(Value.uuidArray(Arrays.asList(uuidArray))) .set("stringArray") .to(Value.stringArray(Arrays.asList(stringArray))) .set("jsonArray") @@ -339,6 +354,12 @@ public void resultSetIteration() { assertThat(rs.getDate("date")).isEqualTo(Date.fromYearMonthDay(year, month, day)); assertThat(rs.getValue("date")).isEqualTo(Value.date(Date.fromYearMonthDay(year, month, day))); + // UUID + assertThat(rs.getUuid(columnIndex)).isEqualTo(uuid); + assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.uuid(uuid)); + assertThat(rs.getUuid("uuid")).isEqualTo(uuid); + assertThat(rs.getValue("uuid")).isEqualTo(Value.uuid(uuid)); + assertEquals(protoMessageVal, rs.getProtoMessage(columnIndex, SingerInfo.getDefaultInstance())); assertEquals(Value.protoMessage(protoMessageVal), rs.getValue(columnIndex++)); assertEquals( @@ -400,6 +421,13 @@ public void resultSetIteration() { assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.dateArray(Arrays.asList(dateArray))); assertThat(rs.getDateList("dateArray")).isEqualTo(Arrays.asList(dateArray)); assertThat(rs.getValue("dateArray")).isEqualTo(Value.dateArray(Arrays.asList(dateArray))); + + // UUID Array + assertThat(rs.getUuidList(columnIndex)).isEqualTo(Arrays.asList(uuidArray)); + assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.uuidArray(Arrays.asList(uuidArray))); + assertThat(rs.getUuidList("uuidArray")).isEqualTo(Arrays.asList(uuidArray)); + assertThat(rs.getValue("uuidArray")).isEqualTo(Value.uuidArray(Arrays.asList(uuidArray))); + assertThat(rs.getStringList(columnIndex)).isEqualTo(Arrays.asList(stringArray)); assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.stringArray(Arrays.asList(stringArray))); assertThat(rs.getStringList("stringArray")).isEqualTo(Arrays.asList(stringArray)); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java index aea799aa158..0d069ae5d8f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java @@ -240,6 +240,16 @@ Type newType() { }.test(); } + @Test + public void uuid() { + new ScalarTypeTester(Type.Code.UUID, TypeCode.UUID) { + @Override + Type newType() { + return Type.uuid(); + } + }.test(); + } + abstract static class ArrayTypeTester { private final Type.Code expectedElementCode; private final TypeCode expectedElementTypeCode; @@ -428,6 +438,16 @@ Type newElementType() { }.test(); } + @Test + public void uuidArray() { + new ArrayTypeTester(Type.Code.UUID, TypeCode.UUID, true) { + @Override + Type newElementType() { + return Type.uuid(); + } + }.test(); + } + @Test public void protoArray() { new ArrayTypeTester(Type.Code.PROTO, TypeCode.PROTO, "com.google.temp", false) { @@ -615,6 +635,7 @@ public void testGoogleSQLTypeNames() { assertEquals("STRING", Type.string().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("BYTES", Type.bytes().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("DATE", Type.date().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); + assertEquals("UUID", Type.uuid().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("TIMESTAMP", Type.timestamp().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("JSON", Type.json().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("NUMERIC", Type.numeric().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); @@ -632,6 +653,8 @@ public void testGoogleSQLTypeNames() { "ARRAY", Type.array(Type.bytes()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals( "ARRAY", Type.array(Type.date()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); + assertEquals( + "ARRAY", Type.array(Type.uuid()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals( "ARRAY", Type.array(Type.timestamp()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); @@ -650,6 +673,7 @@ public void testPostgreSQLTypeNames() { assertEquals("character varying", Type.string().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("bytea", Type.bytes().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("date", Type.date().getSpannerTypeName(Dialect.POSTGRESQL)); + assertEquals("uuid", Type.uuid().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals( "timestamp with time zone", Type.timestamp().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("jsonb", Type.pgJsonb().getSpannerTypeName(Dialect.POSTGRESQL)); @@ -663,6 +687,7 @@ public void testPostgreSQLTypeNames() { "character varying[]", Type.array(Type.string()).getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("bytea[]", Type.array(Type.bytes()).getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("date[]", Type.array(Type.date()).getSpannerTypeName(Dialect.POSTGRESQL)); + assertEquals("uuid[]", Type.array(Type.uuid()).getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals( "timestamp with time zone[]", Type.array(Type.timestamp()).getSpannerTypeName(Dialect.POSTGRESQL)); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java index 23128ad52b2..9017b3d3288 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.Base64; import java.util.Collections; +import java.util.UUID; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -331,6 +332,8 @@ public static Date defaultDate() { return Date.fromYearMonthDay(2016, 9, 15); } + public static UUID defaultUuid() { return UUID.fromString("db09330e-cc05-472c-a54e-b2784deebac3");} + public static boolean[] defaultBooleanArray() { return new boolean[] {false, true}; } @@ -388,6 +391,10 @@ public static Iterable defaultDateIterable() { return Arrays.asList(Date.fromYearMonthDay(2016, 9, 15), Date.fromYearMonthDay(2016, 9, 14)); } + public static Iterable defaultUuidIterable() { + return Arrays.asList(UUID.fromString("8ebe9153-2747-4c92-a462-6da13eb25ebb"), UUID.fromString("12c154ca-6500-4be0-89c8-160bcfa8c3f6")); + } + static Object getDefault(java.lang.reflect.Type type) throws InvocationTargetException, IllegalAccessException { for (Method method : DefaultValues.class.getMethods()) { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java index 92b63913fdb..efa2be01994 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java @@ -51,6 +51,7 @@ import java.util.Collections; import java.util.List; import java.util.Random; +import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; import org.junit.Test; @@ -731,6 +732,28 @@ public void dateNull() { assertEquals("NULL", v.getAsString()); } + @Test + public void uuid() { + UUID uuid = UUID.randomUUID(); + Value v = Value.uuid(uuid); + assertThat(v.getType()).isEqualTo(Type.uuid()); + assertThat(v.isNull()).isFalse(); + assertThat(v.getUuid()).isSameInstanceAs(uuid); + assertThat(v.toString()).isEqualTo(uuid.toString()); + assertEquals(uuid.toString(), v.getAsString()); + } + + @Test + public void uuidNull() { + Value v = Value.uuid(null); + assertThat(v.getType()).isEqualTo(Type.uuid()); + assertThat(v.isNull()).isTrue(); + assertThat(v.toString()).isEqualTo(NULL_STRING); + IllegalStateException e = assertThrows(IllegalStateException.class, v::getUuid); + assertThat(e.getMessage()).contains("null value"); + assertEquals("NULL", v.getAsString()); + } + @Test public void protoMessage() { SingerInfo singerInfo = SingerInfo.newBuilder().setSingerId(111).setGenre(Genre.FOLK).build(); @@ -1359,6 +1382,30 @@ public void dateArrayNull() { assertEquals("NULL", v.getAsString()); } + @Test + public void uuidArray() { + UUID uuid1 = UUID.randomUUID(); + UUID uuid2 = UUID.randomUUID(); + + Value v = Value.uuidArray(Arrays.asList(uuid1, null, uuid2)); + assertThat(v.isNull()).isFalse(); + assertThat(v.getUuidArray()) + .containsExactly(uuid1, null, uuid2) + .inOrder(); + assertThat(v.toString()).isEqualTo("[" + uuid1.toString() + ",NULL," + uuid2.toString() + "]"); + assertEquals(String.format("[%s,NULL,%s]", uuid1.toString(), uuid2.toString()), v.getAsString()); + } + + @Test + public void uuidArrayNull() { + Value v = Value.uuidArray(null); + assertThat(v.isNull()).isTrue(); + assertThat(v.toString()).isEqualTo(NULL_STRING); + IllegalStateException e = assertThrows(IllegalStateException.class, v::getUuidArray); + assertThat(e.getMessage()).contains("null value"); + assertEquals("NULL", v.getAsString()); + } + @Test public void protoMessageArray() { SingerInfo singerInfo1 = SingerInfo.newBuilder().setSingerId(111).setGenre(Genre.FOLK).build(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java index e13cfa91c1f..65ecb683160 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java @@ -42,6 +42,7 @@ import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.util.Arrays; +import java.util.UUID; import java.util.concurrent.Callable; import org.junit.Test; import org.junit.runner.RunWith; @@ -81,6 +82,8 @@ public class ChecksumResultSetTest { .to(Timestamp.parseTimestamp("2022-08-04T11:20:00.123456789Z")) .set("date") .to(Date.fromYearMonthDay(2022, 8, 3)) + .set("uuid") + .to(UUID.randomUUID()) .set("boolArray") .to(Value.boolArray(Arrays.asList(Boolean.FALSE, null, Boolean.TRUE))) .set("longArray") @@ -108,6 +111,9 @@ public class ChecksumResultSetTest { .to( Value.dateArray( Arrays.asList(Date.parseDate("2000-01-01"), null, Date.parseDate("2022-08-03")))) + .set("uuidArray") + .to( + Value.uuidArray(Arrays.asList(UUID.randomUUID(), UUID.randomUUID()))) .set("stringArray") .to(Value.stringArray(Arrays.asList("test2", null, "test1"))) .set("jsonArray") @@ -150,6 +156,7 @@ public void testRetry() { Type.StructField.of("byteVal", Type.bytes()), Type.StructField.of("timestamp", Type.timestamp()), Type.StructField.of("date", Type.date()), + Type.StructField.of("uuid", Type.uuid()), Type.StructField.of("boolArray", Type.array(Type.bool())), Type.StructField.of("longArray", Type.array(Type.int64())), Type.StructField.of("doubleArray", Type.array(Type.float64())), @@ -159,6 +166,7 @@ public void testRetry() { Type.StructField.of("byteArray", Type.array(Type.bytes())), Type.StructField.of("timestampArray", Type.array(Type.timestamp())), Type.StructField.of("dateArray", Type.array(Type.date())), + Type.StructField.of("uuidArray", Type.array(Type.uuid())), Type.StructField.of("stringArray", Type.array(Type.string())), Type.StructField.of("jsonArray", Type.array(Type.json())), Type.StructField.of("pgJsonbArray", Type.array(Type.pgJsonb())), @@ -200,6 +208,8 @@ public void testRetry() { .to(Timestamp.parseTimestamp("2022-08-04T10:19:00.123456789Z")) .set("date") .to(Date.fromYearMonthDay(2022, 8, 4)) + .set("uuid") + .to(UUID.randomUUID()) .set("boolArray") .to(Value.boolArray(Arrays.asList(Boolean.TRUE, null, Boolean.FALSE))) .set("longArray") @@ -228,6 +238,8 @@ public void testRetry() { Value.dateArray( Arrays.asList( Date.parseDate("2000-01-01"), null, Date.parseDate("2022-08-04")))) + .set("uuidArray") + .to(Value.uuidArray(Arrays.asList(UUID.randomUUID(), UUID.randomUUID()))) .set("stringArray") .to(Value.stringArray(Arrays.asList("test1", null, "test2"))) .set("jsonArray") @@ -282,6 +294,8 @@ public void testRetry() { .to((Timestamp) null) .set("date") .to((Date) null) + .set("uuid") + .to((UUID) null) .set("boolArray") .toBoolArray((Iterable) null) .set("longArray") @@ -300,6 +314,8 @@ public void testRetry() { .toTimestampArray(null) .set("dateArray") .toDateArray(null) + .set("uuidArray") + .toUuidArray(null) .set("stringArray") .toStringArray(null) .set("jsonArray") diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java index da4b87200c3..e21e0020f6e 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java @@ -39,6 +39,7 @@ import java.util.Arrays; import java.util.List; import java.util.Random; +import java.util.UUID; /** * Utility class for generating {@link ResultSet}s containing columns with all possible data types @@ -68,6 +69,7 @@ public static Type[] generateAllTypes(Dialect dialect) { : Type.newBuilder().setCode(TypeCode.JSON).build(), Type.newBuilder().setCode(TypeCode.BYTES).build(), Type.newBuilder().setCode(TypeCode.DATE).build(), + Type.newBuilder().setCode(TypeCode.UUID).build(), Type.newBuilder().setCode(TypeCode.TIMESTAMP).build())); if (dialect == Dialect.POSTGRESQL) { types.add( @@ -124,6 +126,10 @@ public static Type[] generateAllTypes(Dialect dialect) { .setCode(TypeCode.ARRAY) .setArrayElementType(Type.newBuilder().setCode(TypeCode.DATE)) .build(), + Type.newBuilder() + .setCode(TypeCode.ARRAY) + .setArrayElementType(Type.newBuilder().setCode(TypeCode.UUID)) + .build(), Type.newBuilder() .setCode(TypeCode.ARRAY) .setArrayElementType(Type.newBuilder().setCode(TypeCode.TIMESTAMP)) @@ -255,6 +261,10 @@ private void setRandomValue(Value.Builder builder, Type type) { random.nextInt(2019) + 1, random.nextInt(11) + 1, random.nextInt(28) + 1); builder.setStringValue(date.toString()); break; + case UUID: + UUID uuid = UUID.randomUUID(); + builder.setStringValue(uuid.toString()); + break; case FLOAT32: if (randomNaN()) { builder.setNumberValue(Float.NaN); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java index 18044c452b5..3fd57761286 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java @@ -56,6 +56,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.UUID; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -423,6 +424,27 @@ public void bindDateNull() { assertThat(row.isNull(0)).isTrue(); } + @Test + public void bindUuid() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + UUID uuid = UUID.randomUUID(); + Struct row = execute(Statement.newBuilder(selectValueQuery).bind("p1").to(uuid), Type.uuid()); + assertThat(row.isNull(0)).isFalse(); + assertThat(row.getUuid(0)).isEqualTo(uuid); + } + + @Test + public void bindUuidNull() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + Struct row = + execute(Statement.newBuilder(selectValueQuery).bind("p1").to((UUID) null), Type.uuid()); + assertThat(row.isNull(0)).isTrue(); + } + @Test public void bindNumeric() { assumeFalse("Emulator does not yet support NUMERIC", EmulatorSpannerHelper.isUsingEmulator()); @@ -817,6 +839,47 @@ public void bindDateArrayNull() { assertThat(row.isNull(0)).isTrue(); } + @Test + public void bindUuidArray() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + UUID u1 = UUID.randomUUID(); + UUID u2 = UUID.randomUUID(); + + Struct row = + execute( + Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(asList(u1, u2, null)), + Type.array(Type.uuid())); + assertThat(row.isNull(0)).isFalse(); + assertThat(row.getUuidList(0)).containsExactly(u1, u2, null).inOrder(); + } + + @Test + public void bindUuidArrayEmpty() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + Struct row = + execute( + Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(Collections.emptyList()), + Type.array(Type.uuid())); + assertThat(row.isNull(0)).isFalse(); + assertThat(row.getUuidList(0)).containsExactly(); + } + + @Test + public void bindUuidArrayNull() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + Struct row = + execute( + Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(null), + Type.array(Type.uuid())); + assertThat(row.isNull(0)).isTrue(); + } + @Test public void bindNumericArrayGoogleStandardSQL() { assumeTrue(dialect.dialect == Dialect.GOOGLE_STANDARD_SQL); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java new file mode 100644 index 00000000000..15d6db09cb1 --- /dev/null +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java @@ -0,0 +1,452 @@ +/* + * 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 + * + * 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.spanner.it; + +import static com.google.common.base.Strings.isNullOrEmpty; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.Timestamp; +import com.google.cloud.spanner.Database; +import com.google.cloud.spanner.DatabaseClient; +import com.google.cloud.spanner.Dialect; +import com.google.cloud.spanner.IntegrationTestEnv; +import com.google.cloud.spanner.Key; +import com.google.cloud.spanner.KeySet; +import com.google.cloud.spanner.Mutation; +import com.google.cloud.spanner.ParallelIntegrationTest; +import com.google.cloud.spanner.ResultSet; +import com.google.cloud.spanner.Statement; +import com.google.cloud.spanner.Struct; +import com.google.cloud.spanner.TimestampBound; +import com.google.cloud.spanner.Value; +import com.google.cloud.spanner.connection.ConnectionOptions; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@Category(ParallelIntegrationTest.class) +@RunWith(Parameterized.class) +public class ITUuidTest { + + @ClassRule public static IntegrationTestEnv env = new IntegrationTestEnv(); + + private static boolean isUsingCloudDevel() { + String jobType = System.getenv("JOB_TYPE"); + + // Assumes that the jobType contains the string "cloud-devel" to signal that + // the environment is cloud-devel. + return !isNullOrEmpty(jobType) && jobType.contains("cloud-devel"); + } + + @Parameterized.Parameters(name = "Dialect = {0}") + public static List data() { + return Arrays.asList( + new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL), + new DialectTestParameter(Dialect.POSTGRESQL)); + } + + @Parameterized.Parameter() public DialectTestParameter dialect; + + private static DatabaseClient googleStandardSQLClient; + private static DatabaseClient postgreSQLClient; + + private static final String[] GOOGLE_STANDARD_SQL_SCHEMA = + new String[] { + "CREATE TABLE T (" + + " Key STRING(MAX) NOT NULL," + + " UuidValue UUID," + + " UuidArrayValue ARRAY," + + ") PRIMARY KEY (Key)", + "CREATE TABLE UK (" + + " Key UUID NOT NULL," + + ") PRIMARY KEY (Key)", + }; + + private static final String[] POSTGRESQL_SCHEMA = + new String[] { + "CREATE TABLE T (" + + " Key VARCHAR PRIMARY KEY," + + " UuidValue UUID," + + " UuidArrayValue UUID[]" + + ")", + "CREATE TABLE UK (" + + " Key UUID PRIMARY KEY" + + ")", + }; + + private static DatabaseClient client; + + private UUID uuid1 = UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a");; + private UUID uuid2 = UUID.fromString("f5868be9-7983-4cfa-adf3-2e9f13f2019d"); + + + @BeforeClass + public static void setUpDatabase() + throws ExecutionException, InterruptedException, TimeoutException { + Database googleStandardSQLDatabase = + env.getTestHelper().createTestDatabase(GOOGLE_STANDARD_SQL_SCHEMA); + + googleStandardSQLClient = env.getTestHelper().getDatabaseClient(googleStandardSQLDatabase); + + Database postgreSQLDatabase = + env.getTestHelper() + .createTestDatabase(Dialect.POSTGRESQL, Arrays.asList(POSTGRESQL_SCHEMA)); + postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); + } + + @Before + public void before() { + client = + dialect.dialect == Dialect.GOOGLE_STANDARD_SQL ? googleStandardSQLClient : postgreSQLClient; + } + + @AfterClass + public static void tearDown() throws Exception { + ConnectionOptions.closeSpanner(); + } + + /** Sequence used to generate unique keys. */ + private static int seq; + + private static String uniqueString() { + return String.format("k%04d", seq++); + } + + private String lastKey; + + private Timestamp write(Mutation m) { + return client.write(Collections.singletonList(m)); + } + + private Mutation.WriteBuilder baseInsert() { + return Mutation.newInsertOrUpdateBuilder("T").set("Key").to(lastKey = uniqueString()); + } + + private Struct readRow(String table, String key, String... columns) { + return client + .singleUse(TimestampBound.strong()) + .readRow(table, Key.of(key), Arrays.asList(columns)); + } + + private Struct readLastRow(String... columns) { + return readRow("T", lastKey, columns); + } + + private Timestamp deleteAllRows(String table) { + return write(Mutation.delete(table, KeySet.all())); + } + + @Test + public void writeUuid() { + UUID uuid = UUID.randomUUID(); + write(baseInsert().set("UuidValue").to(uuid).build()); + Struct row = readLastRow("UuidValue"); + assertFalse(row.isNull(0)); + assertEquals(uuid, row.getUuid(0)); + } + + @Test + public void writeUuidNull() { + write(baseInsert().set("UuidValue").to((UUID) null).build()); + Struct row = readLastRow("UuidValue"); + assertTrue(row.isNull(0)); + } + + @Test + public void writeUuidArrayNull() { + write(baseInsert().set("UuidArrayValue").toUuidArray(null).build()); + Struct row = readLastRow("UuidArrayValue"); + assertTrue(row.isNull(0)); + } + + @Test + public void writeUuidArrayEmpty() { + write(baseInsert().set("UuidArrayValue").toUuidArray(Collections.emptyList()).build()); + Struct row = readLastRow("UuidArrayValue"); + assertFalse(row.isNull(0)); + assertTrue(row.getUuidList(0).isEmpty()); + } + + @Test + public void writeUuidArray() { + UUID uuid1 = UUID.randomUUID(); + UUID uuid2 = UUID.randomUUID(); + + write( + baseInsert() + .set("UuidArrayValue") + .toUuidArray(Arrays.asList(null, uuid1, uuid2)) + .build()); + Struct row = readLastRow("UuidArrayValue"); + assertFalse(row.isNull(0)); + assertEquals(row.getUuidList(0), Arrays.asList(null, uuid1, uuid2)); + } + + @Test + public void writeUuidArrayNoNulls() { + UUID uuid1 = UUID.randomUUID(); + UUID uuid2 = UUID.randomUUID(); + + write(baseInsert().set("UuidArrayValue").toUuidArray(Arrays.asList(uuid1, uuid2)).build()); + Struct row = readLastRow("UuidArrayValue"); + assertFalse(row.isNull(0)); + assertEquals(2, row.getUuidList(0).size()); + assertEquals(uuid1, row.getUuidList(0).get(0)); + assertEquals(uuid2, row.getUuidList(0).get(1)); + } + + private String getInsertStatementWithLiterals() { + String statement = "INSERT INTO T (Key, UuidValue, UuidArrayValue) VALUES "; + + if (dialect.dialect == Dialect.POSTGRESQL) { + statement += + "('dml1', 'aac68fbe-6847-48b1-8373-110950aeaf3a', array['aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid]), " + + "('dml2', 'aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid, array['aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid])," + + "('dml3', null, null), " + + "('dml4', 'aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid, array['aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid, 'f5868be9-7983-4cfa-adf3-2e9f13f2019d'::uuid, null])"; + } else { + statement += + "('dml1', 'aac68fbe-6847-48b1-8373-110950aeaf3a', [CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID)]), " + + "('dml2', CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID), [CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID)]), " + + "('dml3', null, null), " + + "('dml4', 'aac68fbe-6847-48b1-8373-110950aeaf3a', [CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID), CAST('f5868be9-7983-4cfa-adf3-2e9f13f2019d' AS UUID), null])"; + } + return statement; + } + + @Test + public void uuidLiterals() { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate(Statement.of(getInsertStatementWithLiterals())); + return null; + }); + + verifyNonKeyContents("dml"); + } + + private String getInsertStatementWithParameters() { + String statement = + "INSERT INTO T (Key, UuidValue, UuidArrayValue) VALUES " + + "('param1', $1, $2), " + + "('param2', $3, $4), " + + "('param3', $5, $6), " + + "('param4', $7, $8)"; + + return (dialect.dialect == Dialect.POSTGRESQL) ? statement : statement.replace("$", "@p"); + } + + @Test + public void uuidParameter() { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.newBuilder(getInsertStatementWithParameters()) + .bind("p1") + .to(Value.uuid(uuid1)) + .bind("p2") + .to(Value.uuidArray(Collections.singletonList(uuid1))) + .bind("p3") + .to(Value.uuid(uuid1)) + .bind("p4") + .to(Value.uuidArray(Collections.singletonList(uuid1))) + .bind("p5") + .to(Value.uuid(null)) + .bind("p6") + .to(Value.uuidArray(null)) + .bind("p7") + .to(Value.uuid(uuid1)) + .bind("p8") + .to(Value.uuidArray(Arrays.asList(uuid1, uuid2, null))) + .build()); + return null; + }); + + verifyNonKeyContents("param"); + } + + private String getInsertStatementForUntypedParameters() { + if (dialect.dialect == Dialect.POSTGRESQL) { + return "INSERT INTO T (key, uuidValue, uuidArrayValue) VALUES " + + "('untyped1', ($1)::uuid, ($2)::uuid[])"; + } + return "INSERT INTO T (Key, UuidValue, UuidArrayValue) VALUES " + + "('untyped1', CAST(@p1 AS UUID), CAST(@p2 AS ARRAY))"; + } + + @Test + public void uuidUntypedParameter() { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.newBuilder(getInsertStatementForUntypedParameters()) + .bind("p1") + .to( + Value.untyped( + com.google.protobuf.Value.newBuilder() + .setStringValue("aac68fbe-6847-48b1-8373-110950aeaf3a") + .build())) + .bind("p2") + .to( + Value.untyped( + com.google.protobuf.Value.newBuilder() + .setListValue( + com.google.protobuf.ListValue.newBuilder() + .addValues( + com.google.protobuf.Value.newBuilder() + .setStringValue("aac68fbe-6847-48b1-8373-110950aeaf3a"))) + .build())) + .build()); + return null; + }); + + Struct row = readRow("T", "untyped1", "UuidValue", "UuidArrayValue"); + assertEquals(UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a"), row.getUuid(0)); + assertEquals(Collections.singletonList(UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a")), row.getUuidList(1)); + } + + private String getInsertStatementWithKeyLiterals(UUID uuid1, UUID uuid2) { + String statement = "INSERT INTO UK (Key) VALUES "; + if (dialect.dialect == Dialect.POSTGRESQL) { + statement += + "('"+ uuid1.toString() +"')," + + "('"+ uuid2.toString()+"'::uuid)"; + } else { + statement += + "('"+ uuid1.toString() +"')," + + "(CAST('"+ uuid2.toString()+"' AS UUID))"; + } + return statement; + } + + @Test + public void uuidAsKeyLiteral() { + deleteAllRows("UK"); + + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate(Statement.of(getInsertStatementWithKeyLiterals(uuid1, uuid2))); + return null; + }); + + verifyKeyContents(Arrays.asList(uuid1, uuid2)); + } + + private String getInsertStatementWithKeyParameters() { + String statement = "INSERT INTO UK (Key) VALUES " + + "($1)," + + "($2)"; + return (dialect.dialect == Dialect.POSTGRESQL) ? statement : statement.replace("$", "@p"); + } + + @Test + public void uuidAsKeyParameter() { + deleteAllRows("UK"); + UUID uuid1 = UUID.fromString("fb907080-48a4-4615-b2c4-c8ccb5bb66a4"); + UUID uuid2 = UUID.fromString("faee3a78-cc54-42fc-baa2-53197fb89e8a");; + + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.newBuilder(getInsertStatementWithKeyParameters()) + .bind("p1") + .to(Value.uuid(uuid1)) + .bind("p2") + .to(Value.uuid(uuid2)) + .build()); + return null; + }); + + verifyKeyContents(Arrays.asList(uuid1, uuid2)); + } + + private void verifyKeyContents(List uuids){ + try (ResultSet resultSet = + client + .singleUse() + .executeQuery( + Statement.of( + "SELECT Key AS key FROM UK ORDER BY key"))) { + + for (UUID uuid : uuids) { + assertTrue(resultSet.next()); + assertEquals(uuid, resultSet.getUuid("key")); + assertEquals(Value.uuid(uuid), resultSet.getValue("key")); + } + } + } + + private void verifyNonKeyContents(String keyPrefix) { + try (ResultSet resultSet = + client + .singleUse() + .executeQuery( + Statement.of( + "SELECT Key AS key, UuidValue AS uuidvalue, UuidArrayValue AS uuidarrayvalue FROM T WHERE Key LIKE '{keyPrefix}%' ORDER BY key" + .replace("{keyPrefix}", keyPrefix)))) { + + // Row 1 + assertTrue(resultSet.next()); + assertEquals(uuid1, resultSet.getUuid("uuidvalue")); + assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); + assertEquals(Collections.singletonList(uuid1), resultSet.getUuidList("uuidarrayvalue")); + assertEquals(Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); + + // Row 2 + assertTrue(resultSet.next()); + assertEquals(uuid1, resultSet.getUuid("uuidvalue")); + assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); + assertEquals(Collections.singletonList(uuid1), resultSet.getUuidList("uuidarrayvalue")); + assertEquals(Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); + + // Row 3 + assertTrue(resultSet.next()); + assertTrue(resultSet.isNull("uuidvalue")); + assertTrue(resultSet.isNull("uuidarrayvalue")); + + // Row 4 + assertTrue(resultSet.next()); + assertEquals(uuid1, resultSet.getUuid("uuidvalue")); + assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); + assertEquals(Arrays.asList(uuid1, uuid2, null), resultSet.getUuidList("uuidarrayvalue")); + assertEquals(Value.uuidArray(Arrays.asList(uuid1, uuid2, null)), resultSet.getValue("uuidarrayvalue")); + } + } +} From c243ed700a538d7e7bf433626bbdfcdb0470f6a1 Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Thu, 26 Dec 2024 17:41:14 +0530 Subject: [PATCH 34/43] feat: support for UUID type --- .../cloud/spanner/AbstractResultSet.java | 11 + .../cloud/spanner/AbstractStructReader.java | 31 ++ .../cloud/spanner/ForwardingStructReader.java | 25 + .../com/google/cloud/spanner/GrpcStruct.java | 27 ++ .../com/google/cloud/spanner/ResultSets.java | 21 + .../java/com/google/cloud/spanner/Struct.java | 15 + .../google/cloud/spanner/StructReader.java | 9 + .../java/com/google/cloud/spanner/Type.java | 9 + .../java/com/google/cloud/spanner/Value.java | 59 +++ .../com/google/cloud/spanner/ValueBinder.java | 10 + .../connection/DirectExecuteResultSet.java | 24 + .../ReplaceableForwardingResultSet.java | 25 + .../AbstractStructReaderTypesTest.java | 25 + .../cloud/spanner/GrpcResultSetTest.java | 41 +- .../cloud/spanner/MockSpannerServiceImpl.java | 17 + .../google/cloud/spanner/ResultSetsTest.java | 28 ++ .../com/google/cloud/spanner/TypeTest.java | 25 + .../google/cloud/spanner/ValueBinderTest.java | 7 + .../com/google/cloud/spanner/ValueTest.java | 47 ++ .../connection/ChecksumResultSetTest.java | 16 + .../connection/RandomResultSetGenerator.java | 10 + .../google/cloud/spanner/it/ITQueryTest.java | 63 +++ .../google/cloud/spanner/it/ITUuidTest.java | 452 ++++++++++++++++++ 23 files changed, 996 insertions(+), 1 deletion(-) create mode 100644 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java index 3dca970f96e..957bc806430 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractResultSet.java @@ -38,6 +38,7 @@ import java.util.Iterator; import java.util.List; import java.util.Objects; +import java.util.UUID; import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -430,6 +431,11 @@ protected Date getDateInternal(int columnIndex) { return currRow().getDateInternal(columnIndex); } + @Override + protected UUID getUuidInternal(int columnIndex) { + return currRow().getUuidInternal(columnIndex); + } + @Override protected Value getValueInternal(int columnIndex) { return currRow().getValueInternal(columnIndex); @@ -522,6 +528,11 @@ protected List getDateListInternal(int columnIndex) { return currRow().getDateListInternal(columnIndex); } + @Override + protected List getUuidListInternal(int columnIndex) { + return currRow().getUuidListInternal(columnIndex); + } + @Override protected List getStructListInternal(int columnIndex) { return currRow().getStructListInternal(columnIndex); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java index d13c61aaf01..8841d4a6694 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractStructReader.java @@ -28,6 +28,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -67,6 +68,8 @@ protected String getPgJsonbInternal(int columnIndex) { protected abstract Date getDateInternal(int columnIndex); + protected abstract UUID getUuidInternal(int columnIndex); + protected T getProtoMessageInternal(int columnIndex, T message) { throw new UnsupportedOperationException("Not implemented"); } @@ -128,6 +131,8 @@ protected List getPgJsonbListInternal(int columnIndex) { protected abstract List getDateListInternal(int columnIndex); + protected abstract List getUuidListInternal(int columnIndex); + protected abstract List getStructListInternal(int columnIndex); @Override @@ -299,6 +304,19 @@ public Date getDate(String columnName) { return getDateInternal(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + checkNonNullOfType(columnIndex, Type.uuid(), columnIndex); + return getUuidInternal(columnIndex); + } + + @Override + public UUID getUuid(String columnName) { + final int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, Type.uuid(), columnName); + return getUuid(columnIndex); + } + @Override public T getProtoEnum( int columnIndex, Function method) { @@ -583,6 +601,19 @@ public List getDateList(String columnName) { return getDateListInternal(columnIndex); } + @Override + public List getUuidList(int columnIndex) { + checkNonNullOfType(columnIndex, Type.array(Type.uuid()), columnIndex); + return getUuidListInternal(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + final int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, Type.array(Type.uuid()), columnName); + return getUuidList(columnIndex); + } + @Override public List getStructList(int columnIndex) { checkNonNullArrayOfStruct(columnIndex, columnIndex); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java index b3e37ffcddb..edbf0d564d2 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ForwardingStructReader.java @@ -26,6 +26,7 @@ import com.google.protobuf.ProtocolMessageEnum; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** Forwarding implements of StructReader */ @@ -225,12 +226,24 @@ public Date getDate(int columnIndex) { return delegate.get().getDate(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + checkValidState(); + return delegate.get().getUuid(columnIndex); + } + @Override public Date getDate(String columnName) { checkValidState(); return delegate.get().getDate(columnName); } + @Override + public UUID getUuid(String columnName) { + checkValidState(); + return delegate.get().getUuid(columnName); + } + @Override public boolean[] getBooleanArray(int columnIndex) { checkValidState(); @@ -409,6 +422,18 @@ public List getDateList(String columnName) { return delegate.get().getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + checkValidState(); + return delegate.get().getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + checkValidState(); + return delegate.get().getUuidList(columnName); + } + @Override public List getProtoMessageList(int columnIndex, T message) { checkValidState(); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java index 4d07a12880c..ec052e4044e 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/GrpcStruct.java @@ -49,6 +49,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; import java.util.stream.Collectors; @@ -131,6 +132,9 @@ private Object writeReplace() { case DATE: builder.set(fieldName).to((Date) value); break; + case UUID: + builder.set(fieldName).to((UUID) value); + break; case ARRAY: final Type elementType = fieldType.getArrayElementType(); switch (elementType.getCode()) { @@ -184,6 +188,9 @@ private Object writeReplace() { case DATE: builder.set(fieldName).toDateArray((Iterable) value); break; + case UUID: + builder.set(fieldName).toUuidArray((Iterable) value); + break; case STRUCT: builder.set(fieldName).toStructArray(elementType, (Iterable) value); break; @@ -298,6 +305,9 @@ private static Object decodeValue(Type fieldType, com.google.protobuf.Value prot case DATE: checkType(fieldType, proto, KindCase.STRING_VALUE); return Date.parseDate(proto.getStringValue()); + case UUID: + checkType(fieldType, proto, KindCase.STRING_VALUE); + return UUID.fromString(proto.getStringValue()); case ARRAY: checkType(fieldType, proto, KindCase.LIST_VALUE); ListValue listValue = proto.getListValue(); @@ -347,6 +357,7 @@ static Object decodeArrayValue(Type elementType, ListValue listValue) { case BYTES: case TIMESTAMP: case DATE: + case UUID: case STRUCT: case PROTO: return Lists.transform(listValue.getValuesList(), input -> decodeValue(elementType, input)); @@ -503,6 +514,12 @@ protected Date getDateInternal(int columnIndex) { return (Date) rowData.get(columnIndex); } + @Override + protected UUID getUuidInternal(int columnIndex) { + ensureDecoded(columnIndex); + return (UUID) rowData.get(columnIndex); + } + private boolean isUnrecognizedType(int columnIndex) { return type.getStructFields().get(columnIndex).getType().getCode() == Code.UNRECOGNIZED; } @@ -624,6 +641,8 @@ protected Value getValueInternal(int columnIndex) { return Value.timestamp(isNull ? null : getTimestampInternal(columnIndex)); case DATE: return Value.date(isNull ? null : getDateInternal(columnIndex)); + case UUID: + return Value.uuid(isNull ? null : getUuidInternal(columnIndex)); case STRUCT: return Value.struct(isNull ? null : getStructInternal(columnIndex)); case UNRECOGNIZED: @@ -664,6 +683,8 @@ protected Value getValueInternal(int columnIndex) { return Value.timestampArray(isNull ? null : getTimestampListInternal(columnIndex)); case DATE: return Value.dateArray(isNull ? null : getDateListInternal(columnIndex)); + case UUID: + return Value.uuidArray(isNull ? null : getUuidListInternal(columnIndex)); case STRUCT: return Value.structArray( elementType, isNull ? null : getStructListInternal(columnIndex)); @@ -847,6 +868,12 @@ protected List getDateListInternal(int columnIndex) { return Collections.unmodifiableList((List) rowData.get(columnIndex)); } + @Override + protected List getUuidListInternal(int columnIndex) { + ensureDecoded(columnIndex); + return Collections.unmodifiableList((List) rowData.get(columnIndex)); + } + @Override @SuppressWarnings("unchecked") // We know ARRAY> produces a List. protected List getStructListInternal(int columnIndex) { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java index 3d12cf5ad2c..39b73fec3a5 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ResultSets.java @@ -35,6 +35,7 @@ import com.google.spanner.v1.ResultSetStats; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** Utility methods for working with {@link com.google.cloud.spanner.ResultSet}. */ @@ -321,11 +322,21 @@ public Date getDate(int columnIndex) { return getCurrentRowAsStruct().getDate(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + return getCurrentRowAsStruct().getUuid(columnIndex); + } + @Override public Date getDate(String columnName) { return getCurrentRowAsStruct().getDate(columnName); } + @Override + public UUID getUuid(String columnName) { + return getCurrentRowAsStruct().getUuid(columnName); + } + @Override public T getProtoMessage(int columnIndex, T message) { return getCurrentRowAsStruct().getProtoMessage(columnIndex, message); @@ -508,6 +519,16 @@ public List getDateList(String columnName) { return getCurrentRowAsStruct().getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + return getCurrentRowAsStruct().getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnNameÏ) { + return getCurrentRowAsStruct().getUuidList(columnNameÏ); + } + @Override public List getProtoMessageList(int columnIndex, T message) { return getCurrentRowAsStruct().getProtoMessageList(columnIndex, message); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java index 112ecc8120c..d44a12e7291 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Struct.java @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.UUID; import java.util.function.Function; import javax.annotation.concurrent.Immutable; @@ -226,6 +227,11 @@ protected Date getDateInternal(int columnIndex) { return values.get(columnIndex).getDate(); } + @Override + protected UUID getUuidInternal(int columnIndex) { + return values.get(columnIndex).getUuid(); + } + @Override protected T getProtoMessageInternal(int columnIndex, T message) { return values.get(columnIndex).getProtoMessage(message); @@ -334,6 +340,11 @@ protected List getDateListInternal(int columnIndex) { return values.get(columnIndex).getDateArray(); } + @Override + protected List getUuidListInternal(int columnIndex) { + return values.get(columnIndex).getUuidArray(); + } + @Override protected List getStructListInternal(int columnIndex) { return values.get(columnIndex).getStructArray(); @@ -420,6 +431,8 @@ private Object getAsObject(int columnIndex) { return getTimestampInternal(columnIndex); case DATE: return getDateInternal(columnIndex); + case UUID: + return getUuidInternal(columnIndex); case STRUCT: return getStructInternal(columnIndex); case ARRAY: @@ -451,6 +464,8 @@ private Object getAsObject(int columnIndex) { return getTimestampListInternal(columnIndex); case DATE: return getDateListInternal(columnIndex); + case UUID: + return getUuidListInternal(columnIndex); case STRUCT: return getStructListInternal(columnIndex); default: diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java index f9967db0451..ce2ca3209c7 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/StructReader.java @@ -23,6 +23,7 @@ import com.google.protobuf.ProtocolMessageEnum; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -291,12 +292,16 @@ default T getProtoEnum( */ Date getDate(int columnIndex); + UUID getUuid(int columnIndex); + /** * @param columnName name of the column * @return the value of a non-{@code NULL} column with type {@link Type#date()}. */ Date getDate(String columnName); + UUID getUuid(String columnName); + /** * @param columnIndex index of the column * @return the value of a nullable column as a {@link Value}. @@ -625,6 +630,10 @@ default List getProtoEnumList( */ List getDateList(String columnName); + List getUuidList(int columnIndex); + + List getUuidList(String columnNameÏ); + /** * @param columnIndex index of the column * @return the value of a non-{@code NULL} column with type {@code Type.array(Type.struct(...))} diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java index 748cb7f87ec..2db28dad727 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java @@ -59,6 +59,7 @@ public final class Type implements Serializable { private static final Type TYPE_BYTES = new Type(Code.BYTES, null, null); private static final Type TYPE_TIMESTAMP = new Type(Code.TIMESTAMP, null, null); private static final Type TYPE_DATE = new Type(Code.DATE, null, null); + private static final Type TYPE_UUID = new Type(Code.UUID, null, null); private static final Type TYPE_ARRAY_BOOL = new Type(Code.ARRAY, TYPE_BOOL, null); private static final Type TYPE_ARRAY_INT64 = new Type(Code.ARRAY, TYPE_INT64, null); private static final Type TYPE_ARRAY_FLOAT32 = new Type(Code.ARRAY, TYPE_FLOAT32, null); @@ -72,6 +73,7 @@ public final class Type implements Serializable { private static final Type TYPE_ARRAY_BYTES = new Type(Code.ARRAY, TYPE_BYTES, null); private static final Type TYPE_ARRAY_TIMESTAMP = new Type(Code.ARRAY, TYPE_TIMESTAMP, null); private static final Type TYPE_ARRAY_DATE = new Type(Code.ARRAY, TYPE_DATE, null); + private static final Type TYPE_ARRAY_UUID = new Type(Code.ARRAY, TYPE_UUID, null); private static final int AMBIGUOUS_FIELD = -1; private static final long serialVersionUID = -3076152125004114582L; @@ -183,6 +185,8 @@ public static Type date() { return TYPE_DATE; } + public static Type uuid() { return TYPE_UUID;} + /** Returns a descriptor for an array of {@code elementType}. */ public static Type array(Type elementType) { Preconditions.checkNotNull(elementType); @@ -213,6 +217,8 @@ public static Type array(Type elementType) { return TYPE_ARRAY_TIMESTAMP; case DATE: return TYPE_ARRAY_DATE; + case UUID: + return TYPE_ARRAY_UUID; default: return new Type(Code.ARRAY, elementType, null); } @@ -295,6 +301,7 @@ public enum Code { BYTES(TypeCode.BYTES, "bytea"), TIMESTAMP(TypeCode.TIMESTAMP, "timestamp with time zone"), DATE(TypeCode.DATE, "date"), + UUID(TypeCode.UUID, "uuid"), ARRAY(TypeCode.ARRAY, "array"), STRUCT(TypeCode.STRUCT, "struct"); @@ -610,6 +617,8 @@ static Type fromProto(com.google.spanner.v1.Type proto) { return timestamp(); case DATE: return date(); + case UUID: + return uuid(); case PROTO: return proto(proto.getProtoTypeFqn()); case ENUM: diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java index c2c851d6dd8..9b236765ed7 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java @@ -47,6 +47,7 @@ import java.util.Collections; import java.util.List; import java.util.Objects; +import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nonnull; @@ -386,6 +387,8 @@ public static Value date(@Nullable Date v) { return new DateImpl(v == null, v); } + public static Value uuid(@Nullable UUID v) { return new UuidImpl(v == null, v); } + /** Returns a non-{@code NULL} {#code STRUCT} value. */ public static Value struct(Struct v) { Preconditions.checkNotNull(v, "Illegal call to create a NULL struct value."); @@ -776,6 +779,10 @@ public static Value dateArray(@Nullable Iterable v) { return new DateArrayImpl(v == null, v == null ? null : immutableCopyOf(v)); } + public static Value uuidArray(@Nullable Iterable v) { + return new UuidArrayImpl(v == null, v == null ? null : immutableCopyOf(v)); + } + /** * Returns an {@code ARRAY>} value. * @@ -915,6 +922,8 @@ public T getProtoEnum( */ public abstract Date getDate(); + public abstract UUID getUuid(); + /** * Returns the value of a {@code STRUCT}-typed instance. * @@ -1035,6 +1044,8 @@ public List getProtoEnumArray( */ public abstract List getDateArray(); + public abstract List getUuidArray(); + /** * Returns the value of an {@code ARRAY>}-typed instance. While the returned list * itself will never be {@code null}, elements of that list may be null. @@ -1314,6 +1325,11 @@ public Date getDate() { throw defaultGetter(Type.date()); } + @Override + public UUID getUuid() { + throw defaultGetter(Type.uuid()); + } + @Override public Struct getStruct() { if (getType().getCode() != Type.Code.STRUCT) { @@ -1378,6 +1394,9 @@ public List getDateArray() { throw defaultGetter(Type.array(Type.date())); } + @Override + public List getUuidArray() { throw defaultGetter(Type.array(Type.uuid()));} + @Override public List getStructArray() { if (getType().getCode() != Type.Code.ARRAY @@ -1795,6 +1814,24 @@ void valueToString(StringBuilder b) { } } + private static class UuidImpl extends AbstractObjectValue { + + private UuidImpl(boolean isNull, UUID value) { + super(isNull, Type.uuid(), value); + } + + @Override + public UUID getUuid() { + checkNotNull(); + return value; + } + + @Override + void valueToString(StringBuilder b) { + b.append(value); + } + } + private static class StringImpl extends AbstractObjectValue { private StringImpl(boolean isNull, @Nullable String value) { @@ -2797,6 +2834,24 @@ void appendElement(StringBuilder b, Date element) { } } + private static class UuidArrayImpl extends AbstractArrayValue { + + private UuidArrayImpl(boolean isNull, @Nullable List values) { + super(isNull, Type.uuid(), values); + } + + @Override + public List getUuidArray() { + checkNotNull(); + return value; + } + + @Override + void appendElement(StringBuilder b, UUID element) { + b.append(element); + } + } + private static class NumericArrayImpl extends AbstractArrayValue { private NumericArrayImpl(boolean isNull, @Nullable List values) { @@ -2938,6 +2993,8 @@ private Value getValue(int fieldIndex) { return Value.pgOid(value.getLong(fieldIndex)); case DATE: return Value.date(value.getDate(fieldIndex)); + case UUID: + return Value.uuid(value.getUuid(fieldIndex)); case TIMESTAMP: return Value.timestamp(value.getTimestamp(fieldIndex)); case PROTO: @@ -2976,6 +3033,8 @@ private Value getValue(int fieldIndex) { return Value.pgNumericArray(value.getStringList(fieldIndex)); case DATE: return Value.dateArray(value.getDateList(fieldIndex)); + case UUID: + return Value.uuidArray(value.getUuidList(fieldIndex)); case TIMESTAMP: return Value.timestampArray(value.getTimestampList(fieldIndex)); case STRUCT: diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java index 8386bd5c213..1b297758ee3 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java @@ -24,6 +24,7 @@ import com.google.protobuf.Descriptors.EnumDescriptor; import com.google.protobuf.ProtocolMessageEnum; import java.math.BigDecimal; +import java.util.UUID; import javax.annotation.Nullable; /** @@ -165,6 +166,10 @@ public R to(@Nullable Date value) { return handle(Value.date(value)); } + public R to(@Nullable UUID value) { + return handle(Value.uuid(value)); + } + /** Binds a non-{@code NULL} struct value to {@code Value.struct(value)} */ public R to(Struct value) { return handle(Value.struct(value)); @@ -323,6 +328,11 @@ public R toDateArray(@Nullable Iterable values) { return handle(Value.dateArray(values)); } + /** Binds to {@code Value.uuidArray(values)} */ + public R toUuidArray(@Nullable Iterable values) { + return handle(Value.uuidArray(values)); + } + /** Binds to {@code Value.structArray(fieldTypes, values)} */ public R toStructArray(Type elementType, @Nullable Iterable values) { return handle(Value.structArray(elementType, values)); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java index b5e4060ddd8..2e90397a6bd 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java @@ -32,6 +32,7 @@ import com.google.spanner.v1.ResultSetStats; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -288,6 +289,17 @@ public Date getDate(String columnName) { return delegate.getDate(columnName); } + @Override + public UUID getUuid(int columnIndex) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuid(columnIndex); + } + @Override + public UUID getUuid(String columnName) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuid(columnName); + } + @Override public Value getValue(int columnIndex) { Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); @@ -480,6 +492,18 @@ public List getDateList(String columnName) { return delegate.getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); + return delegate.getUuidList(columnName); + } + @Override public List getProtoMessageList(int columnIndex, T message) { Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java index bd7c794a0fa..57210495eca 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ReplaceableForwardingResultSet.java @@ -34,6 +34,7 @@ import com.google.spanner.v1.ResultSetStats; import java.math.BigDecimal; import java.util.List; +import java.util.UUID; import java.util.function.Function; /** @@ -291,12 +292,24 @@ public Date getDate(int columnIndex) { return delegate.getDate(columnIndex); } + @Override + public UUID getUuid(int columnIndex) { + checkClosed(); + return delegate.getUuid(columnIndex); + } + @Override public Date getDate(String columnName) { checkClosed(); return delegate.getDate(columnName); } + @Override + public UUID getUuid(String columnName) { + checkClosed(); + return delegate.getUuid(columnName); + } + @Override public Value getValue(int columnIndex) { checkClosed(); @@ -489,6 +502,18 @@ public List getDateList(String columnName) { return delegate.getDateList(columnName); } + @Override + public List getUuidList(int columnIndex) { + checkClosed(); + return delegate.getUuidList(columnIndex); + } + + @Override + public List getUuidList(String columnName) { + checkClosed(); + return delegate.getUuidList(columnName); + } + @Override public List getProtoMessageList(int columnIndex, T message) { checkClosed(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java index 595bbcaf26a..d7af5dee958 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java @@ -36,6 +36,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.UUID; import java.util.function.Function; import javax.annotation.Nullable; import org.junit.Before; @@ -103,6 +104,11 @@ protected Date getDateInternal(int columnIndex) { return null; } + @Override + protected UUID getUuidInternal(int columnIndex) { + return null; + } + @Override protected T getProtoMessageInternal(int columnIndex, T message) { return null; @@ -206,6 +212,11 @@ protected List getDateListInternal(int columnIndex) { return null; } + @Override + protected List getUuidListInternal(int columnIndex) { + return null; + } + @Override protected List getStructListInternal(int columnIndex) { return null; @@ -301,6 +312,13 @@ public static Collection parameters() { "getDate", Collections.singletonList("getValue") }, + { + Type.uuid(), + "getUuidInternal", + UUID.randomUUID(), + "getUuid", + Collections.singletonList("getValue") + }, { Type.array(Type.bool()), "getBooleanArrayInternal", @@ -423,6 +441,13 @@ public static Collection parameters() { "getDateList", Collections.singletonList("getValue") }, + { + Type.array(Type.uuid()), + "getUuidListInternal", + Arrays.asList(UUID.randomUUID(), UUID.randomUUID()), + "getUuidList", + Collections.singletonList("getValue") + }, { Type.array(Type.struct(StructField.of("f1", Type.int64()))), "getStructListInternal", diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java index 59a18a3ab79..5889608d845 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java @@ -50,6 +50,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.UUID; import javax.annotation.Nullable; import org.junit.Before; import org.junit.Test; @@ -552,6 +553,8 @@ public void serialization() { Value.timestamp(null), Value.date(Date.fromYearMonthDay(2017, 4, 17)), Value.date(null), + Value.uuid(UUID.randomUUID()), + Value.uuid(null), Value.stringArray(ImmutableList.of("one", "two")), Value.stringArray(null), Value.boolArray(new boolean[] {true, false}), @@ -574,11 +577,14 @@ public void serialization() { ImmutableList.of( Date.fromYearMonthDay(2017, 4, 17), Date.fromYearMonthDay(2017, 5, 18))), Value.dateArray(null), + Value.uuidArray(ImmutableList.of(UUID.randomUUID(), UUID.randomUUID())), + Value.uuidArray(null), Value.struct(s(null, 30)), Value.struct(structType, null), Value.structArray(structType, Arrays.asList(s("def", 10), null)), Value.structArray(structType, Collections.singletonList(null)), - Value.structArray(structType, null)); + Value.structArray(structType, null) + ); } @Test @@ -739,6 +745,23 @@ public void getDate() { assertThat(resultSet.getDate(0)).isEqualTo(Date.fromYearMonthDay(2018, 5, 29)); } + @Test + public void getUuid() { + final UUID uuid = UUID.randomUUID(); + consumer.onPartialResultSet( + PartialResultSet.newBuilder() + .setMetadata(makeMetadata(Type.struct(Type.StructField.of("f", Type.uuid())))) + .addValues(Value.uuid(uuid).toProto()) + .build()); + consumer.onCompleted(); + + Value value = Value.uuid(uuid); + com.google.protobuf.Value diff_value = value.toProto(); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getUuid(0)).isEqualTo(uuid); + } + @Test public void getTimestamp() { consumer.onPartialResultSet( @@ -992,6 +1015,22 @@ public void getDateList() { assertThat(resultSet.getDateList(0)).isEqualTo(dateList); } + @Test + public void getUuidList() { + List uuidList = Arrays.asList(UUID.randomUUID(), UUID.randomUUID()); + + consumer.onPartialResultSet( + PartialResultSet.newBuilder() + .setMetadata( + makeMetadata(Type.struct(Type.StructField.of("f", Type.array(Type.uuid()))))) + .addValues(Value.uuidArray(uuidList).toProto()) + .build()); + consumer.onCompleted(); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getUuidList(0)).isEqualTo(uuidList); + } + @Test public void getJsonList() { List jsonList = new ArrayList<>(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java index 39f1ff180fa..b1ef46d5457 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java @@ -1327,6 +1327,9 @@ private Statement buildStatement( case DATE: builder.bind(fieldName).toDateArray(null); break; + case UUID: + builder.bind(fieldName).toUuidArray(null); + break; case FLOAT32: builder.bind(fieldName).toFloat32Array((Iterable) null); break; @@ -1373,6 +1376,9 @@ private Statement buildStatement( case DATE: builder.bind(fieldName).to((Date) null); break; + case UUID: + builder.bind(fieldName).to((UUID) null); + break; case FLOAT32: builder.bind(fieldName).to((Float) null); break; @@ -1441,6 +1447,14 @@ private Statement buildStatement( GrpcStruct.decodeArrayValue( com.google.cloud.spanner.Type.date(), value.getListValue())); break; + case UUID: + builder + .bind(fieldName) + .toUuidArray( + (Iterable) + GrpcStruct.decodeArrayValue( + com.google.cloud.spanner.Type.uuid(), value.getListValue())); + break; case FLOAT32: builder .bind(fieldName) @@ -1532,6 +1546,9 @@ private Statement buildStatement( case DATE: builder.bind(fieldName).to(Date.parseDate(value.getStringValue())); break; + case UUID: + builder.bind(fieldName).to(UUID.fromString(value.getStringValue())); + break; case FLOAT32: builder.bind(fieldName).to((float) value.getNumberValue()); break; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java index 3ca550caa2d..fb51980a73d 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.UUID; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.atomic.AtomicInteger; @@ -70,6 +71,7 @@ public void resultSetIteration() { int year = 2018; int month = 5; int day = 26; + UUID uuid = UUID.randomUUID(); boolean[] boolArray = {true, false, true, true, false}; long[] longArray = {Long.MAX_VALUE, Long.MIN_VALUE, 0, 1, -1}; double[] doubleArray = {Double.MIN_VALUE, Double.MAX_VALUE, 0, 1, -1, 1.2341}; @@ -92,6 +94,9 @@ public void resultSetIteration() { Date[] dateArray = { Date.fromYearMonthDay(1, 2, 3), Date.fromYearMonthDay(4, 5, 6), Date.fromYearMonthDay(7, 8, 9) }; + UUID[] uuidArray = { + UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID() + }; String[] stringArray = {"abc", "def", "ghi"}; String[] jsonArray = {"{}", "{\"color\":\"red\",\"value\":\"#f00\"}", "[]"}; AbstractMessage[] protoMessageArray = { @@ -114,6 +119,7 @@ public void resultSetIteration() { Type.StructField.of("byteVal", Type.bytes()), Type.StructField.of("timestamp", Type.timestamp()), Type.StructField.of("date", Type.date()), + Type.StructField.of("uuid", Type.uuid()), Type.StructField.of( "protoMessage", Type.proto(protoMessageVal.getDescriptorForType().getFullName())), Type.StructField.of( @@ -126,6 +132,7 @@ public void resultSetIteration() { Type.StructField.of("byteArray", Type.array(Type.bytes())), Type.StructField.of("timestampArray", Type.array(Type.timestamp())), Type.StructField.of("dateArray", Type.array(Type.date())), + Type.StructField.of("uuidArray", Type.array(Type.uuid())), Type.StructField.of("stringArray", Type.array(Type.string())), Type.StructField.of("jsonArray", Type.array(Type.json())), Type.StructField.of("pgJsonbArray", Type.array(Type.pgJsonb())), @@ -163,6 +170,8 @@ public void resultSetIteration() { .to(Timestamp.ofTimeMicroseconds(usecs)) .set("date") .to(Date.fromYearMonthDay(year, month, day)) + .set("uuid") + .to(uuid) .set("protoMessage") .to(protoMessageVal) .set("protoEnum") @@ -183,6 +192,8 @@ public void resultSetIteration() { .to(Value.timestampArray(Arrays.asList(timestampArray))) .set("dateArray") .to(Value.dateArray(Arrays.asList(dateArray))) + .set("uuidArray") + .to(Value.uuidArray(Arrays.asList(uuidArray))) .set("stringArray") .to(Value.stringArray(Arrays.asList(stringArray))) .set("jsonArray") @@ -228,6 +239,8 @@ public void resultSetIteration() { .to(Timestamp.ofTimeMicroseconds(usecs)) .set("date") .to(Date.fromYearMonthDay(year, month, day)) + .set("uuid") + .to(uuid) .set("protoMessage") .to(protoMessageVal) .set("protoEnum") @@ -248,6 +261,8 @@ public void resultSetIteration() { .to(Value.timestampArray(Arrays.asList(timestampArray))) .set("dateArray") .to(Value.dateArray(Arrays.asList(dateArray))) + .set("uuidArray") + .to(Value.uuidArray(Arrays.asList(uuidArray))) .set("stringArray") .to(Value.stringArray(Arrays.asList(stringArray))) .set("jsonArray") @@ -339,6 +354,12 @@ public void resultSetIteration() { assertThat(rs.getDate("date")).isEqualTo(Date.fromYearMonthDay(year, month, day)); assertThat(rs.getValue("date")).isEqualTo(Value.date(Date.fromYearMonthDay(year, month, day))); + // UUID + assertThat(rs.getUuid(columnIndex)).isEqualTo(uuid); + assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.uuid(uuid)); + assertThat(rs.getUuid("uuid")).isEqualTo(uuid); + assertThat(rs.getValue("uuid")).isEqualTo(Value.uuid(uuid)); + assertEquals(protoMessageVal, rs.getProtoMessage(columnIndex, SingerInfo.getDefaultInstance())); assertEquals(Value.protoMessage(protoMessageVal), rs.getValue(columnIndex++)); assertEquals( @@ -400,6 +421,13 @@ public void resultSetIteration() { assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.dateArray(Arrays.asList(dateArray))); assertThat(rs.getDateList("dateArray")).isEqualTo(Arrays.asList(dateArray)); assertThat(rs.getValue("dateArray")).isEqualTo(Value.dateArray(Arrays.asList(dateArray))); + + // UUID Array + assertThat(rs.getUuidList(columnIndex)).isEqualTo(Arrays.asList(uuidArray)); + assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.uuidArray(Arrays.asList(uuidArray))); + assertThat(rs.getUuidList("uuidArray")).isEqualTo(Arrays.asList(uuidArray)); + assertThat(rs.getValue("uuidArray")).isEqualTo(Value.uuidArray(Arrays.asList(uuidArray))); + assertThat(rs.getStringList(columnIndex)).isEqualTo(Arrays.asList(stringArray)); assertThat(rs.getValue(columnIndex++)).isEqualTo(Value.stringArray(Arrays.asList(stringArray))); assertThat(rs.getStringList("stringArray")).isEqualTo(Arrays.asList(stringArray)); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java index aea799aa158..0d069ae5d8f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/TypeTest.java @@ -240,6 +240,16 @@ Type newType() { }.test(); } + @Test + public void uuid() { + new ScalarTypeTester(Type.Code.UUID, TypeCode.UUID) { + @Override + Type newType() { + return Type.uuid(); + } + }.test(); + } + abstract static class ArrayTypeTester { private final Type.Code expectedElementCode; private final TypeCode expectedElementTypeCode; @@ -428,6 +438,16 @@ Type newElementType() { }.test(); } + @Test + public void uuidArray() { + new ArrayTypeTester(Type.Code.UUID, TypeCode.UUID, true) { + @Override + Type newElementType() { + return Type.uuid(); + } + }.test(); + } + @Test public void protoArray() { new ArrayTypeTester(Type.Code.PROTO, TypeCode.PROTO, "com.google.temp", false) { @@ -615,6 +635,7 @@ public void testGoogleSQLTypeNames() { assertEquals("STRING", Type.string().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("BYTES", Type.bytes().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("DATE", Type.date().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); + assertEquals("UUID", Type.uuid().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("TIMESTAMP", Type.timestamp().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("JSON", Type.json().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals("NUMERIC", Type.numeric().getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); @@ -632,6 +653,8 @@ public void testGoogleSQLTypeNames() { "ARRAY", Type.array(Type.bytes()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals( "ARRAY", Type.array(Type.date()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); + assertEquals( + "ARRAY", Type.array(Type.uuid()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); assertEquals( "ARRAY", Type.array(Type.timestamp()).getSpannerTypeName(Dialect.GOOGLE_STANDARD_SQL)); @@ -650,6 +673,7 @@ public void testPostgreSQLTypeNames() { assertEquals("character varying", Type.string().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("bytea", Type.bytes().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("date", Type.date().getSpannerTypeName(Dialect.POSTGRESQL)); + assertEquals("uuid", Type.uuid().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals( "timestamp with time zone", Type.timestamp().getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("jsonb", Type.pgJsonb().getSpannerTypeName(Dialect.POSTGRESQL)); @@ -663,6 +687,7 @@ public void testPostgreSQLTypeNames() { "character varying[]", Type.array(Type.string()).getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("bytea[]", Type.array(Type.bytes()).getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals("date[]", Type.array(Type.date()).getSpannerTypeName(Dialect.POSTGRESQL)); + assertEquals("uuid[]", Type.array(Type.uuid()).getSpannerTypeName(Dialect.POSTGRESQL)); assertEquals( "timestamp with time zone[]", Type.array(Type.timestamp()).getSpannerTypeName(Dialect.POSTGRESQL)); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java index 23128ad52b2..9017b3d3288 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.Base64; import java.util.Collections; +import java.util.UUID; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -331,6 +332,8 @@ public static Date defaultDate() { return Date.fromYearMonthDay(2016, 9, 15); } + public static UUID defaultUuid() { return UUID.fromString("db09330e-cc05-472c-a54e-b2784deebac3");} + public static boolean[] defaultBooleanArray() { return new boolean[] {false, true}; } @@ -388,6 +391,10 @@ public static Iterable defaultDateIterable() { return Arrays.asList(Date.fromYearMonthDay(2016, 9, 15), Date.fromYearMonthDay(2016, 9, 14)); } + public static Iterable defaultUuidIterable() { + return Arrays.asList(UUID.fromString("8ebe9153-2747-4c92-a462-6da13eb25ebb"), UUID.fromString("12c154ca-6500-4be0-89c8-160bcfa8c3f6")); + } + static Object getDefault(java.lang.reflect.Type type) throws InvocationTargetException, IllegalAccessException { for (Method method : DefaultValues.class.getMethods()) { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java index 92b63913fdb..efa2be01994 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java @@ -51,6 +51,7 @@ import java.util.Collections; import java.util.List; import java.util.Random; +import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; import org.junit.Test; @@ -731,6 +732,28 @@ public void dateNull() { assertEquals("NULL", v.getAsString()); } + @Test + public void uuid() { + UUID uuid = UUID.randomUUID(); + Value v = Value.uuid(uuid); + assertThat(v.getType()).isEqualTo(Type.uuid()); + assertThat(v.isNull()).isFalse(); + assertThat(v.getUuid()).isSameInstanceAs(uuid); + assertThat(v.toString()).isEqualTo(uuid.toString()); + assertEquals(uuid.toString(), v.getAsString()); + } + + @Test + public void uuidNull() { + Value v = Value.uuid(null); + assertThat(v.getType()).isEqualTo(Type.uuid()); + assertThat(v.isNull()).isTrue(); + assertThat(v.toString()).isEqualTo(NULL_STRING); + IllegalStateException e = assertThrows(IllegalStateException.class, v::getUuid); + assertThat(e.getMessage()).contains("null value"); + assertEquals("NULL", v.getAsString()); + } + @Test public void protoMessage() { SingerInfo singerInfo = SingerInfo.newBuilder().setSingerId(111).setGenre(Genre.FOLK).build(); @@ -1359,6 +1382,30 @@ public void dateArrayNull() { assertEquals("NULL", v.getAsString()); } + @Test + public void uuidArray() { + UUID uuid1 = UUID.randomUUID(); + UUID uuid2 = UUID.randomUUID(); + + Value v = Value.uuidArray(Arrays.asList(uuid1, null, uuid2)); + assertThat(v.isNull()).isFalse(); + assertThat(v.getUuidArray()) + .containsExactly(uuid1, null, uuid2) + .inOrder(); + assertThat(v.toString()).isEqualTo("[" + uuid1.toString() + ",NULL," + uuid2.toString() + "]"); + assertEquals(String.format("[%s,NULL,%s]", uuid1.toString(), uuid2.toString()), v.getAsString()); + } + + @Test + public void uuidArrayNull() { + Value v = Value.uuidArray(null); + assertThat(v.isNull()).isTrue(); + assertThat(v.toString()).isEqualTo(NULL_STRING); + IllegalStateException e = assertThrows(IllegalStateException.class, v::getUuidArray); + assertThat(e.getMessage()).contains("null value"); + assertEquals("NULL", v.getAsString()); + } + @Test public void protoMessageArray() { SingerInfo singerInfo1 = SingerInfo.newBuilder().setSingerId(111).setGenre(Genre.FOLK).build(); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java index e13cfa91c1f..65ecb683160 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java @@ -42,6 +42,7 @@ import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.util.Arrays; +import java.util.UUID; import java.util.concurrent.Callable; import org.junit.Test; import org.junit.runner.RunWith; @@ -81,6 +82,8 @@ public class ChecksumResultSetTest { .to(Timestamp.parseTimestamp("2022-08-04T11:20:00.123456789Z")) .set("date") .to(Date.fromYearMonthDay(2022, 8, 3)) + .set("uuid") + .to(UUID.randomUUID()) .set("boolArray") .to(Value.boolArray(Arrays.asList(Boolean.FALSE, null, Boolean.TRUE))) .set("longArray") @@ -108,6 +111,9 @@ public class ChecksumResultSetTest { .to( Value.dateArray( Arrays.asList(Date.parseDate("2000-01-01"), null, Date.parseDate("2022-08-03")))) + .set("uuidArray") + .to( + Value.uuidArray(Arrays.asList(UUID.randomUUID(), UUID.randomUUID()))) .set("stringArray") .to(Value.stringArray(Arrays.asList("test2", null, "test1"))) .set("jsonArray") @@ -150,6 +156,7 @@ public void testRetry() { Type.StructField.of("byteVal", Type.bytes()), Type.StructField.of("timestamp", Type.timestamp()), Type.StructField.of("date", Type.date()), + Type.StructField.of("uuid", Type.uuid()), Type.StructField.of("boolArray", Type.array(Type.bool())), Type.StructField.of("longArray", Type.array(Type.int64())), Type.StructField.of("doubleArray", Type.array(Type.float64())), @@ -159,6 +166,7 @@ public void testRetry() { Type.StructField.of("byteArray", Type.array(Type.bytes())), Type.StructField.of("timestampArray", Type.array(Type.timestamp())), Type.StructField.of("dateArray", Type.array(Type.date())), + Type.StructField.of("uuidArray", Type.array(Type.uuid())), Type.StructField.of("stringArray", Type.array(Type.string())), Type.StructField.of("jsonArray", Type.array(Type.json())), Type.StructField.of("pgJsonbArray", Type.array(Type.pgJsonb())), @@ -200,6 +208,8 @@ public void testRetry() { .to(Timestamp.parseTimestamp("2022-08-04T10:19:00.123456789Z")) .set("date") .to(Date.fromYearMonthDay(2022, 8, 4)) + .set("uuid") + .to(UUID.randomUUID()) .set("boolArray") .to(Value.boolArray(Arrays.asList(Boolean.TRUE, null, Boolean.FALSE))) .set("longArray") @@ -228,6 +238,8 @@ public void testRetry() { Value.dateArray( Arrays.asList( Date.parseDate("2000-01-01"), null, Date.parseDate("2022-08-04")))) + .set("uuidArray") + .to(Value.uuidArray(Arrays.asList(UUID.randomUUID(), UUID.randomUUID()))) .set("stringArray") .to(Value.stringArray(Arrays.asList("test1", null, "test2"))) .set("jsonArray") @@ -282,6 +294,8 @@ public void testRetry() { .to((Timestamp) null) .set("date") .to((Date) null) + .set("uuid") + .to((UUID) null) .set("boolArray") .toBoolArray((Iterable) null) .set("longArray") @@ -300,6 +314,8 @@ public void testRetry() { .toTimestampArray(null) .set("dateArray") .toDateArray(null) + .set("uuidArray") + .toUuidArray(null) .set("stringArray") .toStringArray(null) .set("jsonArray") diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java index da4b87200c3..e21e0020f6e 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/RandomResultSetGenerator.java @@ -39,6 +39,7 @@ import java.util.Arrays; import java.util.List; import java.util.Random; +import java.util.UUID; /** * Utility class for generating {@link ResultSet}s containing columns with all possible data types @@ -68,6 +69,7 @@ public static Type[] generateAllTypes(Dialect dialect) { : Type.newBuilder().setCode(TypeCode.JSON).build(), Type.newBuilder().setCode(TypeCode.BYTES).build(), Type.newBuilder().setCode(TypeCode.DATE).build(), + Type.newBuilder().setCode(TypeCode.UUID).build(), Type.newBuilder().setCode(TypeCode.TIMESTAMP).build())); if (dialect == Dialect.POSTGRESQL) { types.add( @@ -124,6 +126,10 @@ public static Type[] generateAllTypes(Dialect dialect) { .setCode(TypeCode.ARRAY) .setArrayElementType(Type.newBuilder().setCode(TypeCode.DATE)) .build(), + Type.newBuilder() + .setCode(TypeCode.ARRAY) + .setArrayElementType(Type.newBuilder().setCode(TypeCode.UUID)) + .build(), Type.newBuilder() .setCode(TypeCode.ARRAY) .setArrayElementType(Type.newBuilder().setCode(TypeCode.TIMESTAMP)) @@ -255,6 +261,10 @@ private void setRandomValue(Value.Builder builder, Type type) { random.nextInt(2019) + 1, random.nextInt(11) + 1, random.nextInt(28) + 1); builder.setStringValue(date.toString()); break; + case UUID: + UUID uuid = UUID.randomUUID(); + builder.setStringValue(uuid.toString()); + break; case FLOAT32: if (randomNaN()) { builder.setNumberValue(Float.NaN); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java index 18044c452b5..3fd57761286 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java @@ -56,6 +56,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.UUID; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -423,6 +424,27 @@ public void bindDateNull() { assertThat(row.isNull(0)).isTrue(); } + @Test + public void bindUuid() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + UUID uuid = UUID.randomUUID(); + Struct row = execute(Statement.newBuilder(selectValueQuery).bind("p1").to(uuid), Type.uuid()); + assertThat(row.isNull(0)).isFalse(); + assertThat(row.getUuid(0)).isEqualTo(uuid); + } + + @Test + public void bindUuidNull() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + Struct row = + execute(Statement.newBuilder(selectValueQuery).bind("p1").to((UUID) null), Type.uuid()); + assertThat(row.isNull(0)).isTrue(); + } + @Test public void bindNumeric() { assumeFalse("Emulator does not yet support NUMERIC", EmulatorSpannerHelper.isUsingEmulator()); @@ -817,6 +839,47 @@ public void bindDateArrayNull() { assertThat(row.isNull(0)).isTrue(); } + @Test + public void bindUuidArray() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + UUID u1 = UUID.randomUUID(); + UUID u2 = UUID.randomUUID(); + + Struct row = + execute( + Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(asList(u1, u2, null)), + Type.array(Type.uuid())); + assertThat(row.isNull(0)).isFalse(); + assertThat(row.getUuidList(0)).containsExactly(u1, u2, null).inOrder(); + } + + @Test + public void bindUuidArrayEmpty() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + Struct row = + execute( + Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(Collections.emptyList()), + Type.array(Type.uuid())); + assertThat(row.isNull(0)).isFalse(); + assertThat(row.getUuidList(0)).containsExactly(); + } + + @Test + public void bindUuidArrayNull() { + assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); + + Struct row = + execute( + Statement.newBuilder(selectValueQuery).bind("p1").toUuidArray(null), + Type.array(Type.uuid())); + assertThat(row.isNull(0)).isTrue(); + } + @Test public void bindNumericArrayGoogleStandardSQL() { assumeTrue(dialect.dialect == Dialect.GOOGLE_STANDARD_SQL); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java new file mode 100644 index 00000000000..15d6db09cb1 --- /dev/null +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java @@ -0,0 +1,452 @@ +/* + * 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 + * + * 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.spanner.it; + +import static com.google.common.base.Strings.isNullOrEmpty; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.Timestamp; +import com.google.cloud.spanner.Database; +import com.google.cloud.spanner.DatabaseClient; +import com.google.cloud.spanner.Dialect; +import com.google.cloud.spanner.IntegrationTestEnv; +import com.google.cloud.spanner.Key; +import com.google.cloud.spanner.KeySet; +import com.google.cloud.spanner.Mutation; +import com.google.cloud.spanner.ParallelIntegrationTest; +import com.google.cloud.spanner.ResultSet; +import com.google.cloud.spanner.Statement; +import com.google.cloud.spanner.Struct; +import com.google.cloud.spanner.TimestampBound; +import com.google.cloud.spanner.Value; +import com.google.cloud.spanner.connection.ConnectionOptions; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@Category(ParallelIntegrationTest.class) +@RunWith(Parameterized.class) +public class ITUuidTest { + + @ClassRule public static IntegrationTestEnv env = new IntegrationTestEnv(); + + private static boolean isUsingCloudDevel() { + String jobType = System.getenv("JOB_TYPE"); + + // Assumes that the jobType contains the string "cloud-devel" to signal that + // the environment is cloud-devel. + return !isNullOrEmpty(jobType) && jobType.contains("cloud-devel"); + } + + @Parameterized.Parameters(name = "Dialect = {0}") + public static List data() { + return Arrays.asList( + new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL), + new DialectTestParameter(Dialect.POSTGRESQL)); + } + + @Parameterized.Parameter() public DialectTestParameter dialect; + + private static DatabaseClient googleStandardSQLClient; + private static DatabaseClient postgreSQLClient; + + private static final String[] GOOGLE_STANDARD_SQL_SCHEMA = + new String[] { + "CREATE TABLE T (" + + " Key STRING(MAX) NOT NULL," + + " UuidValue UUID," + + " UuidArrayValue ARRAY," + + ") PRIMARY KEY (Key)", + "CREATE TABLE UK (" + + " Key UUID NOT NULL," + + ") PRIMARY KEY (Key)", + }; + + private static final String[] POSTGRESQL_SCHEMA = + new String[] { + "CREATE TABLE T (" + + " Key VARCHAR PRIMARY KEY," + + " UuidValue UUID," + + " UuidArrayValue UUID[]" + + ")", + "CREATE TABLE UK (" + + " Key UUID PRIMARY KEY" + + ")", + }; + + private static DatabaseClient client; + + private UUID uuid1 = UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a");; + private UUID uuid2 = UUID.fromString("f5868be9-7983-4cfa-adf3-2e9f13f2019d"); + + + @BeforeClass + public static void setUpDatabase() + throws ExecutionException, InterruptedException, TimeoutException { + Database googleStandardSQLDatabase = + env.getTestHelper().createTestDatabase(GOOGLE_STANDARD_SQL_SCHEMA); + + googleStandardSQLClient = env.getTestHelper().getDatabaseClient(googleStandardSQLDatabase); + + Database postgreSQLDatabase = + env.getTestHelper() + .createTestDatabase(Dialect.POSTGRESQL, Arrays.asList(POSTGRESQL_SCHEMA)); + postgreSQLClient = env.getTestHelper().getDatabaseClient(postgreSQLDatabase); + } + + @Before + public void before() { + client = + dialect.dialect == Dialect.GOOGLE_STANDARD_SQL ? googleStandardSQLClient : postgreSQLClient; + } + + @AfterClass + public static void tearDown() throws Exception { + ConnectionOptions.closeSpanner(); + } + + /** Sequence used to generate unique keys. */ + private static int seq; + + private static String uniqueString() { + return String.format("k%04d", seq++); + } + + private String lastKey; + + private Timestamp write(Mutation m) { + return client.write(Collections.singletonList(m)); + } + + private Mutation.WriteBuilder baseInsert() { + return Mutation.newInsertOrUpdateBuilder("T").set("Key").to(lastKey = uniqueString()); + } + + private Struct readRow(String table, String key, String... columns) { + return client + .singleUse(TimestampBound.strong()) + .readRow(table, Key.of(key), Arrays.asList(columns)); + } + + private Struct readLastRow(String... columns) { + return readRow("T", lastKey, columns); + } + + private Timestamp deleteAllRows(String table) { + return write(Mutation.delete(table, KeySet.all())); + } + + @Test + public void writeUuid() { + UUID uuid = UUID.randomUUID(); + write(baseInsert().set("UuidValue").to(uuid).build()); + Struct row = readLastRow("UuidValue"); + assertFalse(row.isNull(0)); + assertEquals(uuid, row.getUuid(0)); + } + + @Test + public void writeUuidNull() { + write(baseInsert().set("UuidValue").to((UUID) null).build()); + Struct row = readLastRow("UuidValue"); + assertTrue(row.isNull(0)); + } + + @Test + public void writeUuidArrayNull() { + write(baseInsert().set("UuidArrayValue").toUuidArray(null).build()); + Struct row = readLastRow("UuidArrayValue"); + assertTrue(row.isNull(0)); + } + + @Test + public void writeUuidArrayEmpty() { + write(baseInsert().set("UuidArrayValue").toUuidArray(Collections.emptyList()).build()); + Struct row = readLastRow("UuidArrayValue"); + assertFalse(row.isNull(0)); + assertTrue(row.getUuidList(0).isEmpty()); + } + + @Test + public void writeUuidArray() { + UUID uuid1 = UUID.randomUUID(); + UUID uuid2 = UUID.randomUUID(); + + write( + baseInsert() + .set("UuidArrayValue") + .toUuidArray(Arrays.asList(null, uuid1, uuid2)) + .build()); + Struct row = readLastRow("UuidArrayValue"); + assertFalse(row.isNull(0)); + assertEquals(row.getUuidList(0), Arrays.asList(null, uuid1, uuid2)); + } + + @Test + public void writeUuidArrayNoNulls() { + UUID uuid1 = UUID.randomUUID(); + UUID uuid2 = UUID.randomUUID(); + + write(baseInsert().set("UuidArrayValue").toUuidArray(Arrays.asList(uuid1, uuid2)).build()); + Struct row = readLastRow("UuidArrayValue"); + assertFalse(row.isNull(0)); + assertEquals(2, row.getUuidList(0).size()); + assertEquals(uuid1, row.getUuidList(0).get(0)); + assertEquals(uuid2, row.getUuidList(0).get(1)); + } + + private String getInsertStatementWithLiterals() { + String statement = "INSERT INTO T (Key, UuidValue, UuidArrayValue) VALUES "; + + if (dialect.dialect == Dialect.POSTGRESQL) { + statement += + "('dml1', 'aac68fbe-6847-48b1-8373-110950aeaf3a', array['aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid]), " + + "('dml2', 'aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid, array['aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid])," + + "('dml3', null, null), " + + "('dml4', 'aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid, array['aac68fbe-6847-48b1-8373-110950aeaf3a'::uuid, 'f5868be9-7983-4cfa-adf3-2e9f13f2019d'::uuid, null])"; + } else { + statement += + "('dml1', 'aac68fbe-6847-48b1-8373-110950aeaf3a', [CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID)]), " + + "('dml2', CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID), [CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID)]), " + + "('dml3', null, null), " + + "('dml4', 'aac68fbe-6847-48b1-8373-110950aeaf3a', [CAST('aac68fbe-6847-48b1-8373-110950aeaf3a' AS UUID), CAST('f5868be9-7983-4cfa-adf3-2e9f13f2019d' AS UUID), null])"; + } + return statement; + } + + @Test + public void uuidLiterals() { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate(Statement.of(getInsertStatementWithLiterals())); + return null; + }); + + verifyNonKeyContents("dml"); + } + + private String getInsertStatementWithParameters() { + String statement = + "INSERT INTO T (Key, UuidValue, UuidArrayValue) VALUES " + + "('param1', $1, $2), " + + "('param2', $3, $4), " + + "('param3', $5, $6), " + + "('param4', $7, $8)"; + + return (dialect.dialect == Dialect.POSTGRESQL) ? statement : statement.replace("$", "@p"); + } + + @Test + public void uuidParameter() { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.newBuilder(getInsertStatementWithParameters()) + .bind("p1") + .to(Value.uuid(uuid1)) + .bind("p2") + .to(Value.uuidArray(Collections.singletonList(uuid1))) + .bind("p3") + .to(Value.uuid(uuid1)) + .bind("p4") + .to(Value.uuidArray(Collections.singletonList(uuid1))) + .bind("p5") + .to(Value.uuid(null)) + .bind("p6") + .to(Value.uuidArray(null)) + .bind("p7") + .to(Value.uuid(uuid1)) + .bind("p8") + .to(Value.uuidArray(Arrays.asList(uuid1, uuid2, null))) + .build()); + return null; + }); + + verifyNonKeyContents("param"); + } + + private String getInsertStatementForUntypedParameters() { + if (dialect.dialect == Dialect.POSTGRESQL) { + return "INSERT INTO T (key, uuidValue, uuidArrayValue) VALUES " + + "('untyped1', ($1)::uuid, ($2)::uuid[])"; + } + return "INSERT INTO T (Key, UuidValue, UuidArrayValue) VALUES " + + "('untyped1', CAST(@p1 AS UUID), CAST(@p2 AS ARRAY))"; + } + + @Test + public void uuidUntypedParameter() { + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.newBuilder(getInsertStatementForUntypedParameters()) + .bind("p1") + .to( + Value.untyped( + com.google.protobuf.Value.newBuilder() + .setStringValue("aac68fbe-6847-48b1-8373-110950aeaf3a") + .build())) + .bind("p2") + .to( + Value.untyped( + com.google.protobuf.Value.newBuilder() + .setListValue( + com.google.protobuf.ListValue.newBuilder() + .addValues( + com.google.protobuf.Value.newBuilder() + .setStringValue("aac68fbe-6847-48b1-8373-110950aeaf3a"))) + .build())) + .build()); + return null; + }); + + Struct row = readRow("T", "untyped1", "UuidValue", "UuidArrayValue"); + assertEquals(UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a"), row.getUuid(0)); + assertEquals(Collections.singletonList(UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a")), row.getUuidList(1)); + } + + private String getInsertStatementWithKeyLiterals(UUID uuid1, UUID uuid2) { + String statement = "INSERT INTO UK (Key) VALUES "; + if (dialect.dialect == Dialect.POSTGRESQL) { + statement += + "('"+ uuid1.toString() +"')," + + "('"+ uuid2.toString()+"'::uuid)"; + } else { + statement += + "('"+ uuid1.toString() +"')," + + "(CAST('"+ uuid2.toString()+"' AS UUID))"; + } + return statement; + } + + @Test + public void uuidAsKeyLiteral() { + deleteAllRows("UK"); + + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate(Statement.of(getInsertStatementWithKeyLiterals(uuid1, uuid2))); + return null; + }); + + verifyKeyContents(Arrays.asList(uuid1, uuid2)); + } + + private String getInsertStatementWithKeyParameters() { + String statement = "INSERT INTO UK (Key) VALUES " + + "($1)," + + "($2)"; + return (dialect.dialect == Dialect.POSTGRESQL) ? statement : statement.replace("$", "@p"); + } + + @Test + public void uuidAsKeyParameter() { + deleteAllRows("UK"); + UUID uuid1 = UUID.fromString("fb907080-48a4-4615-b2c4-c8ccb5bb66a4"); + UUID uuid2 = UUID.fromString("faee3a78-cc54-42fc-baa2-53197fb89e8a");; + + client + .readWriteTransaction() + .run( + transaction -> { + transaction.executeUpdate( + Statement.newBuilder(getInsertStatementWithKeyParameters()) + .bind("p1") + .to(Value.uuid(uuid1)) + .bind("p2") + .to(Value.uuid(uuid2)) + .build()); + return null; + }); + + verifyKeyContents(Arrays.asList(uuid1, uuid2)); + } + + private void verifyKeyContents(List uuids){ + try (ResultSet resultSet = + client + .singleUse() + .executeQuery( + Statement.of( + "SELECT Key AS key FROM UK ORDER BY key"))) { + + for (UUID uuid : uuids) { + assertTrue(resultSet.next()); + assertEquals(uuid, resultSet.getUuid("key")); + assertEquals(Value.uuid(uuid), resultSet.getValue("key")); + } + } + } + + private void verifyNonKeyContents(String keyPrefix) { + try (ResultSet resultSet = + client + .singleUse() + .executeQuery( + Statement.of( + "SELECT Key AS key, UuidValue AS uuidvalue, UuidArrayValue AS uuidarrayvalue FROM T WHERE Key LIKE '{keyPrefix}%' ORDER BY key" + .replace("{keyPrefix}", keyPrefix)))) { + + // Row 1 + assertTrue(resultSet.next()); + assertEquals(uuid1, resultSet.getUuid("uuidvalue")); + assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); + assertEquals(Collections.singletonList(uuid1), resultSet.getUuidList("uuidarrayvalue")); + assertEquals(Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); + + // Row 2 + assertTrue(resultSet.next()); + assertEquals(uuid1, resultSet.getUuid("uuidvalue")); + assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); + assertEquals(Collections.singletonList(uuid1), resultSet.getUuidList("uuidarrayvalue")); + assertEquals(Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); + + // Row 3 + assertTrue(resultSet.next()); + assertTrue(resultSet.isNull("uuidvalue")); + assertTrue(resultSet.isNull("uuidarrayvalue")); + + // Row 4 + assertTrue(resultSet.next()); + assertEquals(uuid1, resultSet.getUuid("uuidvalue")); + assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); + assertEquals(Arrays.asList(uuid1, uuid2, null), resultSet.getUuidList("uuidarrayvalue")); + assertEquals(Value.uuidArray(Arrays.asList(uuid1, uuid2, null)), resultSet.getValue("uuidarrayvalue")); + } + } +} From 49e8f92979757a2c07ed58f6b2814b3ff5777263 Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Fri, 27 Dec 2024 10:34:54 +0530 Subject: [PATCH 35/43] fix: unit tests for UUID type --- .../cloud/spanner/DatabaseClientImplTest.java | 21 +++++++ .../connection/AllTypesMockServerTest.java | 61 ++++++++++++++++--- .../connection/MergedResultSetTest.java | 2 +- .../PartitionedQueryMockServerTest.java | 16 ++--- 4 files changed, 81 insertions(+), 19 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java index 86d0bfc2c94..39784527317 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java @@ -120,6 +120,7 @@ import java.util.List; import java.util.Random; import java.util.Set; +import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -4627,6 +4628,7 @@ public void testGetAllTypesAsString() { resultSet, col++); assertAsString("2023-01-11", resultSet, col++); + assertAsString("b1153a48-cd31-498e-b770-f554bce48e05", resultSet, col++); assertAsString("2023-01-11T11:55:18.123456789Z", resultSet, col++); if (dialect == Dialect.POSTGRESQL) { // Check PG_OID value @@ -4668,6 +4670,7 @@ public void testGetAllTypesAsString() { resultSet, col++); assertAsString(ImmutableList.of("2000-02-29", "NULL", "2000-01-01"), resultSet, col++); + assertAsString(ImmutableList.of("b1153a48-cd31-498e-b770-f554bce48e05", "NULL", "11546309-8b37-4366-9a20-369381c7803a"), resultSet, col++); assertAsString( ImmutableList.of("2023-01-11T11:55:18.123456789Z", "NULL", "2023-01-12T11:55:18Z"), resultSet, @@ -5199,6 +5202,7 @@ private ListValue getRows(Dialect dialect) { .encodeToString("test-bytes".getBytes(StandardCharsets.UTF_8))) .build()) .addValues(com.google.protobuf.Value.newBuilder().setStringValue("2023-01-11").build()) + .addValues(com.google.protobuf.Value.newBuilder().setStringValue("b1153a48-cd31-498e-b770-f554bce48e05").build()) .addValues( com.google.protobuf.Value.newBuilder() .setStringValue("2023-01-11T11:55:18.123456789Z") @@ -5363,6 +5367,23 @@ private ListValue getRows(Dialect dialect) { .setStringValue("2000-01-01") .build()) .build())) + .addValues( + com.google.protobuf.Value.newBuilder() + .setListValue( + ListValue.newBuilder() + .addValues( + com.google.protobuf.Value.newBuilder() + .setStringValue("b1153a48-cd31-498e-b770-f554bce48e05") + .build()) + .addValues( + com.google.protobuf.Value.newBuilder() + .setNullValue(NullValue.NULL_VALUE) + .build()) + .addValues( + com.google.protobuf.Value.newBuilder() + .setStringValue("11546309-8b37-4366-9a20-369381c7803a") + .build()) + .build())) .addValues( com.google.protobuf.Value.newBuilder() .setListValue( diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java index 3313fa53426..a6e48f5d0d3 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java @@ -40,6 +40,7 @@ import java.util.Base64; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.junit.After; @@ -76,6 +77,7 @@ public static Object[] data() { public static final long PG_OID_VALUE = 1L; public static final byte[] BYTES_VALUE = "test-bytes".getBytes(StandardCharsets.UTF_8); public static final Date DATE_VALUE = Date.fromYearMonthDay(2024, 3, 2); + public static final UUID UUID_VALUE = UUID.randomUUID(); public static final Timestamp TIMESTAMP_VALUE = Timestamp.parseTimestamp("2024-03-02T07:07:00.20982735Z"); @@ -124,6 +126,12 @@ public static Object[] data() { Date.fromYearMonthDay(2024, 3, 3), Date.fromYearMonthDay(1, 1, 1), Date.fromYearMonthDay(9999, 12, 31)); + + public static final List UUID_ARRAY_VALUE = + Arrays.asList( + UUID.randomUUID(), + null, + UUID.randomUUID()); public static final List TIMESTAMP_ARRAY_VALUE = Arrays.asList( Timestamp.parseTimestamp("2024-03-01T07:07:00.20982735Z"), @@ -157,15 +165,16 @@ private void setupAllTypesResultSet(Dialect dialect) { // COL7: JSON / PG_JSONB // COL8: BYTES // COL9: DATE - // COL10: TIMESTAMP - // COL11: PG_OID (added only for POSTGRESQL dialect) - // COL12-21: ARRAY<..> for the types above. + // COL10: UUID + // COL11: TIMESTAMP + // COL12: PG_OID (added only for POSTGRESQL dialect) + // COL13-22: ARRAY<..> for the types above. // Only for GoogleSQL: - // COL22: PROTO - // COL23: ENUM - // COL24: ARRAY - // COL25: ARRAY - // COL26: ARRAY (added only for POSTGRESQL dialect) + // COL23: PROTO + // COL24: ENUM + // COL25: ARRAY + // COL26: ARRAY + // COL27: ARRAY (added only for POSTGRESQL dialect) ListValue.Builder row1Builder = ListValue.newBuilder() .addValues(Value.newBuilder().setBoolValue(BOOL_VALUE)) @@ -183,6 +192,7 @@ private void setupAllTypesResultSet(Dialect dialect) { .addValues( Value.newBuilder().setStringValue(Base64.getEncoder().encodeToString(BYTES_VALUE))) .addValues(Value.newBuilder().setStringValue(DATE_VALUE.toString())) + .addValues(Value.newBuilder().setStringValue(UUID_VALUE.toString())) .addValues(Value.newBuilder().setStringValue(TIMESTAMP_VALUE.toString())); if (dialect == Dialect.POSTGRESQL) { row1Builder.addValues( @@ -356,6 +366,23 @@ private void setupAllTypesResultSet(Dialect dialect) { .build()) .collect(Collectors.toList())) .build())) + .addValues( + Value.newBuilder() + .setListValue( + ListValue.newBuilder() + .addAllValues( + UUID_ARRAY_VALUE.stream() + .map( + uuid -> + uuid == null + ? Value.newBuilder() + .setNullValue(NullValue.NULL_VALUE) + .build() + : Value.newBuilder() + .setStringValue(uuid.toString()) + .build()) + .collect(Collectors.toList())) + .build())) .addValues( Value.newBuilder() .setListValue( @@ -509,6 +536,8 @@ public static Statement createInsertStatement(Dialect dialect) { .bind("p" + ++param) .to(DATE_VALUE) .bind("p" + ++param) + .to(UUID_VALUE) + .bind("p" + ++param) .to(TIMESTAMP_VALUE); if (dialect == Dialect.POSTGRESQL) { builder.bind("p" + ++param).to(PG_OID_VALUE); @@ -539,6 +568,8 @@ public static Statement createInsertStatement(Dialect dialect) { .bind("p" + ++param) .toDateArray(DATE_ARRAY_VALUE) .bind("p" + ++param) + .toUuidArray(UUID_ARRAY_VALUE) + .bind("p" + ++param) .toTimestampArray(TIMESTAMP_ARRAY_VALUE); if (dialect == Dialect.POSTGRESQL) { builder.bind("p" + ++param).toInt64Array(PG_OID_ARRAY_VALUE); @@ -573,6 +604,7 @@ public void testSelectAllTypes() { dialect == Dialect.POSTGRESQL ? resultSet.getPgJsonb(++col) : resultSet.getJson(++col)); assertArrayEquals(BYTES_VALUE, resultSet.getBytes(++col).toByteArray()); assertEquals(DATE_VALUE, resultSet.getDate(++col)); + assertEquals(UUID_VALUE, resultSet.getUuid(++col)); assertEquals(TIMESTAMP_VALUE, resultSet.getTimestamp(++col)); if (dialect == Dialect.POSTGRESQL) { assertEquals(PG_OID_VALUE, resultSet.getLong(++col)); @@ -595,6 +627,7 @@ public void testSelectAllTypes() { : resultSet.getJsonList(++col)); assertEquals(BYTES_ARRAY_VALUE, resultSet.getBytesList(++col)); assertEquals(DATE_ARRAY_VALUE, resultSet.getDateList(++col)); + assertEquals(UUID_ARRAY_VALUE, resultSet.getUuidList(++col)); assertEquals(TIMESTAMP_ARRAY_VALUE, resultSet.getTimestampList(++col)); if (dialect == Dialect.POSTGRESQL) { assertEquals(PG_OID_ARRAY_VALUE, resultSet.getLongList(++col)); @@ -613,8 +646,8 @@ public void testInsertAllTypes() { ExecuteSqlRequest request = mockSpanner.getRequestsOfType(ExecuteSqlRequest.class).get(0); Map paramTypes = request.getParamTypesMap(); Map params = request.getParams().getFieldsMap(); - assertEquals(dialect == Dialect.POSTGRESQL ? 22 : 20, paramTypes.size()); - assertEquals(dialect == Dialect.POSTGRESQL ? 22 : 20, params.size()); + assertEquals(dialect == Dialect.POSTGRESQL ? 24 : 22, paramTypes.size()); + assertEquals(dialect == Dialect.POSTGRESQL ? 24 : 22, params.size()); // Verify param types. ImmutableList expectedTypes; @@ -630,6 +663,7 @@ public void testInsertAllTypes() { TypeCode.JSON, TypeCode.BYTES, TypeCode.DATE, + TypeCode.UUID, TypeCode.TIMESTAMP, TypeCode.INT64); } else { @@ -644,6 +678,7 @@ public void testInsertAllTypes() { TypeCode.JSON, TypeCode.BYTES, TypeCode.DATE, + TypeCode.UUID, TypeCode.TIMESTAMP); } for (int col = 0; col < expectedTypes.size(); col++) { @@ -670,6 +705,7 @@ public void testInsertAllTypes() { Base64.getEncoder().encodeToString(BYTES_VALUE), params.get("p" + ++col).getStringValue()); assertEquals(DATE_VALUE.toString(), params.get("p" + ++col).getStringValue()); + assertEquals(UUID_VALUE.toString(), params.get("p" + ++col).getStringValue()); assertEquals(TIMESTAMP_VALUE.toString(), params.get("p" + ++col).getStringValue()); if (dialect == Dialect.POSTGRESQL) { assertEquals(String.valueOf(PG_OID_VALUE), params.get("p" + ++col).getStringValue()); @@ -730,6 +766,11 @@ public void testInsertAllTypes() { params.get("p" + ++col).getListValue().getValuesList().stream() .map(value -> value.hasNullValue() ? null : Date.parseDate(value.getStringValue())) .collect(Collectors.toList())); + assertEquals( + UUID_ARRAY_VALUE, + params.get("p" + ++col).getListValue().getValuesList().stream() + .map(value -> value.hasNullValue() ? null : UUID.fromString(value.getStringValue())) + .collect(Collectors.toList())); assertEquals( TIMESTAMP_ARRAY_VALUE, params.get("p" + ++col).getListValue().getValuesList().stream() diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/MergedResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/MergedResultSetTest.java index 8a309115c71..b0465be6106 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/MergedResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/MergedResultSetTest.java @@ -150,7 +150,7 @@ public void testAllResultsAreReturned() { if (numPartitions == 0) { assertEquals(0, resultSet.getColumnCount()); } else { - assertEquals(24, resultSet.getColumnCount()); + assertEquals(26, resultSet.getColumnCount()); assertEquals(Type.bool(), resultSet.getColumnType(0)); assertEquals(Type.bool(), resultSet.getColumnType("COL0")); assertEquals(10, resultSet.getColumnIndex("COL10")); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/PartitionedQueryMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/PartitionedQueryMockServerTest.java index 655ca0de586..1ac0c766548 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/PartitionedQueryMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/PartitionedQueryMockServerTest.java @@ -403,9 +403,9 @@ public void testRunEmptyPartitionedQuery() { statement, PartitionOptions.newBuilder().setMaxPartitions(maxPartitions).build())) { assertFalse(resultSet.next()); assertNotNull(resultSet.getMetadata()); - assertEquals(24, resultSet.getMetadata().getRowType().getFieldsCount()); + assertEquals(26, resultSet.getMetadata().getRowType().getFieldsCount()); assertNotNull(resultSet.getType()); - assertEquals(24, resultSet.getType().getStructFields().size()); + assertEquals(26, resultSet.getType().getStructFields().size()); } if (isMultiplexedSessionsEnabled(connection.getSpanner())) { assertEquals(2, mockSpanner.countRequestsOfType(CreateSessionRequest.class)); @@ -435,15 +435,15 @@ public void testGetMetadataWithoutNextCall() { connection.runPartitionedQuery( statement, PartitionOptions.newBuilder().setMaxPartitions(maxPartitions).build())) { assertNotNull(resultSet.getMetadata()); - assertEquals(24, resultSet.getMetadata().getRowType().getFieldsCount()); + assertEquals(26, resultSet.getMetadata().getRowType().getFieldsCount()); assertNotNull(resultSet.getType()); - assertEquals(24, resultSet.getType().getStructFields().size()); + assertEquals(26, resultSet.getType().getStructFields().size()); assertTrue(resultSet.next()); assertNotNull(resultSet.getMetadata()); - assertEquals(24, resultSet.getMetadata().getRowType().getFieldsCount()); + assertEquals(26, resultSet.getMetadata().getRowType().getFieldsCount()); assertNotNull(resultSet.getType()); - assertEquals(24, resultSet.getType().getStructFields().size()); + assertEquals(26, resultSet.getType().getStructFields().size()); assertFalse(resultSet.next()); } @@ -470,9 +470,9 @@ public void testGetMetadataWithoutNextCallOnEmptyResultSet() { connection.runPartitionedQuery( statement, PartitionOptions.newBuilder().setMaxPartitions(maxPartitions).build())) { assertNotNull(resultSet.getMetadata()); - assertEquals(24, resultSet.getMetadata().getRowType().getFieldsCount()); + assertEquals(26, resultSet.getMetadata().getRowType().getFieldsCount()); assertNotNull(resultSet.getType()); - assertEquals(24, resultSet.getType().getStructFields().size()); + assertEquals(26, resultSet.getType().getStructFields().size()); assertFalse(resultSet.next()); } From 4d210d7ff279cab5b719d05a1f1d79e9a8c6f72b Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Fri, 27 Dec 2024 11:37:29 +0530 Subject: [PATCH 36/43] fix: ignore uuid methods for clirr plugin --- .../clirr-ignored-differences.xml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/google-cloud-spanner/clirr-ignored-differences.xml b/google-cloud-spanner/clirr-ignored-differences.xml index 5b84cb4ebc3..524882b62a7 100644 --- a/google-cloud-spanner/clirr-ignored-differences.xml +++ b/google-cloud-spanner/clirr-ignored-differences.xml @@ -566,6 +566,48 @@ java.util.List getFloat32Array() + + + 7013 + com/google/cloud/spanner/AbstractStructReader + java.util.UUID getUuidInternal(int) + + + 7013 + com/google/cloud/spanner/AbstractStructReader + java.util.List getUuidListInternal(int) + + + 7012 + com/google/cloud/spanner/StructReader + java.util.UUID getUuid(int) + + + 7012 + com/google/cloud/spanner/StructReader + java.util.UUID getUuid(java.lang.String) + + + 7012 + com/google/cloud/spanner/StructReader + java.util.List getUuidList(int) + + + 7012 + com/google/cloud/spanner/StructReader + java.util.List getUuidList(java.lang.String) + + + 7013 + com/google/cloud/spanner/Value + java.util.UUID getUuid() + + + 7013 + com/google/cloud/spanner/Value + java.util.List getUuidArray() + + 7012 From 7bcc09886007a9024fdc3d56641e0f00e430c517 Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Tue, 31 Dec 2024 15:01:42 +0530 Subject: [PATCH 37/43] style: fix indentation --- .../AbstractStructReaderTypesTest.java | 28 +++++++++---------- .../google/cloud/spanner/it/ITUuidTest.java | 4 +++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java index d7af5dee958..c42082ad97f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/AbstractStructReaderTypesTest.java @@ -312,13 +312,13 @@ public static Collection parameters() { "getDate", Collections.singletonList("getValue") }, - { - Type.uuid(), - "getUuidInternal", - UUID.randomUUID(), - "getUuid", - Collections.singletonList("getValue") - }, + { + Type.uuid(), + "getUuidInternal", + UUID.randomUUID(), + "getUuid", + Collections.singletonList("getValue") + }, { Type.array(Type.bool()), "getBooleanArrayInternal", @@ -441,13 +441,13 @@ public static Collection parameters() { "getDateList", Collections.singletonList("getValue") }, - { - Type.array(Type.uuid()), - "getUuidListInternal", - Arrays.asList(UUID.randomUUID(), UUID.randomUUID()), - "getUuidList", - Collections.singletonList("getValue") - }, + { + Type.array(Type.uuid()), + "getUuidListInternal", + Arrays.asList(UUID.randomUUID(), UUID.randomUUID()), + "getUuidList", + Collections.singletonList("getValue") + }, { Type.array(Type.struct(StructField.of("f1", Type.int64()))), "getStructListInternal", diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java index 15d6db09cb1..3e86fcfda5e 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java @@ -51,6 +51,10 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; +/** + * Class for running integration tests for UUID data type. + * It tests read and write operations involving UUID as key and non-key columns. + */ @Category(ParallelIntegrationTest.class) @RunWith(Parameterized.class) public class ITUuidTest { From 42f078abd3ed3144ae936e7fc444b7ee5e448835 Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Fri, 3 Jan 2025 09:49:32 +0530 Subject: [PATCH 38/43] style: fix formatting issue --- .../java/com/google/cloud/spanner/Type.java | 4 +- .../java/com/google/cloud/spanner/Value.java | 8 +- .../connection/DirectExecuteResultSet.java | 1 + .../cloud/spanner/DatabaseClientImplTest.java | 14 +++- .../cloud/spanner/GrpcResultSetTest.java | 3 +- .../google/cloud/spanner/ResultSetsTest.java | 4 +- .../google/cloud/spanner/ValueBinderTest.java | 8 +- .../com/google/cloud/spanner/ValueTest.java | 7 +- .../connection/AllTypesMockServerTest.java | 9 +-- .../connection/ChecksumResultSetTest.java | 3 +- .../google/cloud/spanner/it/ITUuidTest.java | 79 ++++++++----------- 11 files changed, 70 insertions(+), 70 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java index 2db28dad727..85944bbc20f 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Type.java @@ -185,7 +185,9 @@ public static Type date() { return TYPE_DATE; } - public static Type uuid() { return TYPE_UUID;} + public static Type uuid() { + return TYPE_UUID; + } /** Returns a descriptor for an array of {@code elementType}. */ public static Type array(Type elementType) { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java index 9b236765ed7..8378c216e8c 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java @@ -387,7 +387,9 @@ public static Value date(@Nullable Date v) { return new DateImpl(v == null, v); } - public static Value uuid(@Nullable UUID v) { return new UuidImpl(v == null, v); } + public static Value uuid(@Nullable UUID v) { + return new UuidImpl(v == null, v); + } /** Returns a non-{@code NULL} {#code STRUCT} value. */ public static Value struct(Struct v) { @@ -1395,7 +1397,9 @@ public List getDateArray() { } @Override - public List getUuidArray() { throw defaultGetter(Type.array(Type.uuid()));} + public List getUuidArray() { + throw defaultGetter(Type.array(Type.uuid())); + } @Override public List getStructArray() { diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java index 2e90397a6bd..71451ff66a6 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/DirectExecuteResultSet.java @@ -294,6 +294,7 @@ public UUID getUuid(int columnIndex) { Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); return delegate.getUuid(columnIndex); } + @Override public UUID getUuid(String columnName) { Preconditions.checkState(nextCalledByClient, MISSING_NEXT_CALL); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java index 39784527317..ab283afe6d2 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java @@ -120,7 +120,6 @@ import java.util.List; import java.util.Random; import java.util.Set; -import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -4670,7 +4669,13 @@ public void testGetAllTypesAsString() { resultSet, col++); assertAsString(ImmutableList.of("2000-02-29", "NULL", "2000-01-01"), resultSet, col++); - assertAsString(ImmutableList.of("b1153a48-cd31-498e-b770-f554bce48e05", "NULL", "11546309-8b37-4366-9a20-369381c7803a"), resultSet, col++); + assertAsString( + ImmutableList.of( + "b1153a48-cd31-498e-b770-f554bce48e05", + "NULL", + "11546309-8b37-4366-9a20-369381c7803a"), + resultSet, + col++); assertAsString( ImmutableList.of("2023-01-11T11:55:18.123456789Z", "NULL", "2023-01-12T11:55:18Z"), resultSet, @@ -5202,7 +5207,10 @@ private ListValue getRows(Dialect dialect) { .encodeToString("test-bytes".getBytes(StandardCharsets.UTF_8))) .build()) .addValues(com.google.protobuf.Value.newBuilder().setStringValue("2023-01-11").build()) - .addValues(com.google.protobuf.Value.newBuilder().setStringValue("b1153a48-cd31-498e-b770-f554bce48e05").build()) + .addValues( + com.google.protobuf.Value.newBuilder() + .setStringValue("b1153a48-cd31-498e-b770-f554bce48e05") + .build()) .addValues( com.google.protobuf.Value.newBuilder() .setStringValue("2023-01-11T11:55:18.123456789Z") diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java index 10af30fc821..8d405cc235b 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java @@ -583,8 +583,7 @@ public void serialization() { Value.struct(structType, null), Value.structArray(structType, Arrays.asList(s("def", 10), null)), Value.structArray(structType, Collections.singletonList(null)), - Value.structArray(structType, null) - ); + Value.structArray(structType, null)); } @Test diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java index fb51980a73d..ff9be7fc39b 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java @@ -94,9 +94,7 @@ public void resultSetIteration() { Date[] dateArray = { Date.fromYearMonthDay(1, 2, 3), Date.fromYearMonthDay(4, 5, 6), Date.fromYearMonthDay(7, 8, 9) }; - UUID[] uuidArray = { - UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID() - }; + UUID[] uuidArray = {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()}; String[] stringArray = {"abc", "def", "ghi"}; String[] jsonArray = {"{}", "{\"color\":\"red\",\"value\":\"#f00\"}", "[]"}; AbstractMessage[] protoMessageArray = { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java index 9017b3d3288..d39f2358cd3 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueBinderTest.java @@ -332,7 +332,9 @@ public static Date defaultDate() { return Date.fromYearMonthDay(2016, 9, 15); } - public static UUID defaultUuid() { return UUID.fromString("db09330e-cc05-472c-a54e-b2784deebac3");} + public static UUID defaultUuid() { + return UUID.fromString("db09330e-cc05-472c-a54e-b2784deebac3"); + } public static boolean[] defaultBooleanArray() { return new boolean[] {false, true}; @@ -392,7 +394,9 @@ public static Iterable defaultDateIterable() { } public static Iterable defaultUuidIterable() { - return Arrays.asList(UUID.fromString("8ebe9153-2747-4c92-a462-6da13eb25ebb"), UUID.fromString("12c154ca-6500-4be0-89c8-160bcfa8c3f6")); + return Arrays.asList( + UUID.fromString("8ebe9153-2747-4c92-a462-6da13eb25ebb"), + UUID.fromString("12c154ca-6500-4be0-89c8-160bcfa8c3f6")); } static Object getDefault(java.lang.reflect.Type type) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java index efa2be01994..a91dffb2a2f 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ValueTest.java @@ -1389,11 +1389,10 @@ public void uuidArray() { Value v = Value.uuidArray(Arrays.asList(uuid1, null, uuid2)); assertThat(v.isNull()).isFalse(); - assertThat(v.getUuidArray()) - .containsExactly(uuid1, null, uuid2) - .inOrder(); + assertThat(v.getUuidArray()).containsExactly(uuid1, null, uuid2).inOrder(); assertThat(v.toString()).isEqualTo("[" + uuid1.toString() + ",NULL," + uuid2.toString() + "]"); - assertEquals(String.format("[%s,NULL,%s]", uuid1.toString(), uuid2.toString()), v.getAsString()); + assertEquals( + String.format("[%s,NULL,%s]", uuid1.toString(), uuid2.toString()), v.getAsString()); } @Test diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java index a6e48f5d0d3..1f75885aaa4 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AllTypesMockServerTest.java @@ -128,10 +128,7 @@ public static Object[] data() { Date.fromYearMonthDay(9999, 12, 31)); public static final List UUID_ARRAY_VALUE = - Arrays.asList( - UUID.randomUUID(), - null, - UUID.randomUUID()); + Arrays.asList(UUID.randomUUID(), null, UUID.randomUUID()); public static final List TIMESTAMP_ARRAY_VALUE = Arrays.asList( Timestamp.parseTimestamp("2024-03-01T07:07:00.20982735Z"), @@ -376,8 +373,8 @@ private void setupAllTypesResultSet(Dialect dialect) { uuid -> uuid == null ? Value.newBuilder() - .setNullValue(NullValue.NULL_VALUE) - .build() + .setNullValue(NullValue.NULL_VALUE) + .build() : Value.newBuilder() .setStringValue(uuid.toString()) .build()) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java index 65ecb683160..001bf8513eb 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ChecksumResultSetTest.java @@ -112,8 +112,7 @@ public class ChecksumResultSetTest { Value.dateArray( Arrays.asList(Date.parseDate("2000-01-01"), null, Date.parseDate("2022-08-03")))) .set("uuidArray") - .to( - Value.uuidArray(Arrays.asList(UUID.randomUUID(), UUID.randomUUID()))) + .to(Value.uuidArray(Arrays.asList(UUID.randomUUID(), UUID.randomUUID()))) .set("stringArray") .to(Value.stringArray(Arrays.asList("test2", null, "test1"))) .set("jsonArray") diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java index 3e86fcfda5e..5163a171eb7 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java @@ -52,8 +52,8 @@ import org.junit.runners.Parameterized; /** - * Class for running integration tests for UUID data type. - * It tests read and write operations involving UUID as key and non-key columns. + * Class for running integration tests for UUID data type. It tests read and write operations + * involving UUID as key and non-key columns. */ @Category(ParallelIntegrationTest.class) @RunWith(Parameterized.class) @@ -83,26 +83,22 @@ public static List data() { private static final String[] GOOGLE_STANDARD_SQL_SCHEMA = new String[] { - "CREATE TABLE T (" - + " Key STRING(MAX) NOT NULL," - + " UuidValue UUID," - + " UuidArrayValue ARRAY," - + ") PRIMARY KEY (Key)", - "CREATE TABLE UK (" - + " Key UUID NOT NULL," - + ") PRIMARY KEY (Key)", + "CREATE TABLE T (" + + " Key STRING(MAX) NOT NULL," + + " UuidValue UUID," + + " UuidArrayValue ARRAY," + + ") PRIMARY KEY (Key)", + "CREATE TABLE UK (" + " Key UUID NOT NULL," + ") PRIMARY KEY (Key)", }; private static final String[] POSTGRESQL_SCHEMA = new String[] { - "CREATE TABLE T (" - + " Key VARCHAR PRIMARY KEY," - + " UuidValue UUID," - + " UuidArrayValue UUID[]" - + ")", - "CREATE TABLE UK (" - + " Key UUID PRIMARY KEY" - + ")", + "CREATE TABLE T (" + + " Key VARCHAR PRIMARY KEY," + + " UuidValue UUID," + + " UuidArrayValue UUID[]" + + ")", + "CREATE TABLE UK (" + " Key UUID PRIMARY KEY" + ")", }; private static DatabaseClient client; @@ -110,7 +106,6 @@ public static List data() { private UUID uuid1 = UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a");; private UUID uuid2 = UUID.fromString("f5868be9-7983-4cfa-adf3-2e9f13f2019d"); - @BeforeClass public static void setUpDatabase() throws ExecutionException, InterruptedException, TimeoutException { @@ -204,10 +199,7 @@ public void writeUuidArray() { UUID uuid2 = UUID.randomUUID(); write( - baseInsert() - .set("UuidArrayValue") - .toUuidArray(Arrays.asList(null, uuid1, uuid2)) - .build()); + baseInsert().set("UuidArrayValue").toUuidArray(Arrays.asList(null, uuid1, uuid2)).build()); Struct row = readLastRow("UuidArrayValue"); assertFalse(row.isNull(0)); assertEquals(row.getUuidList(0), Arrays.asList(null, uuid1, uuid2)); @@ -331,7 +323,8 @@ public void uuidUntypedParameter() { com.google.protobuf.ListValue.newBuilder() .addValues( com.google.protobuf.Value.newBuilder() - .setStringValue("aac68fbe-6847-48b1-8373-110950aeaf3a"))) + .setStringValue( + "aac68fbe-6847-48b1-8373-110950aeaf3a"))) .build())) .build()); return null; @@ -339,19 +332,17 @@ public void uuidUntypedParameter() { Struct row = readRow("T", "untyped1", "UuidValue", "UuidArrayValue"); assertEquals(UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a"), row.getUuid(0)); - assertEquals(Collections.singletonList(UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a")), row.getUuidList(1)); + assertEquals( + Collections.singletonList(UUID.fromString("aac68fbe-6847-48b1-8373-110950aeaf3a")), + row.getUuidList(1)); } private String getInsertStatementWithKeyLiterals(UUID uuid1, UUID uuid2) { String statement = "INSERT INTO UK (Key) VALUES "; if (dialect.dialect == Dialect.POSTGRESQL) { - statement += - "('"+ uuid1.toString() +"')," - + "('"+ uuid2.toString()+"'::uuid)"; + statement += "('" + uuid1.toString() + "')," + "('" + uuid2.toString() + "'::uuid)"; } else { - statement += - "('"+ uuid1.toString() +"')," - + "(CAST('"+ uuid2.toString()+"' AS UUID))"; + statement += "('" + uuid1.toString() + "')," + "(CAST('" + uuid2.toString() + "' AS UUID))"; } return statement; } @@ -364,7 +355,8 @@ public void uuidAsKeyLiteral() { .readWriteTransaction() .run( transaction -> { - transaction.executeUpdate(Statement.of(getInsertStatementWithKeyLiterals(uuid1, uuid2))); + transaction.executeUpdate( + Statement.of(getInsertStatementWithKeyLiterals(uuid1, uuid2))); return null; }); @@ -372,9 +364,7 @@ public void uuidAsKeyLiteral() { } private String getInsertStatementWithKeyParameters() { - String statement = "INSERT INTO UK (Key) VALUES " - + "($1)," - + "($2)"; + String statement = "INSERT INTO UK (Key) VALUES " + "($1)," + "($2)"; return (dialect.dialect == Dialect.POSTGRESQL) ? statement : statement.replace("$", "@p"); } @@ -382,7 +372,7 @@ private String getInsertStatementWithKeyParameters() { public void uuidAsKeyParameter() { deleteAllRows("UK"); UUID uuid1 = UUID.fromString("fb907080-48a4-4615-b2c4-c8ccb5bb66a4"); - UUID uuid2 = UUID.fromString("faee3a78-cc54-42fc-baa2-53197fb89e8a");; + UUID uuid2 = UUID.fromString("faee3a78-cc54-42fc-baa2-53197fb89e8a"); client .readWriteTransaction() @@ -401,13 +391,9 @@ public void uuidAsKeyParameter() { verifyKeyContents(Arrays.asList(uuid1, uuid2)); } - private void verifyKeyContents(List uuids){ + private void verifyKeyContents(List uuids) { try (ResultSet resultSet = - client - .singleUse() - .executeQuery( - Statement.of( - "SELECT Key AS key FROM UK ORDER BY key"))) { + client.singleUse().executeQuery(Statement.of("SELECT Key AS key FROM UK ORDER BY key"))) { for (UUID uuid : uuids) { assertTrue(resultSet.next()); @@ -431,14 +417,16 @@ private void verifyNonKeyContents(String keyPrefix) { assertEquals(uuid1, resultSet.getUuid("uuidvalue")); assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); assertEquals(Collections.singletonList(uuid1), resultSet.getUuidList("uuidarrayvalue")); - assertEquals(Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); + assertEquals( + Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); // Row 2 assertTrue(resultSet.next()); assertEquals(uuid1, resultSet.getUuid("uuidvalue")); assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); assertEquals(Collections.singletonList(uuid1), resultSet.getUuidList("uuidarrayvalue")); - assertEquals(Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); + assertEquals( + Value.uuidArray(Collections.singletonList(uuid1)), resultSet.getValue("uuidarrayvalue")); // Row 3 assertTrue(resultSet.next()); @@ -450,7 +438,8 @@ private void verifyNonKeyContents(String keyPrefix) { assertEquals(uuid1, resultSet.getUuid("uuidvalue")); assertEquals(Value.uuid(uuid1), resultSet.getValue("uuidvalue")); assertEquals(Arrays.asList(uuid1, uuid2, null), resultSet.getUuidList("uuidarrayvalue")); - assertEquals(Value.uuidArray(Arrays.asList(uuid1, uuid2, null)), resultSet.getValue("uuidarrayvalue")); + assertEquals( + Value.uuidArray(Arrays.asList(uuid1, uuid2, null)), resultSet.getValue("uuidarrayvalue")); } } } From 971475ad086801f705669174e9d4888cd51f582b Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Fri, 3 Jan 2025 10:20:50 +0530 Subject: [PATCH 39/43] docs: added TODO for removing env checks for integration tests for UUID --- .../java/com/google/cloud/spanner/it/ITQueryTest.java | 10 ++++++++++ .../java/com/google/cloud/spanner/it/ITUuidTest.java | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java index 3fd57761286..9d844036ee5 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java @@ -426,7 +426,9 @@ public void bindDateNull() { @Test public void bindUuid() { + // TODO: Remove once it is enabled in emulator. assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + // TODO: Remove once it is enabled in production universe. assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); UUID uuid = UUID.randomUUID(); @@ -437,7 +439,9 @@ public void bindUuid() { @Test public void bindUuidNull() { + // TODO: Remove once it is enabled in emulator. assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + // TODO: Remove once it is enabled in production universe. assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); Struct row = @@ -841,7 +845,9 @@ public void bindDateArrayNull() { @Test public void bindUuidArray() { + // TODO: Remove once it is enabled in emulator. assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + // TODO: Remove once it is enabled in production universe. assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); UUID u1 = UUID.randomUUID(); @@ -857,7 +863,9 @@ public void bindUuidArray() { @Test public void bindUuidArrayEmpty() { + // TODO: Remove once it is enabled in emulator. assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + // TODO: Remove once it is enabled in production universe. assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); Struct row = @@ -870,7 +878,9 @@ public void bindUuidArrayEmpty() { @Test public void bindUuidArrayNull() { + // TODO: Remove once it is enabled in emulator. assumeFalse("Emulator does not support UUID yet", isUsingEmulator()); + // TODO: Remove once it is enabled in production universe. assumeTrue("UUID is currently only supported in cloud-devel", isUsingCloudDevel()); Struct row = diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java index 5163a171eb7..97a2f3602e5 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java @@ -71,9 +71,12 @@ private static boolean isUsingCloudDevel() { @Parameterized.Parameters(name = "Dialect = {0}") public static List data() { - return Arrays.asList( - new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL), - new DialectTestParameter(Dialect.POSTGRESQL)); + // TODO: Remove once it is enabled in production universe. + if (isUsingCloudDevel()) { + return Arrays.asList( + new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL), + new DialectTestParameter(Dialect.POSTGRESQL)); + } } @Parameterized.Parameter() public DialectTestParameter dialect; From d270a082288445db15eb13907d8c0af1756aa0db Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Fri, 3 Jan 2025 11:15:40 +0530 Subject: [PATCH 40/43] fix: add missing return statement --- .../test/java/com/google/cloud/spanner/it/ITUuidTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java index 97a2f3602e5..d303155a5f5 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITUuidTest.java @@ -77,6 +77,7 @@ public static List data() { new DialectTestParameter(Dialect.GOOGLE_STANDARD_SQL), new DialectTestParameter(Dialect.POSTGRESQL)); } + return Collections.emptyList(); } @Parameterized.Parameter() public DialectTestParameter dialect; @@ -91,7 +92,7 @@ public static List data() { + " UuidValue UUID," + " UuidArrayValue ARRAY," + ") PRIMARY KEY (Key)", - "CREATE TABLE UK (" + " Key UUID NOT NULL," + ") PRIMARY KEY (Key)", + "CREATE TABLE UK (" + " Key UUID NOT NULL," + ") PRIMARY KEY (Key)", }; private static final String[] POSTGRESQL_SCHEMA = @@ -101,7 +102,7 @@ public static List data() { + " UuidValue UUID," + " UuidArrayValue UUID[]" + ")", - "CREATE TABLE UK (" + " Key UUID PRIMARY KEY" + ")", + "CREATE TABLE UK (" + " Key UUID PRIMARY KEY" + ")", }; private static DatabaseClient client; From 01ca718d2dba5c7b9dfd07053d42c26a8c0bbc8b Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Mon, 3 Mar 2025 10:56:47 +0530 Subject: [PATCH 41/43] chore: add support for UUID in CloudClientExecutor --- .../com/google/cloud/executor/spanner/CloudClientExecutor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index 64a29ed3e61..b2f1c5dd776 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -2897,6 +2897,9 @@ private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct case DATE: value.setDateDaysValue(daysFromDate(struct.getDate(i))); break; + case UUID: + value.setStringValue(struct.getUuid(i).toString()); + break; case NUMERIC: String ascii = struct.getBigDecimal(i).toPlainString(); value.setStringValue(ascii); From ff6bab31eda2eee99a3dec6628188c8238512b2a Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Mon, 3 Mar 2025 11:11:17 +0530 Subject: [PATCH 42/43] chore: add support for UUID in CloudClientExecutor --- .../executor/spanner/CloudClientExecutor.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index b2f1c5dd776..7440d846ba4 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -176,6 +176,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; @@ -3046,6 +3047,26 @@ private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.DATE).build()); } break; + case UUID: + { + com.google.spanner.executor.v1.ValueList.Builder builder = + com.google.spanner.executor.v1.ValueList.newBuilder(); + List values = struct.getUuidList(i); + for (UUID uuidValue : values) { + com.google.spanner.executor.v1.Value.Builder valueProto = + com.google.spanner.executor.v1.Value.newBuilder(); + if (uuidValue == null) { + builder.addValue(valueProto.setIsNull(true).build()); + } else { + builder.addValue( + valueProto.setStringValue(uuidValue.toString()).build()); + } + } + value.setArrayValue(builder.build()); + value.setArrayType( + com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.UUID).build()); + } + break; case TIMESTAMP: { com.google.spanner.executor.v1.ValueList.Builder builder = @@ -3229,6 +3250,7 @@ private static com.google.cloud.spanner.Key keyProtoToCloudKey( case BYTES: case FLOAT64: case DATE: + case UUID: case TIMESTAMP: case NUMERIC: case JSON: @@ -3316,6 +3338,9 @@ private static com.google.cloud.spanner.Value valueProtoToCloudValue( case DATE: return com.google.cloud.spanner.Value.date( value.hasIsNull() ? null : dateFromDays(value.getDateDaysValue())); + case UUID: + return com.google.cloud.spanner.Value.uuid( + value.hasIsNull() ? null : UUID.fromString(value.getStringValue())); case NUMERIC: { if (value.hasIsNull()) { @@ -3440,6 +3465,20 @@ private static com.google.cloud.spanner.Value valueProtoToCloudValue( .collect(Collectors.toList()), CloudClientExecutor::dateFromDays)); } + case UUID: + if (value.hasIsNull()) { + return com.google.cloud.spanner.Value.uuidArray(null); + } else { + return com.google.cloud.spanner.Value.uuidArray( + unmarshallValueList( + value.getArrayValue().getValueList().stream() + .map(com.google.spanner.executor.v1.Value::getIsNull) + .collect(Collectors.toList()), + value.getArrayValue().getValueList().stream() + .map(com.google.spanner.executor.v1.Value::getStringValue) + .collect(Collectors.toList()), + UUID::fromString)); + } case NUMERIC: { if (value.hasIsNull()) { @@ -3605,6 +3644,8 @@ private static com.google.cloud.spanner.Type typeProtoToCloudType( return com.google.cloud.spanner.Type.float64(); case DATE: return com.google.cloud.spanner.Type.date(); + case UUID: + return com.google.cloud.spanner.Type.uuid(); case TIMESTAMP: return com.google.cloud.spanner.Type.timestamp(); case NUMERIC: @@ -3661,6 +3702,8 @@ private static com.google.spanner.v1.Type cloudTypeToTypeProto(@Nonnull Type clo return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.TIMESTAMP).build(); case DATE: return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.DATE).build(); + case UUID: + return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.UUID).build(); case NUMERIC: return com.google.spanner.v1.Type.newBuilder().setCode(TypeCode.NUMERIC).build(); case PG_NUMERIC: From b4efab8fc8ef113cdccf5d9721c3a0092010979b Mon Sep 17 00:00:00 2001 From: Gagan Gupta Date: Mon, 3 Mar 2025 11:17:41 +0530 Subject: [PATCH 43/43] style: formatting fix --- .../com/google/cloud/executor/spanner/CloudClientExecutor.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index 7440d846ba4..43cd54ccf46 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -3058,8 +3058,7 @@ private com.google.spanner.executor.v1.ValueList buildStruct(StructReader struct if (uuidValue == null) { builder.addValue(valueProto.setIsNull(true).build()); } else { - builder.addValue( - valueProto.setStringValue(uuidValue.toString()).build()); + builder.addValue(valueProto.setStringValue(uuidValue.toString()).build()); } } value.setArrayValue(builder.build());