diff --git a/.github/release-please.yml b/.github/release-please.yml index 2a97697b5..53b119627 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -26,3 +26,7 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.15.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.17.x diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 19ecc2ed8..0159d7ae3 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -145,6 +145,23 @@ branchProtectionRules: - OwlBot Post Processor - 'Kokoro - Test: Java GraalVM Native Image' - 'Kokoro - Test: Java 17 GraalVM Native Image' + - pattern: 2.17.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - javadoc permissionRules: - team: yoshi-admins permission: admin diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index ea0ff6101..60087ed51 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.27.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.28.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index a4cb8a12c..12ae52070 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.27.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.28.1" } env_vars: { diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f9f09022..66f67d374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.18.6](https://github.com/googleapis/java-datastore/compare/v2.18.5...v2.18.6) (2024-03-18) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.37.0 ([#1355](https://github.com/googleapis/java-datastore/issues/1355)) ([bcc5668](https://github.com/googleapis/java-datastore/commit/bcc5668039d4dd2055e9666a65fcda3984fc33b5)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.28.0 ([#1372](https://github.com/googleapis/java-datastore/issues/1372)) ([09db2a7](https://github.com/googleapis/java-datastore/commit/09db2a75fa714a909bc6fa9b43a9213ae6467c84)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 ([#1373](https://github.com/googleapis/java-datastore/issues/1373)) ([c6e63e5](https://github.com/googleapis/java-datastore/commit/c6e63e5f876fdda953935d09f0536a90a98a812c)) +* Update dependency com.google.errorprone:error_prone_core to v2.26.0 ([#1361](https://github.com/googleapis/java-datastore/issues/1361)) ([9442766](https://github.com/googleapis/java-datastore/commit/9442766ad61b0c1001d36ecfc0668308838b4a83)) +* Update dependency com.google.errorprone:error_prone_core to v2.26.1 ([#1363](https://github.com/googleapis/java-datastore/issues/1363)) ([05fe5bc](https://github.com/googleapis/java-datastore/commit/05fe5bccf97dae92c00f2eead98424771cb321fd)) +* Update dependency com.google.guava:guava-testlib to v33.1.0-jre ([#1368](https://github.com/googleapis/java-datastore/issues/1368)) ([0195345](https://github.com/googleapis/java-datastore/commit/0195345630f404bbcaf1601ded8a8e2011fc3e6e)) + ## [2.18.5](https://github.com/googleapis/java-datastore/compare/v2.18.4...v2.18.5) (2024-03-04) diff --git a/README.md b/README.md index 3ea50e684..49ae68065 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.33.0 + 26.34.0 pom import @@ -42,7 +42,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-datastore - 2.18.4 + 2.18.5 ``` @@ -50,20 +50,20 @@ 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.33.0') +implementation platform('com.google.cloud:libraries-bom:26.34.0') 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.18.4' +implementation 'com.google.cloud:google-cloud-datastore:2.18.5' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.18.4" +libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.18.5" ``` @@ -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.18.4 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.18.5 [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/datastore-v1-proto-client/pom.xml b/datastore-v1-proto-client/pom.xml index fe456b09a..4de2b7e8a 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.5 + 2.18.6 com.google.cloud google-cloud-datastore-parent - 2.18.5 + 2.18.6 jar @@ -98,7 +98,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/google-cloud-datastore-bom/pom.xml b/google-cloud-datastore-bom/pom.xml index 19152234c..d1e7544da 100644 --- a/google-cloud-datastore-bom/pom.xml +++ b/google-cloud-datastore-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-datastore-bom - 2.18.5 + 2.18.6 pom com.google.cloud sdk-platform-java-config - 3.27.0 + 3.28.1 Google Cloud datastore BOM @@ -52,22 +52,22 @@ com.google.cloud google-cloud-datastore - 2.18.5 + 2.18.6 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.5 + 2.18.6 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.5 + 0.109.6 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.5 + 2.18.6 diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml index f0fb57caf..c91330075 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.5 + 2.18.6 jar Google Cloud Datastore https://github.com/googleapis/java-datastore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-datastore-parent - 2.18.5 + 2.18.6 google-cloud-datastore @@ -122,7 +122,7 @@ com.google.guava guava-testlib - 33.0.0-jre + 33.1.0-jre test @@ -157,7 +157,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminSettings.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminSettings.java index 788784b42..4bae1f6f3 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminSettings.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminSettings.java @@ -197,7 +197,6 @@ public static Builder newBuilder() { } /** Returns a new REST builder for this class. */ - @BetaApi public static Builder newHttpJsonBuilder() { return Builder.createHttpJsonDefault(); } @@ -239,7 +238,6 @@ private static Builder createDefault() { return new Builder(DatastoreAdminStubSettings.newBuilder()); } - @BetaApi private static Builder createHttpJsonDefault() { return new Builder(DatastoreAdminStubSettings.newHttpJsonBuilder()); } 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 72e1f3688..64ad035d8 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 @@ -665,8 +665,6 @@ public UnaryCallSettings.Builder exportEntitie } /** Returns the builder for the settings used for calls to exportEntities. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> exportEntitiesOperationSettings() { @@ -679,8 +677,6 @@ public UnaryCallSettings.Builder importEntitie } /** Returns the builder for the settings used for calls to importEntities. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder importEntitiesOperationSettings() { return importEntitiesOperationSettings; @@ -692,8 +688,6 @@ public UnaryCallSettings.Builder createIndexSetti } /** Returns the builder for the settings used for calls to createIndex. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder createIndexOperationSettings() { return createIndexOperationSettings; @@ -705,8 +699,6 @@ public UnaryCallSettings.Builder deleteIndexSetti } /** Returns the builder for the settings used for calls to deleteIndex. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder deleteIndexOperationSettings() { return deleteIndexOperationSettings; diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminCallableFactory.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminCallableFactory.java index fe123ede2..0f992e4c2 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminCallableFactory.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminCallableFactory.java @@ -16,7 +16,6 @@ package com.google.cloud.datastore.admin.v1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; @@ -41,7 +40,6 @@ *

