From e6232e9f368311b9fa4d9098e773d781babf8e09 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:34:22 +0000 Subject: [PATCH 01/11] chore(main): release 2.18.1-SNAPSHOT (#1282) :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). --- datastore-v1-proto-client/pom.xml | 4 ++-- google-cloud-datastore-bom/pom.xml | 10 +++++----- google-cloud-datastore/pom.xml | 4 ++-- grpc-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- proto-google-cloud-datastore-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 12 ++++++------ 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/datastore-v1-proto-client/pom.xml b/datastore-v1-proto-client/pom.xml index 54d1d5ba0..7256170bc 100644 --- a/datastore-v1-proto-client/pom.xml +++ b/datastore-v1-proto-client/pom.xml @@ -19,12 +19,12 @@ 4.0.0 com.google.cloud.datastore datastore-v1-proto-client - 2.18.0 + 2.18.1-SNAPSHOT com.google.cloud google-cloud-datastore-parent - 2.18.0 + 2.18.1-SNAPSHOT jar diff --git a/google-cloud-datastore-bom/pom.xml b/google-cloud-datastore-bom/pom.xml index 24aa2daf2..bf7e07b8b 100644 --- a/google-cloud-datastore-bom/pom.xml +++ b/google-cloud-datastore-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-datastore-bom - 2.18.0 + 2.18.1-SNAPSHOT pom com.google.cloud @@ -52,22 +52,22 @@ com.google.cloud google-cloud-datastore - 2.18.0 + 2.18.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.0 + 2.18.1-SNAPSHOT com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.0 + 0.109.1-SNAPSHOT com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml index d3a9340dc..8833a08e3 100644 --- a/google-cloud-datastore/pom.xml +++ b/google-cloud-datastore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-datastore - 2.18.0 + 2.18.1-SNAPSHOT jar Google Cloud Datastore https://github.com/googleapis/java-datastore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-datastore-parent - 2.18.0 + 2.18.1-SNAPSHOT google-cloud-datastore diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml index 09bcb250c..5d4446fc7 100644 --- a/grpc-google-cloud-datastore-admin-v1/pom.xml +++ b/grpc-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.0 + 2.18.1-SNAPSHOT grpc-google-cloud-datastore-admin-v1 GRPC library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 49856d57a..e9aab05a3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-datastore-parent pom - 2.18.0 + 2.18.1-SNAPSHOT Google Cloud Datastore Parent https://github.com/googleapis/java-datastore @@ -159,27 +159,27 @@ com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.0 + 2.18.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.0 + 2.18.1-SNAPSHOT com.google.cloud google-cloud-datastore - 2.18.0 + 2.18.1-SNAPSHOT com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.0 + 0.109.1-SNAPSHOT com.google.cloud.datastore datastore-v1-proto-client - 2.18.0 + 2.18.1-SNAPSHOT com.google.api.grpc diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml index 34e6e9684..fd148683b 100644 --- a/proto-google-cloud-datastore-admin-v1/pom.xml +++ b/proto-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.0 + 2.18.1-SNAPSHOT proto-google-cloud-datastore-admin-v1 Proto library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml index 366efc164..8bfc2292e 100644 --- a/proto-google-cloud-datastore-v1/pom.xml +++ b/proto-google-cloud-datastore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.0 + 0.109.1-SNAPSHOT proto-google-cloud-datastore-v1 PROTO library for proto-google-cloud-datastore-v1 com.google.cloud google-cloud-datastore-parent - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d343629e9..dc380f03b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-datastore - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 58ccbb8ab..eb98fd391 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-datastore:2.18.0:2.18.0 -google-cloud-datastore-bom:2.18.0:2.18.0 -proto-google-cloud-datastore-v1:0.109.0:0.109.0 -datastore-v1-proto-client:2.18.0:2.18.0 -proto-google-cloud-datastore-admin-v1:2.18.0:2.18.0 -grpc-google-cloud-datastore-admin-v1:2.18.0:2.18.0 +google-cloud-datastore:2.18.0:2.18.1-SNAPSHOT +google-cloud-datastore-bom:2.18.0:2.18.1-SNAPSHOT +proto-google-cloud-datastore-v1:0.109.0:0.109.1-SNAPSHOT +datastore-v1-proto-client:2.18.0:2.18.1-SNAPSHOT +proto-google-cloud-datastore-admin-v1:2.18.0:2.18.1-SNAPSHOT +grpc-google-cloud-datastore-admin-v1:2.18.0:2.18.1-SNAPSHOT From 1ca8bfc92e47e171cafb31a69e236b89d8b46452 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 9 Jan 2024 16:54:48 +0100 Subject: [PATCH 02/11] chore(deps): update dependency com.google.cloud:google-cloud-datastore to v2.18.0 (#1284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-datastore to v2.18.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7ef06cbf4..165d145cd 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-datastore - 2.17.6 + 2.18.0 ``` @@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-datastore' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-datastore:2.17.6' +implementation 'com.google.cloud:google-cloud-datastore:2.18.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.17.6" +libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.18.0" ``` @@ -380,7 +380,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-datastore/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-datastore.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.17.6 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.18.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/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7c6b51231..73398c1da 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-datastore - 2.17.6 + 2.18.0 From 01cced66613bc10ba71cc80166119e321915ec34 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:54:25 -0500 Subject: [PATCH 03/11] fix(deps): Update the Java code generator (gapic-generator-java) to 2.31.0 (#1278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add new types QueryMode, QueryPlan, ResultSetStats feat: add QueryMode field to RunQueryRequest feat: add ResultSetStats field to RunQueryResponse feat: add QueryMode field to RunAggregationQueryRequest feat: add ResultSetStats field to RunAggregationQueryResponse PiperOrigin-RevId: 595774772 Source-Link: https://github.com/googleapis/googleapis/commit/03e7ed44ac499ee71baa2770e78045a3a85f30f5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/dc63e0dea8423c230d5fb0937acb3c98719c9395 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGM2M2UwZGVhODQyM2MyMzBkNWZiMDkzN2FjYjNjOTg3MTljOTM5NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): Update the Java code generator (gapic-generator-java) to 2.31.0 PiperOrigin-RevId: 596645164 Source-Link: https://github.com/googleapis/googleapis/commit/4a0e62ecde2a6459bea8722a33173cfce1e9fb50 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a10ed6a77676c37e60799098d48d0afb16008613 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTEwZWQ2YTc3Njc2YzM3ZTYwNzk5MDk4ZDQ4ZDBhZmIxNjAwODYxMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix javadoc errors --------- Co-authored-by: Owl Bot Co-authored-by: kolea2 --- .../admin/v1/DatastoreAdminClient.java | 120 +- .../v1/stub/DatastoreAdminStubSettings.java | 6 + .../google/datastore/v1/DatastoreProto.java | 290 ++--- .../com/google/datastore/v1/QueryMode.java | 180 +++ .../com/google/datastore/v1/QueryPlan.java | 777 ++++++++++++ .../datastore/v1/QueryPlanOrBuilder.java | 81 ++ .../datastore/v1/QueryProfileProto.java | 87 ++ .../google/datastore/v1/ResultSetStats.java | 1075 +++++++++++++++++ .../datastore/v1/ResultSetStatsOrBuilder.java | 125 ++ .../v1/RunAggregationQueryRequest.java | 167 +++ .../RunAggregationQueryRequestOrBuilder.java | 31 + .../v1/RunAggregationQueryResponse.java | 296 +++++ .../RunAggregationQueryResponseOrBuilder.java | 44 + .../google/datastore/v1/RunQueryRequest.java | 167 +++ .../v1/RunQueryRequestOrBuilder.java | 31 + .../google/datastore/v1/RunQueryResponse.java | 296 +++++ .../v1/RunQueryResponseOrBuilder.java | 44 + .../proto/google/datastore/v1/datastore.proto | 23 + .../google/datastore/v1/query_profile.proto | 75 ++ 19 files changed, 3762 insertions(+), 153 deletions(-) create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryMode.java create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlan.java create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlanOrBuilder.java create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryProfileProto.java create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ResultSetStats.java create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ResultSetStatsOrBuilder.java create mode 100644 proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/query_profile.proto diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java index 399e61e01..dc6811736 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java @@ -115,19 +115,113 @@ *

Note: close() needs to be called on the DatastoreAdminClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants
ExportEntities

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

+ *

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

+ *
    + *
  • exportEntitiesAsync(ExportEntitiesRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • exportEntitiesAsync(String projectId, Map<String, String> labels, EntityFilter entityFilter, String outputUrlPrefix) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • exportEntitiesOperationCallable() + *
  • exportEntitiesCallable() + *
+ *
ImportEntities

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

+ *

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

+ *
    + *
  • importEntitiesAsync(ImportEntitiesRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • importEntitiesAsync(String projectId, Map<String, String> labels, String inputUrl, EntityFilter entityFilter) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • importEntitiesOperationCallable() + *
  • importEntitiesCallable() + *
+ *
CreateIndex

Creates the specified index. A newly created index's initial state is `CREATING`. On completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. + *

During index creation, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then re-creating the index with [create] [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. + *

Indexes with a single property cannot be created.

+ *

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

+ *
    + *
  • createIndexAsync(CreateIndexRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createIndexOperationCallable() + *
  • createIndexCallable() + *
+ *
DeleteIndex

Deletes an existing index. An index can only be deleted if it is in a `READY` or `ERROR` state. On successful execution of the request, the index will be in a `DELETING` [state][google.datastore.admin.v1.Index.State]. And on completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + *

During index deletion, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.

+ *

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

+ *
    + *
  • deleteIndexAsync(DeleteIndexRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteIndexOperationCallable() + *
  • deleteIndexCallable() + *
+ *
GetIndex

Gets an index.

+ *

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

+ *
    + *
  • getIndex(GetIndexRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIndexCallable() + *
+ *
ListIndexes

Lists the indexes that match the specified filters. Datastore uses an eventually consistent query to fetch the list of indexes and may occasionally return stale results.

+ *

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

+ *
    + *
  • listIndexes(ListIndexesRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listIndexesPagedCallable() + *
  • listIndexesCallable() + *
+ *
* *

See the individual methods for example code. * diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java index 08d7b7179..6de58e7f0 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java @@ -258,6 +258,12 @@ public DatastoreAdminStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "datastore"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java index 7c8741735..b87fdafea 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java @@ -131,146 +131,152 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "outing.proto\032,google/datastore/v1/aggreg" + "ation_result.proto\032 google/datastore/v1/" + "entity.proto\032\037google/datastore/v1/query." - + "proto\032\037google/protobuf/timestamp.proto\"\244" - + "\001\n\rLookupRequest\022\030\n\nproject_id\030\010 \001(\tB\004\342A" - + "\001\002\022\023\n\013database_id\030\t \001(\t\0226\n\014read_options\030" - + "\001 \001(\0132 .google.datastore.v1.ReadOptions\022" - + ",\n\004keys\030\003 \003(\0132\030.google.datastore.v1.KeyB" - + "\004\342A\001\002\"\346\001\n\016LookupResponse\0220\n\005found\030\001 \003(\0132" - + "!.google.datastore.v1.EntityResult\0222\n\007mi" - + "ssing\030\002 \003(\0132!.google.datastore.v1.Entity" - + "Result\022*\n\010deferred\030\003 \003(\0132\030.google.datast" - + "ore.v1.Key\022\023\n\013transaction\030\005 \001(\014\022-\n\tread_" - + "time\030\007 \001(\0132\032.google.protobuf.Timestamp\"\237" - + "\002\n\017RunQueryRequest\022\030\n\nproject_id\030\010 \001(\tB\004" - + "\342A\001\002\022\023\n\013database_id\030\t \001(\t\0226\n\014partition_i" - + "d\030\002 \001(\0132 .google.datastore.v1.PartitionI" - + "d\0226\n\014read_options\030\001 \001(\0132 .google.datasto" - + "re.v1.ReadOptions\022+\n\005query\030\003 \001(\0132\032.googl" - + "e.datastore.v1.QueryH\000\0222\n\tgql_query\030\007 \001(" - + "\0132\035.google.datastore.v1.GqlQueryH\000B\014\n\nqu" - + "ery_type\"\210\001\n\020RunQueryResponse\0224\n\005batch\030\001" - + " \001(\0132%.google.datastore.v1.QueryResultBa" - + "tch\022)\n\005query\030\002 \001(\0132\032.google.datastore.v1" - + ".Query\022\023\n\013transaction\030\005 \001(\014\"\301\002\n\032RunAggre" - + "gationQueryRequest\022\030\n\nproject_id\030\010 \001(\tB\004" - + "\342A\001\002\022\023\n\013database_id\030\t \001(\t\0226\n\014partition_i" - + "d\030\002 \001(\0132 .google.datastore.v1.PartitionI" - + "d\0226\n\014read_options\030\001 \001(\0132 .google.datasto" - + "re.v1.ReadOptions\022B\n\021aggregation_query\030\003" - + " \001(\0132%.google.datastore.v1.AggregationQu" - + "eryH\000\0222\n\tgql_query\030\007 \001(\0132\035.google.datast" - + "ore.v1.GqlQueryH\000B\014\n\nquery_type\"\244\001\n\033RunA" - + "ggregationQueryResponse\022:\n\005batch\030\001 \001(\0132+" - + ".google.datastore.v1.AggregationResultBa" - + "tch\0224\n\005query\030\002 \001(\0132%.google.datastore.v1" - + ".AggregationQuery\022\023\n\013transaction\030\005 \001(\014\"\216" - + "\001\n\027BeginTransactionRequest\022\030\n\nproject_id" - + "\030\010 \001(\tB\004\342A\001\002\022\023\n\013database_id\030\t \001(\t\022D\n\023tra" - + "nsaction_options\030\n \001(\0132\'.google.datastor" - + "e.v1.TransactionOptions\"/\n\030BeginTransact" - + "ionResponse\022\023\n\013transaction\030\001 \001(\014\"[\n\017Roll" - + "backRequest\022\030\n\nproject_id\030\010 \001(\tB\004\342A\001\002\022\023\n" - + "\013database_id\030\t \001(\t\022\031\n\013transaction\030\001 \001(\014B" - + "\004\342A\001\002\"\022\n\020RollbackResponse\"\351\002\n\rCommitRequ" + + "proto\032\'google/datastore/v1/query_profile" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\244\001\n\rLookupRequest\022\030\n\nproject_id\030\010 \001(\tB\004\342" + + "A\001\002\022\023\n\013database_id\030\t \001(\t\0226\n\014read_options" + + "\030\001 \001(\0132 .google.datastore.v1.ReadOptions" + + "\022,\n\004keys\030\003 \003(\0132\030.google.datastore.v1.Key" + + "B\004\342A\001\002\"\346\001\n\016LookupResponse\0220\n\005found\030\001 \003(\013" + + "2!.google.datastore.v1.EntityResult\0222\n\007m" + + "issing\030\002 \003(\0132!.google.datastore.v1.Entit" + + "yResult\022*\n\010deferred\030\003 \003(\0132\030.google.datas" + + "tore.v1.Key\022\023\n\013transaction\030\005 \001(\014\022-\n\tread" + + "_time\030\007 \001(\0132\032.google.protobuf.Timestamp\"" + + "\323\002\n\017RunQueryRequest\022\030\n\nproject_id\030\010 \001(\tB" + + "\004\342A\001\002\022\023\n\013database_id\030\t \001(\t\0226\n\014partition_" + + "id\030\002 \001(\0132 .google.datastore.v1.Partition" + + "Id\0226\n\014read_options\030\001 \001(\0132 .google.datast" + + "ore.v1.ReadOptions\022+\n\005query\030\003 \001(\0132\032.goog" + + "le.datastore.v1.QueryH\000\0222\n\tgql_query\030\007 \001" + + "(\0132\035.google.datastore.v1.GqlQueryH\000\0222\n\004m" + + "ode\030\013 \001(\0162\036.google.datastore.v1.QueryMod" + + "eB\004\342A\001\001B\014\n\nquery_type\"\274\001\n\020RunQueryRespon" + + "se\0224\n\005batch\030\001 \001(\0132%.google.datastore.v1." + + "QueryResultBatch\022)\n\005query\030\002 \001(\0132\032.google" + + ".datastore.v1.Query\022\023\n\013transaction\030\005 \001(\014" + + "\0222\n\005stats\030\006 \001(\0132#.google.datastore.v1.Re" + + "sultSetStats\"\365\002\n\032RunAggregationQueryRequ" + "est\022\030\n\nproject_id\030\010 \001(\tB\004\342A\001\002\022\023\n\013databas" - + "e_id\030\t \001(\t\0225\n\004mode\030\005 \001(\0162\'.google.datast" - + "ore.v1.CommitRequest.Mode\022\025\n\013transaction" - + "\030\001 \001(\014H\000\022I\n\026single_use_transaction\030\n \001(\013" - + "2\'.google.datastore.v1.TransactionOption" - + "sH\000\0220\n\tmutations\030\006 \003(\0132\035.google.datastor" - + "e.v1.Mutation\"F\n\004Mode\022\024\n\020MODE_UNSPECIFIE" - + "D\020\000\022\021\n\rTRANSACTIONAL\020\001\022\025\n\021NON_TRANSACTIO" - + "NAL\020\002B\026\n\024transaction_selector\"\227\001\n\016Commit" - + "Response\022=\n\020mutation_results\030\003 \003(\0132#.goo" - + "gle.datastore.v1.MutationResult\022\025\n\rindex" - + "_updates\030\004 \001(\005\022/\n\013commit_time\030\010 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\"q\n\022AllocateIdsRe" - + "quest\022\030\n\nproject_id\030\010 \001(\tB\004\342A\001\002\022\023\n\013datab" - + "ase_id\030\t \001(\t\022,\n\004keys\030\001 \003(\0132\030.google.data" - + "store.v1.KeyB\004\342A\001\002\"=\n\023AllocateIdsRespons" - + "e\022&\n\004keys\030\001 \003(\0132\030.google.datastore.v1.Ke" - + "y\"p\n\021ReserveIdsRequest\022\030\n\nproject_id\030\010 \001" - + "(\tB\004\342A\001\002\022\023\n\013database_id\030\t \001(\t\022,\n\004keys\030\001 " - + "\003(\0132\030.google.datastore.v1.KeyB\004\342A\001\002\"\024\n\022R" - + "eserveIdsResponse\"\272\002\n\010Mutation\022-\n\006insert" - + "\030\004 \001(\0132\033.google.datastore.v1.EntityH\000\022-\n" - + "\006update\030\005 \001(\0132\033.google.datastore.v1.Enti" - + "tyH\000\022-\n\006upsert\030\006 \001(\0132\033.google.datastore." - + "v1.EntityH\000\022*\n\006delete\030\007 \001(\0132\030.google.dat" - + "astore.v1.KeyH\000\022\026\n\014base_version\030\010 \001(\003H\001\022" - + "1\n\013update_time\030\013 \001(\0132\032.google.protobuf.T" - + "imestampH\001B\013\n\toperationB\035\n\033conflict_dete" - + "ction_strategy\"\305\001\n\016MutationResult\022%\n\003key" - + "\030\003 \001(\0132\030.google.datastore.v1.Key\022\017\n\007vers" - + "ion\030\004 \001(\003\022/\n\013create_time\030\007 \001(\0132\032.google." - + "protobuf.Timestamp\022/\n\013update_time\030\006 \001(\0132" - + "\032.google.protobuf.Timestamp\022\031\n\021conflict_" - + "detected\030\005 \001(\010\"\312\002\n\013ReadOptions\022L\n\020read_c" - + "onsistency\030\001 \001(\01620.google.datastore.v1.R" - + "eadOptions.ReadConsistencyH\000\022\025\n\013transact" - + "ion\030\002 \001(\014H\000\022B\n\017new_transaction\030\003 \001(\0132\'.g" - + "oogle.datastore.v1.TransactionOptionsH\000\022" - + "/\n\tread_time\030\004 \001(\0132\032.google.protobuf.Tim" - + "estampH\000\"M\n\017ReadConsistency\022 \n\034READ_CONS" - + "ISTENCY_UNSPECIFIED\020\000\022\n\n\006STRONG\020\001\022\014\n\010EVE" - + "NTUAL\020\002B\022\n\020consistency_type\"\222\002\n\022Transact" - + "ionOptions\022G\n\nread_write\030\001 \001(\01321.google." - + "datastore.v1.TransactionOptions.ReadWrit" - + "eH\000\022E\n\tread_only\030\002 \001(\01320.google.datastor" - + "e.v1.TransactionOptions.ReadOnlyH\000\032)\n\tRe" - + "adWrite\022\034\n\024previous_transaction\030\001 \001(\014\0329\n" - + "\010ReadOnly\022-\n\tread_time\030\001 \001(\0132\032.google.pr" - + "otobuf.TimestampB\006\n\004mode2\341\r\n\tDatastore\022\300" - + "\001\n\006Lookup\022\".google.datastore.v1.LookupRe" - + "quest\032#.google.datastore.v1.LookupRespon" - + "se\"m\332A\034project_id,read_options,keys\202\323\344\223\002" - + "%\" /v1/projects/{project_id}:lookup:\001*\212\323" - + "\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\251\001\n\010Ru" - + "nQuery\022$.google.datastore.v1.RunQueryReq" - + "uest\032%.google.datastore.v1.RunQueryRespo" - + "nse\"P\202\323\344\223\002\'\"\"/v1/projects/{project_id}:r" - + "unQuery:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013databa" - + "se_id\022\325\001\n\023RunAggregationQuery\022/.google.d" - + "atastore.v1.RunAggregationQueryRequest\0320" + + "e_id\030\t \001(\t\0226\n\014partition_id\030\002 \001(\0132 .googl" + + "e.datastore.v1.PartitionId\0226\n\014read_optio" + + "ns\030\001 \001(\0132 .google.datastore.v1.ReadOptio" + + "ns\022B\n\021aggregation_query\030\003 \001(\0132%.google.d" + + "atastore.v1.AggregationQueryH\000\0222\n\tgql_qu" + + "ery\030\007 \001(\0132\035.google.datastore.v1.GqlQuery" + + "H\000\0222\n\004mode\030\n \001(\0162\036.google.datastore.v1.Q" + + "ueryModeB\004\342A\001\001B\014\n\nquery_type\"\330\001\n\033RunAggr" + + "egationQueryResponse\022:\n\005batch\030\001 \001(\0132+.go" + + "ogle.datastore.v1.AggregationResultBatch" + + "\0224\n\005query\030\002 \001(\0132%.google.datastore.v1.Ag" + + "gregationQuery\022\023\n\013transaction\030\005 \001(\014\0222\n\005s" + + "tats\030\006 \001(\0132#.google.datastore.v1.ResultS" + + "etStats\"\216\001\n\027BeginTransactionRequest\022\030\n\np" + + "roject_id\030\010 \001(\tB\004\342A\001\002\022\023\n\013database_id\030\t \001" + + "(\t\022D\n\023transaction_options\030\n \001(\0132\'.google" + + ".datastore.v1.TransactionOptions\"/\n\030Begi" + + "nTransactionResponse\022\023\n\013transaction\030\001 \001(" + + "\014\"[\n\017RollbackRequest\022\030\n\nproject_id\030\010 \001(\t" + + "B\004\342A\001\002\022\023\n\013database_id\030\t \001(\t\022\031\n\013transacti" + + "on\030\001 \001(\014B\004\342A\001\002\"\022\n\020RollbackResponse\"\351\002\n\rC" + + "ommitRequest\022\030\n\nproject_id\030\010 \001(\tB\004\342A\001\002\022\023" + + "\n\013database_id\030\t \001(\t\0225\n\004mode\030\005 \001(\0162\'.goog" + + "le.datastore.v1.CommitRequest.Mode\022\025\n\013tr" + + "ansaction\030\001 \001(\014H\000\022I\n\026single_use_transact" + + "ion\030\n \001(\0132\'.google.datastore.v1.Transact" + + "ionOptionsH\000\0220\n\tmutations\030\006 \003(\0132\035.google" + + ".datastore.v1.Mutation\"F\n\004Mode\022\024\n\020MODE_U" + + "NSPECIFIED\020\000\022\021\n\rTRANSACTIONAL\020\001\022\025\n\021NON_T" + + "RANSACTIONAL\020\002B\026\n\024transaction_selector\"\227" + + "\001\n\016CommitResponse\022=\n\020mutation_results\030\003 " + + "\003(\0132#.google.datastore.v1.MutationResult" + + "\022\025\n\rindex_updates\030\004 \001(\005\022/\n\013commit_time\030\010" + + " \001(\0132\032.google.protobuf.Timestamp\"q\n\022Allo" + + "cateIdsRequest\022\030\n\nproject_id\030\010 \001(\tB\004\342A\001\002" + + "\022\023\n\013database_id\030\t \001(\t\022,\n\004keys\030\001 \003(\0132\030.go" + + "ogle.datastore.v1.KeyB\004\342A\001\002\"=\n\023AllocateI" + + "dsResponse\022&\n\004keys\030\001 \003(\0132\030.google.datast" + + "ore.v1.Key\"p\n\021ReserveIdsRequest\022\030\n\nproje" + + "ct_id\030\010 \001(\tB\004\342A\001\002\022\023\n\013database_id\030\t \001(\t\022," + + "\n\004keys\030\001 \003(\0132\030.google.datastore.v1.KeyB\004" + + "\342A\001\002\"\024\n\022ReserveIdsResponse\"\272\002\n\010Mutation\022" + + "-\n\006insert\030\004 \001(\0132\033.google.datastore.v1.En" + + "tityH\000\022-\n\006update\030\005 \001(\0132\033.google.datastor" + + "e.v1.EntityH\000\022-\n\006upsert\030\006 \001(\0132\033.google.d" + + "atastore.v1.EntityH\000\022*\n\006delete\030\007 \001(\0132\030.g" + + "oogle.datastore.v1.KeyH\000\022\026\n\014base_version" + + "\030\010 \001(\003H\001\0221\n\013update_time\030\013 \001(\0132\032.google.p" + + "rotobuf.TimestampH\001B\013\n\toperationB\035\n\033conf" + + "lict_detection_strategy\"\305\001\n\016MutationResu" + + "lt\022%\n\003key\030\003 \001(\0132\030.google.datastore.v1.Ke" + + "y\022\017\n\007version\030\004 \001(\003\022/\n\013create_time\030\007 \001(\0132" + + "\032.google.protobuf.Timestamp\022/\n\013update_ti" + + "me\030\006 \001(\0132\032.google.protobuf.Timestamp\022\031\n\021" + + "conflict_detected\030\005 \001(\010\"\312\002\n\013ReadOptions\022" + + "L\n\020read_consistency\030\001 \001(\01620.google.datas" + + "tore.v1.ReadOptions.ReadConsistencyH\000\022\025\n" + + "\013transaction\030\002 \001(\014H\000\022B\n\017new_transaction\030" + + "\003 \001(\0132\'.google.datastore.v1.TransactionO" + + "ptionsH\000\022/\n\tread_time\030\004 \001(\0132\032.google.pro" + + "tobuf.TimestampH\000\"M\n\017ReadConsistency\022 \n\034" + + "READ_CONSISTENCY_UNSPECIFIED\020\000\022\n\n\006STRONG" + + "\020\001\022\014\n\010EVENTUAL\020\002B\022\n\020consistency_type\"\222\002\n" + + "\022TransactionOptions\022G\n\nread_write\030\001 \001(\0132" + + "1.google.datastore.v1.TransactionOptions" + + ".ReadWriteH\000\022E\n\tread_only\030\002 \001(\01320.google" + + ".datastore.v1.TransactionOptions.ReadOnl" + + "yH\000\032)\n\tReadWrite\022\034\n\024previous_transaction" + + "\030\001 \001(\014\0329\n\010ReadOnly\022-\n\tread_time\030\001 \001(\0132\032." + + "google.protobuf.TimestampB\006\n\004mode2\341\r\n\tDa" + + "tastore\022\300\001\n\006Lookup\022\".google.datastore.v1" + + ".LookupRequest\032#.google.datastore.v1.Loo" + + "kupResponse\"m\332A\034project_id,read_options," + + "keys\202\323\344\223\002%\" /v1/projects/{project_id}:lo" + + "okup:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_" + + "id\022\251\001\n\010RunQuery\022$.google.datastore.v1.Ru" + + "nQueryRequest\032%.google.datastore.v1.RunQ" + + "ueryResponse\"P\202\323\344\223\002\'\"\"/v1/projects/{proj" + + "ect_id}:runQuery:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022" + + "\r\n\013database_id\022\325\001\n\023RunAggregationQuery\022/" + ".google.datastore.v1.RunAggregationQuery" - + "Response\"[\202\323\344\223\0022\"-/v1/projects/{project_" - + "id}:runAggregationQuery:\001*\212\323\344\223\002\035\022\014\n\nproj" - + "ect_id\022\r\n\013database_id\022\326\001\n\020BeginTransacti" - + "on\022,.google.datastore.v1.BeginTransactio" - + "nRequest\032-.google.datastore.v1.BeginTran" - + "sactionResponse\"e\332A\nproject_id\202\323\344\223\002/\"*/v" - + "1/projects/{project_id}:beginTransaction" - + ":\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\346" - + "\001\n\006Commit\022\".google.datastore.v1.CommitRe" - + "quest\032#.google.datastore.v1.CommitRespon" - + "se\"\222\001\332A%project_id,mode,transaction,muta" - + "tions\332A\031project_id,mode,mutations\202\323\344\223\002%\"" - + " /v1/projects/{project_id}:commit:\001*\212\323\344\223" - + "\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\302\001\n\010Roll" - + "back\022$.google.datastore.v1.RollbackReque" - + "st\032%.google.datastore.v1.RollbackRespons" - + "e\"i\332A\026project_id,transaction\202\323\344\223\002\'\"\"/v1/" - + "projects/{project_id}:rollback:\001*\212\323\344\223\002\035\022" - + "\014\n\nproject_id\022\r\n\013database_id\022\307\001\n\013Allocat" - + "eIds\022\'.google.datastore.v1.AllocateIdsRe" - + "quest\032(.google.datastore.v1.AllocateIdsR" - + "esponse\"e\332A\017project_id,keys\202\323\344\223\002*\"%/v1/p" - + "rojects/{project_id}:allocateIds:\001*\212\323\344\223\002" - + "\035\022\014\n\nproject_id\022\r\n\013database_id\022\303\001\n\nReser" - + "veIds\022&.google.datastore.v1.ReserveIdsRe" - + "quest\032\'.google.datastore.v1.ReserveIdsRe" - + "sponse\"d\332A\017project_id,keys\202\323\344\223\002)\"$/v1/pr" - + "ojects/{project_id}:reserveIds:\001*\212\323\344\223\002\035\022" - + "\014\n\nproject_id\022\r\n\013database_id\032v\312A\030datasto" - + "re.googleapis.com\322AXhttps://www.googleap" - + "is.com/auth/cloud-platform,https://www.g" - + "oogleapis.com/auth/datastoreB\300\001\n\027com.goo" - + "gle.datastore.v1B\016DatastoreProtoP\001Z + * The mode in which the query request must be processed. + * + * + * Protobuf enum {@code google.datastore.v1.QueryMode} + */ +public enum QueryMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *

+   * The default mode. Only the query results are returned.
+   * 
+ * + * NORMAL = 0; + */ + NORMAL(0), + /** + * + * + *
+   * This mode returns only the query plan, without any results or execution
+   * statistics information.
+   * 
+ * + * PLAN = 1; + */ + PLAN(1), + /** + * + * + *
+   * This mode returns both the query plan and the execution statistics along
+   * with the results.
+   * 
+ * + * PROFILE = 2; + */ + PROFILE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The default mode. Only the query results are returned.
+   * 
+ * + * NORMAL = 0; + */ + public static final int NORMAL_VALUE = 0; + /** + * + * + *
+   * This mode returns only the query plan, without any results or execution
+   * statistics information.
+   * 
+ * + * PLAN = 1; + */ + public static final int PLAN_VALUE = 1; + /** + * + * + *
+   * This mode returns both the query plan and the execution statistics along
+   * with the results.
+   * 
+ * + * PROFILE = 2; + */ + public static final int PROFILE_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 QueryMode 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 QueryMode forNumber(int value) { + switch (value) { + case 0: + return NORMAL; + case 1: + return PLAN; + case 2: + return PROFILE; + 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 QueryMode findValueByNumber(int number) { + return QueryMode.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.datastore.v1.QueryProfileProto.getDescriptor().getEnumTypes().get(0); + } + + private static final QueryMode[] VALUES = values(); + + public static QueryMode 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 QueryMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.datastore.v1.QueryMode) +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlan.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlan.java new file mode 100644 index 000000000..fd9fc921e --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlan.java @@ -0,0 +1,777 @@ +/* + * Copyright 2023 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/datastore/v1/query_profile.proto + +package com.google.datastore.v1; + +/** + * + * + *
+ * Plan for the query.
+ * 
+ * + * Protobuf type {@code google.datastore.v1.QueryPlan} + */ +public final class QueryPlan extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.QueryPlan) + QueryPlanOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryPlan.newBuilder() to construct. + private QueryPlan(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryPlan() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryPlan(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_QueryPlan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_QueryPlan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.QueryPlan.class, + com.google.datastore.v1.QueryPlan.Builder.class); + } + + public static final int PLAN_INFO_FIELD_NUMBER = 1; + private com.google.protobuf.Struct planInfo_; + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return Whether the planInfo field is set. + */ + @java.lang.Override + public boolean hasPlanInfo() { + return planInfo_ != null; + } + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return The planInfo. + */ + @java.lang.Override + public com.google.protobuf.Struct getPlanInfo() { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPlanInfoOrBuilder() { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } + + 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 (planInfo_ != null) { + output.writeMessage(1, getPlanInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (planInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPlanInfo()); + } + 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.datastore.v1.QueryPlan)) { + return super.equals(obj); + } + com.google.datastore.v1.QueryPlan other = (com.google.datastore.v1.QueryPlan) obj; + + if (hasPlanInfo() != other.hasPlanInfo()) return false; + if (hasPlanInfo()) { + if (!getPlanInfo().equals(other.getPlanInfo())) 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 (hasPlanInfo()) { + hash = (37 * hash) + PLAN_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPlanInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.v1.QueryPlan parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.QueryPlan parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.QueryPlan parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.QueryPlan 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.datastore.v1.QueryPlan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.QueryPlan parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.QueryPlan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.QueryPlan 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.datastore.v1.QueryPlan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.QueryPlan 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.datastore.v1.QueryPlan parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.QueryPlan 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.datastore.v1.QueryPlan 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; + } + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * Protobuf type {@code google.datastore.v1.QueryPlan} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.v1.QueryPlan) + com.google.datastore.v1.QueryPlanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_QueryPlan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_QueryPlan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.QueryPlan.class, + com.google.datastore.v1.QueryPlan.Builder.class); + } + + // Construct using com.google.datastore.v1.QueryPlan.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + planInfo_ = null; + if (planInfoBuilder_ != null) { + planInfoBuilder_.dispose(); + planInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_QueryPlan_descriptor; + } + + @java.lang.Override + public com.google.datastore.v1.QueryPlan getDefaultInstanceForType() { + return com.google.datastore.v1.QueryPlan.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.v1.QueryPlan build() { + com.google.datastore.v1.QueryPlan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.v1.QueryPlan buildPartial() { + com.google.datastore.v1.QueryPlan result = new com.google.datastore.v1.QueryPlan(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.datastore.v1.QueryPlan result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.planInfo_ = planInfoBuilder_ == null ? planInfo_ : planInfoBuilder_.build(); + } + } + + @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.datastore.v1.QueryPlan) { + return mergeFrom((com.google.datastore.v1.QueryPlan) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.v1.QueryPlan other) { + if (other == com.google.datastore.v1.QueryPlan.getDefaultInstance()) return this; + if (other.hasPlanInfo()) { + mergePlanInfo(other.getPlanInfo()); + } + 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(getPlanInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Struct planInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + planInfoBuilder_; + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return Whether the planInfo field is set. + */ + public boolean hasPlanInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return The planInfo. + */ + public com.google.protobuf.Struct getPlanInfo() { + if (planInfoBuilder_ == null) { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } else { + return planInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder setPlanInfo(com.google.protobuf.Struct value) { + if (planInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + planInfo_ = value; + } else { + planInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder setPlanInfo(com.google.protobuf.Struct.Builder builderForValue) { + if (planInfoBuilder_ == null) { + planInfo_ = builderForValue.build(); + } else { + planInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder mergePlanInfo(com.google.protobuf.Struct value) { + if (planInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && planInfo_ != null + && planInfo_ != com.google.protobuf.Struct.getDefaultInstance()) { + getPlanInfoBuilder().mergeFrom(value); + } else { + planInfo_ = value; + } + } else { + planInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder clearPlanInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + planInfo_ = null; + if (planInfoBuilder_ != null) { + planInfoBuilder_.dispose(); + planInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public com.google.protobuf.Struct.Builder getPlanInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPlanInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public com.google.protobuf.StructOrBuilder getPlanInfoOrBuilder() { + if (planInfoBuilder_ != null) { + return planInfoBuilder_.getMessageOrBuilder(); + } else { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getPlanInfoFieldBuilder() { + if (planInfoBuilder_ == null) { + planInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getPlanInfo(), getParentForChildren(), isClean()); + planInfo_ = null; + } + return planInfoBuilder_; + } + + @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.datastore.v1.QueryPlan) + } + + // @@protoc_insertion_point(class_scope:google.datastore.v1.QueryPlan) + private static final com.google.datastore.v1.QueryPlan DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.v1.QueryPlan(); + } + + public static com.google.datastore.v1.QueryPlan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryPlan 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.datastore.v1.QueryPlan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlanOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlanOrBuilder.java new file mode 100644 index 000000000..dc993225e --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryPlanOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2023 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/datastore/v1/query_profile.proto + +package com.google.datastore.v1; + +public interface QueryPlanOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.QueryPlan) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return Whether the planInfo field is set. + */ + boolean hasPlanInfo(); + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return The planInfo. + */ + com.google.protobuf.Struct getPlanInfo(); + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + com.google.protobuf.StructOrBuilder getPlanInfoOrBuilder(); +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryProfileProto.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryProfileProto.java new file mode 100644 index 000000000..cf0be47e6 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryProfileProto.java @@ -0,0 +1,87 @@ +/* + * Copyright 2023 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/datastore/v1/query_profile.proto + +package com.google.datastore.v1; + +public final class QueryProfileProto { + private QueryProfileProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_v1_QueryPlan_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_QueryPlan_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_v1_ResultSetStats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_ResultSetStats_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\'google/datastore/v1/query_profile.prot" + + "o\022\023google.datastore.v1\032\034google/protobuf/" + + "struct.proto\"7\n\tQueryPlan\022*\n\tplan_info\030\001" + + " \001(\0132\027.google.protobuf.Struct\"r\n\016ResultS" + + "etStats\0222\n\nquery_plan\030\001 \001(\0132\036.google.dat" + + "astore.v1.QueryPlan\022,\n\013query_stats\030\002 \001(\013" + + "2\027.google.protobuf.Struct*.\n\tQueryMode\022\n" + + "\n\006NORMAL\020\000\022\010\n\004PLAN\020\001\022\013\n\007PROFILE\020\002B\303\001\n\027co" + + "m.google.datastore.v1B\021QueryProfileProto" + + "P\001Z + * Planning and execution statistics for the query. + * + * + * Protobuf type {@code google.datastore.v1.ResultSetStats} + */ +public final class ResultSetStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.ResultSetStats) + ResultSetStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResultSetStats.newBuilder() to construct. + private ResultSetStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResultSetStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResultSetStats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ResultSetStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ResultSetStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ResultSetStats.class, + com.google.datastore.v1.ResultSetStats.Builder.class); + } + + public static final int QUERY_PLAN_FIELD_NUMBER = 1; + private com.google.datastore.v1.QueryPlan queryPlan_; + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + * + * @return Whether the queryPlan field is set. + */ + @java.lang.Override + public boolean hasQueryPlan() { + return queryPlan_ != null; + } + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + * + * @return The queryPlan. + */ + @java.lang.Override + public com.google.datastore.v1.QueryPlan getQueryPlan() { + return queryPlan_ == null ? com.google.datastore.v1.QueryPlan.getDefaultInstance() : queryPlan_; + } + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + @java.lang.Override + public com.google.datastore.v1.QueryPlanOrBuilder getQueryPlanOrBuilder() { + return queryPlan_ == null ? com.google.datastore.v1.QueryPlan.getDefaultInstance() : queryPlan_; + } + + public static final int QUERY_STATS_FIELD_NUMBER = 2; + private com.google.protobuf.Struct queryStats_; + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return Whether the queryStats field is set. + */ + @java.lang.Override + public boolean hasQueryStats() { + return queryStats_ != null; + } + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return The queryStats. + */ + @java.lang.Override + public com.google.protobuf.Struct getQueryStats() { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder() { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } + + 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 (queryPlan_ != null) { + output.writeMessage(1, getQueryPlan()); + } + if (queryStats_ != null) { + output.writeMessage(2, getQueryStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (queryPlan_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getQueryPlan()); + } + if (queryStats_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryStats()); + } + 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.datastore.v1.ResultSetStats)) { + return super.equals(obj); + } + com.google.datastore.v1.ResultSetStats other = (com.google.datastore.v1.ResultSetStats) obj; + + if (hasQueryPlan() != other.hasQueryPlan()) return false; + if (hasQueryPlan()) { + if (!getQueryPlan().equals(other.getQueryPlan())) return false; + } + if (hasQueryStats() != other.hasQueryStats()) return false; + if (hasQueryStats()) { + if (!getQueryStats().equals(other.getQueryStats())) 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 (hasQueryPlan()) { + hash = (37 * hash) + QUERY_PLAN_FIELD_NUMBER; + hash = (53 * hash) + getQueryPlan().hashCode(); + } + if (hasQueryStats()) { + hash = (37 * hash) + QUERY_STATS_FIELD_NUMBER; + hash = (53 * hash) + getQueryStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.v1.ResultSetStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ResultSetStats parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.ResultSetStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ResultSetStats 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.datastore.v1.ResultSetStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ResultSetStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.ResultSetStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ResultSetStats 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.datastore.v1.ResultSetStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ResultSetStats 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.datastore.v1.ResultSetStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ResultSetStats 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.datastore.v1.ResultSetStats 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; + } + /** + * + * + *
+   * Planning and execution statistics for the query.
+   * 
+ * + * Protobuf type {@code google.datastore.v1.ResultSetStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.v1.ResultSetStats) + com.google.datastore.v1.ResultSetStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ResultSetStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ResultSetStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ResultSetStats.class, + com.google.datastore.v1.ResultSetStats.Builder.class); + } + + // Construct using com.google.datastore.v1.ResultSetStats.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queryPlan_ = null; + if (queryPlanBuilder_ != null) { + queryPlanBuilder_.dispose(); + queryPlanBuilder_ = null; + } + queryStats_ = null; + if (queryStatsBuilder_ != null) { + queryStatsBuilder_.dispose(); + queryStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ResultSetStats_descriptor; + } + + @java.lang.Override + public com.google.datastore.v1.ResultSetStats getDefaultInstanceForType() { + return com.google.datastore.v1.ResultSetStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.v1.ResultSetStats build() { + com.google.datastore.v1.ResultSetStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.v1.ResultSetStats buildPartial() { + com.google.datastore.v1.ResultSetStats result = + new com.google.datastore.v1.ResultSetStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.datastore.v1.ResultSetStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.queryPlan_ = queryPlanBuilder_ == null ? queryPlan_ : queryPlanBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.queryStats_ = queryStatsBuilder_ == null ? queryStats_ : queryStatsBuilder_.build(); + } + } + + @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.datastore.v1.ResultSetStats) { + return mergeFrom((com.google.datastore.v1.ResultSetStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.v1.ResultSetStats other) { + if (other == com.google.datastore.v1.ResultSetStats.getDefaultInstance()) return this; + if (other.hasQueryPlan()) { + mergeQueryPlan(other.getQueryPlan()); + } + if (other.hasQueryStats()) { + mergeQueryStats(other.getQueryStats()); + } + 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(getQueryPlanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getQueryStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.datastore.v1.QueryPlan queryPlan_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.QueryPlan, + com.google.datastore.v1.QueryPlan.Builder, + com.google.datastore.v1.QueryPlanOrBuilder> + queryPlanBuilder_; + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + * + * @return Whether the queryPlan field is set. + */ + public boolean hasQueryPlan() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + * + * @return The queryPlan. + */ + public com.google.datastore.v1.QueryPlan getQueryPlan() { + if (queryPlanBuilder_ == null) { + return queryPlan_ == null + ? com.google.datastore.v1.QueryPlan.getDefaultInstance() + : queryPlan_; + } else { + return queryPlanBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + public Builder setQueryPlan(com.google.datastore.v1.QueryPlan value) { + if (queryPlanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryPlan_ = value; + } else { + queryPlanBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + public Builder setQueryPlan(com.google.datastore.v1.QueryPlan.Builder builderForValue) { + if (queryPlanBuilder_ == null) { + queryPlan_ = builderForValue.build(); + } else { + queryPlanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + public Builder mergeQueryPlan(com.google.datastore.v1.QueryPlan value) { + if (queryPlanBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && queryPlan_ != null + && queryPlan_ != com.google.datastore.v1.QueryPlan.getDefaultInstance()) { + getQueryPlanBuilder().mergeFrom(value); + } else { + queryPlan_ = value; + } + } else { + queryPlanBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + public Builder clearQueryPlan() { + bitField0_ = (bitField0_ & ~0x00000001); + queryPlan_ = null; + if (queryPlanBuilder_ != null) { + queryPlanBuilder_.dispose(); + queryPlanBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + public com.google.datastore.v1.QueryPlan.Builder getQueryPlanBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getQueryPlanFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + public com.google.datastore.v1.QueryPlanOrBuilder getQueryPlanOrBuilder() { + if (queryPlanBuilder_ != null) { + return queryPlanBuilder_.getMessageOrBuilder(); + } else { + return queryPlan_ == null + ? com.google.datastore.v1.QueryPlan.getDefaultInstance() + : queryPlan_; + } + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.QueryPlan, + com.google.datastore.v1.QueryPlan.Builder, + com.google.datastore.v1.QueryPlanOrBuilder> + getQueryPlanFieldBuilder() { + if (queryPlanBuilder_ == null) { + queryPlanBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.QueryPlan, + com.google.datastore.v1.QueryPlan.Builder, + com.google.datastore.v1.QueryPlanOrBuilder>( + getQueryPlan(), getParentForChildren(), isClean()); + queryPlan_ = null; + } + return queryPlanBuilder_; + } + + private com.google.protobuf.Struct queryStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + queryStatsBuilder_; + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return Whether the queryStats field is set. + */ + public boolean hasQueryStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return The queryStats. + */ + public com.google.protobuf.Struct getQueryStats() { + if (queryStatsBuilder_ == null) { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } else { + return queryStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder setQueryStats(com.google.protobuf.Struct value) { + if (queryStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryStats_ = value; + } else { + queryStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder setQueryStats(com.google.protobuf.Struct.Builder builderForValue) { + if (queryStatsBuilder_ == null) { + queryStats_ = builderForValue.build(); + } else { + queryStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder mergeQueryStats(com.google.protobuf.Struct value) { + if (queryStatsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && queryStats_ != null + && queryStats_ != com.google.protobuf.Struct.getDefaultInstance()) { + getQueryStatsBuilder().mergeFrom(value); + } else { + queryStats_ = value; + } + } else { + queryStatsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder clearQueryStats() { + bitField0_ = (bitField0_ & ~0x00000002); + queryStats_ = null; + if (queryStatsBuilder_ != null) { + queryStatsBuilder_.dispose(); + queryStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public com.google.protobuf.Struct.Builder getQueryStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getQueryStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder() { + if (queryStatsBuilder_ != null) { + return queryStatsBuilder_.getMessageOrBuilder(); + } else { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getQueryStatsFieldBuilder() { + if (queryStatsBuilder_ == null) { + queryStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getQueryStats(), getParentForChildren(), isClean()); + queryStats_ = null; + } + return queryStatsBuilder_; + } + + @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.datastore.v1.ResultSetStats) + } + + // @@protoc_insertion_point(class_scope:google.datastore.v1.ResultSetStats) + private static final com.google.datastore.v1.ResultSetStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.v1.ResultSetStats(); + } + + public static com.google.datastore.v1.ResultSetStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResultSetStats 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.datastore.v1.ResultSetStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ResultSetStatsOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ResultSetStatsOrBuilder.java new file mode 100644 index 000000000..16a951419 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ResultSetStatsOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2023 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/datastore/v1/query_profile.proto + +package com.google.datastore.v1; + +public interface ResultSetStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.ResultSetStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + * + * @return Whether the queryPlan field is set. + */ + boolean hasQueryPlan(); + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + * + * @return The queryPlan. + */ + com.google.datastore.v1.QueryPlan getQueryPlan(); + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.datastore.v1.QueryPlan query_plan = 1; + */ + com.google.datastore.v1.QueryPlanOrBuilder getQueryPlanOrBuilder(); + + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return Whether the queryStats field is set. + */ + boolean hasQueryStats(); + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return The queryStats. + */ + com.google.protobuf.Struct getQueryStats(); + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder(); +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequest.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequest.java index 434acb2c3..12e9bf63c 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequest.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequest.java @@ -41,6 +41,7 @@ private RunAggregationQueryRequest(com.google.protobuf.GeneratedMessageV3.Builde private RunAggregationQueryRequest() { projectId_ = ""; databaseId_ = ""; + mode_ = 0; } @java.lang.Override @@ -432,6 +433,46 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return com.google.datastore.v1.GqlQuery.getDefaultInstance(); } + public static final int MODE_FIELD_NUMBER = 10; + private int mode_ = 0; + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.datastore.v1.QueryMode getMode() { + com.google.datastore.v1.QueryMode result = com.google.datastore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.datastore.v1.QueryMode.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -464,6 +505,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 9, databaseId_); } + if (mode_ != com.google.datastore.v1.QueryMode.NORMAL.getNumber()) { + output.writeEnum(10, mode_); + } getUnknownFields().writeTo(output); } @@ -495,6 +539,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_); } + if (mode_ != com.google.datastore.v1.QueryMode.NORMAL.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, mode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -521,6 +568,7 @@ public boolean equals(final java.lang.Object obj) { if (hasReadOptions()) { if (!getReadOptions().equals(other.getReadOptions())) return false; } + if (mode_ != other.mode_) return false; if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 3: @@ -555,6 +603,8 @@ public int hashCode() { hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getReadOptions().hashCode(); } + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; switch (queryTypeCase_) { case 3: hash = (37 * hash) + AGGREGATION_QUERY_FIELD_NUMBER; @@ -725,6 +775,7 @@ public Builder clear() { if (gqlQueryBuilder_ != null) { gqlQueryBuilder_.clear(); } + mode_ = 0; queryTypeCase_ = 0; queryType_ = null; return this; @@ -778,6 +829,9 @@ private void buildPartial0(com.google.datastore.v1.RunAggregationQueryRequest re result.readOptions_ = readOptionsBuilder_ == null ? readOptions_ : readOptionsBuilder_.build(); } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.mode_ = mode_; + } } private void buildPartialOneofs(com.google.datastore.v1.RunAggregationQueryRequest result) { @@ -853,6 +907,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunAggregationQueryRequest othe if (other.hasReadOptions()) { mergeReadOptions(other.getReadOptions()); } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } switch (other.getQueryTypeCase()) { case AGGREGATION_QUERY: { @@ -932,6 +989,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 74 + case 80: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 80 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2000,6 +2063,110 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return gqlQueryBuilder_; } + private int mode_ = 0; + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.datastore.v1.QueryMode getMode() { + com.google.datastore.v1.QueryMode result = com.google.datastore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.datastore.v1.QueryMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.datastore.v1.QueryMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000040); + mode_ = 0; + 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-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequestOrBuilder.java index cd3bd4435..6d86f2903 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryRequestOrBuilder.java @@ -228,5 +228,36 @@ public interface RunAggregationQueryRequestOrBuilder */ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.datastore.v1.QueryMode getMode(); + com.google.datastore.v1.RunAggregationQueryRequest.QueryTypeCase getQueryTypeCase(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponse.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponse.java index cb94cb231..328afcfdf 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponse.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponse.java @@ -183,6 +183,61 @@ public com.google.protobuf.ByteString getTransaction() { return transaction_; } + public static final int STATS_FIELD_NUMBER = 6; + private com.google.datastore.v1.ResultSetStats stats_; + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return stats_ != null; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + @java.lang.Override + public com.google.datastore.v1.ResultSetStats getStats() { + return stats_ == null ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + @java.lang.Override + public com.google.datastore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -206,6 +261,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!transaction_.isEmpty()) { output.writeBytes(5, transaction_); } + if (stats_ != null) { + output.writeMessage(6, getStats()); + } getUnknownFields().writeTo(output); } @@ -224,6 +282,9 @@ public int getSerializedSize() { if (!transaction_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, transaction_); } + if (stats_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStats()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -249,6 +310,10 @@ public boolean equals(final java.lang.Object obj) { if (!getQuery().equals(other.getQuery())) return false; } if (!getTransaction().equals(other.getTransaction())) return false; + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -270,6 +335,10 @@ public int hashCode() { } hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; hash = (53 * hash) + getTransaction().hashCode(); + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -421,6 +490,11 @@ public Builder clear() { queryBuilder_ = null; } transaction_ = com.google.protobuf.ByteString.EMPTY; + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } return this; } @@ -466,6 +540,9 @@ private void buildPartial0(com.google.datastore.v1.RunAggregationQueryResponse r if (((from_bitField0_ & 0x00000004) != 0)) { result.transaction_ = transaction_; } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + } } @java.lang.Override @@ -523,6 +600,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunAggregationQueryResponse oth if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { setTransaction(other.getTransaction()); } + if (other.hasStats()) { + mergeStats(other.getStats()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -567,6 +647,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 42 + case 50: + { + input.readMessage(getStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1026,6 +1112,216 @@ public Builder clearTransaction() { return this; } + private com.google.datastore.v1.ResultSetStats stats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ResultSetStats, + com.google.datastore.v1.ResultSetStats.Builder, + com.google.datastore.v1.ResultSetStatsOrBuilder> + statsBuilder_; + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + public com.google.datastore.v1.ResultSetStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder setStats(com.google.datastore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder setStats(com.google.datastore.v1.ResultSetStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder mergeStats(com.google.datastore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && stats_ != null + && stats_ != com.google.datastore.v1.ResultSetStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000008); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public com.google.datastore.v1.ResultSetStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public com.google.datastore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ResultSetStats, + com.google.datastore.v1.ResultSetStats.Builder, + com.google.datastore.v1.ResultSetStatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ResultSetStats, + com.google.datastore.v1.ResultSetStats.Builder, + com.google.datastore.v1.ResultSetStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponseOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponseOrBuilder.java index bb9a1b934..6caa14766 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponseOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunAggregationQueryResponseOrBuilder.java @@ -111,4 +111,48 @@ public interface RunAggregationQueryResponseOrBuilder * @return The transaction. */ com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + com.google.datastore.v1.ResultSetStats getStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + com.google.datastore.v1.ResultSetStatsOrBuilder getStatsOrBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java index 123ca5177..62666648c 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java @@ -40,6 +40,7 @@ private RunQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder builde private RunQueryRequest() { projectId_ = ""; databaseId_ = ""; + mode_ = 0; } @java.lang.Override @@ -431,6 +432,46 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return com.google.datastore.v1.GqlQuery.getDefaultInstance(); } + public static final int MODE_FIELD_NUMBER = 11; + private int mode_ = 0; + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.datastore.v1.QueryMode getMode() { + com.google.datastore.v1.QueryMode result = com.google.datastore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.datastore.v1.QueryMode.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -463,6 +504,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 9, databaseId_); } + if (mode_ != com.google.datastore.v1.QueryMode.NORMAL.getNumber()) { + output.writeEnum(11, mode_); + } getUnknownFields().writeTo(output); } @@ -494,6 +538,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_); } + if (mode_ != com.google.datastore.v1.QueryMode.NORMAL.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, mode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -519,6 +566,7 @@ public boolean equals(final java.lang.Object obj) { if (hasReadOptions()) { if (!getReadOptions().equals(other.getReadOptions())) return false; } + if (mode_ != other.mode_) return false; if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 3: @@ -553,6 +601,8 @@ public int hashCode() { hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getReadOptions().hashCode(); } + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; switch (queryTypeCase_) { case 3: hash = (37 * hash) + QUERY_FIELD_NUMBER; @@ -722,6 +772,7 @@ public Builder clear() { if (gqlQueryBuilder_ != null) { gqlQueryBuilder_.clear(); } + mode_ = 0; queryTypeCase_ = 0; queryType_ = null; return this; @@ -775,6 +826,9 @@ private void buildPartial0(com.google.datastore.v1.RunQueryRequest result) { result.readOptions_ = readOptionsBuilder_ == null ? readOptions_ : readOptionsBuilder_.build(); } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.mode_ = mode_; + } } private void buildPartialOneofs(com.google.datastore.v1.RunQueryRequest result) { @@ -849,6 +903,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryRequest other) { if (other.hasReadOptions()) { mergeReadOptions(other.getReadOptions()); } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } switch (other.getQueryTypeCase()) { case QUERY: { @@ -927,6 +984,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 74 + case 88: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 88 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1991,6 +2054,110 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return gqlQueryBuilder_; } + private int mode_ = 0; + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.datastore.v1.QueryMode getMode() { + com.google.datastore.v1.QueryMode result = com.google.datastore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.datastore.v1.QueryMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.datastore.v1.QueryMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000040); + mode_ = 0; + 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-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java index 34f67c822..0f2184076 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java @@ -228,5 +228,36 @@ public interface RunQueryRequestOrBuilder */ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.datastore.v1.QueryMode mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.datastore.v1.QueryMode getMode(); + com.google.datastore.v1.RunQueryRequest.QueryTypeCase getQueryTypeCase(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java index ff387a929..a9f585048 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponse.java @@ -179,6 +179,61 @@ public com.google.protobuf.ByteString getTransaction() { return transaction_; } + public static final int STATS_FIELD_NUMBER = 6; + private com.google.datastore.v1.ResultSetStats stats_; + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return stats_ != null; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + @java.lang.Override + public com.google.datastore.v1.ResultSetStats getStats() { + return stats_ == null ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + @java.lang.Override + public com.google.datastore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -202,6 +257,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!transaction_.isEmpty()) { output.writeBytes(5, transaction_); } + if (stats_ != null) { + output.writeMessage(6, getStats()); + } getUnknownFields().writeTo(output); } @@ -220,6 +278,9 @@ public int getSerializedSize() { if (!transaction_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, transaction_); } + if (stats_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStats()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -244,6 +305,10 @@ public boolean equals(final java.lang.Object obj) { if (!getQuery().equals(other.getQuery())) return false; } if (!getTransaction().equals(other.getTransaction())) return false; + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -265,6 +330,10 @@ public int hashCode() { } hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; hash = (53 * hash) + getTransaction().hashCode(); + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -416,6 +485,11 @@ public Builder clear() { queryBuilder_ = null; } transaction_ = com.google.protobuf.ByteString.EMPTY; + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } return this; } @@ -461,6 +535,9 @@ private void buildPartial0(com.google.datastore.v1.RunQueryResponse result) { if (((from_bitField0_ & 0x00000004) != 0)) { result.transaction_ = transaction_; } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + } } @java.lang.Override @@ -517,6 +594,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryResponse other) { if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { setTransaction(other.getTransaction()); } + if (other.hasStats()) { + mergeStats(other.getStats()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -561,6 +641,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 42 + case 50: + { + input.readMessage(getStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1015,6 +1101,216 @@ public Builder clearTransaction() { return this; } + private com.google.datastore.v1.ResultSetStats stats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ResultSetStats, + com.google.datastore.v1.ResultSetStats.Builder, + com.google.datastore.v1.ResultSetStatsOrBuilder> + statsBuilder_; + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + public com.google.datastore.v1.ResultSetStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder setStats(com.google.datastore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder setStats(com.google.datastore.v1.ResultSetStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder mergeStats(com.google.datastore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && stats_ != null + && stats_ != com.google.datastore.v1.ResultSetStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000008); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public com.google.datastore.v1.ResultSetStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + public com.google.datastore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.datastore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`.
+     * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ResultSetStats, + com.google.datastore.v1.ResultSetStats.Builder, + com.google.datastore.v1.ResultSetStatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ResultSetStats, + com.google.datastore.v1.ResultSetStats.Builder, + com.google.datastore.v1.ResultSetStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponseOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponseOrBuilder.java index 5ec779273..bbd48b7b5 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponseOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryResponseOrBuilder.java @@ -111,4 +111,48 @@ public interface RunQueryResponseOrBuilder * @return The transaction. */ com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + com.google.datastore.v1.ResultSetStats getStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`.
+   * 
+ * + * .google.datastore.v1.ResultSetStats stats = 6; + */ + com.google.datastore.v1.ResultSetStatsOrBuilder getStatsOrBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto index 533988d77..476d48f02 100644 --- a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto +++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto @@ -23,6 +23,7 @@ import "google/api/routing.proto"; import "google/datastore/v1/aggregation_result.proto"; import "google/datastore/v1/entity.proto"; import "google/datastore/v1/query.proto"; +import "google/datastore/v1/query_profile.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Datastore.V1"; @@ -232,6 +233,11 @@ message RunQueryRequest { // The GQL query to run. This query must be a non-aggregation query. GqlQuery gql_query = 7; } + + // Optional. The mode in which the query request is processed. This field is + // optional, and when not provided, it defaults to `NORMAL` mode where no + // additional statistics will be returned with the query results. + QueryMode mode = 11 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -251,6 +257,12 @@ message RunQueryResponse { // was set in // [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. bytes transaction = 5; + + // Query plan and execution statistics. Note that the returned stats are + // subject to change as Firestore evolves. + // + // This is only present when the request specifies a mode other than `NORMAL`. + ResultSetStats stats = 6; } // The request for @@ -282,6 +294,11 @@ message RunAggregationQueryRequest { // The GQL query to run. This query must be an aggregation query. GqlQuery gql_query = 7; } + + // Optional. The mode in which the query request is processed. This field is + // optional, and when not provided, it defaults to `NORMAL` mode where no + // additional statistics will be returned with the query results. + QueryMode mode = 10 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -301,6 +318,12 @@ message RunAggregationQueryResponse { // was set in // [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. bytes transaction = 5; + + // Query plan and execution statistics. Note that the returned stats are + // subject to change as Firestore evolves. + // + // This is only present when the request specifies a mode other than `NORMAL`. + ResultSetStats stats = 6; } // The request for diff --git a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/query_profile.proto b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/query_profile.proto new file mode 100644 index 000000000..05c1cf95e --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/query_profile.proto @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.datastore.v1; + +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Datastore.V1"; +option go_package = "google.golang.org/genproto/googleapis/datastore/v1;datastore"; +option java_multiple_files = true; +option java_outer_classname = "QueryProfileProto"; +option java_package = "com.google.datastore.v1"; +option php_namespace = "Google\\Cloud\\Datastore\\V1"; +option ruby_package = "Google::Cloud::Datastore::V1"; + +// Specification of the Datastore Query Profile fields. + +// The mode in which the query request must be processed. +enum QueryMode { + // The default mode. Only the query results are returned. + NORMAL = 0; + + // This mode returns only the query plan, without any results or execution + // statistics information. + PLAN = 1; + + // This mode returns both the query plan and the execution statistics along + // with the results. + PROFILE = 2; +} + +// Plan for the query. +message QueryPlan { + // Planning phase information for the query. It will include: + // + // { + // "indexes_used": [ + // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + // ] + // } + google.protobuf.Struct plan_info = 1; +} + +// Planning and execution statistics for the query. +message ResultSetStats { + // Plan for the query. + QueryPlan query_plan = 1; + + // Aggregated statistics from the execution of the query. + // + // This will only be present when the request specifies `PROFILE` mode. + // For example, a query will return the statistics including: + // + // { + // "results_returned": "20", + // "documents_scanned": "20", + // "indexes_entries_scanned": "10050", + // "total_execution_time": "100.7 msecs" + // } + google.protobuf.Struct query_stats = 2; +} From 1849e0be44e94fbfa48211484de4af602ca6b614 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 10 Jan 2024 17:55:32 +0100 Subject: [PATCH 04/11] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.5 (#1285) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 6bac0a120..cb95c730d 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -97,7 +97,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.3 + 3.2.5 **/IT* From b42b5138998cdecc2a3dc4cd807fbdae0641fe80 Mon Sep 17 00:00:00 2001 From: kolea2 <45548808+kolea2@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:04:22 -0500 Subject: [PATCH 05/11] test: update datastore emulator version to fix flakiness (#1288) --- .../google/cloud/datastore/testing/LocalDatastoreHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java index 26b892186..2723325ee 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java @@ -57,12 +57,12 @@ public class LocalDatastoreHelper extends BaseEmulatorHelper { private static final String GCLOUD_CMD_TEXT = "gcloud beta emulators datastore start"; private static final String GCLOUD_CMD_PORT_FLAG = "--host-port="; private static final String VERSION_PREFIX = "cloud-datastore-emulator "; - private static final String MIN_VERSION = "1.2.0"; + private static final String MIN_VERSION = "2.0.2"; // Downloadable emulator settings private static final String BIN_NAME = "cloud-datastore-emulator/cloud_datastore_emulator"; private static final String FILENAME = "cloud-datastore-emulator-" + MIN_VERSION + ".zip"; - private static final String MD5_CHECKSUM = "ec2237a0f0ac54964c6bd95e12c73720"; + private static final String MD5_CHECKSUM = "e0d1170519cf52e2e5f9f93892cdf70c"; private static final String BIN_CMD_PORT_FLAG = "--port="; private static final URL EMULATOR_URL; private static final String EMULATOR_URL_ENV_VAR = "DATASTORE_EMULATOR_URL"; From d529d34da22ba37354004afab6726a929de30bc6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Jan 2024 19:14:19 +0100 Subject: [PATCH 06/11] chore(deps): update dependency com.google.cloud:libraries-bom to v26.30.0 (#1289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.30.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 165d145cd..3238cde59 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.29.0 + 26.30.0 pom import @@ -50,7 +50,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.29.0') +implementation platform('com.google.cloud:libraries-bom:26.30.0') implementation 'com.google.cloud:google-cloud-datastore' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index cb95c730d..53f6396e4 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -28,7 +28,7 @@ com.google.cloud libraries-bom - 26.29.0 + 26.30.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 190e06757..e44b0dcbc 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 26.29.0 + 26.30.0 pom import From 5a5c78e01a765d3ebce547b54d7d6d16c0894fb2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 16:02:24 +0100 Subject: [PATCH 07/11] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 (#1291) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e9aab05a3..8cf6d73b5 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.21.0 + 3.22.0 pom import From 4aa45587e5095788ee1dca7e35927003b42cfa6b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:04:42 -0500 Subject: [PATCH 08/11] chore: Create renovate_config_check.yaml (#1920) (#1294) * chore: Create renovate_config_check.yaml Source-Link: https://github.com/googleapis/synthtool/commit/6612ab8f3afcd5e292aecd647f0fa68812c9f5b5 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:a6aa751984f1e905c3ae5a3aac78fc7b68210626ce91487dc7ff4f0a06f010cc Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 6 ++--- .github/workflows/renovate_config_check.yaml | 25 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/renovate_config_check.yaml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f56920557..dc05a7276 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# 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. @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:81f75d962cd28b7ad10740a643b8069b8fa0357cb495b782eef8560bb7a8fd65 -# created: 2023-12-05T19:16:19.735195992Z + digest: sha256:a6aa751984f1e905c3ae5a3aac78fc7b68210626ce91487dc7ff4f0a06f010cc +# created: 2024-01-22T14:14:20.913785597Z diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml new file mode 100644 index 000000000..87d8eb2be --- /dev/null +++ b/.github/workflows/renovate_config_check.yaml @@ -0,0 +1,25 @@ +name: Renovate Bot Config Validation + +on: + pull_request: + paths: + - 'renovate.json' + +jobs: + renovate_bot_config_validation: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install Renovate and Config Validator + run: | + npm install -g npm@latest + npm install --global renovate + renovate-config-validator From f4ee0cb4668077f9fb6b0ede1ea69b9033748fe9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:05:07 -0500 Subject: [PATCH 09/11] fix(deps): Update the Java code generator (gapic-generator-java) to 2.32.0 (#1293) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): Update the Java code generator (gapic-generator-java) to 2.32.0 PiperOrigin-RevId: 599914188 Source-Link: https://github.com/googleapis/googleapis/commit/17e6661f8bf43374633adf950454ed8e69bdcee1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d86ba5be537e489435105ca85566cc4103301aba Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDg2YmE1YmU1MzdlNDg5NDM1MTA1Y2E4NTU2NmNjNDEwMzMwMWFiYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../admin/v1/DatastoreAdminClient.java | 53 ++++++++++--------- .../v1/stub/DatastoreAdminStubSettings.java | 20 ++++++- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java index dc6811736..11bc6ca2a 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java @@ -116,108 +116,109 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * - * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java index 6de58e7f0..e3c2b7d1d 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java @@ -258,6 +258,15 @@ public DatastoreAdminStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -491,7 +500,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -504,7 +512,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -719,6 +726,15 @@ public UnaryCallSettings.Builder getIndexSettings() { return listIndexesSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public DatastoreAdminStubSettings build() throws IOException { return new DatastoreAdminStubSettings(this); From 8997cbbc8310427b50caa3cfc9eee69eb91de283 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 22 Jan 2024 17:06:11 +0100 Subject: [PATCH 10/11] test(deps): update dependency com.google.truth:truth to v1.3.0 (#1292) --- datastore-v1-proto-client/pom.xml | 2 +- google-cloud-datastore/pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/datastore-v1-proto-client/pom.xml b/datastore-v1-proto-client/pom.xml index 7256170bc..d5cc65fc1 100644 --- a/datastore-v1-proto-client/pom.xml +++ b/datastore-v1-proto-client/pom.xml @@ -98,7 +98,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml index 8833a08e3..43631a722 100644 --- a/google-cloud-datastore/pom.xml +++ b/google-cloud-datastore/pom.xml @@ -157,7 +157,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 73398c1da..bc9270f85 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -42,7 +42,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 53f6396e4..88ba1a662 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -50,7 +50,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index dc380f03b..173467b6f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -41,7 +41,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e44b0dcbc..766cad1cb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -53,7 +53,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test From a2849dd5e5a5ac4219587e0cbc8bde2acbfc01cc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:24:15 +0000 Subject: [PATCH 11/11] chore(main): release 2.18.1 (#1286) :robot: I have created a release *beep* *boop* --- ## [2.18.1](https://togithub.com/googleapis/java-datastore/compare/v2.18.0...v2.18.1) (2024-01-22) ### Bug Fixes * **deps:** Update the Java code generator (gapic-generator-java) to 2.31.0 ([#1278](https://togithub.com/googleapis/java-datastore/issues/1278)) ([01cced6](https://togithub.com/googleapis/java-datastore/commit/01cced66613bc10ba71cc80166119e321915ec34)) * **deps:** Update the Java code generator (gapic-generator-java) to 2.32.0 ([#1293](https://togithub.com/googleapis/java-datastore/issues/1293)) ([f4ee0cb](https://togithub.com/googleapis/java-datastore/commit/f4ee0cb4668077f9fb6b0ede1ea69b9033748fe9)) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 ([#1291](https://togithub.com/googleapis/java-datastore/issues/1291)) ([5a5c78e](https://togithub.com/googleapis/java-datastore/commit/5a5c78e01a765d3ebce547b54d7d6d16c0894fb2)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 13 +++++++++++++ datastore-v1-proto-client/pom.xml | 4 ++-- google-cloud-datastore-bom/pom.xml | 10 +++++----- google-cloud-datastore/pom.xml | 4 ++-- grpc-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- proto-google-cloud-datastore-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 12 ++++++------ 10 files changed, 41 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6945a93b..3ca20ce99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.18.1](https://github.com/googleapis/java-datastore/compare/v2.18.0...v2.18.1) (2024-01-22) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.31.0 ([#1278](https://github.com/googleapis/java-datastore/issues/1278)) ([01cced6](https://github.com/googleapis/java-datastore/commit/01cced66613bc10ba71cc80166119e321915ec34)) +* **deps:** Update the Java code generator (gapic-generator-java) to 2.32.0 ([#1293](https://github.com/googleapis/java-datastore/issues/1293)) ([f4ee0cb](https://github.com/googleapis/java-datastore/commit/f4ee0cb4668077f9fb6b0ede1ea69b9033748fe9)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 ([#1291](https://github.com/googleapis/java-datastore/issues/1291)) ([5a5c78e](https://github.com/googleapis/java-datastore/commit/5a5c78e01a765d3ebce547b54d7d6d16c0894fb2)) + ## [2.18.0](https://github.com/googleapis/java-datastore/compare/v2.17.6...v2.18.0) (2024-01-08) diff --git a/datastore-v1-proto-client/pom.xml b/datastore-v1-proto-client/pom.xml index d5cc65fc1..3d4686b30 100644 --- a/datastore-v1-proto-client/pom.xml +++ b/datastore-v1-proto-client/pom.xml @@ -19,12 +19,12 @@ 4.0.0 com.google.cloud.datastore datastore-v1-proto-client - 2.18.1-SNAPSHOT + 2.18.1 com.google.cloud google-cloud-datastore-parent - 2.18.1-SNAPSHOT + 2.18.1 jar diff --git a/google-cloud-datastore-bom/pom.xml b/google-cloud-datastore-bom/pom.xml index bf7e07b8b..f631e64f4 100644 --- a/google-cloud-datastore-bom/pom.xml +++ b/google-cloud-datastore-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-datastore-bom - 2.18.1-SNAPSHOT + 2.18.1 pom com.google.cloud @@ -52,22 +52,22 @@ com.google.cloud google-cloud-datastore - 2.18.1-SNAPSHOT + 2.18.1 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.1-SNAPSHOT + 2.18.1 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.1-SNAPSHOT + 0.109.1 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml index 43631a722..b4bfb5cf3 100644 --- a/google-cloud-datastore/pom.xml +++ b/google-cloud-datastore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-datastore - 2.18.1-SNAPSHOT + 2.18.1 jar Google Cloud Datastore https://github.com/googleapis/java-datastore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-datastore-parent - 2.18.1-SNAPSHOT + 2.18.1 google-cloud-datastore diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml index 5d4446fc7..1f98bfb49 100644 --- a/grpc-google-cloud-datastore-admin-v1/pom.xml +++ b/grpc-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.1-SNAPSHOT + 2.18.1 grpc-google-cloud-datastore-admin-v1 GRPC library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/pom.xml b/pom.xml index 8cf6d73b5..516358c31 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-datastore-parent pom - 2.18.1-SNAPSHOT + 2.18.1 Google Cloud Datastore Parent https://github.com/googleapis/java-datastore @@ -159,27 +159,27 @@ com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.1-SNAPSHOT + 2.18.1 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.1-SNAPSHOT + 2.18.1 com.google.cloud google-cloud-datastore - 2.18.1-SNAPSHOT + 2.18.1 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.1-SNAPSHOT + 0.109.1 com.google.cloud.datastore datastore-v1-proto-client - 2.18.1-SNAPSHOT + 2.18.1 com.google.api.grpc diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml index fd148683b..a35894780 100644 --- a/proto-google-cloud-datastore-admin-v1/pom.xml +++ b/proto-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.1-SNAPSHOT + 2.18.1 proto-google-cloud-datastore-admin-v1 Proto library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml index 8bfc2292e..105e5fa96 100644 --- a/proto-google-cloud-datastore-v1/pom.xml +++ b/proto-google-cloud-datastore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.1-SNAPSHOT + 0.109.1 proto-google-cloud-datastore-v1 PROTO library for proto-google-cloud-datastore-v1 com.google.cloud google-cloud-datastore-parent - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 173467b6f..1ace12f28 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-datastore - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/versions.txt b/versions.txt index eb98fd391..c611c622e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-datastore:2.18.0:2.18.1-SNAPSHOT -google-cloud-datastore-bom:2.18.0:2.18.1-SNAPSHOT -proto-google-cloud-datastore-v1:0.109.0:0.109.1-SNAPSHOT -datastore-v1-proto-client:2.18.0:2.18.1-SNAPSHOT -proto-google-cloud-datastore-admin-v1:2.18.0:2.18.1-SNAPSHOT -grpc-google-cloud-datastore-admin-v1:2.18.0:2.18.1-SNAPSHOT +google-cloud-datastore:2.18.1:2.18.1 +google-cloud-datastore-bom:2.18.1:2.18.1 +proto-google-cloud-datastore-v1:0.109.1:0.109.1 +datastore-v1-proto-client:2.18.1:2.18.1 +proto-google-cloud-datastore-admin-v1:2.18.1:2.18.1 +grpc-google-cloud-datastore-admin-v1:2.18.1:2.18.1
MethodsMethods
MethodDescriptionMethod Variants
ExportEntities

ExportEntities

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

*

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

*
    - *
  • exportEntitiesAsync(ExportEntitiesRequest request) + *
  • exportEntitiesAsync(ExportEntitiesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • exportEntitiesAsync(String projectId, Map<String, String> labels, EntityFilter entityFilter, String outputUrlPrefix) + *
  • exportEntitiesAsync(String projectId, Map<String, String> labels, EntityFilter entityFilter, String outputUrlPrefix) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • exportEntitiesOperationCallable() - *
  • exportEntitiesCallable() + *
  • exportEntitiesOperationCallable() + *

  • exportEntitiesCallable() *

*
ImportEntities

ImportEntities

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

*

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

*
    - *
  • importEntitiesAsync(ImportEntitiesRequest request) + *
  • importEntitiesAsync(ImportEntitiesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • importEntitiesAsync(String projectId, Map<String, String> labels, String inputUrl, EntityFilter entityFilter) + *
  • importEntitiesAsync(String projectId, Map<String, String> labels, String inputUrl, EntityFilter entityFilter) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importEntitiesOperationCallable() - *
  • importEntitiesCallable() + *
  • importEntitiesOperationCallable() + *

  • importEntitiesCallable() *

*
CreateIndex

CreateIndex

Creates the specified index. A newly created index's initial state is `CREATING`. On completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. *

During index creation, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then re-creating the index with [create] [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. *

Indexes with a single property cannot be created.

*

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

*
    - *
  • createIndexAsync(CreateIndexRequest request) + *
  • createIndexAsync(CreateIndexRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createIndexOperationCallable() - *
  • createIndexCallable() + *
  • createIndexOperationCallable() + *

  • createIndexCallable() *

*
DeleteIndex

DeleteIndex

Deletes an existing index. An index can only be deleted if it is in a `READY` or `ERROR` state. On successful execution of the request, the index will be in a `DELETING` [state][google.datastore.admin.v1.Index.State]. And on completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. *

During index deletion, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.

*

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

*
    - *
  • deleteIndexAsync(DeleteIndexRequest request) + *
  • deleteIndexAsync(DeleteIndexRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteIndexOperationCallable() - *
  • deleteIndexCallable() + *
  • deleteIndexOperationCallable() + *

  • deleteIndexCallable() *

*
GetIndex

GetIndex

Gets an index.

*

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

*
    - *
  • getIndex(GetIndexRequest request) + *
  • getIndex(GetIndexRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getIndexCallable() + *
  • getIndexCallable() *

*
ListIndexes

ListIndexes

Lists the indexes that match the specified filters. Datastore uses an eventually consistent query to fetch the list of indexes and may occasionally return stale results.

*

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

*
    - *
  • listIndexes(ListIndexesRequest request) + *
  • listIndexes(ListIndexesRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listIndexesPagedCallable() - *
  • listIndexesCallable() + *
  • listIndexesPagedCallable() + *

  • listIndexesCallable() *

*