This class is for advanced usage. */ @Generated("by gapic-generator-java") -@BetaApi public class HttpJsonDatastoreAdminCallableFactory implements HttpJsonStubCallableFactory { @@ -73,8 +71,6 @@ public UnaryCallable createBatchingCa httpJsonCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminStub.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminStub.java index e85386c56..af095ad28 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminStub.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/HttpJsonDatastoreAdminStub.java @@ -19,7 +19,6 @@ import static com.google.cloud.datastore.admin.v1.DatastoreAdminClient.ListIndexesPagedResponse; import com.google.api.HttpRule; -import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; @@ -66,7 +65,6 @@ *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") -@BetaApi public class HttpJsonDatastoreAdminStub extends DatastoreAdminStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder() diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml index d1638f6e0..c47481cfe 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.5 + 2.18.6 grpc-google-cloud-datastore-admin-v1 GRPC library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.18.5 + 2.18.6 diff --git a/pom.xml b/pom.xml index 354a1ddc9..9591c5387 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-datastore-parent pom - 2.18.5 + 2.18.6 Google Cloud Datastore Parent https://github.com/googleapis/java-datastore @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.27.0 + 3.28.1 @@ -143,7 +143,7 @@ github google-cloud-datastore-parent https://googleapis.dev/java/google-api-grpc/latest - 2.25.0 + 2.26.1 @@ -159,27 +159,27 @@ com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.18.5 + 2.18.6 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.18.5 + 2.18.6 com.google.cloud google-cloud-datastore - 2.18.5 + 2.18.6 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.109.5 + 0.109.6 com.google.cloud.datastore datastore-v1-proto-client - 2.18.5 + 2.18.6 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 9fda50ec8..25b20dd5e 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.5 + 2.18.6 proto-google-cloud-datastore-admin-v1 Proto library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.18.5 + 2.18.6 diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml index 0bf07f830..2a925de99 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.5 + 0.109.6 proto-google-cloud-datastore-v1 PROTO library for proto-google-cloud-datastore-v1 com.google.cloud google-cloud-datastore-parent - 2.18.5 + 2.18.6 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 bec52f514..abd7b5508 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 @@ -132,146 +132,153 @@ 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\"\242" - + "\001\n\rLookupRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A" - + "\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\003" - + "\340A\002\"\346\001\n\016LookupResponse\0220\n\005found\030\001 \003(\0132!." - + "google.datastore.v1.EntityResult\0222\n\007miss" - + "ing\030\002 \003(\0132!.google.datastore.v1.EntityRe" - + "sult\022*\n\010deferred\030\003 \003(\0132\030.google.datastor" - + "e.v1.Key\022\023\n\013transaction\030\005 \001(\014\022-\n\tread_ti" - + "me\030\007 \001(\0132\032.google.protobuf.Timestamp\"\236\002\n" - + "\017RunQueryRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A" - + "\002\022\023\n\013database_id\030\t \001(\t\0226\n\014partition_id\030\002" - + " \001(\0132 .google.datastore.v1.PartitionId\0226" - + "\n\014read_options\030\001 \001(\0132 .google.datastore." - + "v1.ReadOptions\022+\n\005query\030\003 \001(\0132\032.google.d" - + "atastore.v1.QueryH\000\0222\n\tgql_query\030\007 \001(\0132\035" - + ".google.datastore.v1.GqlQueryH\000B\014\n\nquery" - + "_type\"\210\001\n\020RunQueryResponse\0224\n\005batch\030\001 \001(" - + "\0132%.google.datastore.v1.QueryResultBatch" - + "\022)\n\005query\030\002 \001(\0132\032.google.datastore.v1.Qu" - + "ery\022\023\n\013transaction\030\005 \001(\014\"\300\002\n\032RunAggregat" - + "ionQueryRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002" - + "\022\023\n\013database_id\030\t \001(\t\0226\n\014partition_id\030\002 " - + "\001(\0132 .google.datastore.v1.PartitionId\0226\n" - + "\014read_options\030\001 \001(\0132 .google.datastore.v" - + "1.ReadOptions\022B\n\021aggregation_query\030\003 \001(\013" - + "2%.google.datastore.v1.AggregationQueryH" - + "\000\0222\n\tgql_query\030\007 \001(\0132\035.google.datastore." - + "v1.GqlQueryH\000B\014\n\nquery_type\"\244\001\n\033RunAggre" - + "gationQueryResponse\022:\n\005batch\030\001 \001(\0132+.goo" - + "gle.datastore.v1.AggregationResultBatch\022" - + "4\n\005query\030\002 \001(\0132%.google.datastore.v1.Agg" - + "regationQuery\022\023\n\013transaction\030\005 \001(\014\"\215\001\n\027B" - + "eginTransactionRequest\022\027\n\nproject_id\030\010 \001" - + "(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\022D\n\023transact" - + "ion_options\030\n \001(\0132\'.google.datastore.v1." - + "TransactionOptions\"/\n\030BeginTransactionRe" - + "sponse\022\023\n\013transaction\030\001 \001(\014\"Y\n\017RollbackR" - + "equest\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n\013datab" - + "ase_id\030\t \001(\t\022\030\n\013transaction\030\001 \001(\014B\003\340A\002\"\022" - + "\n\020RollbackResponse\"\350\002\n\rCommitRequest\022\027\n\n" - + "project_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001" - + "(\t\0225\n\004mode\030\005 \001(\0162\'.google.datastore.v1.C" - + "ommitRequest.Mode\022\025\n\013transaction\030\001 \001(\014H\000" - + "\022I\n\026single_use_transaction\030\n \001(\0132\'.googl" - + "e.datastore.v1.TransactionOptionsH\000\0220\n\tm" - + "utations\030\006 \003(\0132\035.google.datastore.v1.Mut" - + "ation\"F\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\021\n\rT" - + "RANSACTIONAL\020\001\022\025\n\021NON_TRANSACTIONAL\020\002B\026\n" - + "\024transaction_selector\"\227\001\n\016CommitResponse" - + "\022=\n\020mutation_results\030\003 \003(\0132#.google.data" - + "store.v1.MutationResult\022\025\n\rindex_updates" - + "\030\004 \001(\005\022/\n\013commit_time\030\010 \001(\0132\032.google.pro" - + "tobuf.Timestamp\"o\n\022AllocateIdsRequest\022\027\n" - + "\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t " - + "\001(\t\022+\n\004keys\030\001 \003(\0132\030.google.datastore.v1." - + "KeyB\003\340A\002\"=\n\023AllocateIdsResponse\022&\n\004keys\030" - + "\001 \003(\0132\030.google.datastore.v1.Key\"n\n\021Reser" - + "veIdsRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n" - + "\013database_id\030\t \001(\t\022+\n\004keys\030\001 \003(\0132\030.googl" - + "e.datastore.v1.KeyB\003\340A\002\"\024\n\022ReserveIdsRes" - + "ponse\"\272\002\n\010Mutation\022-\n\006insert\030\004 \001(\0132\033.goo" - + "gle.datastore.v1.EntityH\000\022-\n\006update\030\005 \001(" - + "\0132\033.google.datastore.v1.EntityH\000\022-\n\006upse" - + "rt\030\006 \001(\0132\033.google.datastore.v1.EntityH\000\022" - + "*\n\006delete\030\007 \001(\0132\030.google.datastore.v1.Ke" - + "yH\000\022\026\n\014base_version\030\010 \001(\003H\001\0221\n\013update_ti" - + "me\030\013 \001(\0132\032.google.protobuf.TimestampH\001B\013" - + "\n\toperationB\035\n\033conflict_detection_strate" - + "gy\"\305\001\n\016MutationResult\022%\n\003key\030\003 \001(\0132\030.goo" - + "gle.datastore.v1.Key\022\017\n\007version\030\004 \001(\003\022/\n" - + "\013create_time\030\007 \001(\0132\032.google.protobuf.Tim" - + "estamp\022/\n\013update_time\030\006 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022\031\n\021conflict_detected\030\005 \001" - + "(\010\"\312\002\n\013ReadOptions\022L\n\020read_consistency\030\001" - + " \001(\01620.google.datastore.v1.ReadOptions.R" - + "eadConsistencyH\000\022\025\n\013transaction\030\002 \001(\014H\000\022" - + "B\n\017new_transaction\030\003 \001(\0132\'.google.datast" - + "ore.v1.TransactionOptionsH\000\022/\n\tread_time" - + "\030\004 \001(\0132\032.google.protobuf.TimestampH\000\"M\n\017" - + "ReadConsistency\022 \n\034READ_CONSISTENCY_UNSP" - + "ECIFIED\020\000\022\n\n\006STRONG\020\001\022\014\n\010EVENTUAL\020\002B\022\n\020c" - + "onsistency_type\"\222\002\n\022TransactionOptions\022G" - + "\n\nread_write\030\001 \001(\01321.google.datastore.v1" - + ".TransactionOptions.ReadWriteH\000\022E\n\tread_" - + "only\030\002 \001(\01320.google.datastore.v1.Transac" - + "tionOptions.ReadOnlyH\000\032)\n\tReadWrite\022\034\n\024p" - + "revious_transaction\030\001 \001(\014\0329\n\010ReadOnly\022-\n" - + "\tread_time\030\001 \001(\0132\032.google.protobuf.Times" - + "tampB\006\n\004mode2\341\r\n\tDatastore\022\300\001\n\006Lookup\022\"." - + "google.datastore.v1.LookupRequest\032#.goog" - + "le.datastore.v1.LookupResponse\"m\332A\034proje" - + "ct_id,read_options,keys\202\323\344\223\002%\" /v1/proje" - + "cts/{project_id}:lookup:\001*\212\323\344\223\002\035\022\014\n\nproj" - + "ect_id\022\r\n\013database_id\022\251\001\n\010RunQuery\022$.goo" - + "gle.datastore.v1.RunQueryRequest\032%.googl" - + "e.datastore.v1.RunQueryResponse\"P\202\323\344\223\002\'\"" - + "\"/v1/projects/{project_id}:runQuery:\001*\212\323" - + "\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\325\001\n\023Ru" - + "nAggregationQuery\022/.google.datastore.v1." - + "RunAggregationQueryRequest\0320.google.data" - + "store.v1.RunAggregationQueryResponse\"[\202\323" - + "\344\223\0022\"-/v1/projects/{project_id}:runAggre" - + "gationQuery:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013da" - + "tabase_id\022\326\001\n\020BeginTransaction\022,.google." - + "datastore.v1.BeginTransactionRequest\032-.g" - + "oogle.datastore.v1.BeginTransactionRespo" - + "nse\"e\332A\nproject_id\202\323\344\223\002/\"*/v1/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.CommitRequest\032#.goog" - + "le.datastore.v1.CommitResponse\"\222\001\332A%proj" - + "ect_id,mode,transaction,mutations\332A\031proj" - + "ect_id,mode,mutations\202\323\344\223\002%\" /v1/project" - + "s/{project_id}:commit:\001*\212\323\344\223\002\035\022\014\n\nprojec" - + "t_id\022\r\n\013database_id\022\302\001\n\010Rollback\022$.googl" - + "e.datastore.v1.RollbackRequest\032%.google." - + "datastore.v1.RollbackResponse\"i\332A\026projec" - + "t_id,transaction\202\323\344\223\002\'\"\"/v1/projects/{pr" - + "oject_id}:rollback:\001*\212\323\344\223\002\035\022\014\n\nproject_i" - + "d\022\r\n\013database_id\022\307\001\n\013AllocateIds\022\'.googl" - + "e.datastore.v1.AllocateIdsRequest\032(.goog" - + "le.datastore.v1.AllocateIdsResponse\"e\332A\017" - + "project_id,keys\202\323\344\223\002*\"%/v1/projects/{pro" - + "ject_id}:allocateIds:\001*\212\323\344\223\002\035\022\014\n\nproject" - + "_id\022\r\n\013database_id\022\303\001\n\nReserveIds\022&.goog" - + "le.datastore.v1.ReserveIdsRequest\032\'.goog" - + "le.datastore.v1.ReserveIdsResponse\"d\332A\017p" - + "roject_id,keys\202\323\344\223\002)\"$/v1/projects/{proj" - + "ect_id}:reserveIds:\001*\212\323\344\223\002\035\022\014\n\nproject_i" - + "d\022\r\n\013database_id\032v\312A\030datastore.googleapi" - + "s.com\322AXhttps://www.googleapis.com/auth/" - + "cloud-platform,https://www.googleapis.co" - + "m/auth/datastoreB\300\001\n\027com.google.datastor" - + "e.v1B\016DatastoreProtoP\001Z + * Execution statistics for the query. + * + * + * Protobuf type {@code google.datastore.v1.ExecutionStats} + */ +public final class ExecutionStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.ExecutionStats) + ExecutionStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExecutionStats.newBuilder() to construct. + private ExecutionStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExecutionStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExecutionStats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExecutionStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ExecutionStats.class, + com.google.datastore.v1.ExecutionStats.Builder.class); + } + + private int bitField0_; + public static final int RESULTS_RETURNED_FIELD_NUMBER = 1; + private long resultsReturned_ = 0L; + /** + * + * + *

+   * Total number of results returned, including documents, projections,
+   * aggregation results, keys.
+   * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + @java.lang.Override + public long getResultsReturned() { + return resultsReturned_; + } + + public static final int EXECUTION_DURATION_FIELD_NUMBER = 3; + private com.google.protobuf.Duration executionDuration_; + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + @java.lang.Override + public boolean hasExecutionDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getExecutionDuration() { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder() { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + + public static final int READ_OPERATIONS_FIELD_NUMBER = 4; + private long readOperations_ = 0L; + /** + * + * + *
+   * Total billable read operations.
+   * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + @java.lang.Override + public long getReadOperations() { + return readOperations_; + } + + public static final int DEBUG_STATS_FIELD_NUMBER = 5; + private com.google.protobuf.Struct debugStats_; + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + @java.lang.Override + public boolean hasDebugStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + @java.lang.Override + public com.google.protobuf.Struct getDebugStats() { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder() { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + + 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 (resultsReturned_ != 0L) { + output.writeInt64(1, resultsReturned_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getExecutionDuration()); + } + if (readOperations_ != 0L) { + output.writeInt64(4, readOperations_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getDebugStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resultsReturned_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, resultsReturned_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExecutionDuration()); + } + if (readOperations_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, readOperations_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDebugStats()); + } + 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.ExecutionStats)) { + return super.equals(obj); + } + com.google.datastore.v1.ExecutionStats other = (com.google.datastore.v1.ExecutionStats) obj; + + if (getResultsReturned() != other.getResultsReturned()) return false; + if (hasExecutionDuration() != other.hasExecutionDuration()) return false; + if (hasExecutionDuration()) { + if (!getExecutionDuration().equals(other.getExecutionDuration())) return false; + } + if (getReadOperations() != other.getReadOperations()) return false; + if (hasDebugStats() != other.hasDebugStats()) return false; + if (hasDebugStats()) { + if (!getDebugStats().equals(other.getDebugStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESULTS_RETURNED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getResultsReturned()); + if (hasExecutionDuration()) { + hash = (37 * hash) + EXECUTION_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getExecutionDuration().hashCode(); + } + hash = (37 * hash) + READ_OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadOperations()); + if (hasDebugStats()) { + hash = (37 * hash) + DEBUG_STATS_FIELD_NUMBER; + hash = (53 * hash) + getDebugStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.v1.ExecutionStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExecutionStats 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.ExecutionStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExecutionStats 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.ExecutionStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExecutionStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.ExecutionStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExecutionStats 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.ExecutionStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExecutionStats 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.ExecutionStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExecutionStats 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.ExecutionStats 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; + } + /** + * + * + *
+   * Execution statistics for the query.
+   * 
+ * + * Protobuf type {@code google.datastore.v1.ExecutionStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.v1.ExecutionStats) + com.google.datastore.v1.ExecutionStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExecutionStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ExecutionStats.class, + com.google.datastore.v1.ExecutionStats.Builder.class); + } + + // Construct using com.google.datastore.v1.ExecutionStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExecutionDurationFieldBuilder(); + getDebugStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resultsReturned_ = 0L; + executionDuration_ = null; + if (executionDurationBuilder_ != null) { + executionDurationBuilder_.dispose(); + executionDurationBuilder_ = null; + } + readOperations_ = 0L; + debugStats_ = null; + if (debugStatsBuilder_ != null) { + debugStatsBuilder_.dispose(); + debugStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExecutionStats_descriptor; + } + + @java.lang.Override + public com.google.datastore.v1.ExecutionStats getDefaultInstanceForType() { + return com.google.datastore.v1.ExecutionStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.v1.ExecutionStats build() { + com.google.datastore.v1.ExecutionStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.v1.ExecutionStats buildPartial() { + com.google.datastore.v1.ExecutionStats result = + new com.google.datastore.v1.ExecutionStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.datastore.v1.ExecutionStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resultsReturned_ = resultsReturned_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.executionDuration_ = + executionDurationBuilder_ == null + ? executionDuration_ + : executionDurationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.readOperations_ = readOperations_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.debugStats_ = debugStatsBuilder_ == null ? debugStats_ : debugStatsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.v1.ExecutionStats) { + return mergeFrom((com.google.datastore.v1.ExecutionStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.v1.ExecutionStats other) { + if (other == com.google.datastore.v1.ExecutionStats.getDefaultInstance()) return this; + if (other.getResultsReturned() != 0L) { + setResultsReturned(other.getResultsReturned()); + } + if (other.hasExecutionDuration()) { + mergeExecutionDuration(other.getExecutionDuration()); + } + if (other.getReadOperations() != 0L) { + setReadOperations(other.getReadOperations()); + } + if (other.hasDebugStats()) { + mergeDebugStats(other.getDebugStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + resultsReturned_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: + { + input.readMessage( + getExecutionDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: + { + readOperations_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + input.readMessage(getDebugStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long resultsReturned_; + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + @java.lang.Override + public long getResultsReturned() { + return resultsReturned_; + } + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @param value The resultsReturned to set. + * @return This builder for chaining. + */ + public Builder setResultsReturned(long value) { + + resultsReturned_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of results returned, including documents, projections,
+     * aggregation results, keys.
+     * 
+ * + * int64 results_returned = 1; + * + * @return This builder for chaining. + */ + public Builder clearResultsReturned() { + bitField0_ = (bitField0_ & ~0x00000001); + resultsReturned_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Duration executionDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + executionDurationBuilder_; + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + public boolean hasExecutionDuration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + public com.google.protobuf.Duration getExecutionDuration() { + if (executionDurationBuilder_ == null) { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } else { + return executionDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder setExecutionDuration(com.google.protobuf.Duration value) { + if (executionDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionDuration_ = value; + } else { + executionDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder setExecutionDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (executionDurationBuilder_ == null) { + executionDuration_ = builderForValue.build(); + } else { + executionDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder mergeExecutionDuration(com.google.protobuf.Duration value) { + if (executionDurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && executionDuration_ != null + && executionDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getExecutionDurationBuilder().mergeFrom(value); + } else { + executionDuration_ = value; + } + } else { + executionDurationBuilder_.mergeFrom(value); + } + if (executionDuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public Builder clearExecutionDuration() { + bitField0_ = (bitField0_ & ~0x00000002); + executionDuration_ = null; + if (executionDurationBuilder_ != null) { + executionDurationBuilder_.dispose(); + executionDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public com.google.protobuf.Duration.Builder getExecutionDurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExecutionDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + public com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder() { + if (executionDurationBuilder_ != null) { + return executionDurationBuilder_.getMessageOrBuilder(); + } else { + return executionDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : executionDuration_; + } + } + /** + * + * + *
+     * Total time to execute the query in the backend.
+     * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getExecutionDurationFieldBuilder() { + if (executionDurationBuilder_ == null) { + executionDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getExecutionDuration(), getParentForChildren(), isClean()); + executionDuration_ = null; + } + return executionDurationBuilder_; + } + + private long readOperations_; + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + @java.lang.Override + public long getReadOperations() { + return readOperations_; + } + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @param value The readOperations to set. + * @return This builder for chaining. + */ + public Builder setReadOperations(long value) { + + readOperations_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Total billable read operations.
+     * 
+ * + * int64 read_operations = 4; + * + * @return This builder for chaining. + */ + public Builder clearReadOperations() { + bitField0_ = (bitField0_ & ~0x00000004); + readOperations_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Struct debugStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + debugStatsBuilder_; + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + public boolean hasDebugStats() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + public com.google.protobuf.Struct getDebugStats() { + if (debugStatsBuilder_ == null) { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } else { + return debugStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder setDebugStats(com.google.protobuf.Struct value) { + if (debugStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + debugStats_ = value; + } else { + debugStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder setDebugStats(com.google.protobuf.Struct.Builder builderForValue) { + if (debugStatsBuilder_ == null) { + debugStats_ = builderForValue.build(); + } else { + debugStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder mergeDebugStats(com.google.protobuf.Struct value) { + if (debugStatsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && debugStats_ != null + && debugStats_ != com.google.protobuf.Struct.getDefaultInstance()) { + getDebugStatsBuilder().mergeFrom(value); + } else { + debugStats_ = value; + } + } else { + debugStatsBuilder_.mergeFrom(value); + } + if (debugStats_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public Builder clearDebugStats() { + bitField0_ = (bitField0_ & ~0x00000008); + debugStats_ = null; + if (debugStatsBuilder_ != null) { + debugStatsBuilder_.dispose(); + debugStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public com.google.protobuf.Struct.Builder getDebugStatsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getDebugStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + public com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder() { + if (debugStatsBuilder_ != null) { + return debugStatsBuilder_.getMessageOrBuilder(); + } else { + return debugStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : debugStats_; + } + } + /** + * + * + *
+     * Debugging statistics from the execution of the query. Note that the
+     * debugging stats are subject to change as Firestore evolves. It could
+     * include:
+     *  {
+     *    "indexes_entries_scanned": "1000",
+     *    "documents_scanned": "20",
+     *    "billing_details" : {
+     *       "documents_billable": "20",
+     *       "index_entries_billable": "1000",
+     *       "min_query_cost": "0"
+     *    }
+     *  }
+     * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getDebugStatsFieldBuilder() { + if (debugStatsBuilder_ == null) { + debugStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getDebugStats(), getParentForChildren(), isClean()); + debugStats_ = null; + } + return debugStatsBuilder_; + } + + @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.ExecutionStats) + } + + // @@protoc_insertion_point(class_scope:google.datastore.v1.ExecutionStats) + private static final com.google.datastore.v1.ExecutionStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.v1.ExecutionStats(); + } + + public static com.google.datastore.v1.ExecutionStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecutionStats 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.ExecutionStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExecutionStatsOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExecutionStatsOrBuilder.java new file mode 100644 index 000000000..5aa066928 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExecutionStatsOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.datastore.v1; + +public interface ExecutionStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.ExecutionStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Total number of results returned, including documents, projections,
+   * aggregation results, keys.
+   * 
+ * + * int64 results_returned = 1; + * + * @return The resultsReturned. + */ + long getResultsReturned(); + + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return Whether the executionDuration field is set. + */ + boolean hasExecutionDuration(); + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + * + * @return The executionDuration. + */ + com.google.protobuf.Duration getExecutionDuration(); + /** + * + * + *
+   * Total time to execute the query in the backend.
+   * 
+ * + * .google.protobuf.Duration execution_duration = 3; + */ + com.google.protobuf.DurationOrBuilder getExecutionDurationOrBuilder(); + + /** + * + * + *
+   * Total billable read operations.
+   * 
+ * + * int64 read_operations = 4; + * + * @return The readOperations. + */ + long getReadOperations(); + + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return Whether the debugStats field is set. + */ + boolean hasDebugStats(); + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + * + * @return The debugStats. + */ + com.google.protobuf.Struct getDebugStats(); + /** + * + * + *
+   * Debugging statistics from the execution of the query. Note that the
+   * debugging stats are subject to change as Firestore evolves. It could
+   * include:
+   *  {
+   *    "indexes_entries_scanned": "1000",
+   *    "documents_scanned": "20",
+   *    "billing_details" : {
+   *       "documents_billable": "20",
+   *       "index_entries_billable": "1000",
+   *       "min_query_cost": "0"
+   *    }
+   *  }
+   * 
+ * + * .google.protobuf.Struct debug_stats = 5; + */ + com.google.protobuf.StructOrBuilder getDebugStatsOrBuilder(); +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainMetrics.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainMetrics.java new file mode 100644 index 000000000..9bb2c4872 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainMetrics.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.datastore.v1; + +/** + * + * + *
+ * Explain metrics for the query.
+ * 
+ * + * Protobuf type {@code google.datastore.v1.ExplainMetrics} + */ +public final class ExplainMetrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.ExplainMetrics) + ExplainMetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainMetrics.newBuilder() to construct. + private ExplainMetrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainMetrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainMetrics(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ExplainMetrics.class, + com.google.datastore.v1.ExplainMetrics.Builder.class); + } + + private int bitField0_; + public static final int PLAN_SUMMARY_FIELD_NUMBER = 1; + private com.google.datastore.v1.PlanSummary planSummary_; + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + @java.lang.Override + public boolean hasPlanSummary() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + @java.lang.Override + public com.google.datastore.v1.PlanSummary getPlanSummary() { + return planSummary_ == null + ? com.google.datastore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + @java.lang.Override + public com.google.datastore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder() { + return planSummary_ == null + ? com.google.datastore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + + public static final int EXECUTION_STATS_FIELD_NUMBER = 2; + private com.google.datastore.v1.ExecutionStats executionStats_; + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + @java.lang.Override + public boolean hasExecutionStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + @java.lang.Override + public com.google.datastore.v1.ExecutionStats getExecutionStats() { + return executionStats_ == null + ? com.google.datastore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + @java.lang.Override + public com.google.datastore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder() { + return executionStats_ == null + ? com.google.datastore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPlanSummary()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getExecutionStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPlanSummary()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExecutionStats()); + } + 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.ExplainMetrics)) { + return super.equals(obj); + } + com.google.datastore.v1.ExplainMetrics other = (com.google.datastore.v1.ExplainMetrics) obj; + + if (hasPlanSummary() != other.hasPlanSummary()) return false; + if (hasPlanSummary()) { + if (!getPlanSummary().equals(other.getPlanSummary())) return false; + } + if (hasExecutionStats() != other.hasExecutionStats()) return false; + if (hasExecutionStats()) { + if (!getExecutionStats().equals(other.getExecutionStats())) 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 (hasPlanSummary()) { + hash = (37 * hash) + PLAN_SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getPlanSummary().hashCode(); + } + if (hasExecutionStats()) { + hash = (37 * hash) + EXECUTION_STATS_FIELD_NUMBER; + hash = (53 * hash) + getExecutionStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.v1.ExplainMetrics parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExplainMetrics 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.ExplainMetrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExplainMetrics 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.ExplainMetrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExplainMetrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.ExplainMetrics parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExplainMetrics 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.ExplainMetrics parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExplainMetrics 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.ExplainMetrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExplainMetrics 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.ExplainMetrics 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; + } + /** + * + * + *
+   * Explain metrics for the query.
+   * 
+ * + * Protobuf type {@code google.datastore.v1.ExplainMetrics} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.v1.ExplainMetrics) + com.google.datastore.v1.ExplainMetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainMetrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ExplainMetrics.class, + com.google.datastore.v1.ExplainMetrics.Builder.class); + } + + // Construct using com.google.datastore.v1.ExplainMetrics.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPlanSummaryFieldBuilder(); + getExecutionStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + planSummary_ = null; + if (planSummaryBuilder_ != null) { + planSummaryBuilder_.dispose(); + planSummaryBuilder_ = null; + } + executionStats_ = null; + if (executionStatsBuilder_ != null) { + executionStatsBuilder_.dispose(); + executionStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainMetrics_descriptor; + } + + @java.lang.Override + public com.google.datastore.v1.ExplainMetrics getDefaultInstanceForType() { + return com.google.datastore.v1.ExplainMetrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.v1.ExplainMetrics build() { + com.google.datastore.v1.ExplainMetrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.v1.ExplainMetrics buildPartial() { + com.google.datastore.v1.ExplainMetrics result = + new com.google.datastore.v1.ExplainMetrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.datastore.v1.ExplainMetrics result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.planSummary_ = + planSummaryBuilder_ == null ? planSummary_ : planSummaryBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.executionStats_ = + executionStatsBuilder_ == null ? executionStats_ : executionStatsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.v1.ExplainMetrics) { + return mergeFrom((com.google.datastore.v1.ExplainMetrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.v1.ExplainMetrics other) { + if (other == com.google.datastore.v1.ExplainMetrics.getDefaultInstance()) return this; + if (other.hasPlanSummary()) { + mergePlanSummary(other.getPlanSummary()); + } + if (other.hasExecutionStats()) { + mergeExecutionStats(other.getExecutionStats()); + } + 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(getPlanSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExecutionStatsFieldBuilder().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.PlanSummary planSummary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PlanSummary, + com.google.datastore.v1.PlanSummary.Builder, + com.google.datastore.v1.PlanSummaryOrBuilder> + planSummaryBuilder_; + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + public boolean hasPlanSummary() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + public com.google.datastore.v1.PlanSummary getPlanSummary() { + if (planSummaryBuilder_ == null) { + return planSummary_ == null + ? com.google.datastore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } else { + return planSummaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + public Builder setPlanSummary(com.google.datastore.v1.PlanSummary value) { + if (planSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + planSummary_ = value; + } else { + planSummaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + public Builder setPlanSummary(com.google.datastore.v1.PlanSummary.Builder builderForValue) { + if (planSummaryBuilder_ == null) { + planSummary_ = builderForValue.build(); + } else { + planSummaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + public Builder mergePlanSummary(com.google.datastore.v1.PlanSummary value) { + if (planSummaryBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && planSummary_ != null + && planSummary_ != com.google.datastore.v1.PlanSummary.getDefaultInstance()) { + getPlanSummaryBuilder().mergeFrom(value); + } else { + planSummary_ = value; + } + } else { + planSummaryBuilder_.mergeFrom(value); + } + if (planSummary_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + public Builder clearPlanSummary() { + bitField0_ = (bitField0_ & ~0x00000001); + planSummary_ = null; + if (planSummaryBuilder_ != null) { + planSummaryBuilder_.dispose(); + planSummaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + public com.google.datastore.v1.PlanSummary.Builder getPlanSummaryBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPlanSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + public com.google.datastore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder() { + if (planSummaryBuilder_ != null) { + return planSummaryBuilder_.getMessageOrBuilder(); + } else { + return planSummary_ == null + ? com.google.datastore.v1.PlanSummary.getDefaultInstance() + : planSummary_; + } + } + /** + * + * + *
+     * Planning phase information for the query.
+     * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PlanSummary, + com.google.datastore.v1.PlanSummary.Builder, + com.google.datastore.v1.PlanSummaryOrBuilder> + getPlanSummaryFieldBuilder() { + if (planSummaryBuilder_ == null) { + planSummaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PlanSummary, + com.google.datastore.v1.PlanSummary.Builder, + com.google.datastore.v1.PlanSummaryOrBuilder>( + getPlanSummary(), getParentForChildren(), isClean()); + planSummary_ = null; + } + return planSummaryBuilder_; + } + + private com.google.datastore.v1.ExecutionStats executionStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExecutionStats, + com.google.datastore.v1.ExecutionStats.Builder, + com.google.datastore.v1.ExecutionStatsOrBuilder> + executionStatsBuilder_; + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + public boolean hasExecutionStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + public com.google.datastore.v1.ExecutionStats getExecutionStats() { + if (executionStatsBuilder_ == null) { + return executionStats_ == null + ? com.google.datastore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } else { + return executionStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + public Builder setExecutionStats(com.google.datastore.v1.ExecutionStats value) { + if (executionStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionStats_ = value; + } else { + executionStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + public Builder setExecutionStats( + com.google.datastore.v1.ExecutionStats.Builder builderForValue) { + if (executionStatsBuilder_ == null) { + executionStats_ = builderForValue.build(); + } else { + executionStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + public Builder mergeExecutionStats(com.google.datastore.v1.ExecutionStats value) { + if (executionStatsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && executionStats_ != null + && executionStats_ != com.google.datastore.v1.ExecutionStats.getDefaultInstance()) { + getExecutionStatsBuilder().mergeFrom(value); + } else { + executionStats_ = value; + } + } else { + executionStatsBuilder_.mergeFrom(value); + } + if (executionStats_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + public Builder clearExecutionStats() { + bitField0_ = (bitField0_ & ~0x00000002); + executionStats_ = null; + if (executionStatsBuilder_ != null) { + executionStatsBuilder_.dispose(); + executionStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + public com.google.datastore.v1.ExecutionStats.Builder getExecutionStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExecutionStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + public com.google.datastore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder() { + if (executionStatsBuilder_ != null) { + return executionStatsBuilder_.getMessageOrBuilder(); + } else { + return executionStats_ == null + ? com.google.datastore.v1.ExecutionStats.getDefaultInstance() + : executionStats_; + } + } + /** + * + * + *
+     * Aggregated stats from the execution of the query. Only present when
+     * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+     * to true.
+     * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExecutionStats, + com.google.datastore.v1.ExecutionStats.Builder, + com.google.datastore.v1.ExecutionStatsOrBuilder> + getExecutionStatsFieldBuilder() { + if (executionStatsBuilder_ == null) { + executionStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExecutionStats, + com.google.datastore.v1.ExecutionStats.Builder, + com.google.datastore.v1.ExecutionStatsOrBuilder>( + getExecutionStats(), getParentForChildren(), isClean()); + executionStats_ = null; + } + return executionStatsBuilder_; + } + + @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.ExplainMetrics) + } + + // @@protoc_insertion_point(class_scope:google.datastore.v1.ExplainMetrics) + private static final com.google.datastore.v1.ExplainMetrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.v1.ExplainMetrics(); + } + + public static com.google.datastore.v1.ExplainMetrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainMetrics 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.ExplainMetrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainMetricsOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainMetricsOrBuilder.java new file mode 100644 index 000000000..632fc5ef9 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainMetricsOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.datastore.v1; + +public interface ExplainMetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.ExplainMetrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + * + * @return Whether the planSummary field is set. + */ + boolean hasPlanSummary(); + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + * + * @return The planSummary. + */ + com.google.datastore.v1.PlanSummary getPlanSummary(); + /** + * + * + *
+   * Planning phase information for the query.
+   * 
+ * + * .google.datastore.v1.PlanSummary plan_summary = 1; + */ + com.google.datastore.v1.PlanSummaryOrBuilder getPlanSummaryOrBuilder(); + + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + * + * @return Whether the executionStats field is set. + */ + boolean hasExecutionStats(); + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + * + * @return The executionStats. + */ + com.google.datastore.v1.ExecutionStats getExecutionStats(); + /** + * + * + *
+   * Aggregated stats from the execution of the query. Only present when
+   * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set
+   * to true.
+   * 
+ * + * .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + com.google.datastore.v1.ExecutionStatsOrBuilder getExecutionStatsOrBuilder(); +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainOptions.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainOptions.java new file mode 100644 index 000000000..78fa71cd5 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainOptions.java @@ -0,0 +1,557 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.datastore.v1; + +/** + * + * + *
+ * Explain options for the query.
+ * 
+ * + * Protobuf type {@code google.datastore.v1.ExplainOptions} + */ +public final class ExplainOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.ExplainOptions) + ExplainOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExplainOptions.newBuilder() to construct. + private ExplainOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExplainOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExplainOptions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ExplainOptions.class, + com.google.datastore.v1.ExplainOptions.Builder.class); + } + + public static final int ANALYZE_FIELD_NUMBER = 1; + private boolean analyze_ = false; + /** + * + * + *
+   * Optional. Whether to execute this query.
+   *
+   * When false (the default), the query will be planned, returning only
+   * metrics from the planning stages.
+   *
+   * When true, the query will be planned and executed, returning the full
+   * query results along with both planning and execution stage metrics.
+   * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + @java.lang.Override + public boolean getAnalyze() { + return analyze_; + } + + 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 (analyze_ != false) { + output.writeBool(1, analyze_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (analyze_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, analyze_); + } + 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.ExplainOptions)) { + return super.equals(obj); + } + com.google.datastore.v1.ExplainOptions other = (com.google.datastore.v1.ExplainOptions) obj; + + if (getAnalyze() != other.getAnalyze()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ANALYZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAnalyze()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.v1.ExplainOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExplainOptions 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.ExplainOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExplainOptions 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.ExplainOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.ExplainOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.ExplainOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExplainOptions 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.ExplainOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExplainOptions 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.ExplainOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.ExplainOptions 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.ExplainOptions 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; + } + /** + * + * + *
+   * Explain options for the query.
+   * 
+ * + * Protobuf type {@code google.datastore.v1.ExplainOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.v1.ExplainOptions) + com.google.datastore.v1.ExplainOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.ExplainOptions.class, + com.google.datastore.v1.ExplainOptions.Builder.class); + } + + // Construct using com.google.datastore.v1.ExplainOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + analyze_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_ExplainOptions_descriptor; + } + + @java.lang.Override + public com.google.datastore.v1.ExplainOptions getDefaultInstanceForType() { + return com.google.datastore.v1.ExplainOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.v1.ExplainOptions build() { + com.google.datastore.v1.ExplainOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.v1.ExplainOptions buildPartial() { + com.google.datastore.v1.ExplainOptions result = + new com.google.datastore.v1.ExplainOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.datastore.v1.ExplainOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.analyze_ = analyze_; + } + } + + @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.ExplainOptions) { + return mergeFrom((com.google.datastore.v1.ExplainOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.v1.ExplainOptions other) { + if (other == com.google.datastore.v1.ExplainOptions.getDefaultInstance()) return this; + if (other.getAnalyze() != false) { + setAnalyze(other.getAnalyze()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + analyze_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean analyze_; + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + @java.lang.Override + public boolean getAnalyze() { + return analyze_; + } + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The analyze to set. + * @return This builder for chaining. + */ + public Builder setAnalyze(boolean value) { + + analyze_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to execute this query.
+     *
+     * When false (the default), the query will be planned, returning only
+     * metrics from the planning stages.
+     *
+     * When true, the query will be planned and executed, returning the full
+     * query results along with both planning and execution stage metrics.
+     * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAnalyze() { + bitField0_ = (bitField0_ & ~0x00000001); + analyze_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.v1.ExplainOptions) + } + + // @@protoc_insertion_point(class_scope:google.datastore.v1.ExplainOptions) + private static final com.google.datastore.v1.ExplainOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.v1.ExplainOptions(); + } + + public static com.google.datastore.v1.ExplainOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplainOptions 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.ExplainOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainOptionsOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainOptionsOrBuilder.java new file mode 100644 index 000000000..d539b998d --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/ExplainOptionsOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.datastore.v1; + +public interface ExplainOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.ExplainOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Whether to execute this query.
+   *
+   * When false (the default), the query will be planned, returning only
+   * metrics from the planning stages.
+   *
+   * When true, the query will be planned and executed, returning the full
+   * query results along with both planning and execution stage metrics.
+   * 
+ * + * bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The analyze. + */ + boolean getAnalyze(); +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PlanSummary.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PlanSummary.java new file mode 100644 index 000000000..90df86457 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PlanSummary.java @@ -0,0 +1,1019 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.datastore.v1; + +/** + * + * + *
+ * Planning phase information for the query.
+ * 
+ * + * Protobuf type {@code google.datastore.v1.PlanSummary} + */ +public final class PlanSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.PlanSummary) + PlanSummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use PlanSummary.newBuilder() to construct. + private PlanSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PlanSummary() { + indexesUsed_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PlanSummary(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_PlanSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.PlanSummary.class, + com.google.datastore.v1.PlanSummary.Builder.class); + } + + public static final int INDEXES_USED_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List indexesUsed_; + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public java.util.List getIndexesUsedList() { + return indexesUsed_; + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public java.util.List + getIndexesUsedOrBuilderList() { + return indexesUsed_; + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public int getIndexesUsedCount() { + return indexesUsed_.size(); + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public com.google.protobuf.Struct getIndexesUsed(int index) { + return indexesUsed_.get(index); + } + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index) { + return indexesUsed_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < indexesUsed_.size(); i++) { + output.writeMessage(1, indexesUsed_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < indexesUsed_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, indexesUsed_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.datastore.v1.PlanSummary)) { + return super.equals(obj); + } + com.google.datastore.v1.PlanSummary other = (com.google.datastore.v1.PlanSummary) obj; + + if (!getIndexesUsedList().equals(other.getIndexesUsedList())) 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 (getIndexesUsedCount() > 0) { + hash = (37 * hash) + INDEXES_USED_FIELD_NUMBER; + hash = (53 * hash) + getIndexesUsedList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.v1.PlanSummary parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.PlanSummary 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.PlanSummary parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.PlanSummary 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.PlanSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.PlanSummary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.PlanSummary parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.PlanSummary 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.PlanSummary parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.PlanSummary 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.PlanSummary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.PlanSummary 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.PlanSummary 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 phase information for the query.
+   * 
+ * + * Protobuf type {@code google.datastore.v1.PlanSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.v1.PlanSummary) + com.google.datastore.v1.PlanSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_PlanSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.PlanSummary.class, + com.google.datastore.v1.PlanSummary.Builder.class); + } + + // Construct using com.google.datastore.v1.PlanSummary.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (indexesUsedBuilder_ == null) { + indexesUsed_ = java.util.Collections.emptyList(); + } else { + indexesUsed_ = null; + indexesUsedBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.v1.QueryProfileProto + .internal_static_google_datastore_v1_PlanSummary_descriptor; + } + + @java.lang.Override + public com.google.datastore.v1.PlanSummary getDefaultInstanceForType() { + return com.google.datastore.v1.PlanSummary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.v1.PlanSummary build() { + com.google.datastore.v1.PlanSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.v1.PlanSummary buildPartial() { + com.google.datastore.v1.PlanSummary result = new com.google.datastore.v1.PlanSummary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.datastore.v1.PlanSummary result) { + if (indexesUsedBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + indexesUsed_ = java.util.Collections.unmodifiableList(indexesUsed_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.indexesUsed_ = indexesUsed_; + } else { + result.indexesUsed_ = indexesUsedBuilder_.build(); + } + } + + private void buildPartial0(com.google.datastore.v1.PlanSummary result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.v1.PlanSummary) { + return mergeFrom((com.google.datastore.v1.PlanSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.v1.PlanSummary other) { + if (other == com.google.datastore.v1.PlanSummary.getDefaultInstance()) return this; + if (indexesUsedBuilder_ == null) { + if (!other.indexesUsed_.isEmpty()) { + if (indexesUsed_.isEmpty()) { + indexesUsed_ = other.indexesUsed_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIndexesUsedIsMutable(); + indexesUsed_.addAll(other.indexesUsed_); + } + onChanged(); + } + } else { + if (!other.indexesUsed_.isEmpty()) { + if (indexesUsedBuilder_.isEmpty()) { + indexesUsedBuilder_.dispose(); + indexesUsedBuilder_ = null; + indexesUsed_ = other.indexesUsed_; + bitField0_ = (bitField0_ & ~0x00000001); + indexesUsedBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndexesUsedFieldBuilder() + : null; + } else { + indexesUsedBuilder_.addAllMessages(other.indexesUsed_); + } + } + } + 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: + { + com.google.protobuf.Struct m = + input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(m); + } else { + indexesUsedBuilder_.addMessage(m); + } + 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 java.util.List indexesUsed_ = + java.util.Collections.emptyList(); + + private void ensureIndexesUsedIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + indexesUsed_ = new java.util.ArrayList(indexesUsed_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + indexesUsedBuilder_; + + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List getIndexesUsedList() { + if (indexesUsedBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexesUsed_); + } else { + return indexesUsedBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public int getIndexesUsedCount() { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.size(); + } else { + return indexesUsedBuilder_.getCount(); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct getIndexesUsed(int index) { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.get(index); + } else { + return indexesUsedBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder setIndexesUsed(int index, com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.set(index, value); + onChanged(); + } else { + indexesUsedBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder setIndexesUsed(int index, com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.set(index, builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.add(value); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(int index, com.google.protobuf.Struct value) { + if (indexesUsedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesUsedIsMutable(); + indexesUsed_.add(index, value); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addIndexesUsed(int index, com.google.protobuf.Struct.Builder builderForValue) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.add(index, builderForValue.build()); + onChanged(); + } else { + indexesUsedBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder addAllIndexesUsed( + java.lang.Iterable values) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexesUsed_); + onChanged(); + } else { + indexesUsedBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder clearIndexesUsed() { + if (indexesUsedBuilder_ == null) { + indexesUsed_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + indexesUsedBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public Builder removeIndexesUsed(int index) { + if (indexesUsedBuilder_ == null) { + ensureIndexesUsedIsMutable(); + indexesUsed_.remove(index); + onChanged(); + } else { + indexesUsedBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder getIndexesUsedBuilder(int index) { + return getIndexesUsedFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index) { + if (indexesUsedBuilder_ == null) { + return indexesUsed_.get(index); + } else { + return indexesUsedBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List + getIndexesUsedOrBuilderList() { + if (indexesUsedBuilder_ != null) { + return indexesUsedBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexesUsed_); + } + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder addIndexesUsedBuilder() { + return getIndexesUsedFieldBuilder() + .addBuilder(com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public com.google.protobuf.Struct.Builder addIndexesUsedBuilder(int index) { + return getIndexesUsedFieldBuilder() + .addBuilder(index, com.google.protobuf.Struct.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes selected for the query. For example:
+     *  [
+     *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *  ]
+     * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + public java.util.List getIndexesUsedBuilderList() { + return getIndexesUsedFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getIndexesUsedFieldBuilder() { + if (indexesUsedBuilder_ == null) { + indexesUsedBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + indexesUsed_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + indexesUsed_ = null; + } + return indexesUsedBuilder_; + } + + @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.PlanSummary) + } + + // @@protoc_insertion_point(class_scope:google.datastore.v1.PlanSummary) + private static final com.google.datastore.v1.PlanSummary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.v1.PlanSummary(); + } + + public static com.google.datastore.v1.PlanSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PlanSummary 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.PlanSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PlanSummaryOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PlanSummaryOrBuilder.java new file mode 100644 index 000000000..a98db6c01 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PlanSummaryOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +package com.google.datastore.v1; + +public interface PlanSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.PlanSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + java.util.List getIndexesUsedList(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + com.google.protobuf.Struct getIndexesUsed(int index); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + int getIndexesUsedCount(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + java.util.List getIndexesUsedOrBuilderList(); + /** + * + * + *
+   * The indexes selected for the query. For example:
+   *  [
+   *    {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *    {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *  ]
+   * 
+ * + * repeated .google.protobuf.Struct indexes_used = 1; + */ + com.google.protobuf.StructOrBuilder getIndexesUsedOrBuilder(int index); +} 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..85089166a --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryProfileProto.java @@ -0,0 +1,128 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/query_profile.proto + +// Protobuf Java Version: 3.25.2 +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_ExplainOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_ExplainOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_v1_ExplainMetrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_ExplainMetrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_v1_PlanSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_PlanSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_v1_ExecutionStats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_ExecutionStats_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\037google/api/field" + + "_behavior.proto\032\036google/protobuf/duratio" + + "n.proto\032\034google/protobuf/struct.proto\"&\n" + + "\016ExplainOptions\022\024\n\007analyze\030\001 \001(\010B\003\340A\001\"\206\001" + + "\n\016ExplainMetrics\0226\n\014plan_summary\030\001 \001(\0132 " + + ".google.datastore.v1.PlanSummary\022<\n\017exec" + + "ution_stats\030\002 \001(\0132#.google.datastore.v1." + + "ExecutionStats\"<\n\013PlanSummary\022-\n\014indexes" + + "_used\030\001 \003(\0132\027.google.protobuf.Struct\"\250\001\n" + + "\016ExecutionStats\022\030\n\020results_returned\030\001 \001(" + + "\003\0225\n\022execution_duration\030\003 \001(\0132\031.google.p" + + "rotobuf.Duration\022\027\n\017read_operations\030\004 \001(" + + "\003\022,\n\013debug_stats\030\005 \001(\0132\027.google.protobuf" + + ".StructB\303\001\n\027com.google.datastore.v1B\021Que" + + "ryProfileProtoP\001Z + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + @java.lang.Override + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + @java.lang.Override + public com.google.datastore.v1.ExplainOptions getExplainOptions() { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.datastore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -466,6 +525,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 (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(11, getExplainOptions()); + } getUnknownFields().writeTo(output); } @@ -497,6 +559,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExplainOptions()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -523,6 +588,10 @@ public boolean equals(final java.lang.Object obj) { if (hasReadOptions()) { if (!getReadOptions().equals(other.getReadOptions())) return false; } + if (hasExplainOptions() != other.hasExplainOptions()) return false; + if (hasExplainOptions()) { + if (!getExplainOptions().equals(other.getExplainOptions())) return false; + } if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 3: @@ -557,6 +626,10 @@ public int hashCode() { hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getReadOptions().hashCode(); } + if (hasExplainOptions()) { + hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplainOptions().hashCode(); + } switch (queryTypeCase_) { case 3: hash = (37 * hash) + AGGREGATION_QUERY_FIELD_NUMBER; @@ -712,6 +785,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getPartitionIdFieldBuilder(); getReadOptionsFieldBuilder(); + getExplainOptionsFieldBuilder(); } } @@ -737,6 +811,11 @@ public Builder clear() { if (gqlQueryBuilder_ != null) { gqlQueryBuilder_.clear(); } + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } queryTypeCase_ = 0; queryType_ = null; return this; @@ -793,6 +872,11 @@ private void buildPartial0(com.google.datastore.v1.RunAggregationQueryRequest re readOptionsBuilder_ == null ? readOptions_ : readOptionsBuilder_.build(); to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.explainOptions_ = + explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -869,6 +953,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunAggregationQueryRequest othe if (other.hasReadOptions()) { mergeReadOptions(other.getReadOptions()); } + if (other.hasExplainOptions()) { + mergeExplainOptions(other.getExplainOptions()); + } switch (other.getQueryTypeCase()) { case AGGREGATION_QUERY: { @@ -948,6 +1035,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 74 + case 90: + { + input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2020,6 +2113,219 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return gqlQueryBuilder_; } + private com.google.datastore.v1.ExplainOptions explainOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainOptions, + com.google.datastore.v1.ExplainOptions.Builder, + com.google.datastore.v1.ExplainOptionsOrBuilder> + explainOptionsBuilder_; + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + public com.google.datastore.v1.ExplainOptions getExplainOptions() { + if (explainOptionsBuilder_ == null) { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } else { + return explainOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions(com.google.datastore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainOptions_ = value; + } else { + explainOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions( + com.google.datastore.v1.ExplainOptions.Builder builderForValue) { + if (explainOptionsBuilder_ == null) { + explainOptions_ = builderForValue.build(); + } else { + explainOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && explainOptions_ != null + && explainOptions_ != com.google.datastore.v1.ExplainOptions.getDefaultInstance()) { + getExplainOptionsBuilder().mergeFrom(value); + } else { + explainOptions_ = value; + } + } else { + explainOptionsBuilder_.mergeFrom(value); + } + if (explainOptions_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExplainOptions() { + bitField0_ = (bitField0_ & ~0x00000040); + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.datastore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getExplainOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.datastore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + if (explainOptionsBuilder_ != null) { + return explainOptionsBuilder_.getMessageOrBuilder(); + } else { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainOptions, + com.google.datastore.v1.ExplainOptions.Builder, + com.google.datastore.v1.ExplainOptionsOrBuilder> + getExplainOptionsFieldBuilder() { + if (explainOptionsBuilder_ == null) { + explainOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainOptions, + com.google.datastore.v1.ExplainOptions.Builder, + com.google.datastore.v1.ExplainOptionsOrBuilder>( + getExplainOptions(), getParentForChildren(), isClean()); + explainOptions_ = null; + } + return explainOptionsBuilder_; + } + @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 0982b2b2b..23a5c4e62 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 @@ -229,5 +229,49 @@ public interface RunAggregationQueryRequestOrBuilder */ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + boolean hasExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + com.google.datastore.v1.ExplainOptions getExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.datastore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder(); + 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 f33cfc1af..9ddc2eb14 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 @@ -185,6 +185,62 @@ public com.google.protobuf.ByteString getTransaction() { return transaction_; } + public static final int EXPLAIN_METRICS_FIELD_NUMBER = 9; + private com.google.datastore.v1.ExplainMetrics explainMetrics_; + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return Whether the explainMetrics field is set. + */ + @java.lang.Override + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return The explainMetrics. + */ + @java.lang.Override + public com.google.datastore.v1.ExplainMetrics getExplainMetrics() { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + @java.lang.Override + public com.google.datastore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -208,6 +264,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!transaction_.isEmpty()) { output.writeBytes(5, transaction_); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getExplainMetrics()); + } getUnknownFields().writeTo(output); } @@ -226,6 +285,9 @@ public int getSerializedSize() { if (!transaction_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, transaction_); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getExplainMetrics()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -251,6 +313,10 @@ public boolean equals(final java.lang.Object obj) { if (!getQuery().equals(other.getQuery())) return false; } if (!getTransaction().equals(other.getTransaction())) return false; + if (hasExplainMetrics() != other.hasExplainMetrics()) return false; + if (hasExplainMetrics()) { + if (!getExplainMetrics().equals(other.getExplainMetrics())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -272,6 +338,10 @@ public int hashCode() { } hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; hash = (53 * hash) + getTransaction().hashCode(); + if (hasExplainMetrics()) { + hash = (37 * hash) + EXPLAIN_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getExplainMetrics().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -415,6 +485,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getBatchFieldBuilder(); getQueryFieldBuilder(); + getExplainMetricsFieldBuilder(); } } @@ -433,6 +504,11 @@ public Builder clear() { queryBuilder_ = null; } transaction_ = com.google.protobuf.ByteString.EMPTY; + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } return this; } @@ -481,6 +557,11 @@ private void buildPartial0(com.google.datastore.v1.RunAggregationQueryResponse r if (((from_bitField0_ & 0x00000004) != 0)) { result.transaction_ = transaction_; } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.explainMetrics_ = + explainMetricsBuilder_ == null ? explainMetrics_ : explainMetricsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -539,6 +620,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunAggregationQueryResponse oth if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { setTransaction(other.getTransaction()); } + if (other.hasExplainMetrics()) { + mergeExplainMetrics(other.getExplainMetrics()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -583,6 +667,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 42 + case 74: + { + input.readMessage(getExplainMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1046,6 +1136,210 @@ public Builder clearTransaction() { return this; } + private com.google.datastore.v1.ExplainMetrics explainMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainMetrics, + com.google.datastore.v1.ExplainMetrics.Builder, + com.google.datastore.v1.ExplainMetricsOrBuilder> + explainMetricsBuilder_; + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return Whether the explainMetrics field is set. + */ + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return The explainMetrics. + */ + public com.google.datastore.v1.ExplainMetrics getExplainMetrics() { + if (explainMetricsBuilder_ == null) { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } else { + return explainMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder setExplainMetrics(com.google.datastore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainMetrics_ = value; + } else { + explainMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder setExplainMetrics( + com.google.datastore.v1.ExplainMetrics.Builder builderForValue) { + if (explainMetricsBuilder_ == null) { + explainMetrics_ = builderForValue.build(); + } else { + explainMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder mergeExplainMetrics(com.google.datastore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && explainMetrics_ != null + && explainMetrics_ != com.google.datastore.v1.ExplainMetrics.getDefaultInstance()) { + getExplainMetricsBuilder().mergeFrom(value); + } else { + explainMetrics_ = value; + } + } else { + explainMetricsBuilder_.mergeFrom(value); + } + if (explainMetrics_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder clearExplainMetrics() { + bitField0_ = (bitField0_ & ~0x00000008); + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public com.google.datastore.v1.ExplainMetrics.Builder getExplainMetricsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getExplainMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public com.google.datastore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + if (explainMetricsBuilder_ != null) { + return explainMetricsBuilder_.getMessageOrBuilder(); + } else { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainMetrics, + com.google.datastore.v1.ExplainMetrics.Builder, + com.google.datastore.v1.ExplainMetricsOrBuilder> + getExplainMetricsFieldBuilder() { + if (explainMetricsBuilder_ == null) { + explainMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainMetrics, + com.google.datastore.v1.ExplainMetrics.Builder, + com.google.datastore.v1.ExplainMetricsOrBuilder>( + getExplainMetrics(), getParentForChildren(), isClean()); + explainMetrics_ = null; + } + return explainMetricsBuilder_; + } + @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 fc035ea99..423c26052 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 @@ -112,4 +112,45 @@ public interface RunAggregationQueryResponseOrBuilder * @return The transaction. */ com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return Whether the explainMetrics field is set. + */ + boolean hasExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return The explainMetrics. + */ + com.google.datastore.v1.ExplainMetrics getExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + com.google.datastore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder(); } 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 e6a745896..cdbc7b6fa 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 @@ -433,6 +433,65 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return com.google.datastore.v1.GqlQuery.getDefaultInstance(); } + public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 12; + private com.google.datastore.v1.ExplainOptions explainOptions_; + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + @java.lang.Override + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + @java.lang.Override + public com.google.datastore.v1.ExplainOptions getExplainOptions() { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.datastore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -465,6 +524,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 (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(12, getExplainOptions()); + } getUnknownFields().writeTo(output); } @@ -496,6 +558,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(databaseId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getExplainOptions()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -521,6 +586,10 @@ public boolean equals(final java.lang.Object obj) { if (hasReadOptions()) { if (!getReadOptions().equals(other.getReadOptions())) return false; } + if (hasExplainOptions() != other.hasExplainOptions()) return false; + if (hasExplainOptions()) { + if (!getExplainOptions().equals(other.getExplainOptions())) return false; + } if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 3: @@ -555,6 +624,10 @@ public int hashCode() { hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getReadOptions().hashCode(); } + if (hasExplainOptions()) { + hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExplainOptions().hashCode(); + } switch (queryTypeCase_) { case 3: hash = (37 * hash) + QUERY_FIELD_NUMBER; @@ -709,6 +782,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getPartitionIdFieldBuilder(); getReadOptionsFieldBuilder(); + getExplainOptionsFieldBuilder(); } } @@ -734,6 +808,11 @@ public Builder clear() { if (gqlQueryBuilder_ != null) { gqlQueryBuilder_.clear(); } + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } queryTypeCase_ = 0; queryType_ = null; return this; @@ -790,6 +869,11 @@ private void buildPartial0(com.google.datastore.v1.RunQueryRequest result) { readOptionsBuilder_ == null ? readOptions_ : readOptionsBuilder_.build(); to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.explainOptions_ = + explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -865,6 +949,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryRequest other) { if (other.hasReadOptions()) { mergeReadOptions(other.getReadOptions()); } + if (other.hasExplainOptions()) { + mergeExplainOptions(other.getExplainOptions()); + } switch (other.getQueryTypeCase()) { case QUERY: { @@ -943,6 +1030,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 74 + case 98: + { + input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 98 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2011,6 +2104,219 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return gqlQueryBuilder_; } + private com.google.datastore.v1.ExplainOptions explainOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainOptions, + com.google.datastore.v1.ExplainOptions.Builder, + com.google.datastore.v1.ExplainOptionsOrBuilder> + explainOptionsBuilder_; + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + public boolean hasExplainOptions() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + public com.google.datastore.v1.ExplainOptions getExplainOptions() { + if (explainOptionsBuilder_ == null) { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } else { + return explainOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions(com.google.datastore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainOptions_ = value; + } else { + explainOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExplainOptions( + com.google.datastore.v1.ExplainOptions.Builder builderForValue) { + if (explainOptionsBuilder_ == null) { + explainOptions_ = builderForValue.build(); + } else { + explainOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) { + if (explainOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && explainOptions_ != null + && explainOptions_ != com.google.datastore.v1.ExplainOptions.getDefaultInstance()) { + getExplainOptionsBuilder().mergeFrom(value); + } else { + explainOptions_ = value; + } + } else { + explainOptionsBuilder_.mergeFrom(value); + } + if (explainOptions_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExplainOptions() { + bitField0_ = (bitField0_ & ~0x00000040); + explainOptions_ = null; + if (explainOptionsBuilder_ != null) { + explainOptionsBuilder_.dispose(); + explainOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.datastore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getExplainOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.datastore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder() { + if (explainOptionsBuilder_ != null) { + return explainOptionsBuilder_.getMessageOrBuilder(); + } else { + return explainOptions_ == null + ? com.google.datastore.v1.ExplainOptions.getDefaultInstance() + : explainOptions_; + } + } + /** + * + * + *
+     * Optional. Explain options for the query. If set, additional query
+     * statistics will be returned. If not, only query results will be returned.
+     * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainOptions, + com.google.datastore.v1.ExplainOptions.Builder, + com.google.datastore.v1.ExplainOptionsOrBuilder> + getExplainOptionsFieldBuilder() { + if (explainOptionsBuilder_ == null) { + explainOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainOptions, + com.google.datastore.v1.ExplainOptions.Builder, + com.google.datastore.v1.ExplainOptionsOrBuilder>( + getExplainOptions(), getParentForChildren(), isClean()); + explainOptions_ = null; + } + return explainOptionsBuilder_; + } + @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 b11ecd648..d94ba46d2 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 @@ -229,5 +229,49 @@ public interface RunQueryRequestOrBuilder */ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the explainOptions field is set. + */ + boolean hasExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The explainOptions. + */ + com.google.datastore.v1.ExplainOptions getExplainOptions(); + /** + * + * + *
+   * Optional. Explain options for the query. If set, additional query
+   * statistics will be returned. If not, only query results will be returned.
+   * 
+ * + * + * .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.datastore.v1.ExplainOptionsOrBuilder getExplainOptionsOrBuilder(); + 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 f4852c6a8..338b81c10 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 @@ -181,6 +181,62 @@ public com.google.protobuf.ByteString getTransaction() { return transaction_; } + public static final int EXPLAIN_METRICS_FIELD_NUMBER = 9; + private com.google.datastore.v1.ExplainMetrics explainMetrics_; + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return Whether the explainMetrics field is set. + */ + @java.lang.Override + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return The explainMetrics. + */ + @java.lang.Override + public com.google.datastore.v1.ExplainMetrics getExplainMetrics() { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + @java.lang.Override + public com.google.datastore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -204,6 +260,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!transaction_.isEmpty()) { output.writeBytes(5, transaction_); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getExplainMetrics()); + } getUnknownFields().writeTo(output); } @@ -222,6 +281,9 @@ public int getSerializedSize() { if (!transaction_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, transaction_); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getExplainMetrics()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -246,6 +308,10 @@ public boolean equals(final java.lang.Object obj) { if (!getQuery().equals(other.getQuery())) return false; } if (!getTransaction().equals(other.getTransaction())) return false; + if (hasExplainMetrics() != other.hasExplainMetrics()) return false; + if (hasExplainMetrics()) { + if (!getExplainMetrics().equals(other.getExplainMetrics())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -267,6 +333,10 @@ public int hashCode() { } hash = (37 * hash) + TRANSACTION_FIELD_NUMBER; hash = (53 * hash) + getTransaction().hashCode(); + if (hasExplainMetrics()) { + hash = (37 * hash) + EXPLAIN_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getExplainMetrics().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -410,6 +480,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getBatchFieldBuilder(); getQueryFieldBuilder(); + getExplainMetricsFieldBuilder(); } } @@ -428,6 +499,11 @@ public Builder clear() { queryBuilder_ = null; } transaction_ = com.google.protobuf.ByteString.EMPTY; + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } return this; } @@ -476,6 +552,11 @@ private void buildPartial0(com.google.datastore.v1.RunQueryResponse result) { if (((from_bitField0_ & 0x00000004) != 0)) { result.transaction_ = transaction_; } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.explainMetrics_ = + explainMetricsBuilder_ == null ? explainMetrics_ : explainMetricsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -533,6 +614,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryResponse other) { if (other.getTransaction() != com.google.protobuf.ByteString.EMPTY) { setTransaction(other.getTransaction()); } + if (other.hasExplainMetrics()) { + mergeExplainMetrics(other.getExplainMetrics()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -577,6 +661,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 42 + case 74: + { + input.readMessage(getExplainMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1035,6 +1125,210 @@ public Builder clearTransaction() { return this; } + private com.google.datastore.v1.ExplainMetrics explainMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainMetrics, + com.google.datastore.v1.ExplainMetrics.Builder, + com.google.datastore.v1.ExplainMetricsOrBuilder> + explainMetricsBuilder_; + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return Whether the explainMetrics field is set. + */ + public boolean hasExplainMetrics() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return The explainMetrics. + */ + public com.google.datastore.v1.ExplainMetrics getExplainMetrics() { + if (explainMetricsBuilder_ == null) { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } else { + return explainMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder setExplainMetrics(com.google.datastore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explainMetrics_ = value; + } else { + explainMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder setExplainMetrics( + com.google.datastore.v1.ExplainMetrics.Builder builderForValue) { + if (explainMetricsBuilder_ == null) { + explainMetrics_ = builderForValue.build(); + } else { + explainMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder mergeExplainMetrics(com.google.datastore.v1.ExplainMetrics value) { + if (explainMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && explainMetrics_ != null + && explainMetrics_ != com.google.datastore.v1.ExplainMetrics.getDefaultInstance()) { + getExplainMetricsBuilder().mergeFrom(value); + } else { + explainMetrics_ = value; + } + } else { + explainMetricsBuilder_.mergeFrom(value); + } + if (explainMetrics_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public Builder clearExplainMetrics() { + bitField0_ = (bitField0_ & ~0x00000008); + explainMetrics_ = null; + if (explainMetricsBuilder_ != null) { + explainMetricsBuilder_.dispose(); + explainMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public com.google.datastore.v1.ExplainMetrics.Builder getExplainMetricsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getExplainMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + public com.google.datastore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder() { + if (explainMetricsBuilder_ != null) { + return explainMetricsBuilder_.getMessageOrBuilder(); + } else { + return explainMetrics_ == null + ? com.google.datastore.v1.ExplainMetrics.getDefaultInstance() + : explainMetrics_; + } + } + /** + * + * + *
+     * Query explain metrics. This is only present when the
+     * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+     * is provided, and it is sent only once with the last response in the stream.
+     * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainMetrics, + com.google.datastore.v1.ExplainMetrics.Builder, + com.google.datastore.v1.ExplainMetricsOrBuilder> + getExplainMetricsFieldBuilder() { + if (explainMetricsBuilder_ == null) { + explainMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.ExplainMetrics, + com.google.datastore.v1.ExplainMetrics.Builder, + com.google.datastore.v1.ExplainMetricsOrBuilder>( + getExplainMetrics(), getParentForChildren(), isClean()); + explainMetrics_ = null; + } + return explainMetricsBuilder_; + } + @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 53de7bf14..3bcbb324e 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 @@ -112,4 +112,45 @@ public interface RunQueryResponseOrBuilder * @return The transaction. */ com.google.protobuf.ByteString getTransaction(); + + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return Whether the explainMetrics field is set. + */ + boolean hasExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * + * @return The explainMetrics. + */ + com.google.datastore.v1.ExplainMetrics getExplainMetrics(); + /** + * + * + *
+   * Query explain metrics. This is only present when the
+   * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options]
+   * is provided, and it is sent only once with the last response in the stream.
+   * 
+ * + * .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + com.google.datastore.v1.ExplainMetricsOrBuilder getExplainMetricsOrBuilder(); } 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..1a3fbdd11 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,10 @@ message RunQueryRequest { // The GQL query to run. This query must be a non-aggregation query. GqlQuery gql_query = 7; } + + // Optional. Explain options for the query. If set, additional query + // statistics will be returned. If not, only query results will be returned. + ExplainOptions explain_options = 12 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -251,6 +256,11 @@ message RunQueryResponse { // was set in // [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. bytes transaction = 5; + + // Query explain metrics. This is only present when the + // [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] + // is provided, and it is sent only once with the last response in the stream. + ExplainMetrics explain_metrics = 9; } // The request for @@ -282,6 +292,10 @@ message RunAggregationQueryRequest { // The GQL query to run. This query must be an aggregation query. GqlQuery gql_query = 7; } + + // Optional. Explain options for the query. If set, additional query + // statistics will be returned. If not, only query results will be returned. + ExplainOptions explain_options = 11 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -301,6 +315,11 @@ message RunAggregationQueryResponse { // was set in // [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. bytes transaction = 5; + + // Query explain metrics. This is only present when the + // [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] + // is provided, and it is sent only once with the last response in the stream. + ExplainMetrics explain_metrics = 9; } // 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..01c9fc254 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/query_profile.proto @@ -0,0 +1,91 @@ +// 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/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +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. + +// Explain options for the query. +message ExplainOptions { + // Optional. Whether to execute this query. + // + // When false (the default), the query will be planned, returning only + // metrics from the planning stages. + // + // When true, the query will be planned and executed, returning the full + // query results along with both planning and execution stage metrics. + bool analyze = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Explain metrics for the query. +message ExplainMetrics { + // Planning phase information for the query. + PlanSummary plan_summary = 1; + + // Aggregated stats from the execution of the query. Only present when + // [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set + // to true. + ExecutionStats execution_stats = 2; +} + +// Planning phase information for the query. +message PlanSummary { + // The indexes selected for the query. For example: + // [ + // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + // ] + repeated google.protobuf.Struct indexes_used = 1; +} + +// Execution statistics for the query. +message ExecutionStats { + // Total number of results returned, including documents, projections, + // aggregation results, keys. + int64 results_returned = 1; + + // Total time to execute the query in the backend. + google.protobuf.Duration execution_duration = 3; + + // Total billable read operations. + int64 read_operations = 4; + + // Debugging statistics from the execution of the query. Note that the + // debugging stats are subject to change as Firestore evolves. It could + // include: + // { + // "indexes_entries_scanned": "1000", + // "documents_scanned": "20", + // "billing_details" : { + // "documents_billable": "20", + // "index_entries_billable": "1000", + // "min_query_cost": "0" + // } + // } + google.protobuf.Struct debug_stats = 5; +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c7eab8dfa..58d7e4c34 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.18.4 + 2.18.5 @@ -42,7 +42,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index cc06e9d72..5ab8f16bd 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.33.0 + 26.34.0 pom import @@ -50,7 +50,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1e87fd7fb..c0152c055 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-datastore - 2.18.5 + 2.18.6 @@ -41,7 +41,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8b31b9af8..9640927ce 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 26.33.0 + 26.34.0 pom import @@ -53,7 +53,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/versions.txt b/versions.txt index 9369a0467..b8c9f62f9 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-datastore:2.18.5:2.18.5 -google-cloud-datastore-bom:2.18.5:2.18.5 -proto-google-cloud-datastore-v1:0.109.5:0.109.5 -datastore-v1-proto-client:2.18.5:2.18.5 -proto-google-cloud-datastore-admin-v1:2.18.5:2.18.5 -grpc-google-cloud-datastore-admin-v1:2.18.5:2.18.5 +google-cloud-datastore:2.18.6:2.18.6 +google-cloud-datastore-bom:2.18.6:2.18.6 +proto-google-cloud-datastore-v1:0.109.6:0.109.6 +datastore-v1-proto-client:2.18.6:2.18.6 +proto-google-cloud-datastore-admin-v1:2.18.6:2.18.6 +grpc-google-cloud-datastore-admin-v1:2.18.6:2.18.6