diff --git a/generation_config.yaml b/generation_config.yaml index 0c70cb56986..05d24f70bbd 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.64.1 -googleapis_commitish: c2db528a3e4d12b95666c719ee0db30a3d4c78ad +googleapis_commitish: 15fa97d38ad2a38319426328c795ef76a03448bd libraries_bom_version: 26.71.0 libraries: - api_shortname: spanner diff --git a/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json b/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json index 7c9d39e9d11..4fe69e288d6 100644 --- a/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json +++ b/google-cloud-spanner-executor/src/main/resources/META-INF/native-image/com.google.cloud.spanner.executor.v1/reflect-config.json @@ -5318,6 +5318,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.CacheUpdate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.CacheUpdate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.CommitRequest", "queryAllDeclaredConstructors": true, @@ -5606,6 +5624,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Group", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Group$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.KeyRange", "queryAllDeclaredConstructors": true, @@ -5624,6 +5660,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.KeyRecipe", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part$NullOrder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part$Order", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.KeySet", "queryAllDeclaredConstructors": true, @@ -5705,6 +5795,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Mutation$Ack", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Mutation$Ack$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Mutation$Builder", "queryAllDeclaredConstructors": true, @@ -5732,6 +5840,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Mutation$Send", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Mutation$Send$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Mutation$Write", "queryAllDeclaredConstructors": true, @@ -5921,6 +6047,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult$IndexAdvice", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult$IndexAdvice$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.QueryPlan", "queryAllDeclaredConstructors": true, @@ -5939,6 +6101,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Range", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Range$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.ReadRequest", "queryAllDeclaredConstructors": true, @@ -5975,6 +6155,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.RecipeList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RecipeList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.RequestOptions", "queryAllDeclaredConstructors": true, @@ -6074,6 +6272,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.RoutingHint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RoutingHint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RoutingHint$SkippedTablet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RoutingHint$SkippedTablet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Session", "queryAllDeclaredConstructors": true, @@ -6128,6 +6362,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Tablet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Tablet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Tablet$Role", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Transaction", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java index 68b24a9d067..cf2c3f734f9 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java @@ -661,9 +661,10 @@ public final UnaryCallable createSessionCallable( * } * * @param database Required. The database in which the new sessions are created. - * @param sessionCount Required. The number of sessions to be created in this batch call. The API - * can return fewer than the requested number of sessions. If a specific number of sessions - * are desired, the client can make additional calls to `BatchCreateSessions` (adjusting + * @param sessionCount Required. The number of sessions to be created in this batch call. At least + * one session is created. The API can return fewer than the requested number of sessions. If + * a specific number of sessions are desired, the client can make additional calls to + * `BatchCreateSessions` (adjusting * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -701,9 +702,10 @@ public final BatchCreateSessionsResponse batchCreateSessions( * } * * @param database Required. The database in which the new sessions are created. - * @param sessionCount Required. The number of sessions to be created in this batch call. The API - * can return fewer than the requested number of sessions. If a specific number of sessions - * are desired, the client can make additional calls to `BatchCreateSessions` (adjusting + * @param sessionCount Required. The number of sessions to be created in this batch call. At least + * one session is created. The API can return fewer than the requested number of sessions. If + * a specific number of sessions are desired, the client can make additional calls to + * `BatchCreateSessions` (adjusting * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1216,6 +1218,7 @@ public final UnaryCallable deleteSessionCallable() * .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) * .setDataBoostEnabled(true) * .setLastStatement(true) + * .setRoutingHint(RoutingHint.newBuilder().build()) * .build(); * ResultSet response = spannerClient.executeSql(request); * } @@ -1269,6 +1272,7 @@ public final ResultSet executeSql(ExecuteSqlRequest request) { * .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) * .setDataBoostEnabled(true) * .setLastStatement(true) + * .setRoutingHint(RoutingHint.newBuilder().build()) * .build(); * ApiFuture future = spannerClient.executeSqlCallable().futureCall(request); * // Do something. @@ -1315,6 +1319,7 @@ public final UnaryCallable executeSqlCallable() { * .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) * .setDataBoostEnabled(true) * .setLastStatement(true) + * .setRoutingHint(RoutingHint.newBuilder().build()) * .build(); * ServerStream stream = * spannerClient.executeStreamingSqlCallable().call(request); @@ -1454,6 +1459,7 @@ public final ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest requ * .setRequestOptions(RequestOptions.newBuilder().build()) * .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) * .setDataBoostEnabled(true) + * .setRoutingHint(RoutingHint.newBuilder().build()) * .build(); * ResultSet response = spannerClient.read(request); * } @@ -1504,6 +1510,7 @@ public final ResultSet read(ReadRequest request) { * .setRequestOptions(RequestOptions.newBuilder().build()) * .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) * .setDataBoostEnabled(true) + * .setRoutingHint(RoutingHint.newBuilder().build()) * .build(); * ApiFuture future = spannerClient.readCallable().futureCall(request); * // Do something. @@ -1546,6 +1553,7 @@ public final UnaryCallable readCallable() { * .setRequestOptions(RequestOptions.newBuilder().build()) * .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) * .setDataBoostEnabled(true) + * .setRoutingHint(RoutingHint.newBuilder().build()) * .build(); * ServerStream stream = spannerClient.streamingReadCallable().call(request); * for (PartialResultSet response : stream) { diff --git a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json index 90fb979315e..9dd4579f179 100644 --- a/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json +++ b/google-cloud-spanner/src/main/resources/META-INF/native-image/com.google.cloud.spanner.v1/reflect-config.json @@ -1403,6 +1403,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.CacheUpdate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.CacheUpdate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.ChangeStreamRecord", "queryAllDeclaredConstructors": true, @@ -1907,6 +1925,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Group", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Group$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.KeyRange", "queryAllDeclaredConstructors": true, @@ -1925,6 +1961,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.KeyRecipe", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part$NullOrder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.KeyRecipe$Part$Order", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.KeySet", "queryAllDeclaredConstructors": true, @@ -2006,6 +2096,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Mutation$Ack", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Mutation$Ack$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Mutation$Builder", "queryAllDeclaredConstructors": true, @@ -2033,6 +2141,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Mutation$Send", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Mutation$Send$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Mutation$Write", "queryAllDeclaredConstructors": true, @@ -2222,6 +2348,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult$IndexAdvice", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.QueryAdvisorResult$IndexAdvice$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.QueryPlan", "queryAllDeclaredConstructors": true, @@ -2240,6 +2402,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Range", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Range$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.ReadRequest", "queryAllDeclaredConstructors": true, @@ -2276,6 +2456,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.RecipeList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RecipeList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.RequestOptions", "queryAllDeclaredConstructors": true, @@ -2375,6 +2573,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.RoutingHint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RoutingHint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RoutingHint$SkippedTablet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.RoutingHint$SkippedTablet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Session", "queryAllDeclaredConstructors": true, @@ -2429,6 +2663,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.spanner.v1.Tablet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Tablet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.spanner.v1.Tablet$Role", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.spanner.v1.Transaction", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientHttpJsonTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientHttpJsonTest.java index 236d7f9649a..5c20729d494 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientHttpJsonTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientHttpJsonTest.java @@ -56,6 +56,7 @@ import com.google.spanner.v1.ResultSet; import com.google.spanner.v1.ResultSetMetadata; import com.google.spanner.v1.ResultSetStats; +import com.google.spanner.v1.RoutingHint; import com.google.spanner.v1.Session; import com.google.spanner.v1.SessionName; import com.google.spanner.v1.Transaction; @@ -608,6 +609,7 @@ public void executeSqlTest() throws Exception { .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) .setLastStatement(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); ResultSet actualResponse = client.executeSql(request); @@ -652,6 +654,7 @@ public void executeSqlExceptionTest() throws Exception { .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) .setLastStatement(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); client.executeSql(request); Assert.fail("No exception raised"); @@ -761,6 +764,7 @@ public void readTest() throws Exception { .setRequestOptions(RequestOptions.newBuilder().build()) .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); ResultSet actualResponse = client.read(request); @@ -804,6 +808,7 @@ public void readExceptionTest() throws Exception { .setRequestOptions(RequestOptions.newBuilder().build()) .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); client.read(request); Assert.fail("No exception raised"); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java index 35ed41c0d86..66d2313bf2e 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/v1/SpannerClientTest.java @@ -42,6 +42,7 @@ import com.google.spanner.v1.BatchWriteRequest; import com.google.spanner.v1.BatchWriteResponse; import com.google.spanner.v1.BeginTransactionRequest; +import com.google.spanner.v1.CacheUpdate; import com.google.spanner.v1.CommitRequest; import com.google.spanner.v1.CommitResponse; import com.google.spanner.v1.CreateSessionRequest; @@ -69,6 +70,7 @@ import com.google.spanner.v1.ResultSetMetadata; import com.google.spanner.v1.ResultSetStats; import com.google.spanner.v1.RollbackRequest; +import com.google.spanner.v1.RoutingHint; import com.google.spanner.v1.Session; import com.google.spanner.v1.SessionName; import com.google.spanner.v1.Transaction; @@ -566,6 +568,7 @@ public void executeSqlTest() throws Exception { .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) .setLastStatement(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); ResultSet actualResponse = client.executeSql(request); @@ -589,6 +592,7 @@ public void executeSqlTest() throws Exception { Assert.assertEquals(request.getDirectedReadOptions(), actualRequest.getDirectedReadOptions()); Assert.assertEquals(request.getDataBoostEnabled(), actualRequest.getDataBoostEnabled()); Assert.assertEquals(request.getLastStatement(), actualRequest.getLastStatement()); + Assert.assertEquals(request.getRoutingHint(), actualRequest.getRoutingHint()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -617,6 +621,7 @@ public void executeSqlExceptionTest() throws Exception { .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) .setLastStatement(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); client.executeSql(request); Assert.fail("No exception raised"); @@ -636,6 +641,7 @@ public void executeStreamingSqlTest() throws Exception { .setStats(ResultSetStats.newBuilder().build()) .setPrecommitToken(MultiplexedSessionPrecommitToken.newBuilder().build()) .setLast(true) + .setCacheUpdate(CacheUpdate.newBuilder().build()) .build(); mockSpanner.addResponse(expectedResponse); ExecuteSqlRequest request = @@ -654,6 +660,7 @@ public void executeStreamingSqlTest() throws Exception { .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) .setLastStatement(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -687,6 +694,7 @@ public void executeStreamingSqlExceptionTest() throws Exception { .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) .setLastStatement(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -794,6 +802,7 @@ public void readTest() throws Exception { .setRequestOptions(RequestOptions.newBuilder().build()) .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); ResultSet actualResponse = client.read(request); @@ -817,6 +826,7 @@ public void readTest() throws Exception { Assert.assertEquals(request.getDataBoostEnabled(), actualRequest.getDataBoostEnabled()); Assert.assertEquals(request.getOrderBy(), actualRequest.getOrderBy()); Assert.assertEquals(request.getLockHint(), actualRequest.getLockHint()); + Assert.assertEquals(request.getRoutingHint(), actualRequest.getRoutingHint()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -844,6 +854,7 @@ public void readExceptionTest() throws Exception { .setRequestOptions(RequestOptions.newBuilder().build()) .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); client.read(request); Assert.fail("No exception raised"); @@ -863,6 +874,7 @@ public void streamingReadTest() throws Exception { .setStats(ResultSetStats.newBuilder().build()) .setPrecommitToken(MultiplexedSessionPrecommitToken.newBuilder().build()) .setLast(true) + .setCacheUpdate(CacheUpdate.newBuilder().build()) .build(); mockSpanner.addResponse(expectedResponse); ReadRequest request = @@ -880,6 +892,7 @@ public void streamingReadTest() throws Exception { .setRequestOptions(RequestOptions.newBuilder().build()) .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -912,6 +925,7 @@ public void streamingReadExceptionTest() throws Exception { .setRequestOptions(RequestOptions.newBuilder().build()) .setDirectedReadOptions(DirectedReadOptions.newBuilder().build()) .setDataBoostEnabled(true) + .setRoutingHint(RoutingHint.newBuilder().build()) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequest.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequest.java index 57ae1ee310d..2b314e582b9 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequest.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequest.java @@ -183,10 +183,10 @@ public com.google.spanner.v1.SessionOrBuilder getSessionTemplateOrBuilder() { * * *
-   * Required. The number of sessions to be created in this batch call.
-   * The API can return fewer than the requested number of sessions. If a
-   * specific number of sessions are desired, the client can make additional
-   * calls to `BatchCreateSessions` (adjusting
+   * Required. The number of sessions to be created in this batch call. At least
+   * one session is created. The API can return fewer than the requested number
+   * of sessions. If a specific number of sessions are desired, the client can
+   * make additional calls to `BatchCreateSessions` (adjusting
    * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
    * as necessary).
    * 
@@ -931,10 +931,10 @@ public com.google.spanner.v1.SessionOrBuilder getSessionTemplateOrBuilder() { * * *
-     * Required. The number of sessions to be created in this batch call.
-     * The API can return fewer than the requested number of sessions. If a
-     * specific number of sessions are desired, the client can make additional
-     * calls to `BatchCreateSessions` (adjusting
+     * Required. The number of sessions to be created in this batch call. At least
+     * one session is created. The API can return fewer than the requested number
+     * of sessions. If a specific number of sessions are desired, the client can
+     * make additional calls to `BatchCreateSessions` (adjusting
      * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
      * as necessary).
      * 
@@ -952,10 +952,10 @@ public int getSessionCount() { * * *
-     * Required. The number of sessions to be created in this batch call.
-     * The API can return fewer than the requested number of sessions. If a
-     * specific number of sessions are desired, the client can make additional
-     * calls to `BatchCreateSessions` (adjusting
+     * Required. The number of sessions to be created in this batch call. At least
+     * one session is created. The API can return fewer than the requested number
+     * of sessions. If a specific number of sessions are desired, the client can
+     * make additional calls to `BatchCreateSessions` (adjusting
      * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
      * as necessary).
      * 
@@ -977,10 +977,10 @@ public Builder setSessionCount(int value) { * * *
-     * Required. The number of sessions to be created in this batch call.
-     * The API can return fewer than the requested number of sessions. If a
-     * specific number of sessions are desired, the client can make additional
-     * calls to `BatchCreateSessions` (adjusting
+     * Required. The number of sessions to be created in this batch call. At least
+     * one session is created. The API can return fewer than the requested number
+     * of sessions. If a specific number of sessions are desired, the client can
+     * make additional calls to `BatchCreateSessions` (adjusting
      * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
      * as necessary).
      * 
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequestOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequestOrBuilder.java index 698601c466c..4c055ea7348 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequestOrBuilder.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/BatchCreateSessionsRequestOrBuilder.java @@ -95,10 +95,10 @@ public interface BatchCreateSessionsRequestOrBuilder * * *
-   * Required. The number of sessions to be created in this batch call.
-   * The API can return fewer than the requested number of sessions. If a
-   * specific number of sessions are desired, the client can make additional
-   * calls to `BatchCreateSessions` (adjusting
+   * Required. The number of sessions to be created in this batch call. At least
+   * one session is created. The API can return fewer than the requested number
+   * of sessions. If a specific number of sessions are desired, the client can
+   * make additional calls to `BatchCreateSessions` (adjusting
    * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
    * as necessary).
    * 
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CacheUpdate.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CacheUpdate.java new file mode 100644 index 00000000000..758dbaa5141 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CacheUpdate.java @@ -0,0 +1,1855 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +/** + * + * + *
+ * A `CacheUpdate` expresses a set of changes the client should incorporate into
+ * its location cache. These changes may or may not be newer than what the
+ * client has in its cache, and should be discarded if necessary. `CacheUpdate`s
+ * can be obtained in response to requests that included a `RoutingHint`
+ * field, but may also be obtained by explicit location-fetching RPCs which may
+ * be added in the future.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.CacheUpdate} + */ +public final class CacheUpdate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.CacheUpdate) + CacheUpdateOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CacheUpdate.newBuilder() to construct. + private CacheUpdate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CacheUpdate() { + range_ = java.util.Collections.emptyList(); + group_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CacheUpdate(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_CacheUpdate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_CacheUpdate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.CacheUpdate.class, + com.google.spanner.v1.CacheUpdate.Builder.class); + } + + private int bitField0_; + public static final int DATABASE_ID_FIELD_NUMBER = 1; + private long databaseId_ = 0L; + + /** + * + * + *
+   * An internal ID for the database. Database names can be reused if a database
+   * is deleted and re-created. Each time the database is re-created, it will
+   * get a new database ID, which will never be re-used for any other database.
+   * 
+ * + * uint64 database_id = 1; + * + * @return The databaseId. + */ + @java.lang.Override + public long getDatabaseId() { + return databaseId_; + } + + public static final int RANGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List range_; + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + @java.lang.Override + public java.util.List getRangeList() { + return range_; + } + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + @java.lang.Override + public java.util.List getRangeOrBuilderList() { + return range_; + } + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + @java.lang.Override + public int getRangeCount() { + return range_.size(); + } + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + @java.lang.Override + public com.google.spanner.v1.Range getRange(int index) { + return range_.get(index); + } + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + @java.lang.Override + public com.google.spanner.v1.RangeOrBuilder getRangeOrBuilder(int index) { + return range_.get(index); + } + + public static final int GROUP_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List group_; + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + @java.lang.Override + public java.util.List getGroupList() { + return group_; + } + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + @java.lang.Override + public java.util.List getGroupOrBuilderList() { + return group_; + } + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + @java.lang.Override + public int getGroupCount() { + return group_.size(); + } + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + @java.lang.Override + public com.google.spanner.v1.Group getGroup(int index) { + return group_.get(index); + } + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + @java.lang.Override + public com.google.spanner.v1.GroupOrBuilder getGroupOrBuilder(int index) { + return group_.get(index); + } + + public static final int KEY_RECIPES_FIELD_NUMBER = 5; + private com.google.spanner.v1.RecipeList keyRecipes_; + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + * + * @return Whether the keyRecipes field is set. + */ + @java.lang.Override + public boolean hasKeyRecipes() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + * + * @return The keyRecipes. + */ + @java.lang.Override + public com.google.spanner.v1.RecipeList getKeyRecipes() { + return keyRecipes_ == null + ? com.google.spanner.v1.RecipeList.getDefaultInstance() + : keyRecipes_; + } + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + @java.lang.Override + public com.google.spanner.v1.RecipeListOrBuilder getKeyRecipesOrBuilder() { + return keyRecipes_ == null + ? com.google.spanner.v1.RecipeList.getDefaultInstance() + : keyRecipes_; + } + + 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 (databaseId_ != 0L) { + output.writeUInt64(1, databaseId_); + } + for (int i = 0; i < range_.size(); i++) { + output.writeMessage(2, range_.get(i)); + } + for (int i = 0; i < group_.size(); i++) { + output.writeMessage(3, group_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getKeyRecipes()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (databaseId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(1, databaseId_); + } + for (int i = 0; i < range_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, range_.get(i)); + } + for (int i = 0; i < group_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, group_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getKeyRecipes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.CacheUpdate)) { + return super.equals(obj); + } + com.google.spanner.v1.CacheUpdate other = (com.google.spanner.v1.CacheUpdate) obj; + + if (getDatabaseId() != other.getDatabaseId()) return false; + if (!getRangeList().equals(other.getRangeList())) return false; + if (!getGroupList().equals(other.getGroupList())) return false; + if (hasKeyRecipes() != other.hasKeyRecipes()) return false; + if (hasKeyRecipes()) { + if (!getKeyRecipes().equals(other.getKeyRecipes())) 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) + DATABASE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDatabaseId()); + if (getRangeCount() > 0) { + hash = (37 * hash) + RANGE_FIELD_NUMBER; + hash = (53 * hash) + getRangeList().hashCode(); + } + if (getGroupCount() > 0) { + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroupList().hashCode(); + } + if (hasKeyRecipes()) { + hash = (37 * hash) + KEY_RECIPES_FIELD_NUMBER; + hash = (53 * hash) + getKeyRecipes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.CacheUpdate parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.CacheUpdate parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.CacheUpdate parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.CacheUpdate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.CacheUpdate 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; + } + + /** + * + * + *
+   * A `CacheUpdate` expresses a set of changes the client should incorporate into
+   * its location cache. These changes may or may not be newer than what the
+   * client has in its cache, and should be discarded if necessary. `CacheUpdate`s
+   * can be obtained in response to requests that included a `RoutingHint`
+   * field, but may also be obtained by explicit location-fetching RPCs which may
+   * be added in the future.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.CacheUpdate} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.CacheUpdate) + com.google.spanner.v1.CacheUpdateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_CacheUpdate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_CacheUpdate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.CacheUpdate.class, + com.google.spanner.v1.CacheUpdate.Builder.class); + } + + // Construct using com.google.spanner.v1.CacheUpdate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRangeFieldBuilder(); + getGroupFieldBuilder(); + getKeyRecipesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + databaseId_ = 0L; + if (rangeBuilder_ == null) { + range_ = java.util.Collections.emptyList(); + } else { + range_ = null; + rangeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + } else { + group_ = null; + groupBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + keyRecipes_ = null; + if (keyRecipesBuilder_ != null) { + keyRecipesBuilder_.dispose(); + keyRecipesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_CacheUpdate_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.CacheUpdate getDefaultInstanceForType() { + return com.google.spanner.v1.CacheUpdate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.CacheUpdate build() { + com.google.spanner.v1.CacheUpdate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.CacheUpdate buildPartial() { + com.google.spanner.v1.CacheUpdate result = new com.google.spanner.v1.CacheUpdate(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.spanner.v1.CacheUpdate result) { + if (rangeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + range_ = java.util.Collections.unmodifiableList(range_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.range_ = range_; + } else { + result.range_ = rangeBuilder_.build(); + } + if (groupBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + group_ = java.util.Collections.unmodifiableList(group_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.group_ = group_; + } else { + result.group_ = groupBuilder_.build(); + } + } + + private void buildPartial0(com.google.spanner.v1.CacheUpdate result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.databaseId_ = databaseId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.keyRecipes_ = keyRecipesBuilder_ == null ? keyRecipes_ : keyRecipesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.CacheUpdate) { + return mergeFrom((com.google.spanner.v1.CacheUpdate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.CacheUpdate other) { + if (other == com.google.spanner.v1.CacheUpdate.getDefaultInstance()) return this; + if (other.getDatabaseId() != 0L) { + setDatabaseId(other.getDatabaseId()); + } + if (rangeBuilder_ == null) { + if (!other.range_.isEmpty()) { + if (range_.isEmpty()) { + range_ = other.range_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRangeIsMutable(); + range_.addAll(other.range_); + } + onChanged(); + } + } else { + if (!other.range_.isEmpty()) { + if (rangeBuilder_.isEmpty()) { + rangeBuilder_.dispose(); + rangeBuilder_ = null; + range_ = other.range_; + bitField0_ = (bitField0_ & ~0x00000002); + rangeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRangeFieldBuilder() + : null; + } else { + rangeBuilder_.addAllMessages(other.range_); + } + } + } + if (groupBuilder_ == null) { + if (!other.group_.isEmpty()) { + if (group_.isEmpty()) { + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureGroupIsMutable(); + group_.addAll(other.group_); + } + onChanged(); + } + } else { + if (!other.group_.isEmpty()) { + if (groupBuilder_.isEmpty()) { + groupBuilder_.dispose(); + groupBuilder_ = null; + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000004); + groupBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupFieldBuilder() + : null; + } else { + groupBuilder_.addAllMessages(other.group_); + } + } + } + if (other.hasKeyRecipes()) { + mergeKeyRecipes(other.getKeyRecipes()); + } + 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: + { + databaseId_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.spanner.v1.Range m = + input.readMessage(com.google.spanner.v1.Range.parser(), extensionRegistry); + if (rangeBuilder_ == null) { + ensureRangeIsMutable(); + range_.add(m); + } else { + rangeBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + com.google.spanner.v1.Group m = + input.readMessage(com.google.spanner.v1.Group.parser(), extensionRegistry); + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(m); + } else { + groupBuilder_.addMessage(m); + } + break; + } // case 26 + case 42: + { + input.readMessage(getKeyRecipesFieldBuilder().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 databaseId_; + + /** + * + * + *
+     * An internal ID for the database. Database names can be reused if a database
+     * is deleted and re-created. Each time the database is re-created, it will
+     * get a new database ID, which will never be re-used for any other database.
+     * 
+ * + * uint64 database_id = 1; + * + * @return The databaseId. + */ + @java.lang.Override + public long getDatabaseId() { + return databaseId_; + } + + /** + * + * + *
+     * An internal ID for the database. Database names can be reused if a database
+     * is deleted and re-created. Each time the database is re-created, it will
+     * get a new database ID, which will never be re-used for any other database.
+     * 
+ * + * uint64 database_id = 1; + * + * @param value The databaseId to set. + * @return This builder for chaining. + */ + public Builder setDatabaseId(long value) { + + databaseId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * An internal ID for the database. Database names can be reused if a database
+     * is deleted and re-created. Each time the database is re-created, it will
+     * get a new database ID, which will never be re-used for any other database.
+     * 
+ * + * uint64 database_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseId() { + bitField0_ = (bitField0_ & ~0x00000001); + databaseId_ = 0L; + onChanged(); + return this; + } + + private java.util.List range_ = java.util.Collections.emptyList(); + + private void ensureRangeIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + range_ = new java.util.ArrayList(range_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Range, + com.google.spanner.v1.Range.Builder, + com.google.spanner.v1.RangeOrBuilder> + rangeBuilder_; + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public java.util.List getRangeList() { + if (rangeBuilder_ == null) { + return java.util.Collections.unmodifiableList(range_); + } else { + return rangeBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public int getRangeCount() { + if (rangeBuilder_ == null) { + return range_.size(); + } else { + return rangeBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public com.google.spanner.v1.Range getRange(int index) { + if (rangeBuilder_ == null) { + return range_.get(index); + } else { + return rangeBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder setRange(int index, com.google.spanner.v1.Range value) { + if (rangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRangeIsMutable(); + range_.set(index, value); + onChanged(); + } else { + rangeBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder setRange(int index, com.google.spanner.v1.Range.Builder builderForValue) { + if (rangeBuilder_ == null) { + ensureRangeIsMutable(); + range_.set(index, builderForValue.build()); + onChanged(); + } else { + rangeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder addRange(com.google.spanner.v1.Range value) { + if (rangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRangeIsMutable(); + range_.add(value); + onChanged(); + } else { + rangeBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder addRange(int index, com.google.spanner.v1.Range value) { + if (rangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRangeIsMutable(); + range_.add(index, value); + onChanged(); + } else { + rangeBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder addRange(com.google.spanner.v1.Range.Builder builderForValue) { + if (rangeBuilder_ == null) { + ensureRangeIsMutable(); + range_.add(builderForValue.build()); + onChanged(); + } else { + rangeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder addRange(int index, com.google.spanner.v1.Range.Builder builderForValue) { + if (rangeBuilder_ == null) { + ensureRangeIsMutable(); + range_.add(index, builderForValue.build()); + onChanged(); + } else { + rangeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder addAllRange(java.lang.Iterable values) { + if (rangeBuilder_ == null) { + ensureRangeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, range_); + onChanged(); + } else { + rangeBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder clearRange() { + if (rangeBuilder_ == null) { + range_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rangeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public Builder removeRange(int index) { + if (rangeBuilder_ == null) { + ensureRangeIsMutable(); + range_.remove(index); + onChanged(); + } else { + rangeBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public com.google.spanner.v1.Range.Builder getRangeBuilder(int index) { + return getRangeFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public com.google.spanner.v1.RangeOrBuilder getRangeOrBuilder(int index) { + if (rangeBuilder_ == null) { + return range_.get(index); + } else { + return rangeBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public java.util.List getRangeOrBuilderList() { + if (rangeBuilder_ != null) { + return rangeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(range_); + } + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public com.google.spanner.v1.Range.Builder addRangeBuilder() { + return getRangeFieldBuilder().addBuilder(com.google.spanner.v1.Range.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public com.google.spanner.v1.Range.Builder addRangeBuilder(int index) { + return getRangeFieldBuilder() + .addBuilder(index, com.google.spanner.v1.Range.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of ranges to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + public java.util.List getRangeBuilderList() { + return getRangeFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Range, + com.google.spanner.v1.Range.Builder, + com.google.spanner.v1.RangeOrBuilder> + getRangeFieldBuilder() { + if (rangeBuilder_ == null) { + rangeBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Range, + com.google.spanner.v1.Range.Builder, + com.google.spanner.v1.RangeOrBuilder>( + range_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + range_ = null; + } + return rangeBuilder_; + } + + private java.util.List group_ = java.util.Collections.emptyList(); + + private void ensureGroupIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + group_ = new java.util.ArrayList(group_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Group, + com.google.spanner.v1.Group.Builder, + com.google.spanner.v1.GroupOrBuilder> + groupBuilder_; + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public java.util.List getGroupList() { + if (groupBuilder_ == null) { + return java.util.Collections.unmodifiableList(group_); + } else { + return groupBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public int getGroupCount() { + if (groupBuilder_ == null) { + return group_.size(); + } else { + return groupBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public com.google.spanner.v1.Group getGroup(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder setGroup(int index, com.google.spanner.v1.Group value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.set(index, value); + onChanged(); + } else { + groupBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder setGroup(int index, com.google.spanner.v1.Group.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.set(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder addGroup(com.google.spanner.v1.Group value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(value); + onChanged(); + } else { + groupBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder addGroup(int index, com.google.spanner.v1.Group value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(index, value); + onChanged(); + } else { + groupBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder addGroup(com.google.spanner.v1.Group.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder addGroup(int index, com.google.spanner.v1.Group.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder addAllGroup(java.lang.Iterable values) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, group_); + onChanged(); + } else { + groupBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder clearGroup() { + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + groupBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public Builder removeGroup(int index) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.remove(index); + onChanged(); + } else { + groupBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public com.google.spanner.v1.Group.Builder getGroupBuilder(int index) { + return getGroupFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public com.google.spanner.v1.GroupOrBuilder getGroupOrBuilder(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public java.util.List getGroupOrBuilderList() { + if (groupBuilder_ != null) { + return groupBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(group_); + } + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public com.google.spanner.v1.Group.Builder addGroupBuilder() { + return getGroupFieldBuilder().addBuilder(com.google.spanner.v1.Group.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public com.google.spanner.v1.Group.Builder addGroupBuilder(int index) { + return getGroupFieldBuilder() + .addBuilder(index, com.google.spanner.v1.Group.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of groups to be cached.
+     * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + public java.util.List getGroupBuilderList() { + return getGroupFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Group, + com.google.spanner.v1.Group.Builder, + com.google.spanner.v1.GroupOrBuilder> + getGroupFieldBuilder() { + if (groupBuilder_ == null) { + groupBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Group, + com.google.spanner.v1.Group.Builder, + com.google.spanner.v1.GroupOrBuilder>( + group_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + group_ = null; + } + return groupBuilder_; + } + + private com.google.spanner.v1.RecipeList keyRecipes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RecipeList, + com.google.spanner.v1.RecipeList.Builder, + com.google.spanner.v1.RecipeListOrBuilder> + keyRecipesBuilder_; + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + * + * @return Whether the keyRecipes field is set. + */ + public boolean hasKeyRecipes() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + * + * @return The keyRecipes. + */ + public com.google.spanner.v1.RecipeList getKeyRecipes() { + if (keyRecipesBuilder_ == null) { + return keyRecipes_ == null + ? com.google.spanner.v1.RecipeList.getDefaultInstance() + : keyRecipes_; + } else { + return keyRecipesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + public Builder setKeyRecipes(com.google.spanner.v1.RecipeList value) { + if (keyRecipesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + keyRecipes_ = value; + } else { + keyRecipesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + public Builder setKeyRecipes(com.google.spanner.v1.RecipeList.Builder builderForValue) { + if (keyRecipesBuilder_ == null) { + keyRecipes_ = builderForValue.build(); + } else { + keyRecipesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + public Builder mergeKeyRecipes(com.google.spanner.v1.RecipeList value) { + if (keyRecipesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && keyRecipes_ != null + && keyRecipes_ != com.google.spanner.v1.RecipeList.getDefaultInstance()) { + getKeyRecipesBuilder().mergeFrom(value); + } else { + keyRecipes_ = value; + } + } else { + keyRecipesBuilder_.mergeFrom(value); + } + if (keyRecipes_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + public Builder clearKeyRecipes() { + bitField0_ = (bitField0_ & ~0x00000008); + keyRecipes_ = null; + if (keyRecipesBuilder_ != null) { + keyRecipesBuilder_.dispose(); + keyRecipesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + public com.google.spanner.v1.RecipeList.Builder getKeyRecipesBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getKeyRecipesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + public com.google.spanner.v1.RecipeListOrBuilder getKeyRecipesOrBuilder() { + if (keyRecipesBuilder_ != null) { + return keyRecipesBuilder_.getMessageOrBuilder(); + } else { + return keyRecipes_ == null + ? com.google.spanner.v1.RecipeList.getDefaultInstance() + : keyRecipes_; + } + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RecipeList, + com.google.spanner.v1.RecipeList.Builder, + com.google.spanner.v1.RecipeListOrBuilder> + getKeyRecipesFieldBuilder() { + if (keyRecipesBuilder_ == null) { + keyRecipesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RecipeList, + com.google.spanner.v1.RecipeList.Builder, + com.google.spanner.v1.RecipeListOrBuilder>( + getKeyRecipes(), getParentForChildren(), isClean()); + keyRecipes_ = null; + } + return keyRecipesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.CacheUpdate) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.CacheUpdate) + private static final com.google.spanner.v1.CacheUpdate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.CacheUpdate(); + } + + public static com.google.spanner.v1.CacheUpdate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CacheUpdate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.CacheUpdate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CacheUpdateOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CacheUpdateOrBuilder.java new file mode 100644 index 00000000000..12f48672f65 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CacheUpdateOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface CacheUpdateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.CacheUpdate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * An internal ID for the database. Database names can be reused if a database
+   * is deleted and re-created. Each time the database is re-created, it will
+   * get a new database ID, which will never be re-used for any other database.
+   * 
+ * + * uint64 database_id = 1; + * + * @return The databaseId. + */ + long getDatabaseId(); + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + java.util.List getRangeList(); + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + com.google.spanner.v1.Range getRange(int index); + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + int getRangeCount(); + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + java.util.List getRangeOrBuilderList(); + + /** + * + * + *
+   * A list of ranges to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Range range = 2; + */ + com.google.spanner.v1.RangeOrBuilder getRangeOrBuilder(int index); + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + java.util.List getGroupList(); + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + com.google.spanner.v1.Group getGroup(int index); + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + int getGroupCount(); + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + java.util.List getGroupOrBuilderList(); + + /** + * + * + *
+   * A list of groups to be cached.
+   * 
+ * + * repeated .google.spanner.v1.Group group = 3; + */ + com.google.spanner.v1.GroupOrBuilder getGroupOrBuilder(int index); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + * + * @return Whether the keyRecipes field is set. + */ + boolean hasKeyRecipes(); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + * + * @return The keyRecipes. + */ + com.google.spanner.v1.RecipeList getKeyRecipes(); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * .google.spanner.v1.RecipeList key_recipes = 5; + */ + com.google.spanner.v1.RecipeListOrBuilder getKeyRecipesOrBuilder(); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java index 8fd531908a0..404d9cea412 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java @@ -2315,6 +2315,80 @@ public boolean getLastStatement() { return lastStatement_; } + public static final int ROUTING_HINT_FIELD_NUMBER = 18; + private com.google.spanner.v1.RoutingHint routingHint_; + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingHint field is set. + */ + @java.lang.Override + public boolean hasRoutingHint() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingHint. + */ + @java.lang.Override + public com.google.spanner.v1.RoutingHint getRoutingHint() { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.v1.RoutingHintOrBuilder getRoutingHintOrBuilder() { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2370,6 +2444,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (lastStatement_ != false) { output.writeBool(17, lastStatement_); } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(18, getRoutingHint()); + } getUnknownFields().writeTo(output); } @@ -2429,6 +2506,9 @@ public int getSerializedSize() { if (lastStatement_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(17, lastStatement_); } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getRoutingHint()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2473,6 +2553,10 @@ public boolean equals(final java.lang.Object obj) { } if (getDataBoostEnabled() != other.getDataBoostEnabled()) return false; if (getLastStatement() != other.getLastStatement()) return false; + if (hasRoutingHint() != other.hasRoutingHint()) return false; + if (hasRoutingHint()) { + if (!getRoutingHint().equals(other.getRoutingHint())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2524,6 +2608,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDataBoostEnabled()); hash = (37 * hash) + LAST_STATEMENT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLastStatement()); + if (hasRoutingHint()) { + hash = (37 * hash) + ROUTING_HINT_FIELD_NUMBER; + hash = (53 * hash) + getRoutingHint().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2693,6 +2781,7 @@ private void maybeForceBuilderInitialization() { getQueryOptionsFieldBuilder(); getRequestOptionsFieldBuilder(); getDirectedReadOptionsFieldBuilder(); + getRoutingHintFieldBuilder(); } } @@ -2734,6 +2823,11 @@ public Builder clear() { } dataBoostEnabled_ = false; lastStatement_ = false; + routingHint_ = null; + if (routingHintBuilder_ != null) { + routingHintBuilder_.dispose(); + routingHintBuilder_ = null; + } return this; } @@ -2825,6 +2919,11 @@ private void buildPartial0(com.google.spanner.v1.ExecuteSqlRequest result) { if (((from_bitField0_ & 0x00002000) != 0)) { result.lastStatement_ = lastStatement_; } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.routingHint_ = + routingHintBuilder_ == null ? routingHint_ : routingHintBuilder_.build(); + to_bitField0_ |= 0x00000020; + } result.bitField0_ |= to_bitField0_; } @@ -2918,6 +3017,9 @@ public Builder mergeFrom(com.google.spanner.v1.ExecuteSqlRequest other) { if (other.getLastStatement() != false) { setLastStatement(other.getLastStatement()); } + if (other.hasRoutingHint()) { + mergeRoutingHint(other.getRoutingHint()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -3036,6 +3138,12 @@ public Builder mergeFrom( bitField0_ |= 0x00002000; break; } // case 136 + case 146: + { + input.readMessage(getRoutingHintFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 146 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -5242,6 +5350,263 @@ public Builder clearLastStatement() { return this; } + private com.google.spanner.v1.RoutingHint routingHint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RoutingHint, + com.google.spanner.v1.RoutingHint.Builder, + com.google.spanner.v1.RoutingHintOrBuilder> + routingHintBuilder_; + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingHint field is set. + */ + public boolean hasRoutingHint() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingHint. + */ + public com.google.spanner.v1.RoutingHint getRoutingHint() { + if (routingHintBuilder_ == null) { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } else { + return routingHintBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRoutingHint(com.google.spanner.v1.RoutingHint value) { + if (routingHintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingHint_ = value; + } else { + routingHintBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRoutingHint(com.google.spanner.v1.RoutingHint.Builder builderForValue) { + if (routingHintBuilder_ == null) { + routingHint_ = builderForValue.build(); + } else { + routingHintBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRoutingHint(com.google.spanner.v1.RoutingHint value) { + if (routingHintBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && routingHint_ != null + && routingHint_ != com.google.spanner.v1.RoutingHint.getDefaultInstance()) { + getRoutingHintBuilder().mergeFrom(value); + } else { + routingHint_ = value; + } + } else { + routingHintBuilder_.mergeFrom(value); + } + if (routingHint_ != null) { + bitField0_ |= 0x00004000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRoutingHint() { + bitField0_ = (bitField0_ & ~0x00004000); + routingHint_ = null; + if (routingHintBuilder_ != null) { + routingHintBuilder_.dispose(); + routingHintBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.RoutingHint.Builder getRoutingHintBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getRoutingHintFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.RoutingHintOrBuilder getRoutingHintOrBuilder() { + if (routingHintBuilder_ != null) { + return routingHintBuilder_.getMessageOrBuilder(); + } else { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RoutingHint, + com.google.spanner.v1.RoutingHint.Builder, + com.google.spanner.v1.RoutingHintOrBuilder> + getRoutingHintFieldBuilder() { + if (routingHintBuilder_ == null) { + routingHintBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RoutingHint, + com.google.spanner.v1.RoutingHint.Builder, + com.google.spanner.v1.RoutingHintOrBuilder>( + getRoutingHint(), getParentForChildren(), isClean()); + routingHint_ = null; + } + return routingHintBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java index c3f479e50fe..da9c99ba607 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java @@ -560,4 +560,62 @@ com.google.spanner.v1.Type getParamTypesOrDefault( * @return The lastStatement. */ boolean getLastStatement(); + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingHint field is set. + */ + boolean hasRoutingHint(); + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingHint. + */ + com.google.spanner.v1.RoutingHint getRoutingHint(); + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.v1.RoutingHintOrBuilder getRoutingHintOrBuilder(); } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Group.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Group.java new file mode 100644 index 00000000000..e3cd6fcaea6 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Group.java @@ -0,0 +1,1358 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +/** + * + * + *
+ * A `Group` represents a paxos group in a database. A group is a set of
+ * tablets that are replicated across multiple servers. Groups may have a leader
+ * tablet. Groups store one (or sometimes more) ranges of keys.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.Group} + */ +public final class Group extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.Group) + GroupOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Group.newBuilder() to construct. + private Group(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Group() { + tablets_ = java.util.Collections.emptyList(); + generation_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Group(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto.internal_static_google_spanner_v1_Group_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Group_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Group.class, com.google.spanner.v1.Group.Builder.class); + } + + public static final int GROUP_UID_FIELD_NUMBER = 1; + private long groupUid_ = 0L; + + /** + * + * + *
+   * The UID of the paxos group, unique within the database. Matches the
+   * `group_uid` field in `Range`.
+   * 
+ * + * uint64 group_uid = 1; + * + * @return The groupUid. + */ + @java.lang.Override + public long getGroupUid() { + return groupUid_; + } + + public static final int TABLETS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List tablets_; + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + @java.lang.Override + public java.util.List getTabletsList() { + return tablets_; + } + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + @java.lang.Override + public java.util.List getTabletsOrBuilderList() { + return tablets_; + } + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + @java.lang.Override + public int getTabletsCount() { + return tablets_.size(); + } + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + @java.lang.Override + public com.google.spanner.v1.Tablet getTablets(int index) { + return tablets_.get(index); + } + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + @java.lang.Override + public com.google.spanner.v1.TabletOrBuilder getTabletsOrBuilder(int index) { + return tablets_.get(index); + } + + public static final int LEADER_INDEX_FIELD_NUMBER = 3; + private int leaderIndex_ = 0; + + /** + * + * + *
+   * The last known leader tablet of the group as an index into `tablets`. May
+   * be negative if the group has no known leader.
+   * 
+ * + * int32 leader_index = 3; + * + * @return The leaderIndex. + */ + @java.lang.Override + public int getLeaderIndex() { + return leaderIndex_; + } + + public static final int GENERATION_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString generation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * `generation` indicates the freshness of the group information (including
+   * leader information) contained in this proto. Generations can be compared
+   * lexicographically; if generation A is greater than generation B, then the
+   * `Group` corresponding to A is newer than the `Group` corresponding to B,
+   * and should be used preferentially.
+   * 
+ * + * bytes generation = 4; + * + * @return The generation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGeneration() { + return generation_; + } + + 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 (groupUid_ != 0L) { + output.writeUInt64(1, groupUid_); + } + for (int i = 0; i < tablets_.size(); i++) { + output.writeMessage(2, tablets_.get(i)); + } + if (leaderIndex_ != 0) { + output.writeInt32(3, leaderIndex_); + } + if (!generation_.isEmpty()) { + output.writeBytes(4, generation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (groupUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(1, groupUid_); + } + for (int i = 0; i < tablets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, tablets_.get(i)); + } + if (leaderIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, leaderIndex_); + } + if (!generation_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, generation_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.Group)) { + return super.equals(obj); + } + com.google.spanner.v1.Group other = (com.google.spanner.v1.Group) obj; + + if (getGroupUid() != other.getGroupUid()) return false; + if (!getTabletsList().equals(other.getTabletsList())) return false; + if (getLeaderIndex() != other.getLeaderIndex()) return false; + if (!getGeneration().equals(other.getGeneration())) 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) + GROUP_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGroupUid()); + if (getTabletsCount() > 0) { + hash = (37 * hash) + TABLETS_FIELD_NUMBER; + hash = (53 * hash) + getTabletsList().hashCode(); + } + hash = (37 * hash) + LEADER_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getLeaderIndex(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + getGeneration().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.Group parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Group parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Group parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Group parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Group parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Group parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Group parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Group parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Group parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Group parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Group parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Group parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.Group 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; + } + + /** + * + * + *
+   * A `Group` represents a paxos group in a database. A group is a set of
+   * tablets that are replicated across multiple servers. Groups may have a leader
+   * tablet. Groups store one (or sometimes more) ranges of keys.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.Group} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.Group) + com.google.spanner.v1.GroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto.internal_static_google_spanner_v1_Group_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Group_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Group.class, com.google.spanner.v1.Group.Builder.class); + } + + // Construct using com.google.spanner.v1.Group.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + groupUid_ = 0L; + if (tabletsBuilder_ == null) { + tablets_ = java.util.Collections.emptyList(); + } else { + tablets_ = null; + tabletsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + leaderIndex_ = 0; + generation_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto.internal_static_google_spanner_v1_Group_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.Group getDefaultInstanceForType() { + return com.google.spanner.v1.Group.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.Group build() { + com.google.spanner.v1.Group result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.Group buildPartial() { + com.google.spanner.v1.Group result = new com.google.spanner.v1.Group(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.spanner.v1.Group result) { + if (tabletsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + tablets_ = java.util.Collections.unmodifiableList(tablets_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.tablets_ = tablets_; + } else { + result.tablets_ = tabletsBuilder_.build(); + } + } + + private void buildPartial0(com.google.spanner.v1.Group result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.groupUid_ = groupUid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.leaderIndex_ = leaderIndex_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.generation_ = generation_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.Group) { + return mergeFrom((com.google.spanner.v1.Group) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.Group other) { + if (other == com.google.spanner.v1.Group.getDefaultInstance()) return this; + if (other.getGroupUid() != 0L) { + setGroupUid(other.getGroupUid()); + } + if (tabletsBuilder_ == null) { + if (!other.tablets_.isEmpty()) { + if (tablets_.isEmpty()) { + tablets_ = other.tablets_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTabletsIsMutable(); + tablets_.addAll(other.tablets_); + } + onChanged(); + } + } else { + if (!other.tablets_.isEmpty()) { + if (tabletsBuilder_.isEmpty()) { + tabletsBuilder_.dispose(); + tabletsBuilder_ = null; + tablets_ = other.tablets_; + bitField0_ = (bitField0_ & ~0x00000002); + tabletsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTabletsFieldBuilder() + : null; + } else { + tabletsBuilder_.addAllMessages(other.tablets_); + } + } + } + if (other.getLeaderIndex() != 0) { + setLeaderIndex(other.getLeaderIndex()); + } + if (other.getGeneration() != com.google.protobuf.ByteString.EMPTY) { + setGeneration(other.getGeneration()); + } + 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: + { + groupUid_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.spanner.v1.Tablet m = + input.readMessage(com.google.spanner.v1.Tablet.parser(), extensionRegistry); + if (tabletsBuilder_ == null) { + ensureTabletsIsMutable(); + tablets_.add(m); + } else { + tabletsBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + leaderIndex_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + generation_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long groupUid_; + + /** + * + * + *
+     * The UID of the paxos group, unique within the database. Matches the
+     * `group_uid` field in `Range`.
+     * 
+ * + * uint64 group_uid = 1; + * + * @return The groupUid. + */ + @java.lang.Override + public long getGroupUid() { + return groupUid_; + } + + /** + * + * + *
+     * The UID of the paxos group, unique within the database. Matches the
+     * `group_uid` field in `Range`.
+     * 
+ * + * uint64 group_uid = 1; + * + * @param value The groupUid to set. + * @return This builder for chaining. + */ + public Builder setGroupUid(long value) { + + groupUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The UID of the paxos group, unique within the database. Matches the
+     * `group_uid` field in `Range`.
+     * 
+ * + * uint64 group_uid = 1; + * + * @return This builder for chaining. + */ + public Builder clearGroupUid() { + bitField0_ = (bitField0_ & ~0x00000001); + groupUid_ = 0L; + onChanged(); + return this; + } + + private java.util.List tablets_ = + java.util.Collections.emptyList(); + + private void ensureTabletsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + tablets_ = new java.util.ArrayList(tablets_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Tablet, + com.google.spanner.v1.Tablet.Builder, + com.google.spanner.v1.TabletOrBuilder> + tabletsBuilder_; + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public java.util.List getTabletsList() { + if (tabletsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tablets_); + } else { + return tabletsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public int getTabletsCount() { + if (tabletsBuilder_ == null) { + return tablets_.size(); + } else { + return tabletsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public com.google.spanner.v1.Tablet getTablets(int index) { + if (tabletsBuilder_ == null) { + return tablets_.get(index); + } else { + return tabletsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder setTablets(int index, com.google.spanner.v1.Tablet value) { + if (tabletsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTabletsIsMutable(); + tablets_.set(index, value); + onChanged(); + } else { + tabletsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder setTablets(int index, com.google.spanner.v1.Tablet.Builder builderForValue) { + if (tabletsBuilder_ == null) { + ensureTabletsIsMutable(); + tablets_.set(index, builderForValue.build()); + onChanged(); + } else { + tabletsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder addTablets(com.google.spanner.v1.Tablet value) { + if (tabletsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTabletsIsMutable(); + tablets_.add(value); + onChanged(); + } else { + tabletsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder addTablets(int index, com.google.spanner.v1.Tablet value) { + if (tabletsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTabletsIsMutable(); + tablets_.add(index, value); + onChanged(); + } else { + tabletsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder addTablets(com.google.spanner.v1.Tablet.Builder builderForValue) { + if (tabletsBuilder_ == null) { + ensureTabletsIsMutable(); + tablets_.add(builderForValue.build()); + onChanged(); + } else { + tabletsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder addTablets(int index, com.google.spanner.v1.Tablet.Builder builderForValue) { + if (tabletsBuilder_ == null) { + ensureTabletsIsMutable(); + tablets_.add(index, builderForValue.build()); + onChanged(); + } else { + tabletsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder addAllTablets( + java.lang.Iterable values) { + if (tabletsBuilder_ == null) { + ensureTabletsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tablets_); + onChanged(); + } else { + tabletsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder clearTablets() { + if (tabletsBuilder_ == null) { + tablets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + tabletsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public Builder removeTablets(int index) { + if (tabletsBuilder_ == null) { + ensureTabletsIsMutable(); + tablets_.remove(index); + onChanged(); + } else { + tabletsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public com.google.spanner.v1.Tablet.Builder getTabletsBuilder(int index) { + return getTabletsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public com.google.spanner.v1.TabletOrBuilder getTabletsOrBuilder(int index) { + if (tabletsBuilder_ == null) { + return tablets_.get(index); + } else { + return tabletsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public java.util.List + getTabletsOrBuilderList() { + if (tabletsBuilder_ != null) { + return tabletsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tablets_); + } + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public com.google.spanner.v1.Tablet.Builder addTabletsBuilder() { + return getTabletsFieldBuilder().addBuilder(com.google.spanner.v1.Tablet.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public com.google.spanner.v1.Tablet.Builder addTabletsBuilder(int index) { + return getTabletsFieldBuilder() + .addBuilder(index, com.google.spanner.v1.Tablet.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of tablets that are part of the group. Note that this list may not
+     * be exhaustive; it will only include tablets the server considers useful
+     * to the client. The returned list is ordered ascending by distance.
+     *
+     * Tablet UIDs reference `Tablet.tablet_uid`.
+     * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + public java.util.List getTabletsBuilderList() { + return getTabletsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Tablet, + com.google.spanner.v1.Tablet.Builder, + com.google.spanner.v1.TabletOrBuilder> + getTabletsFieldBuilder() { + if (tabletsBuilder_ == null) { + tabletsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.Tablet, + com.google.spanner.v1.Tablet.Builder, + com.google.spanner.v1.TabletOrBuilder>( + tablets_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + tablets_ = null; + } + return tabletsBuilder_; + } + + private int leaderIndex_; + + /** + * + * + *
+     * The last known leader tablet of the group as an index into `tablets`. May
+     * be negative if the group has no known leader.
+     * 
+ * + * int32 leader_index = 3; + * + * @return The leaderIndex. + */ + @java.lang.Override + public int getLeaderIndex() { + return leaderIndex_; + } + + /** + * + * + *
+     * The last known leader tablet of the group as an index into `tablets`. May
+     * be negative if the group has no known leader.
+     * 
+ * + * int32 leader_index = 3; + * + * @param value The leaderIndex to set. + * @return This builder for chaining. + */ + public Builder setLeaderIndex(int value) { + + leaderIndex_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The last known leader tablet of the group as an index into `tablets`. May
+     * be negative if the group has no known leader.
+     * 
+ * + * int32 leader_index = 3; + * + * @return This builder for chaining. + */ + public Builder clearLeaderIndex() { + bitField0_ = (bitField0_ & ~0x00000004); + leaderIndex_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString generation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * `generation` indicates the freshness of the group information (including
+     * leader information) contained in this proto. Generations can be compared
+     * lexicographically; if generation A is greater than generation B, then the
+     * `Group` corresponding to A is newer than the `Group` corresponding to B,
+     * and should be used preferentially.
+     * 
+ * + * bytes generation = 4; + * + * @return The generation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGeneration() { + return generation_; + } + + /** + * + * + *
+     * `generation` indicates the freshness of the group information (including
+     * leader information) contained in this proto. Generations can be compared
+     * lexicographically; if generation A is greater than generation B, then the
+     * `Group` corresponding to A is newer than the `Group` corresponding to B,
+     * and should be used preferentially.
+     * 
+ * + * bytes generation = 4; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + generation_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * `generation` indicates the freshness of the group information (including
+     * leader information) contained in this proto. Generations can be compared
+     * lexicographically; if generation A is greater than generation B, then the
+     * `Group` corresponding to A is newer than the `Group` corresponding to B,
+     * and should be used preferentially.
+     * 
+ * + * bytes generation = 4; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + bitField0_ = (bitField0_ & ~0x00000008); + generation_ = getDefaultInstance().getGeneration(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.Group) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.Group) + private static final com.google.spanner.v1.Group DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.Group(); + } + + public static com.google.spanner.v1.Group getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Group parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.Group getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/GroupOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/GroupOrBuilder.java new file mode 100644 index 00000000000..b7c764e353d --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/GroupOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface GroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.Group) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The UID of the paxos group, unique within the database. Matches the
+   * `group_uid` field in `Range`.
+   * 
+ * + * uint64 group_uid = 1; + * + * @return The groupUid. + */ + long getGroupUid(); + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + java.util.List getTabletsList(); + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + com.google.spanner.v1.Tablet getTablets(int index); + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + int getTabletsCount(); + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + java.util.List getTabletsOrBuilderList(); + + /** + * + * + *
+   * A list of tablets that are part of the group. Note that this list may not
+   * be exhaustive; it will only include tablets the server considers useful
+   * to the client. The returned list is ordered ascending by distance.
+   *
+   * Tablet UIDs reference `Tablet.tablet_uid`.
+   * 
+ * + * repeated .google.spanner.v1.Tablet tablets = 2; + */ + com.google.spanner.v1.TabletOrBuilder getTabletsOrBuilder(int index); + + /** + * + * + *
+   * The last known leader tablet of the group as an index into `tablets`. May
+   * be negative if the group has no known leader.
+   * 
+ * + * int32 leader_index = 3; + * + * @return The leaderIndex. + */ + int getLeaderIndex(); + + /** + * + * + *
+   * `generation` indicates the freshness of the group information (including
+   * leader information) contained in this proto. Generations can be compared
+   * lexicographically; if generation A is greater than generation B, then the
+   * `Group` corresponding to A is newer than the `Group` corresponding to B,
+   * and should be used preferentially.
+   * 
+ * + * bytes generation = 4; + * + * @return The generation. + */ + com.google.protobuf.ByteString getGeneration(); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/KeyRecipe.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/KeyRecipe.java new file mode 100644 index 00000000000..9cce5cecc32 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/KeyRecipe.java @@ -0,0 +1,4463 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +/** + * + * + *
+ * A `KeyRecipe` provides the metadata required to translate reads, mutations,
+ * and queries into a byte array in "sortable string format" (ssformat)that can
+ * be used with `Range`s to route requests. Note that the client *must* tolerate
+ * `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may
+ * change over time. Requests with invalid `KeyRecipe`s should be routed to a
+ * default server.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.KeyRecipe} + */ +public final class KeyRecipe extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.KeyRecipe) + KeyRecipeOrBuilder { + private static final long serialVersionUID = 0L; + + // Use KeyRecipe.newBuilder() to construct. + private KeyRecipe(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private KeyRecipe() { + part_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new KeyRecipe(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.KeyRecipe.class, com.google.spanner.v1.KeyRecipe.Builder.class); + } + + public interface PartOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.KeyRecipe.Part) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If non-zero, `tag` is the only field present in this `Part`. The part
+     * is encoded by appending `tag` to the ssformat key.
+     * 
+ * + * uint32 tag = 1; + * + * @return The tag. + */ + int getTag(); + + /** + * + * + *
+     * Whether the key column is sorted ascending or descending. Only present
+     * if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @return The enum numeric value on the wire for order. + */ + int getOrderValue(); + + /** + * + * + *
+     * Whether the key column is sorted ascending or descending. Only present
+     * if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @return The order. + */ + com.google.spanner.v1.KeyRecipe.Part.Order getOrder(); + + /** + * + * + *
+     * How NULLs are represented in the encoded key part. Only present if `tag`
+     * is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @return The enum numeric value on the wire for nullOrder. + */ + int getNullOrderValue(); + + /** + * + * + *
+     * How NULLs are represented in the encoded key part. Only present if `tag`
+     * is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @return The nullOrder. + */ + com.google.spanner.v1.KeyRecipe.Part.NullOrder getNullOrder(); + + /** + * + * + *
+     * The type of the key part. Only present if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.Type type = 4; + * + * @return Whether the type field is set. + */ + boolean hasType(); + + /** + * + * + *
+     * The type of the key part. Only present if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.Type type = 4; + * + * @return The type. + */ + com.google.spanner.v1.Type getType(); + + /** + * + * + *
+     * The type of the key part. Only present if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.Type type = 4; + */ + com.google.spanner.v1.TypeOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+     * `identifier` is the name of the column or query parameter.
+     * 
+ * + * string identifier = 5; + * + * @return Whether the identifier field is set. + */ + boolean hasIdentifier(); + + /** + * + * + *
+     * `identifier` is the name of the column or query parameter.
+     * 
+ * + * string identifier = 5; + * + * @return The identifier. + */ + java.lang.String getIdentifier(); + + /** + * + * + *
+     * `identifier` is the name of the column or query parameter.
+     * 
+ * + * string identifier = 5; + * + * @return The bytes for identifier. + */ + com.google.protobuf.ByteString getIdentifierBytes(); + + /** + * + * + *
+     * The constant value of the key part.
+     * It is present when query uses a constant as a part of the key.
+     * 
+ * + * .google.protobuf.Value value = 6; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + + /** + * + * + *
+     * The constant value of the key part.
+     * It is present when query uses a constant as a part of the key.
+     * 
+ * + * .google.protobuf.Value value = 6; + * + * @return The value. + */ + com.google.protobuf.Value getValue(); + + /** + * + * + *
+     * The constant value of the key part.
+     * It is present when query uses a constant as a part of the key.
+     * 
+ * + * .google.protobuf.Value value = 6; + */ + com.google.protobuf.ValueOrBuilder getValueOrBuilder(); + + /** + * + * + *
+     * If true, the client is responsible to fill in the value randomly.
+     * It's relevant only for the INT64 type.
+     * 
+ * + * bool random = 8; + * + * @return Whether the random field is set. + */ + boolean hasRandom(); + + /** + * + * + *
+     * If true, the client is responsible to fill in the value randomly.
+     * It's relevant only for the INT64 type.
+     * 
+ * + * bool random = 8; + * + * @return The random. + */ + boolean getRandom(); + + /** + * + * + *
+     * It is a repeated field to support fetching key columns from nested
+     * structs, such as `STRUCT` query parameters.
+     * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @return A list containing the structIdentifiers. + */ + java.util.List getStructIdentifiersList(); + + /** + * + * + *
+     * It is a repeated field to support fetching key columns from nested
+     * structs, such as `STRUCT` query parameters.
+     * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @return The count of structIdentifiers. + */ + int getStructIdentifiersCount(); + + /** + * + * + *
+     * It is a repeated field to support fetching key columns from nested
+     * structs, such as `STRUCT` query parameters.
+     * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @param index The index of the element to return. + * @return The structIdentifiers at the given index. + */ + int getStructIdentifiers(int index); + + com.google.spanner.v1.KeyRecipe.Part.ValueTypeCase getValueTypeCase(); + } + + /** + * + * + *
+   * An ssformat key is composed of a sequence of tag numbers and key column
+   * values. `Part` represents a single tag or key column value.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.KeyRecipe.Part} + */ + public static final class Part extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.KeyRecipe.Part) + PartOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Part.newBuilder() to construct. + private Part(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Part() { + order_ = 0; + nullOrder_ = 0; + structIdentifiers_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Part(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.KeyRecipe.Part.class, + com.google.spanner.v1.KeyRecipe.Part.Builder.class); + } + + /** + * + * + *
+     * The remaining fields encode column values.
+     * 
+ * + * Protobuf enum {@code google.spanner.v1.KeyRecipe.Part.Order} + */ + public enum Order implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value, equivalent to `ASCENDING`.
+       * 
+ * + * ORDER_UNSPECIFIED = 0; + */ + ORDER_UNSPECIFIED(0), + /** + * + * + *
+       * The key is ascending - corresponds to `ASC` in the schema definition.
+       * 
+ * + * ASCENDING = 1; + */ + ASCENDING(1), + /** + * + * + *
+       * The key is descending - corresponds to `DESC` in the schema definition.
+       * 
+ * + * DESCENDING = 2; + */ + DESCENDING(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value, equivalent to `ASCENDING`.
+       * 
+ * + * ORDER_UNSPECIFIED = 0; + */ + public static final int ORDER_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * The key is ascending - corresponds to `ASC` in the schema definition.
+       * 
+ * + * ASCENDING = 1; + */ + public static final int ASCENDING_VALUE = 1; + + /** + * + * + *
+       * The key is descending - corresponds to `DESC` in the schema definition.
+       * 
+ * + * DESCENDING = 2; + */ + public static final int DESCENDING_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Order valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Order forNumber(int value) { + switch (value) { + case 0: + return ORDER_UNSPECIFIED; + case 1: + return ASCENDING; + case 2: + return DESCENDING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Order findValueByNumber(int number) { + return Order.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.v1.KeyRecipe.Part.getDescriptor().getEnumTypes().get(0); + } + + private static final Order[] VALUES = values(); + + public static Order valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Order(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.v1.KeyRecipe.Part.Order) + } + + /** + * + * + *
+     * The null order of the key column. This dictates where NULL values sort
+     * in the sorted order. Note that columns which are `NOT NULL` can have a
+     * special encoding.
+     * 
+ * + * Protobuf enum {@code google.spanner.v1.KeyRecipe.Part.NullOrder} + */ + public enum NullOrder implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value. This value is unused.
+       * 
+ * + * NULL_ORDER_UNSPECIFIED = 0; + */ + NULL_ORDER_UNSPECIFIED(0), + /** + * + * + *
+       * NULL values sort before any non-NULL values.
+       * 
+ * + * NULLS_FIRST = 1; + */ + NULLS_FIRST(1), + /** + * + * + *
+       * NULL values sort after any non-NULL values.
+       * 
+ * + * NULLS_LAST = 2; + */ + NULLS_LAST(2), + /** + * + * + *
+       * The column does not support NULL values.
+       * 
+ * + * NOT_NULL = 3; + */ + NOT_NULL(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. This value is unused.
+       * 
+ * + * NULL_ORDER_UNSPECIFIED = 0; + */ + public static final int NULL_ORDER_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * NULL values sort before any non-NULL values.
+       * 
+ * + * NULLS_FIRST = 1; + */ + public static final int NULLS_FIRST_VALUE = 1; + + /** + * + * + *
+       * NULL values sort after any non-NULL values.
+       * 
+ * + * NULLS_LAST = 2; + */ + public static final int NULLS_LAST_VALUE = 2; + + /** + * + * + *
+       * The column does not support NULL values.
+       * 
+ * + * NOT_NULL = 3; + */ + public static final int NOT_NULL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NullOrder valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static NullOrder forNumber(int value) { + switch (value) { + case 0: + return NULL_ORDER_UNSPECIFIED; + case 1: + return NULLS_FIRST; + case 2: + return NULLS_LAST; + case 3: + return NOT_NULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NullOrder findValueByNumber(int number) { + return NullOrder.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.v1.KeyRecipe.Part.getDescriptor().getEnumTypes().get(1); + } + + private static final NullOrder[] VALUES = values(); + + public static NullOrder valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private NullOrder(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.v1.KeyRecipe.Part.NullOrder) + } + + private int bitField0_; + private int valueTypeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object valueType_; + + public enum ValueTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + IDENTIFIER(5), + VALUE(6), + RANDOM(8), + VALUETYPE_NOT_SET(0); + private final int value; + + private ValueTypeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ValueTypeCase forNumber(int value) { + switch (value) { + case 5: + return IDENTIFIER; + case 6: + return VALUE; + case 8: + return RANDOM; + case 0: + return VALUETYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueTypeCase getValueTypeCase() { + return ValueTypeCase.forNumber(valueTypeCase_); + } + + public static final int TAG_FIELD_NUMBER = 1; + private int tag_ = 0; + + /** + * + * + *
+     * If non-zero, `tag` is the only field present in this `Part`. The part
+     * is encoded by appending `tag` to the ssformat key.
+     * 
+ * + * uint32 tag = 1; + * + * @return The tag. + */ + @java.lang.Override + public int getTag() { + return tag_; + } + + public static final int ORDER_FIELD_NUMBER = 2; + private int order_ = 0; + + /** + * + * + *
+     * Whether the key column is sorted ascending or descending. Only present
+     * if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @return The enum numeric value on the wire for order. + */ + @java.lang.Override + public int getOrderValue() { + return order_; + } + + /** + * + * + *
+     * Whether the key column is sorted ascending or descending. Only present
+     * if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @return The order. + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part.Order getOrder() { + com.google.spanner.v1.KeyRecipe.Part.Order result = + com.google.spanner.v1.KeyRecipe.Part.Order.forNumber(order_); + return result == null ? com.google.spanner.v1.KeyRecipe.Part.Order.UNRECOGNIZED : result; + } + + public static final int NULL_ORDER_FIELD_NUMBER = 3; + private int nullOrder_ = 0; + + /** + * + * + *
+     * How NULLs are represented in the encoded key part. Only present if `tag`
+     * is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @return The enum numeric value on the wire for nullOrder. + */ + @java.lang.Override + public int getNullOrderValue() { + return nullOrder_; + } + + /** + * + * + *
+     * How NULLs are represented in the encoded key part. Only present if `tag`
+     * is zero.
+     * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @return The nullOrder. + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part.NullOrder getNullOrder() { + com.google.spanner.v1.KeyRecipe.Part.NullOrder result = + com.google.spanner.v1.KeyRecipe.Part.NullOrder.forNumber(nullOrder_); + return result == null ? com.google.spanner.v1.KeyRecipe.Part.NullOrder.UNRECOGNIZED : result; + } + + public static final int TYPE_FIELD_NUMBER = 4; + private com.google.spanner.v1.Type type_; + + /** + * + * + *
+     * The type of the key part. Only present if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.Type type = 4; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The type of the key part. Only present if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.Type type = 4; + * + * @return The type. + */ + @java.lang.Override + public com.google.spanner.v1.Type getType() { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } + + /** + * + * + *
+     * The type of the key part. Only present if `tag` is zero.
+     * 
+ * + * .google.spanner.v1.Type type = 4; + */ + @java.lang.Override + public com.google.spanner.v1.TypeOrBuilder getTypeOrBuilder() { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } + + public static final int IDENTIFIER_FIELD_NUMBER = 5; + + /** + * + * + *
+     * `identifier` is the name of the column or query parameter.
+     * 
+ * + * string identifier = 5; + * + * @return Whether the identifier field is set. + */ + public boolean hasIdentifier() { + return valueTypeCase_ == 5; + } + + /** + * + * + *
+     * `identifier` is the name of the column or query parameter.
+     * 
+ * + * string identifier = 5; + * + * @return The identifier. + */ + public java.lang.String getIdentifier() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueTypeCase_ == 5) { + valueType_ = s; + } + return s; + } + } + + /** + * + * + *
+     * `identifier` is the name of the column or query parameter.
+     * 
+ * + * string identifier = 5; + * + * @return The bytes for identifier. + */ + public com.google.protobuf.ByteString getIdentifierBytes() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueTypeCase_ == 5) { + valueType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 6; + + /** + * + * + *
+     * The constant value of the key part.
+     * It is present when query uses a constant as a part of the key.
+     * 
+ * + * .google.protobuf.Value value = 6; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return valueTypeCase_ == 6; + } + + /** + * + * + *
+     * The constant value of the key part.
+     * It is present when query uses a constant as a part of the key.
+     * 
+ * + * .google.protobuf.Value value = 6; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.Value getValue() { + if (valueTypeCase_ == 6) { + return (com.google.protobuf.Value) valueType_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + + /** + * + * + *
+     * The constant value of the key part.
+     * It is present when query uses a constant as a part of the key.
+     * 
+ * + * .google.protobuf.Value value = 6; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + if (valueTypeCase_ == 6) { + return (com.google.protobuf.Value) valueType_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + + public static final int RANDOM_FIELD_NUMBER = 8; + + /** + * + * + *
+     * If true, the client is responsible to fill in the value randomly.
+     * It's relevant only for the INT64 type.
+     * 
+ * + * bool random = 8; + * + * @return Whether the random field is set. + */ + @java.lang.Override + public boolean hasRandom() { + return valueTypeCase_ == 8; + } + + /** + * + * + *
+     * If true, the client is responsible to fill in the value randomly.
+     * It's relevant only for the INT64 type.
+     * 
+ * + * bool random = 8; + * + * @return The random. + */ + @java.lang.Override + public boolean getRandom() { + if (valueTypeCase_ == 8) { + return (java.lang.Boolean) valueType_; + } + return false; + } + + public static final int STRUCT_IDENTIFIERS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList structIdentifiers_ = emptyIntList(); + + /** + * + * + *
+     * It is a repeated field to support fetching key columns from nested
+     * structs, such as `STRUCT` query parameters.
+     * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @return A list containing the structIdentifiers. + */ + @java.lang.Override + public java.util.List getStructIdentifiersList() { + return structIdentifiers_; + } + + /** + * + * + *
+     * It is a repeated field to support fetching key columns from nested
+     * structs, such as `STRUCT` query parameters.
+     * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @return The count of structIdentifiers. + */ + public int getStructIdentifiersCount() { + return structIdentifiers_.size(); + } + + /** + * + * + *
+     * It is a repeated field to support fetching key columns from nested
+     * structs, such as `STRUCT` query parameters.
+     * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @param index The index of the element to return. + * @return The structIdentifiers at the given index. + */ + public int getStructIdentifiers(int index) { + return structIdentifiers_.getInt(index); + } + + private int structIdentifiersMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (tag_ != 0) { + output.writeUInt32(1, tag_); + } + if (order_ != com.google.spanner.v1.KeyRecipe.Part.Order.ORDER_UNSPECIFIED.getNumber()) { + output.writeEnum(2, order_); + } + if (nullOrder_ + != com.google.spanner.v1.KeyRecipe.Part.NullOrder.NULL_ORDER_UNSPECIFIED.getNumber()) { + output.writeEnum(3, nullOrder_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getType()); + } + if (valueTypeCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, valueType_); + } + if (valueTypeCase_ == 6) { + output.writeMessage(6, (com.google.protobuf.Value) valueType_); + } + if (getStructIdentifiersList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(structIdentifiersMemoizedSerializedSize); + } + for (int i = 0; i < structIdentifiers_.size(); i++) { + output.writeInt32NoTag(structIdentifiers_.getInt(i)); + } + if (valueTypeCase_ == 8) { + output.writeBool(8, (boolean) ((java.lang.Boolean) valueType_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tag_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(1, tag_); + } + if (order_ != com.google.spanner.v1.KeyRecipe.Part.Order.ORDER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, order_); + } + if (nullOrder_ + != com.google.spanner.v1.KeyRecipe.Part.NullOrder.NULL_ORDER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, nullOrder_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getType()); + } + if (valueTypeCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, valueType_); + } + if (valueTypeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.protobuf.Value) valueType_); + } + { + int dataSize = 0; + for (int i = 0; i < structIdentifiers_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag( + structIdentifiers_.getInt(i)); + } + size += dataSize; + if (!getStructIdentifiersList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + structIdentifiersMemoizedSerializedSize = dataSize; + } + if (valueTypeCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 8, (boolean) ((java.lang.Boolean) valueType_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.KeyRecipe.Part)) { + return super.equals(obj); + } + com.google.spanner.v1.KeyRecipe.Part other = (com.google.spanner.v1.KeyRecipe.Part) obj; + + if (getTag() != other.getTag()) return false; + if (order_ != other.order_) return false; + if (nullOrder_ != other.nullOrder_) return false; + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (!getStructIdentifiersList().equals(other.getStructIdentifiersList())) return false; + if (!getValueTypeCase().equals(other.getValueTypeCase())) return false; + switch (valueTypeCase_) { + case 5: + if (!getIdentifier().equals(other.getIdentifier())) return false; + break; + case 6: + if (!getValue().equals(other.getValue())) return false; + break; + case 8: + if (getRandom() != other.getRandom()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TAG_FIELD_NUMBER; + hash = (53 * hash) + getTag(); + hash = (37 * hash) + ORDER_FIELD_NUMBER; + hash = (53 * hash) + order_; + hash = (37 * hash) + NULL_ORDER_FIELD_NUMBER; + hash = (53 * hash) + nullOrder_; + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + if (getStructIdentifiersCount() > 0) { + hash = (37 * hash) + STRUCT_IDENTIFIERS_FIELD_NUMBER; + hash = (53 * hash) + getStructIdentifiersList().hashCode(); + } + switch (valueTypeCase_) { + case 5: + hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; + hash = (53 * hash) + getIdentifier().hashCode(); + break; + case 6: + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + break; + case 8: + hash = (37 * hash) + RANDOM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRandom()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.KeyRecipe.Part parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.KeyRecipe.Part 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; + } + + /** + * + * + *
+     * An ssformat key is composed of a sequence of tag numbers and key column
+     * values. `Part` represents a single tag or key column value.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.KeyRecipe.Part} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.KeyRecipe.Part) + com.google.spanner.v1.KeyRecipe.PartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.KeyRecipe.Part.class, + com.google.spanner.v1.KeyRecipe.Part.Builder.class); + } + + // Construct using com.google.spanner.v1.KeyRecipe.Part.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTypeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tag_ = 0; + order_ = 0; + nullOrder_ = 0; + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + if (valueBuilder_ != null) { + valueBuilder_.clear(); + } + structIdentifiers_ = emptyIntList(); + valueTypeCase_ = 0; + valueType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_Part_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part getDefaultInstanceForType() { + return com.google.spanner.v1.KeyRecipe.Part.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part build() { + com.google.spanner.v1.KeyRecipe.Part result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part buildPartial() { + com.google.spanner.v1.KeyRecipe.Part result = + new com.google.spanner.v1.KeyRecipe.Part(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.KeyRecipe.Part result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tag_ = tag_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.order_ = order_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nullOrder_ = nullOrder_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = typeBuilder_ == null ? type_ : typeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + structIdentifiers_.makeImmutable(); + result.structIdentifiers_ = structIdentifiers_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.spanner.v1.KeyRecipe.Part result) { + result.valueTypeCase_ = valueTypeCase_; + result.valueType_ = this.valueType_; + if (valueTypeCase_ == 6 && valueBuilder_ != null) { + result.valueType_ = valueBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.KeyRecipe.Part) { + return mergeFrom((com.google.spanner.v1.KeyRecipe.Part) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.KeyRecipe.Part other) { + if (other == com.google.spanner.v1.KeyRecipe.Part.getDefaultInstance()) return this; + if (other.getTag() != 0) { + setTag(other.getTag()); + } + if (other.order_ != 0) { + setOrderValue(other.getOrderValue()); + } + if (other.nullOrder_ != 0) { + setNullOrderValue(other.getNullOrderValue()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (!other.structIdentifiers_.isEmpty()) { + if (structIdentifiers_.isEmpty()) { + structIdentifiers_ = other.structIdentifiers_; + structIdentifiers_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureStructIdentifiersIsMutable(); + structIdentifiers_.addAll(other.structIdentifiers_); + } + onChanged(); + } + switch (other.getValueTypeCase()) { + case IDENTIFIER: + { + valueTypeCase_ = 5; + valueType_ = other.valueType_; + onChanged(); + break; + } + case VALUE: + { + mergeValue(other.getValue()); + break; + } + case RANDOM: + { + setRandom(other.getRandom()); + break; + } + case VALUETYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + tag_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + order_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + nullOrder_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage(getTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + valueTypeCase_ = 5; + valueType_ = s; + break; + } // case 42 + case 50: + { + input.readMessage(getValueFieldBuilder().getBuilder(), extensionRegistry); + valueTypeCase_ = 6; + break; + } // case 50 + case 56: + { + int v = input.readInt32(); + ensureStructIdentifiersIsMutable(); + structIdentifiers_.addInt(v); + break; + } // case 56 + case 58: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureStructIdentifiersIsMutable(); + while (input.getBytesUntilLimit() > 0) { + structIdentifiers_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 58 + case 64: + { + valueType_ = input.readBool(); + valueTypeCase_ = 8; + break; + } // case 64 + 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 valueTypeCase_ = 0; + private java.lang.Object valueType_; + + public ValueTypeCase getValueTypeCase() { + return ValueTypeCase.forNumber(valueTypeCase_); + } + + public Builder clearValueType() { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int tag_; + + /** + * + * + *
+       * If non-zero, `tag` is the only field present in this `Part`. The part
+       * is encoded by appending `tag` to the ssformat key.
+       * 
+ * + * uint32 tag = 1; + * + * @return The tag. + */ + @java.lang.Override + public int getTag() { + return tag_; + } + + /** + * + * + *
+       * If non-zero, `tag` is the only field present in this `Part`. The part
+       * is encoded by appending `tag` to the ssformat key.
+       * 
+ * + * uint32 tag = 1; + * + * @param value The tag to set. + * @return This builder for chaining. + */ + public Builder setTag(int value) { + + tag_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * If non-zero, `tag` is the only field present in this `Part`. The part
+       * is encoded by appending `tag` to the ssformat key.
+       * 
+ * + * uint32 tag = 1; + * + * @return This builder for chaining. + */ + public Builder clearTag() { + bitField0_ = (bitField0_ & ~0x00000001); + tag_ = 0; + onChanged(); + return this; + } + + private int order_ = 0; + + /** + * + * + *
+       * Whether the key column is sorted ascending or descending. Only present
+       * if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @return The enum numeric value on the wire for order. + */ + @java.lang.Override + public int getOrderValue() { + return order_; + } + + /** + * + * + *
+       * Whether the key column is sorted ascending or descending. Only present
+       * if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @param value The enum numeric value on the wire for order to set. + * @return This builder for chaining. + */ + public Builder setOrderValue(int value) { + order_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether the key column is sorted ascending or descending. Only present
+       * if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @return The order. + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part.Order getOrder() { + com.google.spanner.v1.KeyRecipe.Part.Order result = + com.google.spanner.v1.KeyRecipe.Part.Order.forNumber(order_); + return result == null ? com.google.spanner.v1.KeyRecipe.Part.Order.UNRECOGNIZED : result; + } + + /** + * + * + *
+       * Whether the key column is sorted ascending or descending. Only present
+       * if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @param value The order to set. + * @return This builder for chaining. + */ + public Builder setOrder(com.google.spanner.v1.KeyRecipe.Part.Order value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + order_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Whether the key column is sorted ascending or descending. Only present
+       * if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.Order order = 2; + * + * @return This builder for chaining. + */ + public Builder clearOrder() { + bitField0_ = (bitField0_ & ~0x00000002); + order_ = 0; + onChanged(); + return this; + } + + private int nullOrder_ = 0; + + /** + * + * + *
+       * How NULLs are represented in the encoded key part. Only present if `tag`
+       * is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @return The enum numeric value on the wire for nullOrder. + */ + @java.lang.Override + public int getNullOrderValue() { + return nullOrder_; + } + + /** + * + * + *
+       * How NULLs are represented in the encoded key part. Only present if `tag`
+       * is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @param value The enum numeric value on the wire for nullOrder to set. + * @return This builder for chaining. + */ + public Builder setNullOrderValue(int value) { + nullOrder_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * How NULLs are represented in the encoded key part. Only present if `tag`
+       * is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @return The nullOrder. + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part.NullOrder getNullOrder() { + com.google.spanner.v1.KeyRecipe.Part.NullOrder result = + com.google.spanner.v1.KeyRecipe.Part.NullOrder.forNumber(nullOrder_); + return result == null + ? com.google.spanner.v1.KeyRecipe.Part.NullOrder.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * How NULLs are represented in the encoded key part. Only present if `tag`
+       * is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @param value The nullOrder to set. + * @return This builder for chaining. + */ + public Builder setNullOrder(com.google.spanner.v1.KeyRecipe.Part.NullOrder value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + nullOrder_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * How NULLs are represented in the encoded key part. Only present if `tag`
+       * is zero.
+       * 
+ * + * .google.spanner.v1.KeyRecipe.Part.NullOrder null_order = 3; + * + * @return This builder for chaining. + */ + public Builder clearNullOrder() { + bitField0_ = (bitField0_ & ~0x00000004); + nullOrder_ = 0; + onChanged(); + return this; + } + + private com.google.spanner.v1.Type type_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Type, + com.google.spanner.v1.Type.Builder, + com.google.spanner.v1.TypeOrBuilder> + typeBuilder_; + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + * + * @return The type. + */ + public com.google.spanner.v1.Type getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + */ + public Builder setType(com.google.spanner.v1.Type value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + } else { + typeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + */ + public Builder setType(com.google.spanner.v1.Type.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + */ + public Builder mergeType(com.google.spanner.v1.Type value) { + if (typeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && type_ != null + && type_ != com.google.spanner.v1.Type.getDefaultInstance()) { + getTypeBuilder().mergeFrom(value); + } else { + type_ = value; + } + } else { + typeBuilder_.mergeFrom(value); + } + if (type_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000008); + type_ = null; + if (typeBuilder_ != null) { + typeBuilder_.dispose(); + typeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + */ + public com.google.spanner.v1.Type.Builder getTypeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getTypeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + */ + public com.google.spanner.v1.TypeOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.spanner.v1.Type.getDefaultInstance() : type_; + } + } + + /** + * + * + *
+       * The type of the key part. Only present if `tag` is zero.
+       * 
+ * + * .google.spanner.v1.Type type = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Type, + com.google.spanner.v1.Type.Builder, + com.google.spanner.v1.TypeOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Type, + com.google.spanner.v1.Type.Builder, + com.google.spanner.v1.TypeOrBuilder>( + getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + /** + * + * + *
+       * `identifier` is the name of the column or query parameter.
+       * 
+ * + * string identifier = 5; + * + * @return Whether the identifier field is set. + */ + @java.lang.Override + public boolean hasIdentifier() { + return valueTypeCase_ == 5; + } + + /** + * + * + *
+       * `identifier` is the name of the column or query parameter.
+       * 
+ * + * string identifier = 5; + * + * @return The identifier. + */ + @java.lang.Override + public java.lang.String getIdentifier() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueTypeCase_ == 5) { + valueType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * `identifier` is the name of the column or query parameter.
+       * 
+ * + * string identifier = 5; + * + * @return The bytes for identifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdentifierBytes() { + java.lang.Object ref = ""; + if (valueTypeCase_ == 5) { + ref = valueType_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (valueTypeCase_ == 5) { + valueType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * `identifier` is the name of the column or query parameter.
+       * 
+ * + * string identifier = 5; + * + * @param value The identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifier(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueTypeCase_ = 5; + valueType_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * `identifier` is the name of the column or query parameter.
+       * 
+ * + * string identifier = 5; + * + * @return This builder for chaining. + */ + public Builder clearIdentifier() { + if (valueTypeCase_ == 5) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * `identifier` is the name of the column or query parameter.
+       * 
+ * + * string identifier = 5; + * + * @param value The bytes for identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifierBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueTypeCase_ = 5; + valueType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + valueBuilder_; + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return valueTypeCase_ == 6; + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + * + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.Value getValue() { + if (valueBuilder_ == null) { + if (valueTypeCase_ == 6) { + return (com.google.protobuf.Value) valueType_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } else { + if (valueTypeCase_ == 6) { + return valueBuilder_.getMessage(); + } + return com.google.protobuf.Value.getDefaultInstance(); + } + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + */ + public Builder setValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + onChanged(); + } else { + valueBuilder_.setMessage(value); + } + valueTypeCase_ = 6; + return this; + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + */ + public Builder setValue(com.google.protobuf.Value.Builder builderForValue) { + if (valueBuilder_ == null) { + valueType_ = builderForValue.build(); + onChanged(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + valueTypeCase_ = 6; + return this; + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + */ + public Builder mergeValue(com.google.protobuf.Value value) { + if (valueBuilder_ == null) { + if (valueTypeCase_ == 6 && valueType_ != com.google.protobuf.Value.getDefaultInstance()) { + valueType_ = + com.google.protobuf.Value.newBuilder((com.google.protobuf.Value) valueType_) + .mergeFrom(value) + .buildPartial(); + } else { + valueType_ = value; + } + onChanged(); + } else { + if (valueTypeCase_ == 6) { + valueBuilder_.mergeFrom(value); + } else { + valueBuilder_.setMessage(value); + } + } + valueTypeCase_ = 6; + return this; + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + */ + public Builder clearValue() { + if (valueBuilder_ == null) { + if (valueTypeCase_ == 6) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + } else { + if (valueTypeCase_ == 6) { + valueTypeCase_ = 0; + valueType_ = null; + } + valueBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + */ + public com.google.protobuf.Value.Builder getValueBuilder() { + return getValueFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getValueOrBuilder() { + if ((valueTypeCase_ == 6) && (valueBuilder_ != null)) { + return valueBuilder_.getMessageOrBuilder(); + } else { + if (valueTypeCase_ == 6) { + return (com.google.protobuf.Value) valueType_; + } + return com.google.protobuf.Value.getDefaultInstance(); + } + } + + /** + * + * + *
+       * The constant value of the key part.
+       * It is present when query uses a constant as a part of the key.
+       * 
+ * + * .google.protobuf.Value value = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + if (!(valueTypeCase_ == 6)) { + valueType_ = com.google.protobuf.Value.getDefaultInstance(); + } + valueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + (com.google.protobuf.Value) valueType_, getParentForChildren(), isClean()); + valueType_ = null; + } + valueTypeCase_ = 6; + onChanged(); + return valueBuilder_; + } + + /** + * + * + *
+       * If true, the client is responsible to fill in the value randomly.
+       * It's relevant only for the INT64 type.
+       * 
+ * + * bool random = 8; + * + * @return Whether the random field is set. + */ + public boolean hasRandom() { + return valueTypeCase_ == 8; + } + + /** + * + * + *
+       * If true, the client is responsible to fill in the value randomly.
+       * It's relevant only for the INT64 type.
+       * 
+ * + * bool random = 8; + * + * @return The random. + */ + public boolean getRandom() { + if (valueTypeCase_ == 8) { + return (java.lang.Boolean) valueType_; + } + return false; + } + + /** + * + * + *
+       * If true, the client is responsible to fill in the value randomly.
+       * It's relevant only for the INT64 type.
+       * 
+ * + * bool random = 8; + * + * @param value The random to set. + * @return This builder for chaining. + */ + public Builder setRandom(boolean value) { + + valueTypeCase_ = 8; + valueType_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * If true, the client is responsible to fill in the value randomly.
+       * It's relevant only for the INT64 type.
+       * 
+ * + * bool random = 8; + * + * @return This builder for chaining. + */ + public Builder clearRandom() { + if (valueTypeCase_ == 8) { + valueTypeCase_ = 0; + valueType_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.Internal.IntList structIdentifiers_ = emptyIntList(); + + private void ensureStructIdentifiersIsMutable() { + if (!structIdentifiers_.isModifiable()) { + structIdentifiers_ = makeMutableCopy(structIdentifiers_); + } + bitField0_ |= 0x00000080; + } + + /** + * + * + *
+       * It is a repeated field to support fetching key columns from nested
+       * structs, such as `STRUCT` query parameters.
+       * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @return A list containing the structIdentifiers. + */ + public java.util.List getStructIdentifiersList() { + structIdentifiers_.makeImmutable(); + return structIdentifiers_; + } + + /** + * + * + *
+       * It is a repeated field to support fetching key columns from nested
+       * structs, such as `STRUCT` query parameters.
+       * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @return The count of structIdentifiers. + */ + public int getStructIdentifiersCount() { + return structIdentifiers_.size(); + } + + /** + * + * + *
+       * It is a repeated field to support fetching key columns from nested
+       * structs, such as `STRUCT` query parameters.
+       * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @param index The index of the element to return. + * @return The structIdentifiers at the given index. + */ + public int getStructIdentifiers(int index) { + return structIdentifiers_.getInt(index); + } + + /** + * + * + *
+       * It is a repeated field to support fetching key columns from nested
+       * structs, such as `STRUCT` query parameters.
+       * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @param index The index to set the value at. + * @param value The structIdentifiers to set. + * @return This builder for chaining. + */ + public Builder setStructIdentifiers(int index, int value) { + + ensureStructIdentifiersIsMutable(); + structIdentifiers_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * It is a repeated field to support fetching key columns from nested
+       * structs, such as `STRUCT` query parameters.
+       * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @param value The structIdentifiers to add. + * @return This builder for chaining. + */ + public Builder addStructIdentifiers(int value) { + + ensureStructIdentifiersIsMutable(); + structIdentifiers_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * It is a repeated field to support fetching key columns from nested
+       * structs, such as `STRUCT` query parameters.
+       * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @param values The structIdentifiers to add. + * @return This builder for chaining. + */ + public Builder addAllStructIdentifiers( + java.lang.Iterable values) { + ensureStructIdentifiersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, structIdentifiers_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * It is a repeated field to support fetching key columns from nested
+       * structs, such as `STRUCT` query parameters.
+       * 
+ * + * repeated int32 struct_identifiers = 7; + * + * @return This builder for chaining. + */ + public Builder clearStructIdentifiers() { + structIdentifiers_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.KeyRecipe.Part) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.KeyRecipe.Part) + private static final com.google.spanner.v1.KeyRecipe.Part DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.KeyRecipe.Part(); + } + + public static com.google.spanner.v1.KeyRecipe.Part getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Part parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int targetCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object target_; + + public enum TargetCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TABLE_NAME(1), + INDEX_NAME(2), + OPERATION_UID(3), + TARGET_NOT_SET(0); + private final int value; + + private TargetCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TargetCase valueOf(int value) { + return forNumber(value); + } + + public static TargetCase forNumber(int value) { + switch (value) { + case 1: + return TABLE_NAME; + case 2: + return INDEX_NAME; + case 3: + return OPERATION_UID; + case 0: + return TARGET_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public static final int TABLE_NAME_FIELD_NUMBER = 1; + + /** + * + * + *
+   * A table name, matching the name from the database schema.
+   * 
+ * + * string table_name = 1; + * + * @return Whether the tableName field is set. + */ + public boolean hasTableName() { + return targetCase_ == 1; + } + + /** + * + * + *
+   * A table name, matching the name from the database schema.
+   * 
+ * + * string table_name = 1; + * + * @return The tableName. + */ + public java.lang.String getTableName() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 1) { + target_ = s; + } + return s; + } + } + + /** + * + * + *
+   * A table name, matching the name from the database schema.
+   * 
+ * + * string table_name = 1; + * + * @return The bytes for tableName. + */ + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 1) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_NAME_FIELD_NUMBER = 2; + + /** + * + * + *
+   * An index name, matching the name from the database schema.
+   * 
+ * + * string index_name = 2; + * + * @return Whether the indexName field is set. + */ + public boolean hasIndexName() { + return targetCase_ == 2; + } + + /** + * + * + *
+   * An index name, matching the name from the database schema.
+   * 
+ * + * string index_name = 2; + * + * @return The indexName. + */ + public java.lang.String getIndexName() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 2) { + target_ = s; + } + return s; + } + } + + /** + * + * + *
+   * An index name, matching the name from the database schema.
+   * 
+ * + * string index_name = 2; + * + * @return The bytes for indexName. + */ + public com.google.protobuf.ByteString getIndexNameBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 2) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATION_UID_FIELD_NUMBER = 3; + + /** + * + * + *
+   * The UID of a query, matching the UID from `RoutingHint`.
+   * 
+ * + * uint64 operation_uid = 3; + * + * @return Whether the operationUid field is set. + */ + @java.lang.Override + public boolean hasOperationUid() { + return targetCase_ == 3; + } + + /** + * + * + *
+   * The UID of a query, matching the UID from `RoutingHint`.
+   * 
+ * + * uint64 operation_uid = 3; + * + * @return The operationUid. + */ + @java.lang.Override + public long getOperationUid() { + if (targetCase_ == 3) { + return (java.lang.Long) target_; + } + return 0L; + } + + public static final int PART_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List part_; + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + @java.lang.Override + public java.util.List getPartList() { + return part_; + } + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + @java.lang.Override + public java.util.List + getPartOrBuilderList() { + return part_; + } + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + @java.lang.Override + public int getPartCount() { + return part_.size(); + } + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.Part getPart(int index) { + return part_.get(index); + } + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipe.PartOrBuilder getPartOrBuilder(int index) { + return part_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (targetCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, target_); + } + if (targetCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, target_); + } + if (targetCase_ == 3) { + output.writeUInt64(3, (long) ((java.lang.Long) target_)); + } + for (int i = 0; i < part_.size(); i++) { + output.writeMessage(4, part_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, target_); + } + if (targetCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, target_); + } + if (targetCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeUInt64Size( + 3, (long) ((java.lang.Long) target_)); + } + for (int i = 0; i < part_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, part_.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.spanner.v1.KeyRecipe)) { + return super.equals(obj); + } + com.google.spanner.v1.KeyRecipe other = (com.google.spanner.v1.KeyRecipe) obj; + + if (!getPartList().equals(other.getPartList())) return false; + if (!getTargetCase().equals(other.getTargetCase())) return false; + switch (targetCase_) { + case 1: + if (!getTableName().equals(other.getTableName())) return false; + break; + case 2: + if (!getIndexName().equals(other.getIndexName())) return false; + break; + case 3: + if (getOperationUid() != other.getOperationUid()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPartCount() > 0) { + hash = (37 * hash) + PART_FIELD_NUMBER; + hash = (53 * hash) + getPartList().hashCode(); + } + switch (targetCase_) { + case 1: + hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + break; + case 2: + hash = (37 * hash) + INDEX_NAME_FIELD_NUMBER; + hash = (53 * hash) + getIndexName().hashCode(); + break; + case 3: + hash = (37 * hash) + OPERATION_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOperationUid()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.KeyRecipe parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.KeyRecipe parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.KeyRecipe parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.KeyRecipe 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; + } + + /** + * + * + *
+   * A `KeyRecipe` provides the metadata required to translate reads, mutations,
+   * and queries into a byte array in "sortable string format" (ssformat)that can
+   * be used with `Range`s to route requests. Note that the client *must* tolerate
+   * `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may
+   * change over time. Requests with invalid `KeyRecipe`s should be routed to a
+   * default server.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.KeyRecipe} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.KeyRecipe) + com.google.spanner.v1.KeyRecipeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.KeyRecipe.class, com.google.spanner.v1.KeyRecipe.Builder.class); + } + + // Construct using com.google.spanner.v1.KeyRecipe.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (partBuilder_ == null) { + part_ = java.util.Collections.emptyList(); + } else { + part_ = null; + partBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + targetCase_ = 0; + target_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_KeyRecipe_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe getDefaultInstanceForType() { + return com.google.spanner.v1.KeyRecipe.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe build() { + com.google.spanner.v1.KeyRecipe result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe buildPartial() { + com.google.spanner.v1.KeyRecipe result = new com.google.spanner.v1.KeyRecipe(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.spanner.v1.KeyRecipe result) { + if (partBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + part_ = java.util.Collections.unmodifiableList(part_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.part_ = part_; + } else { + result.part_ = partBuilder_.build(); + } + } + + private void buildPartial0(com.google.spanner.v1.KeyRecipe result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.spanner.v1.KeyRecipe result) { + result.targetCase_ = targetCase_; + result.target_ = this.target_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.KeyRecipe) { + return mergeFrom((com.google.spanner.v1.KeyRecipe) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.KeyRecipe other) { + if (other == com.google.spanner.v1.KeyRecipe.getDefaultInstance()) return this; + if (partBuilder_ == null) { + if (!other.part_.isEmpty()) { + if (part_.isEmpty()) { + part_ = other.part_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePartIsMutable(); + part_.addAll(other.part_); + } + onChanged(); + } + } else { + if (!other.part_.isEmpty()) { + if (partBuilder_.isEmpty()) { + partBuilder_.dispose(); + partBuilder_ = null; + part_ = other.part_; + bitField0_ = (bitField0_ & ~0x00000008); + partBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPartFieldBuilder() + : null; + } else { + partBuilder_.addAllMessages(other.part_); + } + } + } + switch (other.getTargetCase()) { + case TABLE_NAME: + { + targetCase_ = 1; + target_ = other.target_; + onChanged(); + break; + } + case INDEX_NAME: + { + targetCase_ = 2; + target_ = other.target_; + onChanged(); + break; + } + case OPERATION_UID: + { + setOperationUid(other.getOperationUid()); + break; + } + case TARGET_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 1; + target_ = s; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 2; + target_ = s; + break; + } // case 18 + case 24: + { + target_ = input.readUInt64(); + targetCase_ = 3; + break; + } // case 24 + case 34: + { + com.google.spanner.v1.KeyRecipe.Part m = + input.readMessage( + com.google.spanner.v1.KeyRecipe.Part.parser(), extensionRegistry); + if (partBuilder_ == null) { + ensurePartIsMutable(); + part_.add(m); + } else { + partBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int targetCase_ = 0; + private java.lang.Object target_; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public Builder clearTarget() { + targetCase_ = 0; + target_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * A table name, matching the name from the database schema.
+     * 
+ * + * string table_name = 1; + * + * @return Whether the tableName field is set. + */ + @java.lang.Override + public boolean hasTableName() { + return targetCase_ == 1; + } + + /** + * + * + *
+     * A table name, matching the name from the database schema.
+     * 
+ * + * string table_name = 1; + * + * @return The tableName. + */ + @java.lang.Override + public java.lang.String getTableName() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 1) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A table name, matching the name from the database schema.
+     * 
+ * + * string table_name = 1; + * + * @return The bytes for tableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableNameBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 1) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A table name, matching the name from the database schema.
+     * 
+ * + * string table_name = 1; + * + * @param value The tableName to set. + * @return This builder for chaining. + */ + public Builder setTableName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 1; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * A table name, matching the name from the database schema.
+     * 
+ * + * string table_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearTableName() { + if (targetCase_ == 1) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A table name, matching the name from the database schema.
+     * 
+ * + * string table_name = 1; + * + * @param value The bytes for tableName to set. + * @return This builder for chaining. + */ + public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 1; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * An index name, matching the name from the database schema.
+     * 
+ * + * string index_name = 2; + * + * @return Whether the indexName field is set. + */ + @java.lang.Override + public boolean hasIndexName() { + return targetCase_ == 2; + } + + /** + * + * + *
+     * An index name, matching the name from the database schema.
+     * 
+ * + * string index_name = 2; + * + * @return The indexName. + */ + @java.lang.Override + public java.lang.String getIndexName() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 2) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * An index name, matching the name from the database schema.
+     * 
+ * + * string index_name = 2; + * + * @return The bytes for indexName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndexNameBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 2) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 2) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * An index name, matching the name from the database schema.
+     * 
+ * + * string index_name = 2; + * + * @param value The indexName to set. + * @return This builder for chaining. + */ + public Builder setIndexName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 2; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * An index name, matching the name from the database schema.
+     * 
+ * + * string index_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearIndexName() { + if (targetCase_ == 2) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * An index name, matching the name from the database schema.
+     * 
+ * + * string index_name = 2; + * + * @param value The bytes for indexName to set. + * @return This builder for chaining. + */ + public Builder setIndexNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 2; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The UID of a query, matching the UID from `RoutingHint`.
+     * 
+ * + * uint64 operation_uid = 3; + * + * @return Whether the operationUid field is set. + */ + public boolean hasOperationUid() { + return targetCase_ == 3; + } + + /** + * + * + *
+     * The UID of a query, matching the UID from `RoutingHint`.
+     * 
+ * + * uint64 operation_uid = 3; + * + * @return The operationUid. + */ + public long getOperationUid() { + if (targetCase_ == 3) { + return (java.lang.Long) target_; + } + return 0L; + } + + /** + * + * + *
+     * The UID of a query, matching the UID from `RoutingHint`.
+     * 
+ * + * uint64 operation_uid = 3; + * + * @param value The operationUid to set. + * @return This builder for chaining. + */ + public Builder setOperationUid(long value) { + + targetCase_ = 3; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The UID of a query, matching the UID from `RoutingHint`.
+     * 
+ * + * uint64 operation_uid = 3; + * + * @return This builder for chaining. + */ + public Builder clearOperationUid() { + if (targetCase_ == 3) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + + private java.util.List part_ = + java.util.Collections.emptyList(); + + private void ensurePartIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + part_ = new java.util.ArrayList(part_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.KeyRecipe.Part, + com.google.spanner.v1.KeyRecipe.Part.Builder, + com.google.spanner.v1.KeyRecipe.PartOrBuilder> + partBuilder_; + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public java.util.List getPartList() { + if (partBuilder_ == null) { + return java.util.Collections.unmodifiableList(part_); + } else { + return partBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public int getPartCount() { + if (partBuilder_ == null) { + return part_.size(); + } else { + return partBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public com.google.spanner.v1.KeyRecipe.Part getPart(int index) { + if (partBuilder_ == null) { + return part_.get(index); + } else { + return partBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder setPart(int index, com.google.spanner.v1.KeyRecipe.Part value) { + if (partBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartIsMutable(); + part_.set(index, value); + onChanged(); + } else { + partBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder setPart( + int index, com.google.spanner.v1.KeyRecipe.Part.Builder builderForValue) { + if (partBuilder_ == null) { + ensurePartIsMutable(); + part_.set(index, builderForValue.build()); + onChanged(); + } else { + partBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder addPart(com.google.spanner.v1.KeyRecipe.Part value) { + if (partBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartIsMutable(); + part_.add(value); + onChanged(); + } else { + partBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder addPart(int index, com.google.spanner.v1.KeyRecipe.Part value) { + if (partBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartIsMutable(); + part_.add(index, value); + onChanged(); + } else { + partBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder addPart(com.google.spanner.v1.KeyRecipe.Part.Builder builderForValue) { + if (partBuilder_ == null) { + ensurePartIsMutable(); + part_.add(builderForValue.build()); + onChanged(); + } else { + partBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder addPart( + int index, com.google.spanner.v1.KeyRecipe.Part.Builder builderForValue) { + if (partBuilder_ == null) { + ensurePartIsMutable(); + part_.add(index, builderForValue.build()); + onChanged(); + } else { + partBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder addAllPart( + java.lang.Iterable values) { + if (partBuilder_ == null) { + ensurePartIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, part_); + onChanged(); + } else { + partBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder clearPart() { + if (partBuilder_ == null) { + part_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + partBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public Builder removePart(int index) { + if (partBuilder_ == null) { + ensurePartIsMutable(); + part_.remove(index); + onChanged(); + } else { + partBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public com.google.spanner.v1.KeyRecipe.Part.Builder getPartBuilder(int index) { + return getPartFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public com.google.spanner.v1.KeyRecipe.PartOrBuilder getPartOrBuilder(int index) { + if (partBuilder_ == null) { + return part_.get(index); + } else { + return partBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public java.util.List + getPartOrBuilderList() { + if (partBuilder_ != null) { + return partBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(part_); + } + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public com.google.spanner.v1.KeyRecipe.Part.Builder addPartBuilder() { + return getPartFieldBuilder() + .addBuilder(com.google.spanner.v1.KeyRecipe.Part.getDefaultInstance()); + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public com.google.spanner.v1.KeyRecipe.Part.Builder addPartBuilder(int index) { + return getPartFieldBuilder() + .addBuilder(index, com.google.spanner.v1.KeyRecipe.Part.getDefaultInstance()); + } + + /** + * + * + *
+     * Parts are in the order they should appear in the encoded key.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + public java.util.List getPartBuilderList() { + return getPartFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.KeyRecipe.Part, + com.google.spanner.v1.KeyRecipe.Part.Builder, + com.google.spanner.v1.KeyRecipe.PartOrBuilder> + getPartFieldBuilder() { + if (partBuilder_ == null) { + partBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.KeyRecipe.Part, + com.google.spanner.v1.KeyRecipe.Part.Builder, + com.google.spanner.v1.KeyRecipe.PartOrBuilder>( + part_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + part_ = null; + } + return partBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.KeyRecipe) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.KeyRecipe) + private static final com.google.spanner.v1.KeyRecipe DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.KeyRecipe(); + } + + public static com.google.spanner.v1.KeyRecipe getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KeyRecipe parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.KeyRecipe getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/KeyRecipeOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/KeyRecipeOrBuilder.java new file mode 100644 index 00000000000..569e5642309 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/KeyRecipeOrBuilder.java @@ -0,0 +1,187 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface KeyRecipeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.KeyRecipe) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A table name, matching the name from the database schema.
+   * 
+ * + * string table_name = 1; + * + * @return Whether the tableName field is set. + */ + boolean hasTableName(); + + /** + * + * + *
+   * A table name, matching the name from the database schema.
+   * 
+ * + * string table_name = 1; + * + * @return The tableName. + */ + java.lang.String getTableName(); + + /** + * + * + *
+   * A table name, matching the name from the database schema.
+   * 
+ * + * string table_name = 1; + * + * @return The bytes for tableName. + */ + com.google.protobuf.ByteString getTableNameBytes(); + + /** + * + * + *
+   * An index name, matching the name from the database schema.
+   * 
+ * + * string index_name = 2; + * + * @return Whether the indexName field is set. + */ + boolean hasIndexName(); + + /** + * + * + *
+   * An index name, matching the name from the database schema.
+   * 
+ * + * string index_name = 2; + * + * @return The indexName. + */ + java.lang.String getIndexName(); + + /** + * + * + *
+   * An index name, matching the name from the database schema.
+   * 
+ * + * string index_name = 2; + * + * @return The bytes for indexName. + */ + com.google.protobuf.ByteString getIndexNameBytes(); + + /** + * + * + *
+   * The UID of a query, matching the UID from `RoutingHint`.
+   * 
+ * + * uint64 operation_uid = 3; + * + * @return Whether the operationUid field is set. + */ + boolean hasOperationUid(); + + /** + * + * + *
+   * The UID of a query, matching the UID from `RoutingHint`.
+   * 
+ * + * uint64 operation_uid = 3; + * + * @return The operationUid. + */ + long getOperationUid(); + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + java.util.List getPartList(); + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + com.google.spanner.v1.KeyRecipe.Part getPart(int index); + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + int getPartCount(); + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + java.util.List getPartOrBuilderList(); + + /** + * + * + *
+   * Parts are in the order they should appear in the encoded key.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe.Part part = 4; + */ + com.google.spanner.v1.KeyRecipe.PartOrBuilder getPartOrBuilder(int index); + + com.google.spanner.v1.KeyRecipe.TargetCase getTargetCase(); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/LocationProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/LocationProto.java new file mode 100644 index 00000000000..83833a06f66 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/LocationProto.java @@ -0,0 +1,257 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public final class LocationProto { + private LocationProto() {} + + 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_spanner_v1_Range_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_Range_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_Tablet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_Tablet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_Group_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_Group_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_KeyRecipe_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_KeyRecipe_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_KeyRecipe_Part_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_KeyRecipe_Part_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_RecipeList_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_RecipeList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_CacheUpdate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_CacheUpdate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_RoutingHint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_RoutingHint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_RoutingHint_SkippedTablet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_RoutingHint_SkippedTablet_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/spanner/v1/location.proto\022\021goog" + + "le.spanner.v1\032\034google/protobuf/struct.proto\032\034google/spanner/v1/type.proto\"f\n" + + "\005Range\022\021\n" + + "\tstart_key\030\001 \001(\014\022\021\n" + + "\tlimit_key\030\002 \001(\014\022\021\n" + + "\tgroup_uid\030\003 \001(\004\022\020\n" + + "\010split_id\030\004 \001(\004\022\022\n" + + "\n" + + "generation\030\005 \001(\014\"\346\001\n" + + "\006Tablet\022\022\n\n" + + "tablet_uid\030\001 \001(\004\022\026\n" + + "\016server_address\030\002 \001(\t\022\020\n" + + "\010location\030\003 \001(\t\022,\n" + + "\004role\030\004 \001(\0162\036.google.spanner.v1.Tablet.Role\022\023\n" + + "\013incarnation\030\005 \001(\014\022\020\n" + + "\010distance\030\006 \001(\r" + + "\022\014\n" + + "\004skip\030\007 \001(\010\";\n" + + "\004Role\022\024\n" + + "\020ROLE_UNSPECIFIED\020\000\022\016\n\n" + + "READ_WRITE\020\001\022\r\n" + + "\tREAD_ONLY\020\002\"p\n" + + "\005Group\022\021\n" + + "\tgroup_uid\030\001 \001(\004\022*\n" + + "\007tablets\030\002 \003(\0132\031.google.spanner.v1.Tablet\022\024\n" + + "\014leader_index\030\003 \001(\005\022\022\n\n" + + "generation\030\004 \001(\014\"\323\004\n" + + "\tKeyRecipe\022\024\n\n" + + "table_name\030\001 \001(\tH\000\022\024\n\n" + + "index_name\030\002 \001(\tH\000\022\027\n\r" + + "operation_uid\030\003 \001(\004H\000\022/\n" + + "\004part\030\004 \003(\0132!.google.spanner.v1.KeyRecipe.Part\032\305\003\n" + + "\004Part\022\013\n" + + "\003tag\030\001 \001(\r" + + "\0226\n" + + "\005order\030\002 \001(\0162\'.google.spanner.v1.KeyRecipe.Part.Order\022?\n\n" + + "null_order\030\003 \001(\0162+.google.spanner.v1.KeyRecipe.Part.NullOrder\022%\n" + + "\004type\030\004 \001(\0132\027.google.spanner.v1.Type\022\024\n\n" + + "identifier\030\005 \001(\tH\000\022\'\n" + + "\005value\030\006 \001(\0132\026.google.protobuf.ValueH\000\022\020\n" + + "\006random\030\010 \001(\010H\000\022\032\n" + + "\022struct_identifiers\030\007 \003(\005\"=\n" + + "\005Order\022\025\n" + + "\021ORDER_UNSPECIFIED\020\000\022\r\n" + + "\tASCENDING\020\001\022\016\n\n" + + "DESCENDING\020\002\"V\n" + + "\tNullOrder\022\032\n" + + "\026NULL_ORDER_UNSPECIFIED\020\000\022\017\n" + + "\013NULLS_FIRST\020\001\022\016\n\n" + + "NULLS_LAST\020\002\022\014\n" + + "\010NOT_NULL\020\003B\014\n\n" + + "value_typeB\010\n" + + "\006target\"U\n\n" + + "RecipeList\022\031\n" + + "\021schema_generation\030\001 \001(\014\022,\n" + + "\006recipe\030\003 \003(\0132\034.google.spanner.v1.KeyRecipe\"\250\001\n" + + "\013CacheUpdate\022\023\n" + + "\013database_id\030\001 \001(\004\022\'\n" + + "\005range\030\002 \003(\0132\030.google.spanner.v1.Range\022\'\n" + + "\005group\030\003 \003(\0132\030.google.spanner.v1.Group\0222\n" + + "\013key_recipes\030\005 \001(\0132\035.google.spanner.v1.RecipeList\"\312\002\n" + + "\013RoutingHint\022\025\n\r" + + "operation_uid\030\001 \001(\004\022\023\n" + + "\013database_id\030\002 \001(\004\022\031\n" + + "\021schema_generation\030\003 \001(\014\022\013\n" + + "\003key\030\004 \001(\014\022\021\n" + + "\tlimit_key\030\005 \001(\014\022\021\n" + + "\tgroup_uid\030\006 \001(\004\022\020\n" + + "\010split_id\030\007 \001(\004\022\022\n\n" + + "tablet_uid\030\010 \001(\004\022H\n" + + "\022skipped_tablet_uid\030\t" + + " \003(\0132,.google.spanner.v1.RoutingHint.SkippedTablet\022\027\n" + + "\017client_location\030\n" + + " \001(\t\0328\n\r" + + "SkippedTablet\022\022\n\n" + + "tablet_uid\030\001 \001(\004\022\023\n" + + "\013incarnation\030\002 \001(\014B\260\001\n" + + "\025com.google.spanner.v1B\r" + + "LocationProtoP\001Z5cloud.google.com/go/spanner/apiv1/spannerp" + + "b;spannerpb\252\002\027Google.Cloud.Spanner.V1\312\002\027" + + "Google\\Cloud\\Spanner\\V1\352\002\032Google::Cloud::Spanner::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.StructProto.getDescriptor(), + com.google.spanner.v1.TypeProto.getDescriptor(), + }); + internal_static_google_spanner_v1_Range_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_spanner_v1_Range_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_Range_descriptor, + new java.lang.String[] { + "StartKey", "LimitKey", "GroupUid", "SplitId", "Generation", + }); + internal_static_google_spanner_v1_Tablet_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_spanner_v1_Tablet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_Tablet_descriptor, + new java.lang.String[] { + "TabletUid", "ServerAddress", "Location", "Role", "Incarnation", "Distance", "Skip", + }); + internal_static_google_spanner_v1_Group_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_spanner_v1_Group_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_Group_descriptor, + new java.lang.String[] { + "GroupUid", "Tablets", "LeaderIndex", "Generation", + }); + internal_static_google_spanner_v1_KeyRecipe_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_spanner_v1_KeyRecipe_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_KeyRecipe_descriptor, + new java.lang.String[] { + "TableName", "IndexName", "OperationUid", "Part", "Target", + }); + internal_static_google_spanner_v1_KeyRecipe_Part_descriptor = + internal_static_google_spanner_v1_KeyRecipe_descriptor.getNestedTypes().get(0); + internal_static_google_spanner_v1_KeyRecipe_Part_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_KeyRecipe_Part_descriptor, + new java.lang.String[] { + "Tag", + "Order", + "NullOrder", + "Type", + "Identifier", + "Value", + "Random", + "StructIdentifiers", + "ValueType", + }); + internal_static_google_spanner_v1_RecipeList_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_spanner_v1_RecipeList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_RecipeList_descriptor, + new java.lang.String[] { + "SchemaGeneration", "Recipe", + }); + internal_static_google_spanner_v1_CacheUpdate_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_spanner_v1_CacheUpdate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_CacheUpdate_descriptor, + new java.lang.String[] { + "DatabaseId", "Range", "Group", "KeyRecipes", + }); + internal_static_google_spanner_v1_RoutingHint_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_spanner_v1_RoutingHint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_RoutingHint_descriptor, + new java.lang.String[] { + "OperationUid", + "DatabaseId", + "SchemaGeneration", + "Key", + "LimitKey", + "GroupUid", + "SplitId", + "TabletUid", + "SkippedTabletUid", + "ClientLocation", + }); + internal_static_google_spanner_v1_RoutingHint_SkippedTablet_descriptor = + internal_static_google_spanner_v1_RoutingHint_descriptor.getNestedTypes().get(0); + internal_static_google_spanner_v1_RoutingHint_SkippedTablet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_RoutingHint_SkippedTablet_descriptor, + new java.lang.String[] { + "TabletUid", "Incarnation", + }); + com.google.protobuf.StructProto.getDescriptor(); + com.google.spanner.v1.TypeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Mutation.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Mutation.java index 47adefcfa87..03a33ae2bf3 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Mutation.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Mutation.java @@ -3019,189 +3019,2933 @@ public com.google.spanner.v1.Mutation.Delete getDefaultInstanceForType() { } } - private int operationCase_ = 0; + public interface SendOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.Mutation.Send) + com.google.protobuf.MessageOrBuilder { - @SuppressWarnings("serial") - private java.lang.Object operation_; + /** + * + * + *
+     * Required. The queue to which the message will be sent.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The queue. + */ + java.lang.String getQueue(); - public enum OperationCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - INSERT(1), - UPDATE(2), - INSERT_OR_UPDATE(3), - REPLACE(4), - DELETE(5), - OPERATION_NOT_SET(0); - private final int value; + /** + * + * + *
+     * Required. The queue to which the message will be sent.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for queue. + */ + com.google.protobuf.ByteString getQueueBytes(); - private OperationCase(int value) { - this.value = value; - } + /** + * + * + *
+     * Required. The primary key of the message to be sent.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the key field is set. + */ + boolean hasKey(); /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. + * + * + *
+     * Required. The primary key of the message to be sent.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. */ - @java.lang.Deprecated - public static OperationCase valueOf(int value) { - return forNumber(value); - } + com.google.protobuf.ListValue getKey(); - public static OperationCase forNumber(int value) { - switch (value) { - case 1: - return INSERT; - case 2: - return UPDATE; - case 3: - return INSERT_OR_UPDATE; - case 4: - return REPLACE; - case 5: - return DELETE; - case 0: - return OPERATION_NOT_SET; - default: - return null; - } - } + /** + * + * + *
+     * Required. The primary key of the message to be sent.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.protobuf.ListValueOrBuilder getKeyOrBuilder(); - public int getNumber() { - return this.value; - } - }; + /** + * + * + *
+     * The time at which Spanner will begin attempting to deliver the message.
+     * If `deliver_time` is not set, Spanner will deliver the message
+     * immediately. If `deliver_time` is in the past, Spanner will replace it
+     * with a value closer to the current time.
+     * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + * + * @return Whether the deliverTime field is set. + */ + boolean hasDeliverTime(); - public OperationCase getOperationCase() { - return OperationCase.forNumber(operationCase_); - } + /** + * + * + *
+     * The time at which Spanner will begin attempting to deliver the message.
+     * If `deliver_time` is not set, Spanner will deliver the message
+     * immediately. If `deliver_time` is in the past, Spanner will replace it
+     * with a value closer to the current time.
+     * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + * + * @return The deliverTime. + */ + com.google.protobuf.Timestamp getDeliverTime(); - public static final int INSERT_FIELD_NUMBER = 1; + /** + * + * + *
+     * The time at which Spanner will begin attempting to deliver the message.
+     * If `deliver_time` is not set, Spanner will deliver the message
+     * immediately. If `deliver_time` is in the past, Spanner will replace it
+     * with a value closer to the current time.
+     * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getDeliverTimeOrBuilder(); - /** - * - * - *
-   * Insert new rows in a table. If any of the rows already exist,
-   * the write or transaction fails with error `ALREADY_EXISTS`.
-   * 
- * - * .google.spanner.v1.Mutation.Write insert = 1; - * - * @return Whether the insert field is set. - */ - @java.lang.Override - public boolean hasInsert() { - return operationCase_ == 1; - } + /** + * + * + *
+     * The payload of the message.
+     * 
+ * + * .google.protobuf.Value payload = 4; + * + * @return Whether the payload field is set. + */ + boolean hasPayload(); - /** - * - * - *
-   * Insert new rows in a table. If any of the rows already exist,
-   * the write or transaction fails with error `ALREADY_EXISTS`.
-   * 
- * - * .google.spanner.v1.Mutation.Write insert = 1; - * - * @return The insert. - */ - @java.lang.Override - public com.google.spanner.v1.Mutation.Write getInsert() { - if (operationCase_ == 1) { - return (com.google.spanner.v1.Mutation.Write) operation_; - } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + /** + * + * + *
+     * The payload of the message.
+     * 
+ * + * .google.protobuf.Value payload = 4; + * + * @return The payload. + */ + com.google.protobuf.Value getPayload(); + + /** + * + * + *
+     * The payload of the message.
+     * 
+ * + * .google.protobuf.Value payload = 4; + */ + com.google.protobuf.ValueOrBuilder getPayloadOrBuilder(); } /** * * *
-   * Insert new rows in a table. If any of the rows already exist,
-   * the write or transaction fails with error `ALREADY_EXISTS`.
+   * Arguments to [send][google.spanner.v1.Mutation.send] operations.
    * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * Protobuf type {@code google.spanner.v1.Mutation.Send} */ - @java.lang.Override - public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrBuilder() { - if (operationCase_ == 1) { - return (com.google.spanner.v1.Mutation.Write) operation_; + public static final class Send extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.Mutation.Send) + SendOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Send.newBuilder() to construct. + private Send(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); - } - public static final int UPDATE_FIELD_NUMBER = 2; + private Send() { + queue_ = ""; + } - /** - * - * - *
-   * Update existing rows in a table. If any of the rows does not
-   * already exist, the transaction fails with error `NOT_FOUND`.
-   * 
- * - * .google.spanner.v1.Mutation.Write update = 2; - * - * @return Whether the update field is set. - */ - @java.lang.Override - public boolean hasUpdate() { - return operationCase_ == 2; - } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Send(); + } - /** - * - * - *
-   * Update existing rows in a table. If any of the rows does not
-   * already exist, the transaction fails with error `NOT_FOUND`.
-   * 
- * - * .google.spanner.v1.Mutation.Write update = 2; - * - * @return The update. - */ - @java.lang.Override - public com.google.spanner.v1.Mutation.Write getUpdate() { - if (operationCase_ == 2) { - return (com.google.spanner.v1.Mutation.Write) operation_; + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Send_descriptor; } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); - } - /** - * - * - *
-   * Update existing rows in a table. If any of the rows does not
-   * already exist, the transaction fails with error `NOT_FOUND`.
-   * 
- * - * .google.spanner.v1.Mutation.Write update = 2; - */ - @java.lang.Override - public com.google.spanner.v1.Mutation.WriteOrBuilder getUpdateOrBuilder() { - if (operationCase_ == 2) { - return (com.google.spanner.v1.Mutation.Write) operation_; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Send_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Mutation.Send.class, + com.google.spanner.v1.Mutation.Send.Builder.class); } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); - } - public static final int INSERT_OR_UPDATE_FIELD_NUMBER = 3; + private int bitField0_; + public static final int QUEUE_FIELD_NUMBER = 1; - /** - * - * - *
-   * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-   * already exists, then its column values are overwritten with the ones
-   * provided. Any column values not explicitly written are preserved.
-   *
+    @SuppressWarnings("serial")
+    private volatile java.lang.Object queue_ = "";
+
+    /**
+     *
+     *
+     * 
+     * Required. The queue to which the message will be sent.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The queue. + */ + @java.lang.Override + public java.lang.String getQueue() { + java.lang.Object ref = queue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queue_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. The queue to which the message will be sent.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for queue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueueBytes() { + java.lang.Object ref = queue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ListValue key_; + + /** + * + * + *
+     * Required. The primary key of the message to be sent.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the key field is set. + */ + @java.lang.Override + public boolean hasKey() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The primary key of the message to be sent.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ListValue getKey() { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } + + /** + * + * + *
+     * Required. The primary key of the message to be sent.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getKeyOrBuilder() { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } + + public static final int DELIVER_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp deliverTime_; + + /** + * + * + *
+     * The time at which Spanner will begin attempting to deliver the message.
+     * If `deliver_time` is not set, Spanner will deliver the message
+     * immediately. If `deliver_time` is in the past, Spanner will replace it
+     * with a value closer to the current time.
+     * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + * + * @return Whether the deliverTime field is set. + */ + @java.lang.Override + public boolean hasDeliverTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The time at which Spanner will begin attempting to deliver the message.
+     * If `deliver_time` is not set, Spanner will deliver the message
+     * immediately. If `deliver_time` is in the past, Spanner will replace it
+     * with a value closer to the current time.
+     * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + * + * @return The deliverTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeliverTime() { + return deliverTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deliverTime_; + } + + /** + * + * + *
+     * The time at which Spanner will begin attempting to deliver the message.
+     * If `deliver_time` is not set, Spanner will deliver the message
+     * immediately. If `deliver_time` is in the past, Spanner will replace it
+     * with a value closer to the current time.
+     * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeliverTimeOrBuilder() { + return deliverTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deliverTime_; + } + + public static final int PAYLOAD_FIELD_NUMBER = 4; + private com.google.protobuf.Value payload_; + + /** + * + * + *
+     * The payload of the message.
+     * 
+ * + * .google.protobuf.Value payload = 4; + * + * @return Whether the payload field is set. + */ + @java.lang.Override + public boolean hasPayload() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * The payload of the message.
+     * 
+ * + * .google.protobuf.Value payload = 4; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.Value getPayload() { + return payload_ == null ? com.google.protobuf.Value.getDefaultInstance() : payload_; + } + + /** + * + * + *
+     * The payload of the message.
+     * 
+ * + * .google.protobuf.Value payload = 4; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getPayloadOrBuilder() { + return payload_ == null ? com.google.protobuf.Value.getDefaultInstance() : payload_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, queue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getKey()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getDeliverTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getPayload()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, queue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getKey()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getDeliverTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPayload()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.Mutation.Send)) { + return super.equals(obj); + } + com.google.spanner.v1.Mutation.Send other = (com.google.spanner.v1.Mutation.Send) obj; + + if (!getQueue().equals(other.getQueue())) return false; + if (hasKey() != other.hasKey()) return false; + if (hasKey()) { + if (!getKey().equals(other.getKey())) return false; + } + if (hasDeliverTime() != other.hasDeliverTime()) return false; + if (hasDeliverTime()) { + if (!getDeliverTime().equals(other.getDeliverTime())) return false; + } + if (hasPayload() != other.hasPayload()) return false; + if (hasPayload()) { + if (!getPayload().equals(other.getPayload())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + QUEUE_FIELD_NUMBER; + hash = (53 * hash) + getQueue().hashCode(); + if (hasKey()) { + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + } + if (hasDeliverTime()) { + hash = (37 * hash) + DELIVER_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeliverTime().hashCode(); + } + if (hasPayload()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.Mutation.Send parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Send parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Mutation.Send parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Mutation.Send parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.Mutation.Send 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; + } + + /** + * + * + *
+     * Arguments to [send][google.spanner.v1.Mutation.send] operations.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.Mutation.Send} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.Mutation.Send) + com.google.spanner.v1.Mutation.SendOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Send_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Send_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Mutation.Send.class, + com.google.spanner.v1.Mutation.Send.Builder.class); + } + + // Construct using com.google.spanner.v1.Mutation.Send.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getKeyFieldBuilder(); + getDeliverTimeFieldBuilder(); + getPayloadFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queue_ = ""; + key_ = null; + if (keyBuilder_ != null) { + keyBuilder_.dispose(); + keyBuilder_ = null; + } + deliverTime_ = null; + if (deliverTimeBuilder_ != null) { + deliverTimeBuilder_.dispose(); + deliverTimeBuilder_ = null; + } + payload_ = null; + if (payloadBuilder_ != null) { + payloadBuilder_.dispose(); + payloadBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Send_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Send getDefaultInstanceForType() { + return com.google.spanner.v1.Mutation.Send.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Send build() { + com.google.spanner.v1.Mutation.Send result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Send buildPartial() { + com.google.spanner.v1.Mutation.Send result = new com.google.spanner.v1.Mutation.Send(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.Mutation.Send result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.queue_ = queue_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.key_ = keyBuilder_ == null ? key_ : keyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deliverTime_ = + deliverTimeBuilder_ == null ? deliverTime_ : deliverTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.payload_ = payloadBuilder_ == null ? payload_ : payloadBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.Mutation.Send) { + return mergeFrom((com.google.spanner.v1.Mutation.Send) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.Mutation.Send other) { + if (other == com.google.spanner.v1.Mutation.Send.getDefaultInstance()) return this; + if (!other.getQueue().isEmpty()) { + queue_ = other.queue_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasKey()) { + mergeKey(other.getKey()); + } + if (other.hasDeliverTime()) { + mergeDeliverTime(other.getDeliverTime()); + } + if (other.hasPayload()) { + mergePayload(other.getPayload()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + queue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getDeliverTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getPayloadFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object queue_ = ""; + + /** + * + * + *
+       * Required. The queue to which the message will be sent.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The queue. + */ + public java.lang.String getQueue() { + java.lang.Object ref = queue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. The queue to which the message will be sent.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for queue. + */ + public com.google.protobuf.ByteString getQueueBytes() { + java.lang.Object ref = queue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. The queue to which the message will be sent.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The queue to set. + * @return This builder for chaining. + */ + public Builder setQueue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The queue to which the message will be sent.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQueue() { + queue_ = getDefaultInstance().getQueue(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The queue to which the message will be sent.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for queue to set. + * @return This builder for chaining. + */ + public Builder setQueueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ListValue key_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + keyBuilder_; + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the key field is set. + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public com.google.protobuf.ListValue getKey() { + if (keyBuilder_ == null) { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } else { + return keyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setKey(com.google.protobuf.ListValue value) { + if (keyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + } else { + keyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setKey(com.google.protobuf.ListValue.Builder builderForValue) { + if (keyBuilder_ == null) { + key_ = builderForValue.build(); + } else { + keyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeKey(com.google.protobuf.ListValue value) { + if (keyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && key_ != null + && key_ != com.google.protobuf.ListValue.getDefaultInstance()) { + getKeyBuilder().mergeFrom(value); + } else { + key_ = value; + } + } else { + keyBuilder_.mergeFrom(value); + } + if (key_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000002); + key_ = null; + if (keyBuilder_ != null) { + keyBuilder_.dispose(); + keyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.ListValue.Builder getKeyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getKeyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.ListValueOrBuilder getKeyOrBuilder() { + if (keyBuilder_ != null) { + return keyBuilder_.getMessageOrBuilder(); + } else { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } + } + + /** + * + * + *
+       * Required. The primary key of the message to be sent.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + getKeyFieldBuilder() { + if (keyBuilder_ == null) { + keyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + getKey(), getParentForChildren(), isClean()); + key_ = null; + } + return keyBuilder_; + } + + private com.google.protobuf.Timestamp deliverTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deliverTimeBuilder_; + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + * + * @return Whether the deliverTime field is set. + */ + public boolean hasDeliverTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + * + * @return The deliverTime. + */ + public com.google.protobuf.Timestamp getDeliverTime() { + if (deliverTimeBuilder_ == null) { + return deliverTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deliverTime_; + } else { + return deliverTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + public Builder setDeliverTime(com.google.protobuf.Timestamp value) { + if (deliverTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deliverTime_ = value; + } else { + deliverTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + public Builder setDeliverTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deliverTimeBuilder_ == null) { + deliverTime_ = builderForValue.build(); + } else { + deliverTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + public Builder mergeDeliverTime(com.google.protobuf.Timestamp value) { + if (deliverTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && deliverTime_ != null + && deliverTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeliverTimeBuilder().mergeFrom(value); + } else { + deliverTime_ = value; + } + } else { + deliverTimeBuilder_.mergeFrom(value); + } + if (deliverTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + public Builder clearDeliverTime() { + bitField0_ = (bitField0_ & ~0x00000004); + deliverTime_ = null; + if (deliverTimeBuilder_ != null) { + deliverTimeBuilder_.dispose(); + deliverTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getDeliverTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDeliverTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getDeliverTimeOrBuilder() { + if (deliverTimeBuilder_ != null) { + return deliverTimeBuilder_.getMessageOrBuilder(); + } else { + return deliverTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deliverTime_; + } + } + + /** + * + * + *
+       * The time at which Spanner will begin attempting to deliver the message.
+       * If `deliver_time` is not set, Spanner will deliver the message
+       * immediately. If `deliver_time` is in the past, Spanner will replace it
+       * with a value closer to the current time.
+       * 
+ * + * .google.protobuf.Timestamp deliver_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeliverTimeFieldBuilder() { + if (deliverTimeBuilder_ == null) { + deliverTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeliverTime(), getParentForChildren(), isClean()); + deliverTime_ = null; + } + return deliverTimeBuilder_; + } + + private com.google.protobuf.Value payload_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + payloadBuilder_; + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + * + * @return Whether the payload field is set. + */ + public boolean hasPayload() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + * + * @return The payload. + */ + public com.google.protobuf.Value getPayload() { + if (payloadBuilder_ == null) { + return payload_ == null ? com.google.protobuf.Value.getDefaultInstance() : payload_; + } else { + return payloadBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + */ + public Builder setPayload(com.google.protobuf.Value value) { + if (payloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + } else { + payloadBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + */ + public Builder setPayload(com.google.protobuf.Value.Builder builderForValue) { + if (payloadBuilder_ == null) { + payload_ = builderForValue.build(); + } else { + payloadBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + */ + public Builder mergePayload(com.google.protobuf.Value value) { + if (payloadBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && payload_ != null + && payload_ != com.google.protobuf.Value.getDefaultInstance()) { + getPayloadBuilder().mergeFrom(value); + } else { + payload_ = value; + } + } else { + payloadBuilder_.mergeFrom(value); + } + if (payload_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000008); + payload_ = null; + if (payloadBuilder_ != null) { + payloadBuilder_.dispose(); + payloadBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + */ + public com.google.protobuf.Value.Builder getPayloadBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getPayloadFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + */ + public com.google.protobuf.ValueOrBuilder getPayloadOrBuilder() { + if (payloadBuilder_ != null) { + return payloadBuilder_.getMessageOrBuilder(); + } else { + return payload_ == null ? com.google.protobuf.Value.getDefaultInstance() : payload_; + } + } + + /** + * + * + *
+       * The payload of the message.
+       * 
+ * + * .google.protobuf.Value payload = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getPayloadFieldBuilder() { + if (payloadBuilder_ == null) { + payloadBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getPayload(), getParentForChildren(), isClean()); + payload_ = null; + } + return payloadBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.Mutation.Send) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.Mutation.Send) + private static final com.google.spanner.v1.Mutation.Send DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.Mutation.Send(); + } + + public static com.google.spanner.v1.Mutation.Send getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Send parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Send getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AckOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.Mutation.Ack) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The queue where the message to be acked is stored.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The queue. + */ + java.lang.String getQueue(); + + /** + * + * + *
+     * Required. The queue where the message to be acked is stored.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for queue. + */ + com.google.protobuf.ByteString getQueueBytes(); + + /** + * + * + *
+     * Required. The primary key of the message to be acked.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the key field is set. + */ + boolean hasKey(); + + /** + * + * + *
+     * Required. The primary key of the message to be acked.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + com.google.protobuf.ListValue getKey(); + + /** + * + * + *
+     * Required. The primary key of the message to be acked.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.protobuf.ListValueOrBuilder getKeyOrBuilder(); + + /** + * + * + *
+     * By default, an attempt to ack a message that does not exist will fail
+     * with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack
+     * will succeed even if the message does not exist. This is useful for
+     * unconditionally acking a message, even if it is missing or has already
+     * been acked.
+     * 
+ * + * bool ignore_not_found = 3; + * + * @return The ignoreNotFound. + */ + boolean getIgnoreNotFound(); + } + + /** + * + * + *
+   * Arguments to [ack][google.spanner.v1.Mutation.ack] operations.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.Mutation.Ack} + */ + public static final class Ack extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.Mutation.Ack) + AckOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Ack.newBuilder() to construct. + private Ack(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Ack() { + queue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Ack(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Ack_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Ack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Mutation.Ack.class, + com.google.spanner.v1.Mutation.Ack.Builder.class); + } + + private int bitField0_; + public static final int QUEUE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object queue_ = ""; + + /** + * + * + *
+     * Required. The queue where the message to be acked is stored.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The queue. + */ + @java.lang.Override + public java.lang.String getQueue() { + java.lang.Object ref = queue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queue_ = s; + return s; + } + } + + /** + * + * + *
+     * Required. The queue where the message to be acked is stored.
+     * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for queue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueueBytes() { + java.lang.Object ref = queue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ListValue key_; + + /** + * + * + *
+     * Required. The primary key of the message to be acked.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the key field is set. + */ + @java.lang.Override + public boolean hasKey() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The primary key of the message to be acked.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ListValue getKey() { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } + + /** + * + * + *
+     * Required. The primary key of the message to be acked.
+     * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getKeyOrBuilder() { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } + + public static final int IGNORE_NOT_FOUND_FIELD_NUMBER = 3; + private boolean ignoreNotFound_ = false; + + /** + * + * + *
+     * By default, an attempt to ack a message that does not exist will fail
+     * with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack
+     * will succeed even if the message does not exist. This is useful for
+     * unconditionally acking a message, even if it is missing or has already
+     * been acked.
+     * 
+ * + * bool ignore_not_found = 3; + * + * @return The ignoreNotFound. + */ + @java.lang.Override + public boolean getIgnoreNotFound() { + return ignoreNotFound_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, queue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getKey()); + } + if (ignoreNotFound_ != false) { + output.writeBool(3, ignoreNotFound_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, queue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getKey()); + } + if (ignoreNotFound_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreNotFound_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.Mutation.Ack)) { + return super.equals(obj); + } + com.google.spanner.v1.Mutation.Ack other = (com.google.spanner.v1.Mutation.Ack) obj; + + if (!getQueue().equals(other.getQueue())) return false; + if (hasKey() != other.hasKey()) return false; + if (hasKey()) { + if (!getKey().equals(other.getKey())) return false; + } + if (getIgnoreNotFound() != other.getIgnoreNotFound()) 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) + QUEUE_FIELD_NUMBER; + hash = (53 * hash) + getQueue().hashCode(); + if (hasKey()) { + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + } + hash = (37 * hash) + IGNORE_NOT_FOUND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreNotFound()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Ack parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Mutation.Ack parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Mutation.Ack parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.Mutation.Ack 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; + } + + /** + * + * + *
+     * Arguments to [ack][google.spanner.v1.Mutation.ack] operations.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.Mutation.Ack} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.Mutation.Ack) + com.google.spanner.v1.Mutation.AckOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Ack_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Ack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Mutation.Ack.class, + com.google.spanner.v1.Mutation.Ack.Builder.class); + } + + // Construct using com.google.spanner.v1.Mutation.Ack.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getKeyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queue_ = ""; + key_ = null; + if (keyBuilder_ != null) { + keyBuilder_.dispose(); + keyBuilder_ = null; + } + ignoreNotFound_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_Ack_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Ack getDefaultInstanceForType() { + return com.google.spanner.v1.Mutation.Ack.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Ack build() { + com.google.spanner.v1.Mutation.Ack result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Ack buildPartial() { + com.google.spanner.v1.Mutation.Ack result = new com.google.spanner.v1.Mutation.Ack(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.Mutation.Ack result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.queue_ = queue_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.key_ = keyBuilder_ == null ? key_ : keyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreNotFound_ = ignoreNotFound_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.Mutation.Ack) { + return mergeFrom((com.google.spanner.v1.Mutation.Ack) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.Mutation.Ack other) { + if (other == com.google.spanner.v1.Mutation.Ack.getDefaultInstance()) return this; + if (!other.getQueue().isEmpty()) { + queue_ = other.queue_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasKey()) { + mergeKey(other.getKey()); + } + if (other.getIgnoreNotFound() != false) { + setIgnoreNotFound(other.getIgnoreNotFound()); + } + 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: + { + queue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + ignoreNotFound_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object queue_ = ""; + + /** + * + * + *
+       * Required. The queue where the message to be acked is stored.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The queue. + */ + public java.lang.String getQueue() { + java.lang.Object ref = queue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Required. The queue where the message to be acked is stored.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for queue. + */ + public com.google.protobuf.ByteString getQueueBytes() { + java.lang.Object ref = queue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Required. The queue where the message to be acked is stored.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The queue to set. + * @return This builder for chaining. + */ + public Builder setQueue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The queue where the message to be acked is stored.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQueue() { + queue_ = getDefaultInstance().getQueue(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The queue where the message to be acked is stored.
+       * 
+ * + * string queue = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for queue to set. + * @return This builder for chaining. + */ + public Builder setQueueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ListValue key_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + keyBuilder_; + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the key field is set. + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + public com.google.protobuf.ListValue getKey() { + if (keyBuilder_ == null) { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } else { + return keyBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setKey(com.google.protobuf.ListValue value) { + if (keyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + } else { + keyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setKey(com.google.protobuf.ListValue.Builder builderForValue) { + if (keyBuilder_ == null) { + key_ = builderForValue.build(); + } else { + keyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeKey(com.google.protobuf.ListValue value) { + if (keyBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && key_ != null + && key_ != com.google.protobuf.ListValue.getDefaultInstance()) { + getKeyBuilder().mergeFrom(value); + } else { + key_ = value; + } + } else { + keyBuilder_.mergeFrom(value); + } + if (key_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000002); + key_ = null; + if (keyBuilder_ != null) { + keyBuilder_.dispose(); + keyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.ListValue.Builder getKeyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getKeyFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.protobuf.ListValueOrBuilder getKeyOrBuilder() { + if (keyBuilder_ != null) { + return keyBuilder_.getMessageOrBuilder(); + } else { + return key_ == null ? com.google.protobuf.ListValue.getDefaultInstance() : key_; + } + } + + /** + * + * + *
+       * Required. The primary key of the message to be acked.
+       * 
+ * + * .google.protobuf.ListValue key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + getKeyFieldBuilder() { + if (keyBuilder_ == null) { + keyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + getKey(), getParentForChildren(), isClean()); + key_ = null; + } + return keyBuilder_; + } + + private boolean ignoreNotFound_; + + /** + * + * + *
+       * By default, an attempt to ack a message that does not exist will fail
+       * with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack
+       * will succeed even if the message does not exist. This is useful for
+       * unconditionally acking a message, even if it is missing or has already
+       * been acked.
+       * 
+ * + * bool ignore_not_found = 3; + * + * @return The ignoreNotFound. + */ + @java.lang.Override + public boolean getIgnoreNotFound() { + return ignoreNotFound_; + } + + /** + * + * + *
+       * By default, an attempt to ack a message that does not exist will fail
+       * with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack
+       * will succeed even if the message does not exist. This is useful for
+       * unconditionally acking a message, even if it is missing or has already
+       * been acked.
+       * 
+ * + * bool ignore_not_found = 3; + * + * @param value The ignoreNotFound to set. + * @return This builder for chaining. + */ + public Builder setIgnoreNotFound(boolean value) { + + ignoreNotFound_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * By default, an attempt to ack a message that does not exist will fail
+       * with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack
+       * will succeed even if the message does not exist. This is useful for
+       * unconditionally acking a message, even if it is missing or has already
+       * been acked.
+       * 
+ * + * bool ignore_not_found = 3; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreNotFound() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreNotFound_ = 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.spanner.v1.Mutation.Ack) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.Mutation.Ack) + private static final com.google.spanner.v1.Mutation.Ack DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.Mutation.Ack(); + } + + public static com.google.spanner.v1.Mutation.Ack getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Ack parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation.Ack getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int operationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object operation_; + + public enum OperationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INSERT(1), + UPDATE(2), + INSERT_OR_UPDATE(3), + REPLACE(4), + DELETE(5), + SEND(6), + ACK(7), + OPERATION_NOT_SET(0); + private final int value; + + private OperationCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OperationCase valueOf(int value) { + return forNumber(value); + } + + public static OperationCase forNumber(int value) { + switch (value) { + case 1: + return INSERT; + case 2: + return UPDATE; + case 3: + return INSERT_OR_UPDATE; + case 4: + return REPLACE; + case 5: + return DELETE; + case 6: + return SEND; + case 7: + return ACK; + case 0: + return OPERATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OperationCase getOperationCase() { + return OperationCase.forNumber(operationCase_); + } + + public static final int INSERT_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Insert new rows in a table. If any of the rows already exist,
+   * the write or transaction fails with error `ALREADY_EXISTS`.
+   * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + * + * @return Whether the insert field is set. + */ + @java.lang.Override + public boolean hasInsert() { + return operationCase_ == 1; + } + + /** + * + * + *
+   * Insert new rows in a table. If any of the rows already exist,
+   * the write or transaction fails with error `ALREADY_EXISTS`.
+   * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + * + * @return The insert. + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.Write getInsert() { + if (operationCase_ == 1) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } + + /** + * + * + *
+   * Insert new rows in a table. If any of the rows already exist,
+   * the write or transaction fails with error `ALREADY_EXISTS`.
+   * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrBuilder() { + if (operationCase_ == 1) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } + + public static final int UPDATE_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Update existing rows in a table. If any of the rows does not
+   * already exist, the transaction fails with error `NOT_FOUND`.
+   * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + * + * @return Whether the update field is set. + */ + @java.lang.Override + public boolean hasUpdate() { + return operationCase_ == 2; + } + + /** + * + * + *
+   * Update existing rows in a table. If any of the rows does not
+   * already exist, the transaction fails with error `NOT_FOUND`.
+   * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + * + * @return The update. + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.Write getUpdate() { + if (operationCase_ == 2) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } + + /** + * + * + *
+   * Update existing rows in a table. If any of the rows does not
+   * already exist, the transaction fails with error `NOT_FOUND`.
+   * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.WriteOrBuilder getUpdateOrBuilder() { + if (operationCase_ == 2) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } + + public static final int INSERT_OR_UPDATE_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+   * already exists, then its column values are overwritten with the ones
+   * provided. Any column values not explicitly written are preserved.
+   *
    * When using
    * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
    * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
@@ -3344,68 +6088,176 @@ public com.google.spanner.v1.Mutation.Write getReplace() {
    * .google.spanner.v1.Mutation.Write replace = 4;
    */
   @java.lang.Override
-  public com.google.spanner.v1.Mutation.WriteOrBuilder getReplaceOrBuilder() {
-    if (operationCase_ == 4) {
-      return (com.google.spanner.v1.Mutation.Write) operation_;
+  public com.google.spanner.v1.Mutation.WriteOrBuilder getReplaceOrBuilder() {
+    if (operationCase_ == 4) {
+      return (com.google.spanner.v1.Mutation.Write) operation_;
+    }
+    return com.google.spanner.v1.Mutation.Write.getDefaultInstance();
+  }
+
+  public static final int DELETE_FIELD_NUMBER = 5;
+
+  /**
+   *
+   *
+   * 
+   * Delete rows from a table. Succeeds whether or not the named
+   * rows were present.
+   * 
+ * + * .google.spanner.v1.Mutation.Delete delete = 5; + * + * @return Whether the delete field is set. + */ + @java.lang.Override + public boolean hasDelete() { + return operationCase_ == 5; + } + + /** + * + * + *
+   * Delete rows from a table. Succeeds whether or not the named
+   * rows were present.
+   * 
+ * + * .google.spanner.v1.Mutation.Delete delete = 5; + * + * @return The delete. + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.Delete getDelete() { + if (operationCase_ == 5) { + return (com.google.spanner.v1.Mutation.Delete) operation_; + } + return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + } + + /** + * + * + *
+   * Delete rows from a table. Succeeds whether or not the named
+   * rows were present.
+   * 
+ * + * .google.spanner.v1.Mutation.Delete delete = 5; + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.DeleteOrBuilder getDeleteOrBuilder() { + if (operationCase_ == 5) { + return (com.google.spanner.v1.Mutation.Delete) operation_; + } + return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + } + + public static final int SEND_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Send a message to a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Send send = 6; + * + * @return Whether the send field is set. + */ + @java.lang.Override + public boolean hasSend() { + return operationCase_ == 6; + } + + /** + * + * + *
+   * Send a message to a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Send send = 6; + * + * @return The send. + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.Send getSend() { + if (operationCase_ == 6) { + return (com.google.spanner.v1.Mutation.Send) operation_; + } + return com.google.spanner.v1.Mutation.Send.getDefaultInstance(); + } + + /** + * + * + *
+   * Send a message to a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Send send = 6; + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.SendOrBuilder getSendOrBuilder() { + if (operationCase_ == 6) { + return (com.google.spanner.v1.Mutation.Send) operation_; } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Send.getDefaultInstance(); } - public static final int DELETE_FIELD_NUMBER = 5; + public static final int ACK_FIELD_NUMBER = 7; /** * * *
-   * Delete rows from a table. Succeeds whether or not the named
-   * rows were present.
+   * Ack a message from a queue.
    * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; * - * @return Whether the delete field is set. + * @return Whether the ack field is set. */ @java.lang.Override - public boolean hasDelete() { - return operationCase_ == 5; + public boolean hasAck() { + return operationCase_ == 7; } /** * * *
-   * Delete rows from a table. Succeeds whether or not the named
-   * rows were present.
+   * Ack a message from a queue.
    * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; * - * @return The delete. + * @return The ack. */ @java.lang.Override - public com.google.spanner.v1.Mutation.Delete getDelete() { - if (operationCase_ == 5) { - return (com.google.spanner.v1.Mutation.Delete) operation_; + public com.google.spanner.v1.Mutation.Ack getAck() { + if (operationCase_ == 7) { + return (com.google.spanner.v1.Mutation.Ack) operation_; } - return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Ack.getDefaultInstance(); } /** * * *
-   * Delete rows from a table. Succeeds whether or not the named
-   * rows were present.
+   * Ack a message from a queue.
    * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ @java.lang.Override - public com.google.spanner.v1.Mutation.DeleteOrBuilder getDeleteOrBuilder() { - if (operationCase_ == 5) { - return (com.google.spanner.v1.Mutation.Delete) operation_; + public com.google.spanner.v1.Mutation.AckOrBuilder getAckOrBuilder() { + if (operationCase_ == 7) { + return (com.google.spanner.v1.Mutation.Ack) operation_; } - return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Ack.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -3437,6 +6289,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (operationCase_ == 5) { output.writeMessage(5, (com.google.spanner.v1.Mutation.Delete) operation_); } + if (operationCase_ == 6) { + output.writeMessage(6, (com.google.spanner.v1.Mutation.Send) operation_); + } + if (operationCase_ == 7) { + output.writeMessage(7, (com.google.spanner.v1.Mutation.Ack) operation_); + } getUnknownFields().writeTo(output); } @@ -3471,6 +6329,16 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 5, (com.google.spanner.v1.Mutation.Delete) operation_); } + if (operationCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.spanner.v1.Mutation.Send) operation_); + } + if (operationCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.spanner.v1.Mutation.Ack) operation_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -3503,6 +6371,12 @@ public boolean equals(final java.lang.Object obj) { case 5: if (!getDelete().equals(other.getDelete())) return false; break; + case 6: + if (!getSend().equals(other.getSend())) return false; + break; + case 7: + if (!getAck().equals(other.getAck())) return false; + break; case 0: default: } @@ -3538,6 +6412,14 @@ public int hashCode() { hash = (37 * hash) + DELETE_FIELD_NUMBER; hash = (53 * hash) + getDelete().hashCode(); break; + case 6: + hash = (37 * hash) + SEND_FIELD_NUMBER; + hash = (53 * hash) + getSend().hashCode(); + break; + case 7: + hash = (37 * hash) + ACK_FIELD_NUMBER; + hash = (53 * hash) + getAck().hashCode(); + break; case 0: default: } @@ -3670,302 +6552,802 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.spanner.v1.Mutation.class, com.google.spanner.v1.Mutation.Builder.class); } - // Construct using com.google.spanner.v1.Mutation.newBuilder() - private Builder() {} + // Construct using com.google.spanner.v1.Mutation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (insertBuilder_ != null) { + insertBuilder_.clear(); + } + if (updateBuilder_ != null) { + updateBuilder_.clear(); + } + if (insertOrUpdateBuilder_ != null) { + insertOrUpdateBuilder_.clear(); + } + if (replaceBuilder_ != null) { + replaceBuilder_.clear(); + } + if (deleteBuilder_ != null) { + deleteBuilder_.clear(); + } + if (sendBuilder_ != null) { + sendBuilder_.clear(); + } + if (ackBuilder_ != null) { + ackBuilder_.clear(); + } + operationCase_ = 0; + operation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.MutationProto + .internal_static_google_spanner_v1_Mutation_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation getDefaultInstanceForType() { + return com.google.spanner.v1.Mutation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.Mutation build() { + com.google.spanner.v1.Mutation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.Mutation buildPartial() { + com.google.spanner.v1.Mutation result = new com.google.spanner.v1.Mutation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.Mutation result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.spanner.v1.Mutation result) { + result.operationCase_ = operationCase_; + result.operation_ = this.operation_; + if (operationCase_ == 1 && insertBuilder_ != null) { + result.operation_ = insertBuilder_.build(); + } + if (operationCase_ == 2 && updateBuilder_ != null) { + result.operation_ = updateBuilder_.build(); + } + if (operationCase_ == 3 && insertOrUpdateBuilder_ != null) { + result.operation_ = insertOrUpdateBuilder_.build(); + } + if (operationCase_ == 4 && replaceBuilder_ != null) { + result.operation_ = replaceBuilder_.build(); + } + if (operationCase_ == 5 && deleteBuilder_ != null) { + result.operation_ = deleteBuilder_.build(); + } + if (operationCase_ == 6 && sendBuilder_ != null) { + result.operation_ = sendBuilder_.build(); + } + if (operationCase_ == 7 && ackBuilder_ != null) { + result.operation_ = ackBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.Mutation) { + return mergeFrom((com.google.spanner.v1.Mutation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.Mutation other) { + if (other == com.google.spanner.v1.Mutation.getDefaultInstance()) return this; + switch (other.getOperationCase()) { + case INSERT: + { + mergeInsert(other.getInsert()); + break; + } + case UPDATE: + { + mergeUpdate(other.getUpdate()); + break; + } + case INSERT_OR_UPDATE: + { + mergeInsertOrUpdate(other.getInsertOrUpdate()); + break; + } + case REPLACE: + { + mergeReplace(other.getReplace()); + break; + } + case DELETE: + { + mergeDelete(other.getDelete()); + break; + } + case SEND: + { + mergeSend(other.getSend()); + break; + } + case ACK: + { + mergeAck(other.getAck()); + break; + } + case OPERATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getInsertFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getInsertOrUpdateFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getReplaceFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getDeleteFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getSendFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getAckFieldBuilder().getBuilder(), extensionRegistry); + operationCase_ = 7; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int operationCase_ = 0; + private java.lang.Object operation_; - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + public OperationCase getOperationCase() { + return OperationCase.forNumber(operationCase_); } - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (insertBuilder_ != null) { - insertBuilder_.clear(); - } - if (updateBuilder_ != null) { - updateBuilder_.clear(); - } - if (insertOrUpdateBuilder_ != null) { - insertOrUpdateBuilder_.clear(); - } - if (replaceBuilder_ != null) { - replaceBuilder_.clear(); - } - if (deleteBuilder_ != null) { - deleteBuilder_.clear(); - } + public Builder clearOperation() { operationCase_ = 0; operation_ = null; + onChanged(); return this; } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.spanner.v1.MutationProto - .internal_static_google_spanner_v1_Mutation_descriptor; - } + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Mutation.Write, + com.google.spanner.v1.Mutation.Write.Builder, + com.google.spanner.v1.Mutation.WriteOrBuilder> + insertBuilder_; + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + * + * @return Whether the insert field is set. + */ @java.lang.Override - public com.google.spanner.v1.Mutation getDefaultInstanceForType() { - return com.google.spanner.v1.Mutation.getDefaultInstance(); + public boolean hasInsert() { + return operationCase_ == 1; } + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + * + * @return The insert. + */ @java.lang.Override - public com.google.spanner.v1.Mutation build() { - com.google.spanner.v1.Mutation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + public com.google.spanner.v1.Mutation.Write getInsert() { + if (insertBuilder_ == null) { + if (operationCase_ == 1) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } else { + if (operationCase_ == 1) { + return insertBuilder_.getMessage(); + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } - return result; } - @java.lang.Override - public com.google.spanner.v1.Mutation buildPartial() { - com.google.spanner.v1.Mutation result = new com.google.spanner.v1.Mutation(this); - if (bitField0_ != 0) { - buildPartial0(result); + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ + public Builder setInsert(com.google.spanner.v1.Mutation.Write value) { + if (insertBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + insertBuilder_.setMessage(value); } - buildPartialOneofs(result); - onBuilt(); - return result; + operationCase_ = 1; + return this; } - private void buildPartial0(com.google.spanner.v1.Mutation result) { - int from_bitField0_ = bitField0_; + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ + public Builder setInsert(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { + if (insertBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + insertBuilder_.setMessage(builderForValue.build()); + } + operationCase_ = 1; + return this; } - private void buildPartialOneofs(com.google.spanner.v1.Mutation result) { - result.operationCase_ = operationCase_; - result.operation_ = this.operation_; - if (operationCase_ == 1 && insertBuilder_ != null) { - result.operation_ = insertBuilder_.build(); - } - if (operationCase_ == 2 && updateBuilder_ != null) { - result.operation_ = updateBuilder_.build(); - } - if (operationCase_ == 3 && insertOrUpdateBuilder_ != null) { - result.operation_ = insertOrUpdateBuilder_.build(); - } - if (operationCase_ == 4 && replaceBuilder_ != null) { - result.operation_ = replaceBuilder_.build(); - } - if (operationCase_ == 5 && deleteBuilder_ != null) { - result.operation_ = deleteBuilder_.build(); + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ + public Builder mergeInsert(com.google.spanner.v1.Mutation.Write value) { + if (insertBuilder_ == null) { + if (operationCase_ == 1 + && operation_ != com.google.spanner.v1.Mutation.Write.getDefaultInstance()) { + operation_ = + com.google.spanner.v1.Mutation.Write.newBuilder( + (com.google.spanner.v1.Mutation.Write) operation_) + .mergeFrom(value) + .buildPartial(); + } else { + operation_ = value; + } + onChanged(); + } else { + if (operationCase_ == 1) { + insertBuilder_.mergeFrom(value); + } else { + insertBuilder_.setMessage(value); + } } + operationCase_ = 1; + return this; } - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ + public Builder clearInsert() { + if (insertBuilder_ == null) { + if (operationCase_ == 1) { + operationCase_ = 0; + operation_ = null; + onChanged(); + } + } else { + if (operationCase_ == 1) { + operationCase_ = 0; + operation_ = null; + } + insertBuilder_.clear(); + } + return this; } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ + public com.google.spanner.v1.Mutation.Write.Builder getInsertBuilder() { + return getInsertFieldBuilder().getBuilder(); } + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrBuilder() { + if ((operationCase_ == 1) && (insertBuilder_ != null)) { + return insertBuilder_.getMessageOrBuilder(); + } else { + if (operationCase_ == 1) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
+     * Insert new rows in a table. If any of the rows already exist,
+     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write insert = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Mutation.Write, + com.google.spanner.v1.Mutation.Write.Builder, + com.google.spanner.v1.Mutation.WriteOrBuilder> + getInsertFieldBuilder() { + if (insertBuilder_ == null) { + if (!(operationCase_ == 1)) { + operation_ = com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } + insertBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Mutation.Write, + com.google.spanner.v1.Mutation.Write.Builder, + com.google.spanner.v1.Mutation.WriteOrBuilder>( + (com.google.spanner.v1.Mutation.Write) operation_, + getParentForChildren(), + isClean()); + operation_ = null; + } + operationCase_ = 1; + onChanged(); + return insertBuilder_; } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Mutation.Write, + com.google.spanner.v1.Mutation.Write.Builder, + com.google.spanner.v1.Mutation.WriteOrBuilder> + updateBuilder_; + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + * + * @return Whether the update field is set. + */ @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + public boolean hasUpdate() { + return operationCase_ == 2; } + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + * + * @return The update. + */ @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.spanner.v1.Mutation) { - return mergeFrom((com.google.spanner.v1.Mutation) other); + public com.google.spanner.v1.Mutation.Write getUpdate() { + if (updateBuilder_ == null) { + if (operationCase_ == 2) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } else { - super.mergeFrom(other); - return this; + if (operationCase_ == 2) { + return updateBuilder_.getMessage(); + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } } - public Builder mergeFrom(com.google.spanner.v1.Mutation other) { - if (other == com.google.spanner.v1.Mutation.getDefaultInstance()) return this; - switch (other.getOperationCase()) { - case INSERT: - { - mergeInsert(other.getInsert()); - break; - } - case UPDATE: - { - mergeUpdate(other.getUpdate()); - break; - } - case INSERT_OR_UPDATE: - { - mergeInsertOrUpdate(other.getInsertOrUpdate()); - break; - } - case REPLACE: - { - mergeReplace(other.getReplace()); - break; - } - case DELETE: - { - mergeDelete(other.getDelete()); - break; - } - case OPERATION_NOT_SET: - { - break; - } + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + public Builder setUpdate(com.google.spanner.v1.Mutation.Write value) { + if (updateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + onChanged(); + } else { + updateBuilder_.setMessage(value); } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); + operationCase_ = 2; return this; } - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + public Builder setUpdate(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { + if (updateBuilder_ == null) { + operation_ = builderForValue.build(); + onChanged(); + } else { + updateBuilder_.setMessage(builderForValue.build()); + } + operationCase_ = 2; + return this; } - @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(getInsertFieldBuilder().getBuilder(), extensionRegistry); - operationCase_ = 1; - break; - } // case 10 - case 18: - { - input.readMessage(getUpdateFieldBuilder().getBuilder(), extensionRegistry); - operationCase_ = 2; - break; - } // case 18 - case 26: - { - input.readMessage(getInsertOrUpdateFieldBuilder().getBuilder(), extensionRegistry); - operationCase_ = 3; - break; - } // case 26 - case 34: - { - input.readMessage(getReplaceFieldBuilder().getBuilder(), extensionRegistry); - operationCase_ = 4; - break; - } // case 34 - case 42: - { - input.readMessage(getDeleteFieldBuilder().getBuilder(), extensionRegistry); - operationCase_ = 5; - 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 { + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + public Builder mergeUpdate(com.google.spanner.v1.Mutation.Write value) { + if (updateBuilder_ == null) { + if (operationCase_ == 2 + && operation_ != com.google.spanner.v1.Mutation.Write.getDefaultInstance()) { + operation_ = + com.google.spanner.v1.Mutation.Write.newBuilder( + (com.google.spanner.v1.Mutation.Write) operation_) + .mergeFrom(value) + .buildPartial(); + } else { + operation_ = value; + } onChanged(); - } // finally + } else { + if (operationCase_ == 2) { + updateBuilder_.mergeFrom(value); + } else { + updateBuilder_.setMessage(value); + } + } + operationCase_ = 2; return this; } - private int operationCase_ = 0; - private java.lang.Object operation_; + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + public Builder clearUpdate() { + if (updateBuilder_ == null) { + if (operationCase_ == 2) { + operationCase_ = 0; + operation_ = null; + onChanged(); + } + } else { + if (operationCase_ == 2) { + operationCase_ = 0; + operation_ = null; + } + updateBuilder_.clear(); + } + return this; + } - public OperationCase getOperationCase() { - return OperationCase.forNumber(operationCase_); + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + public com.google.spanner.v1.Mutation.Write.Builder getUpdateBuilder() { + return getUpdateFieldBuilder().getBuilder(); } - public Builder clearOperation() { - operationCase_ = 0; - operation_ = null; - onChanged(); - return this; + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + @java.lang.Override + public com.google.spanner.v1.Mutation.WriteOrBuilder getUpdateOrBuilder() { + if ((operationCase_ == 2) && (updateBuilder_ != null)) { + return updateBuilder_.getMessageOrBuilder(); + } else { + if (operationCase_ == 2) { + return (com.google.spanner.v1.Mutation.Write) operation_; + } + return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } } - private int bitField0_; + /** + * + * + *
+     * Update existing rows in a table. If any of the rows does not
+     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+ * + * .google.spanner.v1.Mutation.Write update = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Mutation.Write, + com.google.spanner.v1.Mutation.Write.Builder, + com.google.spanner.v1.Mutation.WriteOrBuilder> + getUpdateFieldBuilder() { + if (updateBuilder_ == null) { + if (!(operationCase_ == 2)) { + operation_ = com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + } + updateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.Mutation.Write, + com.google.spanner.v1.Mutation.Write.Builder, + com.google.spanner.v1.Mutation.WriteOrBuilder>( + (com.google.spanner.v1.Mutation.Write) operation_, + getParentForChildren(), + isClean()); + operation_ = null; + } + operationCase_ = 2; + onChanged(); + return updateBuilder_; + } private com.google.protobuf.SingleFieldBuilderV3< com.google.spanner.v1.Mutation.Write, com.google.spanner.v1.Mutation.Write.Builder, com.google.spanner.v1.Mutation.WriteOrBuilder> - insertBuilder_; + insertOrUpdateBuilder_; /** * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; * - * @return Whether the insert field is set. + * @return Whether the insertOrUpdate field is set. */ @java.lang.Override - public boolean hasInsert() { - return operationCase_ == 1; + public boolean hasInsertOrUpdate() { + return operationCase_ == 3; } /** * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; * - * @return The insert. + * @return The insertOrUpdate. */ @java.lang.Override - public com.google.spanner.v1.Mutation.Write getInsert() { - if (insertBuilder_ == null) { - if (operationCase_ == 1) { + public com.google.spanner.v1.Mutation.Write getInsertOrUpdate() { + if (insertOrUpdateBuilder_ == null) { + if (operationCase_ == 3) { return (com.google.spanner.v1.Mutation.Write) operation_; } return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } else { - if (operationCase_ == 1) { - return insertBuilder_.getMessage(); + if (operationCase_ == 3) { + return insertOrUpdateBuilder_.getMessage(); } return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } @@ -3975,23 +7357,30 @@ public com.google.spanner.v1.Mutation.Write getInsert() { * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; */ - public Builder setInsert(com.google.spanner.v1.Mutation.Write value) { - if (insertBuilder_ == null) { + public Builder setInsertOrUpdate(com.google.spanner.v1.Mutation.Write value) { + if (insertOrUpdateBuilder_ == null) { if (value == null) { throw new NullPointerException(); } operation_ = value; onChanged(); } else { - insertBuilder_.setMessage(value); + insertOrUpdateBuilder_.setMessage(value); } - operationCase_ = 1; + operationCase_ = 3; return this; } @@ -3999,20 +7388,27 @@ public Builder setInsert(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; */ - public Builder setInsert(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { - if (insertBuilder_ == null) { + public Builder setInsertOrUpdate(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { + if (insertOrUpdateBuilder_ == null) { operation_ = builderForValue.build(); onChanged(); } else { - insertBuilder_.setMessage(builderForValue.build()); + insertOrUpdateBuilder_.setMessage(builderForValue.build()); } - operationCase_ = 1; + operationCase_ = 3; return this; } @@ -4020,15 +7416,22 @@ public Builder setInsert(com.google.spanner.v1.Mutation.Write.Builder builderFor * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; */ - public Builder mergeInsert(com.google.spanner.v1.Mutation.Write value) { - if (insertBuilder_ == null) { - if (operationCase_ == 1 + public Builder mergeInsertOrUpdate(com.google.spanner.v1.Mutation.Write value) { + if (insertOrUpdateBuilder_ == null) { + if (operationCase_ == 3 && operation_ != com.google.spanner.v1.Mutation.Write.getDefaultInstance()) { operation_ = com.google.spanner.v1.Mutation.Write.newBuilder( @@ -4040,13 +7443,13 @@ public Builder mergeInsert(com.google.spanner.v1.Mutation.Write value) { } onChanged(); } else { - if (operationCase_ == 1) { - insertBuilder_.mergeFrom(value); + if (operationCase_ == 3) { + insertOrUpdateBuilder_.mergeFrom(value); } else { - insertBuilder_.setMessage(value); + insertOrUpdateBuilder_.setMessage(value); } } - operationCase_ = 1; + operationCase_ = 3; return this; } @@ -4054,25 +7457,32 @@ public Builder mergeInsert(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; */ - public Builder clearInsert() { - if (insertBuilder_ == null) { - if (operationCase_ == 1) { + public Builder clearInsertOrUpdate() { + if (insertOrUpdateBuilder_ == null) { + if (operationCase_ == 3) { operationCase_ = 0; operation_ = null; onChanged(); } } else { - if (operationCase_ == 1) { + if (operationCase_ == 3) { operationCase_ = 0; operation_ = null; } - insertBuilder_.clear(); + insertOrUpdateBuilder_.clear(); } return this; } @@ -4081,32 +7491,46 @@ public Builder clearInsert() { * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; */ - public com.google.spanner.v1.Mutation.Write.Builder getInsertBuilder() { - return getInsertFieldBuilder().getBuilder(); + public com.google.spanner.v1.Mutation.Write.Builder getInsertOrUpdateBuilder() { + return getInsertOrUpdateFieldBuilder().getBuilder(); } /** * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; */ @java.lang.Override - public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrBuilder() { - if ((operationCase_ == 1) && (insertBuilder_ != null)) { - return insertBuilder_.getMessageOrBuilder(); + public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrUpdateOrBuilder() { + if ((operationCase_ == 3) && (insertOrUpdateBuilder_ != null)) { + return insertOrUpdateBuilder_.getMessageOrBuilder(); } else { - if (operationCase_ == 1) { + if (operationCase_ == 3) { return (com.google.spanner.v1.Mutation.Write) operation_; } return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); @@ -4117,22 +7541,29 @@ public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrBuilder() { * * *
-     * Insert new rows in a table. If any of the rows already exist,
-     * the write or transaction fails with error `ALREADY_EXISTS`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, then its column values are overwritten with the ones
+     * provided. Any column values not explicitly written are preserved.
+     *
+     * When using
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
+     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
+     * columns in the table must be given a value. This holds true even when the
+     * row already exists and will therefore actually be updated.
      * 
* - * .google.spanner.v1.Mutation.Write insert = 1; + * .google.spanner.v1.Mutation.Write insert_or_update = 3; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.spanner.v1.Mutation.Write, com.google.spanner.v1.Mutation.Write.Builder, com.google.spanner.v1.Mutation.WriteOrBuilder> - getInsertFieldBuilder() { - if (insertBuilder_ == null) { - if (!(operationCase_ == 1)) { + getInsertOrUpdateFieldBuilder() { + if (insertOrUpdateBuilder_ == null) { + if (!(operationCase_ == 3)) { operation_ = com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } - insertBuilder_ = + insertOrUpdateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.spanner.v1.Mutation.Write, com.google.spanner.v1.Mutation.Write.Builder, @@ -4142,56 +7573,72 @@ public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrBuilder() { isClean()); operation_ = null; } - operationCase_ = 1; + operationCase_ = 3; onChanged(); - return insertBuilder_; + return insertOrUpdateBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.google.spanner.v1.Mutation.Write, com.google.spanner.v1.Mutation.Write.Builder, com.google.spanner.v1.Mutation.WriteOrBuilder> - updateBuilder_; + replaceBuilder_; /** * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; * - * @return Whether the update field is set. + * @return Whether the replace field is set. */ @java.lang.Override - public boolean hasUpdate() { - return operationCase_ == 2; + public boolean hasReplace() { + return operationCase_ == 4; } /** * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; * - * @return The update. + * @return The replace. */ @java.lang.Override - public com.google.spanner.v1.Mutation.Write getUpdate() { - if (updateBuilder_ == null) { - if (operationCase_ == 2) { + public com.google.spanner.v1.Mutation.Write getReplace() { + if (replaceBuilder_ == null) { + if (operationCase_ == 4) { return (com.google.spanner.v1.Mutation.Write) operation_; } return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } else { - if (operationCase_ == 2) { - return updateBuilder_.getMessage(); + if (operationCase_ == 4) { + return replaceBuilder_.getMessage(); } return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } @@ -4201,23 +7648,31 @@ public com.google.spanner.v1.Mutation.Write getUpdate() { * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; */ - public Builder setUpdate(com.google.spanner.v1.Mutation.Write value) { - if (updateBuilder_ == null) { + public Builder setReplace(com.google.spanner.v1.Mutation.Write value) { + if (replaceBuilder_ == null) { if (value == null) { throw new NullPointerException(); } operation_ = value; onChanged(); } else { - updateBuilder_.setMessage(value); + replaceBuilder_.setMessage(value); } - operationCase_ = 2; + operationCase_ = 4; return this; } @@ -4225,20 +7680,28 @@ public Builder setUpdate(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; */ - public Builder setUpdate(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { - if (updateBuilder_ == null) { + public Builder setReplace(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { + if (replaceBuilder_ == null) { operation_ = builderForValue.build(); onChanged(); } else { - updateBuilder_.setMessage(builderForValue.build()); + replaceBuilder_.setMessage(builderForValue.build()); } - operationCase_ = 2; + operationCase_ = 4; return this; } @@ -4246,15 +7709,23 @@ public Builder setUpdate(com.google.spanner.v1.Mutation.Write.Builder builderFor * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; */ - public Builder mergeUpdate(com.google.spanner.v1.Mutation.Write value) { - if (updateBuilder_ == null) { - if (operationCase_ == 2 + public Builder mergeReplace(com.google.spanner.v1.Mutation.Write value) { + if (replaceBuilder_ == null) { + if (operationCase_ == 4 && operation_ != com.google.spanner.v1.Mutation.Write.getDefaultInstance()) { operation_ = com.google.spanner.v1.Mutation.Write.newBuilder( @@ -4266,13 +7737,13 @@ public Builder mergeUpdate(com.google.spanner.v1.Mutation.Write value) { } onChanged(); } else { - if (operationCase_ == 2) { - updateBuilder_.mergeFrom(value); + if (operationCase_ == 4) { + replaceBuilder_.mergeFrom(value); } else { - updateBuilder_.setMessage(value); + replaceBuilder_.setMessage(value); } } - operationCase_ = 2; + operationCase_ = 4; return this; } @@ -4280,25 +7751,33 @@ public Builder mergeUpdate(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; */ - public Builder clearUpdate() { - if (updateBuilder_ == null) { - if (operationCase_ == 2) { + public Builder clearReplace() { + if (replaceBuilder_ == null) { + if (operationCase_ == 4) { operationCase_ = 0; operation_ = null; onChanged(); } } else { - if (operationCase_ == 2) { + if (operationCase_ == 4) { operationCase_ = 0; operation_ = null; } - updateBuilder_.clear(); + replaceBuilder_.clear(); } return this; } @@ -4307,32 +7786,48 @@ public Builder clearUpdate() { * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; */ - public com.google.spanner.v1.Mutation.Write.Builder getUpdateBuilder() { - return getUpdateFieldBuilder().getBuilder(); + public com.google.spanner.v1.Mutation.Write.Builder getReplaceBuilder() { + return getReplaceFieldBuilder().getBuilder(); } /** * * *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; */ @java.lang.Override - public com.google.spanner.v1.Mutation.WriteOrBuilder getUpdateOrBuilder() { - if ((operationCase_ == 2) && (updateBuilder_ != null)) { - return updateBuilder_.getMessageOrBuilder(); + public com.google.spanner.v1.Mutation.WriteOrBuilder getReplaceOrBuilder() { + if ((operationCase_ == 4) && (replaceBuilder_ != null)) { + return replaceBuilder_.getMessageOrBuilder(); } else { - if (operationCase_ == 2) { + if (operationCase_ == 4) { return (com.google.spanner.v1.Mutation.Write) operation_; } return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); @@ -4342,23 +7837,31 @@ public com.google.spanner.v1.Mutation.WriteOrBuilder getUpdateOrBuilder() { /** * * - *
-     * Update existing rows in a table. If any of the rows does not
-     * already exist, the transaction fails with error `NOT_FOUND`.
+     * 
+     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
+     * already exists, it is deleted, and the column values provided are
+     * inserted instead. Unlike
+     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
+     * means any values not explicitly written become `NULL`.
+     *
+     * In an interleaved table, if you create the child table with the
+     * `ON DELETE CASCADE` annotation, then replacing a parent row
+     * also deletes the child rows. Otherwise, you must delete the
+     * child rows before you replace the parent row.
      * 
* - * .google.spanner.v1.Mutation.Write update = 2; + * .google.spanner.v1.Mutation.Write replace = 4; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.spanner.v1.Mutation.Write, com.google.spanner.v1.Mutation.Write.Builder, com.google.spanner.v1.Mutation.WriteOrBuilder> - getUpdateFieldBuilder() { - if (updateBuilder_ == null) { - if (!(operationCase_ == 2)) { + getReplaceFieldBuilder() { + if (replaceBuilder_ == null) { + if (!(operationCase_ == 4)) { operation_ = com.google.spanner.v1.Mutation.Write.getDefaultInstance(); } - updateBuilder_ = + replaceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.spanner.v1.Mutation.Write, com.google.spanner.v1.Mutation.Write.Builder, @@ -4368,72 +7871,58 @@ public com.google.spanner.v1.Mutation.WriteOrBuilder getUpdateOrBuilder() { isClean()); operation_ = null; } - operationCase_ = 2; + operationCase_ = 4; onChanged(); - return updateBuilder_; + return replaceBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Write, - com.google.spanner.v1.Mutation.Write.Builder, - com.google.spanner.v1.Mutation.WriteOrBuilder> - insertOrUpdateBuilder_; + com.google.spanner.v1.Mutation.Delete, + com.google.spanner.v1.Mutation.Delete.Builder, + com.google.spanner.v1.Mutation.DeleteOrBuilder> + deleteBuilder_; /** * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; * - * @return Whether the insertOrUpdate field is set. + * @return Whether the delete field is set. */ @java.lang.Override - public boolean hasInsertOrUpdate() { - return operationCase_ == 3; + public boolean hasDelete() { + return operationCase_ == 5; } /** * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; * - * @return The insertOrUpdate. + * @return The delete. */ @java.lang.Override - public com.google.spanner.v1.Mutation.Write getInsertOrUpdate() { - if (insertOrUpdateBuilder_ == null) { - if (operationCase_ == 3) { - return (com.google.spanner.v1.Mutation.Write) operation_; + public com.google.spanner.v1.Mutation.Delete getDelete() { + if (deleteBuilder_ == null) { + if (operationCase_ == 5) { + return (com.google.spanner.v1.Mutation.Delete) operation_; } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); } else { - if (operationCase_ == 3) { - return insertOrUpdateBuilder_.getMessage(); + if (operationCase_ == 5) { + return deleteBuilder_.getMessage(); } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); } } @@ -4441,30 +7930,23 @@ public com.google.spanner.v1.Mutation.Write getInsertOrUpdate() { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; */ - public Builder setInsertOrUpdate(com.google.spanner.v1.Mutation.Write value) { - if (insertOrUpdateBuilder_ == null) { + public Builder setDelete(com.google.spanner.v1.Mutation.Delete value) { + if (deleteBuilder_ == null) { if (value == null) { throw new NullPointerException(); } operation_ = value; onChanged(); } else { - insertOrUpdateBuilder_.setMessage(value); + deleteBuilder_.setMessage(value); } - operationCase_ = 3; + operationCase_ = 5; return this; } @@ -4472,27 +7954,20 @@ public Builder setInsertOrUpdate(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; */ - public Builder setInsertOrUpdate(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { - if (insertOrUpdateBuilder_ == null) { + public Builder setDelete(com.google.spanner.v1.Mutation.Delete.Builder builderForValue) { + if (deleteBuilder_ == null) { operation_ = builderForValue.build(); onChanged(); } else { - insertOrUpdateBuilder_.setMessage(builderForValue.build()); + deleteBuilder_.setMessage(builderForValue.build()); } - operationCase_ = 3; + operationCase_ = 5; return this; } @@ -4500,26 +7975,19 @@ public Builder setInsertOrUpdate(com.google.spanner.v1.Mutation.Write.Builder bu * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; */ - public Builder mergeInsertOrUpdate(com.google.spanner.v1.Mutation.Write value) { - if (insertOrUpdateBuilder_ == null) { - if (operationCase_ == 3 - && operation_ != com.google.spanner.v1.Mutation.Write.getDefaultInstance()) { + public Builder mergeDelete(com.google.spanner.v1.Mutation.Delete value) { + if (deleteBuilder_ == null) { + if (operationCase_ == 5 + && operation_ != com.google.spanner.v1.Mutation.Delete.getDefaultInstance()) { operation_ = - com.google.spanner.v1.Mutation.Write.newBuilder( - (com.google.spanner.v1.Mutation.Write) operation_) + com.google.spanner.v1.Mutation.Delete.newBuilder( + (com.google.spanner.v1.Mutation.Delete) operation_) .mergeFrom(value) .buildPartial(); } else { @@ -4527,13 +7995,13 @@ public Builder mergeInsertOrUpdate(com.google.spanner.v1.Mutation.Write value) { } onChanged(); } else { - if (operationCase_ == 3) { - insertOrUpdateBuilder_.mergeFrom(value); + if (operationCase_ == 5) { + deleteBuilder_.mergeFrom(value); } else { - insertOrUpdateBuilder_.setMessage(value); + deleteBuilder_.setMessage(value); } } - operationCase_ = 3; + operationCase_ = 5; return this; } @@ -4541,32 +8009,25 @@ public Builder mergeInsertOrUpdate(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; */ - public Builder clearInsertOrUpdate() { - if (insertOrUpdateBuilder_ == null) { - if (operationCase_ == 3) { + public Builder clearDelete() { + if (deleteBuilder_ == null) { + if (operationCase_ == 5) { operationCase_ = 0; operation_ = null; onChanged(); } } else { - if (operationCase_ == 3) { + if (operationCase_ == 5) { operationCase_ = 0; operation_ = null; } - insertOrUpdateBuilder_.clear(); + deleteBuilder_.clear(); } return this; } @@ -4575,49 +8036,35 @@ public Builder clearInsertOrUpdate() { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; */ - public com.google.spanner.v1.Mutation.Write.Builder getInsertOrUpdateBuilder() { - return getInsertOrUpdateFieldBuilder().getBuilder(); + public com.google.spanner.v1.Mutation.Delete.Builder getDeleteBuilder() { + return getDeleteFieldBuilder().getBuilder(); } /** * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; */ @java.lang.Override - public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrUpdateOrBuilder() { - if ((operationCase_ == 3) && (insertOrUpdateBuilder_ != null)) { - return insertOrUpdateBuilder_.getMessageOrBuilder(); + public com.google.spanner.v1.Mutation.DeleteOrBuilder getDeleteOrBuilder() { + if ((operationCase_ == 5) && (deleteBuilder_ != null)) { + return deleteBuilder_.getMessageOrBuilder(); } else { - if (operationCase_ == 3) { - return (com.google.spanner.v1.Mutation.Write) operation_; + if (operationCase_ == 5) { + return (com.google.spanner.v1.Mutation.Delete) operation_; } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); } } @@ -4625,106 +8072,81 @@ public com.google.spanner.v1.Mutation.WriteOrBuilder getInsertOrUpdateOrBuilder( * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, then its column values are overwritten with the ones
-     * provided. Any column values not explicitly written are preserved.
-     *
-     * When using
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
-     * when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
-     * columns in the table must be given a value. This holds true even when the
-     * row already exists and will therefore actually be updated.
+     * Delete rows from a table. Succeeds whether or not the named
+     * rows were present.
      * 
* - * .google.spanner.v1.Mutation.Write insert_or_update = 3; + * .google.spanner.v1.Mutation.Delete delete = 5; */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Write, - com.google.spanner.v1.Mutation.Write.Builder, - com.google.spanner.v1.Mutation.WriteOrBuilder> - getInsertOrUpdateFieldBuilder() { - if (insertOrUpdateBuilder_ == null) { - if (!(operationCase_ == 3)) { - operation_ = com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + com.google.spanner.v1.Mutation.Delete, + com.google.spanner.v1.Mutation.Delete.Builder, + com.google.spanner.v1.Mutation.DeleteOrBuilder> + getDeleteFieldBuilder() { + if (deleteBuilder_ == null) { + if (!(operationCase_ == 5)) { + operation_ = com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); } - insertOrUpdateBuilder_ = + deleteBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Write, - com.google.spanner.v1.Mutation.Write.Builder, - com.google.spanner.v1.Mutation.WriteOrBuilder>( - (com.google.spanner.v1.Mutation.Write) operation_, + com.google.spanner.v1.Mutation.Delete, + com.google.spanner.v1.Mutation.Delete.Builder, + com.google.spanner.v1.Mutation.DeleteOrBuilder>( + (com.google.spanner.v1.Mutation.Delete) operation_, getParentForChildren(), isClean()); operation_ = null; } - operationCase_ = 3; + operationCase_ = 5; onChanged(); - return insertOrUpdateBuilder_; + return deleteBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Write, - com.google.spanner.v1.Mutation.Write.Builder, - com.google.spanner.v1.Mutation.WriteOrBuilder> - replaceBuilder_; + com.google.spanner.v1.Mutation.Send, + com.google.spanner.v1.Mutation.Send.Builder, + com.google.spanner.v1.Mutation.SendOrBuilder> + sendBuilder_; /** * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; * - * @return Whether the replace field is set. + * @return Whether the send field is set. */ @java.lang.Override - public boolean hasReplace() { - return operationCase_ == 4; + public boolean hasSend() { + return operationCase_ == 6; } /** * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; * - * @return The replace. + * @return The send. */ @java.lang.Override - public com.google.spanner.v1.Mutation.Write getReplace() { - if (replaceBuilder_ == null) { - if (operationCase_ == 4) { - return (com.google.spanner.v1.Mutation.Write) operation_; + public com.google.spanner.v1.Mutation.Send getSend() { + if (sendBuilder_ == null) { + if (operationCase_ == 6) { + return (com.google.spanner.v1.Mutation.Send) operation_; } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Send.getDefaultInstance(); } else { - if (operationCase_ == 4) { - return replaceBuilder_.getMessage(); + if (operationCase_ == 6) { + return sendBuilder_.getMessage(); } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Send.getDefaultInstance(); } } @@ -4732,31 +8154,22 @@ public com.google.spanner.v1.Mutation.Write getReplace() { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; */ - public Builder setReplace(com.google.spanner.v1.Mutation.Write value) { - if (replaceBuilder_ == null) { + public Builder setSend(com.google.spanner.v1.Mutation.Send value) { + if (sendBuilder_ == null) { if (value == null) { throw new NullPointerException(); } operation_ = value; onChanged(); } else { - replaceBuilder_.setMessage(value); + sendBuilder_.setMessage(value); } - operationCase_ = 4; + operationCase_ = 6; return this; } @@ -4764,28 +8177,19 @@ public Builder setReplace(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; */ - public Builder setReplace(com.google.spanner.v1.Mutation.Write.Builder builderForValue) { - if (replaceBuilder_ == null) { + public Builder setSend(com.google.spanner.v1.Mutation.Send.Builder builderForValue) { + if (sendBuilder_ == null) { operation_ = builderForValue.build(); onChanged(); } else { - replaceBuilder_.setMessage(builderForValue.build()); + sendBuilder_.setMessage(builderForValue.build()); } - operationCase_ = 4; + operationCase_ = 6; return this; } @@ -4793,27 +8197,18 @@ public Builder setReplace(com.google.spanner.v1.Mutation.Write.Builder builderFo * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; */ - public Builder mergeReplace(com.google.spanner.v1.Mutation.Write value) { - if (replaceBuilder_ == null) { - if (operationCase_ == 4 - && operation_ != com.google.spanner.v1.Mutation.Write.getDefaultInstance()) { + public Builder mergeSend(com.google.spanner.v1.Mutation.Send value) { + if (sendBuilder_ == null) { + if (operationCase_ == 6 + && operation_ != com.google.spanner.v1.Mutation.Send.getDefaultInstance()) { operation_ = - com.google.spanner.v1.Mutation.Write.newBuilder( - (com.google.spanner.v1.Mutation.Write) operation_) + com.google.spanner.v1.Mutation.Send.newBuilder( + (com.google.spanner.v1.Mutation.Send) operation_) .mergeFrom(value) .buildPartial(); } else { @@ -4821,13 +8216,13 @@ public Builder mergeReplace(com.google.spanner.v1.Mutation.Write value) { } onChanged(); } else { - if (operationCase_ == 4) { - replaceBuilder_.mergeFrom(value); + if (operationCase_ == 6) { + sendBuilder_.mergeFrom(value); } else { - replaceBuilder_.setMessage(value); + sendBuilder_.setMessage(value); } } - operationCase_ = 4; + operationCase_ = 6; return this; } @@ -4835,33 +8230,24 @@ public Builder mergeReplace(com.google.spanner.v1.Mutation.Write value) { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; */ - public Builder clearReplace() { - if (replaceBuilder_ == null) { - if (operationCase_ == 4) { + public Builder clearSend() { + if (sendBuilder_ == null) { + if (operationCase_ == 6) { operationCase_ = 0; operation_ = null; onChanged(); } } else { - if (operationCase_ == 4) { + if (operationCase_ == 6) { operationCase_ = 0; operation_ = null; } - replaceBuilder_.clear(); + sendBuilder_.clear(); } return this; } @@ -4870,51 +8256,33 @@ public Builder clearReplace() { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; */ - public com.google.spanner.v1.Mutation.Write.Builder getReplaceBuilder() { - return getReplaceFieldBuilder().getBuilder(); + public com.google.spanner.v1.Mutation.Send.Builder getSendBuilder() { + return getSendFieldBuilder().getBuilder(); } /** * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; */ @java.lang.Override - public com.google.spanner.v1.Mutation.WriteOrBuilder getReplaceOrBuilder() { - if ((operationCase_ == 4) && (replaceBuilder_ != null)) { - return replaceBuilder_.getMessageOrBuilder(); + public com.google.spanner.v1.Mutation.SendOrBuilder getSendOrBuilder() { + if ((operationCase_ == 6) && (sendBuilder_ != null)) { + return sendBuilder_.getMessageOrBuilder(); } else { - if (operationCase_ == 4) { - return (com.google.spanner.v1.Mutation.Write) operation_; + if (operationCase_ == 6) { + return (com.google.spanner.v1.Mutation.Send) operation_; } - return com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Send.getDefaultInstance(); } } @@ -4922,91 +8290,80 @@ public com.google.spanner.v1.Mutation.WriteOrBuilder getReplaceOrBuilder() { * * *
-     * Like [insert][google.spanner.v1.Mutation.insert], except that if the row
-     * already exists, it is deleted, and the column values provided are
-     * inserted instead. Unlike
-     * [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
-     * means any values not explicitly written become `NULL`.
-     *
-     * In an interleaved table, if you create the child table with the
-     * `ON DELETE CASCADE` annotation, then replacing a parent row
-     * also deletes the child rows. Otherwise, you must delete the
-     * child rows before you replace the parent row.
+     * Send a message to a queue.
      * 
* - * .google.spanner.v1.Mutation.Write replace = 4; + * .google.spanner.v1.Mutation.Send send = 6; */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Write, - com.google.spanner.v1.Mutation.Write.Builder, - com.google.spanner.v1.Mutation.WriteOrBuilder> - getReplaceFieldBuilder() { - if (replaceBuilder_ == null) { - if (!(operationCase_ == 4)) { - operation_ = com.google.spanner.v1.Mutation.Write.getDefaultInstance(); + com.google.spanner.v1.Mutation.Send, + com.google.spanner.v1.Mutation.Send.Builder, + com.google.spanner.v1.Mutation.SendOrBuilder> + getSendFieldBuilder() { + if (sendBuilder_ == null) { + if (!(operationCase_ == 6)) { + operation_ = com.google.spanner.v1.Mutation.Send.getDefaultInstance(); } - replaceBuilder_ = + sendBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Write, - com.google.spanner.v1.Mutation.Write.Builder, - com.google.spanner.v1.Mutation.WriteOrBuilder>( - (com.google.spanner.v1.Mutation.Write) operation_, + com.google.spanner.v1.Mutation.Send, + com.google.spanner.v1.Mutation.Send.Builder, + com.google.spanner.v1.Mutation.SendOrBuilder>( + (com.google.spanner.v1.Mutation.Send) operation_, getParentForChildren(), isClean()); operation_ = null; } - operationCase_ = 4; + operationCase_ = 6; onChanged(); - return replaceBuilder_; + return sendBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Delete, - com.google.spanner.v1.Mutation.Delete.Builder, - com.google.spanner.v1.Mutation.DeleteOrBuilder> - deleteBuilder_; + com.google.spanner.v1.Mutation.Ack, + com.google.spanner.v1.Mutation.Ack.Builder, + com.google.spanner.v1.Mutation.AckOrBuilder> + ackBuilder_; /** * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; * - * @return Whether the delete field is set. + * @return Whether the ack field is set. */ @java.lang.Override - public boolean hasDelete() { - return operationCase_ == 5; + public boolean hasAck() { + return operationCase_ == 7; } /** * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; * - * @return The delete. + * @return The ack. */ @java.lang.Override - public com.google.spanner.v1.Mutation.Delete getDelete() { - if (deleteBuilder_ == null) { - if (operationCase_ == 5) { - return (com.google.spanner.v1.Mutation.Delete) operation_; + public com.google.spanner.v1.Mutation.Ack getAck() { + if (ackBuilder_ == null) { + if (operationCase_ == 7) { + return (com.google.spanner.v1.Mutation.Ack) operation_; } - return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Ack.getDefaultInstance(); } else { - if (operationCase_ == 5) { - return deleteBuilder_.getMessage(); + if (operationCase_ == 7) { + return ackBuilder_.getMessage(); } - return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Ack.getDefaultInstance(); } } @@ -5014,23 +8371,22 @@ public com.google.spanner.v1.Mutation.Delete getDelete() { * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ - public Builder setDelete(com.google.spanner.v1.Mutation.Delete value) { - if (deleteBuilder_ == null) { + public Builder setAck(com.google.spanner.v1.Mutation.Ack value) { + if (ackBuilder_ == null) { if (value == null) { throw new NullPointerException(); } operation_ = value; onChanged(); } else { - deleteBuilder_.setMessage(value); + ackBuilder_.setMessage(value); } - operationCase_ = 5; + operationCase_ = 7; return this; } @@ -5038,20 +8394,19 @@ public Builder setDelete(com.google.spanner.v1.Mutation.Delete value) { * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ - public Builder setDelete(com.google.spanner.v1.Mutation.Delete.Builder builderForValue) { - if (deleteBuilder_ == null) { + public Builder setAck(com.google.spanner.v1.Mutation.Ack.Builder builderForValue) { + if (ackBuilder_ == null) { operation_ = builderForValue.build(); onChanged(); } else { - deleteBuilder_.setMessage(builderForValue.build()); + ackBuilder_.setMessage(builderForValue.build()); } - operationCase_ = 5; + operationCase_ = 7; return this; } @@ -5059,19 +8414,18 @@ public Builder setDelete(com.google.spanner.v1.Mutation.Delete.Builder builderFo * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ - public Builder mergeDelete(com.google.spanner.v1.Mutation.Delete value) { - if (deleteBuilder_ == null) { - if (operationCase_ == 5 - && operation_ != com.google.spanner.v1.Mutation.Delete.getDefaultInstance()) { + public Builder mergeAck(com.google.spanner.v1.Mutation.Ack value) { + if (ackBuilder_ == null) { + if (operationCase_ == 7 + && operation_ != com.google.spanner.v1.Mutation.Ack.getDefaultInstance()) { operation_ = - com.google.spanner.v1.Mutation.Delete.newBuilder( - (com.google.spanner.v1.Mutation.Delete) operation_) + com.google.spanner.v1.Mutation.Ack.newBuilder( + (com.google.spanner.v1.Mutation.Ack) operation_) .mergeFrom(value) .buildPartial(); } else { @@ -5079,13 +8433,13 @@ public Builder mergeDelete(com.google.spanner.v1.Mutation.Delete value) { } onChanged(); } else { - if (operationCase_ == 5) { - deleteBuilder_.mergeFrom(value); + if (operationCase_ == 7) { + ackBuilder_.mergeFrom(value); } else { - deleteBuilder_.setMessage(value); + ackBuilder_.setMessage(value); } } - operationCase_ = 5; + operationCase_ = 7; return this; } @@ -5093,25 +8447,24 @@ public Builder mergeDelete(com.google.spanner.v1.Mutation.Delete value) { * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ - public Builder clearDelete() { - if (deleteBuilder_ == null) { - if (operationCase_ == 5) { + public Builder clearAck() { + if (ackBuilder_ == null) { + if (operationCase_ == 7) { operationCase_ = 0; operation_ = null; onChanged(); } } else { - if (operationCase_ == 5) { + if (operationCase_ == 7) { operationCase_ = 0; operation_ = null; } - deleteBuilder_.clear(); + ackBuilder_.clear(); } return this; } @@ -5120,35 +8473,33 @@ public Builder clearDelete() { * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ - public com.google.spanner.v1.Mutation.Delete.Builder getDeleteBuilder() { - return getDeleteFieldBuilder().getBuilder(); + public com.google.spanner.v1.Mutation.Ack.Builder getAckBuilder() { + return getAckFieldBuilder().getBuilder(); } /** * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ @java.lang.Override - public com.google.spanner.v1.Mutation.DeleteOrBuilder getDeleteOrBuilder() { - if ((operationCase_ == 5) && (deleteBuilder_ != null)) { - return deleteBuilder_.getMessageOrBuilder(); + public com.google.spanner.v1.Mutation.AckOrBuilder getAckOrBuilder() { + if ((operationCase_ == 7) && (ackBuilder_ != null)) { + return ackBuilder_.getMessageOrBuilder(); } else { - if (operationCase_ == 5) { - return (com.google.spanner.v1.Mutation.Delete) operation_; + if (operationCase_ == 7) { + return (com.google.spanner.v1.Mutation.Ack) operation_; } - return com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + return com.google.spanner.v1.Mutation.Ack.getDefaultInstance(); } } @@ -5156,34 +8507,31 @@ public com.google.spanner.v1.Mutation.DeleteOrBuilder getDeleteOrBuilder() { * * *
-     * Delete rows from a table. Succeeds whether or not the named
-     * rows were present.
+     * Ack a message from a queue.
      * 
* - * .google.spanner.v1.Mutation.Delete delete = 5; + * .google.spanner.v1.Mutation.Ack ack = 7; */ private com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Delete, - com.google.spanner.v1.Mutation.Delete.Builder, - com.google.spanner.v1.Mutation.DeleteOrBuilder> - getDeleteFieldBuilder() { - if (deleteBuilder_ == null) { - if (!(operationCase_ == 5)) { - operation_ = com.google.spanner.v1.Mutation.Delete.getDefaultInstance(); + com.google.spanner.v1.Mutation.Ack, + com.google.spanner.v1.Mutation.Ack.Builder, + com.google.spanner.v1.Mutation.AckOrBuilder> + getAckFieldBuilder() { + if (ackBuilder_ == null) { + if (!(operationCase_ == 7)) { + operation_ = com.google.spanner.v1.Mutation.Ack.getDefaultInstance(); } - deleteBuilder_ = + ackBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.spanner.v1.Mutation.Delete, - com.google.spanner.v1.Mutation.Delete.Builder, - com.google.spanner.v1.Mutation.DeleteOrBuilder>( - (com.google.spanner.v1.Mutation.Delete) operation_, - getParentForChildren(), - isClean()); + com.google.spanner.v1.Mutation.Ack, + com.google.spanner.v1.Mutation.Ack.Builder, + com.google.spanner.v1.Mutation.AckOrBuilder>( + (com.google.spanner.v1.Mutation.Ack) operation_, getParentForChildren(), isClean()); operation_ = null; } - operationCase_ = 5; + operationCase_ = 7; onChanged(); - return deleteBuilder_; + return ackBuilder_; } @java.lang.Override diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationOrBuilder.java index 4b4d088fe26..d4253acad52 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationOrBuilder.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationOrBuilder.java @@ -269,5 +269,79 @@ public interface MutationOrBuilder */ com.google.spanner.v1.Mutation.DeleteOrBuilder getDeleteOrBuilder(); + /** + * + * + *
+   * Send a message to a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Send send = 6; + * + * @return Whether the send field is set. + */ + boolean hasSend(); + + /** + * + * + *
+   * Send a message to a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Send send = 6; + * + * @return The send. + */ + com.google.spanner.v1.Mutation.Send getSend(); + + /** + * + * + *
+   * Send a message to a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Send send = 6; + */ + com.google.spanner.v1.Mutation.SendOrBuilder getSendOrBuilder(); + + /** + * + * + *
+   * Ack a message from a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Ack ack = 7; + * + * @return Whether the ack field is set. + */ + boolean hasAck(); + + /** + * + * + *
+   * Ack a message from a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Ack ack = 7; + * + * @return The ack. + */ + com.google.spanner.v1.Mutation.Ack getAck(); + + /** + * + * + *
+   * Ack a message from a queue.
+   * 
+ * + * .google.spanner.v1.Mutation.Ack ack = 7; + */ + com.google.spanner.v1.Mutation.AckOrBuilder getAckOrBuilder(); + com.google.spanner.v1.Mutation.OperationCase getOperationCase(); } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationProto.java index 9af035418c0..ba4add22f8a 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationProto.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/MutationProto.java @@ -40,6 +40,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_spanner_v1_Mutation_Delete_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_spanner_v1_Mutation_Delete_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_Mutation_Send_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_Mutation_Send_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_Mutation_Ack_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_Mutation_Ack_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -52,25 +60,39 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n" + " google/spanner/v1/mutation.proto\022\021goog" + "le.spanner.v1\032\037google/api/field_behavior" - + ".proto\032\034google/protobuf/struct.proto\032\034google/spanner/v1/keys.proto\"\325\003\n" + + ".proto\032\034google/protobuf/struct.proto\032\037go" + + "ogle/protobuf/timestamp.proto\032\034google/spanner/v1/keys.proto\"\300\006\n" + "\010Mutation\0223\n" + "\006insert\030\001 \001(\0132!.google.spanner.v1.Mutation.WriteH\000\0223\n" + "\006update\030\002 \001(\0132!.google.spanner.v1.Mutation.WriteH\000\022=\n" + "\020insert_or_update\030\003 \001(\0132!.google.spanner.v1.Mutation.WriteH\000\0224\n" + "\007replace\030\004 \001(\0132!.google.spanner.v1.Mutation.WriteH\000\0224\n" - + "\006delete\030\005 \001(\0132\".google.spanner.v1.Mutation.DeleteH\000\032X\n" + + "\006delete\030\005 \001(\0132\".google.spanner.v1.Mutation.DeleteH\000\0220\n" + + "\004send\030\006 \001(\0132 .google.spanner.v1.Mutation.SendH\000\022.\n" + + "\003ack\030\007 \001(\0132\037.google.spanner.v1.Mutation.AckH\000\032X\n" + "\005Write\022\022\n" + "\005table\030\001 \001(\tB\003\340A\002\022\017\n" + "\007columns\030\002 \003(\t\022*\n" + "\006values\030\003 \003(\0132\032.google.protobuf.ListValue\032M\n" + "\006Delete\022\022\n" + "\005table\030\001 \001(\tB\003\340A\002\022/\n" - + "\007key_set\030\002 \001(\0132\031.google.spanner.v1.KeySetB\003\340A\002B\013\n" + + "\007key_set\030\002" + + " \001(\0132\031.google.spanner.v1.KeySetB\003\340A\002\032\243\001\n" + + "\004Send\022\022\n" + + "\005queue\030\001 \001(\tB\003\340A\002\022,\n" + + "\003key\030\002 \001(\0132\032.google.protobuf.ListValueB\003\340A\002\0220\n" + + "\014deliver_time\030\003 \001(\0132\032.google.protobuf.Timestamp\022\'\n" + + "\007payload\030\004 \001(\0132\026.google.protobuf.Value\032a\n" + + "\003Ack\022\022\n" + + "\005queue\030\001 \001(\tB\003\340A\002\022,\n" + + "\003key\030\002 \001(\0132\032.google.protobuf.ListValueB\003\340A\002\022\030\n" + + "\020ignore_not_found\030\003 \001(\010B\013\n" + "\toperationB\260\001\n" + "\025com.google.spanner.v1B\r" - + "MutationProtoP\001Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\252\002\027G" - + "oogle.Cloud.Spanner.V1\312\002\027Google\\Cloud\\Sp" - + "anner\\V1\352\002\032Google::Cloud::Spanner::V1b\006proto3" + + "MutationProtoP\001Z5cloud.google.com/go/s" + + "panner/apiv1/spannerpb;spannerpb\252\002\027Googl" + + "e.Cloud.Spanner.V1\312\002\027Google\\Cloud\\Spanne" + + "r\\V1\352\002\032Google::Cloud::Spanner::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -78,6 +100,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), com.google.spanner.v1.KeysProto.getDescriptor(), }); internal_static_google_spanner_v1_Mutation_descriptor = @@ -86,7 +109,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_v1_Mutation_descriptor, new java.lang.String[] { - "Insert", "Update", "InsertOrUpdate", "Replace", "Delete", "Operation", + "Insert", "Update", "InsertOrUpdate", "Replace", "Delete", "Send", "Ack", "Operation", }); internal_static_google_spanner_v1_Mutation_Write_descriptor = internal_static_google_spanner_v1_Mutation_descriptor.getNestedTypes().get(0); @@ -104,6 +127,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Table", "KeySet", }); + internal_static_google_spanner_v1_Mutation_Send_descriptor = + internal_static_google_spanner_v1_Mutation_descriptor.getNestedTypes().get(2); + internal_static_google_spanner_v1_Mutation_Send_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_Mutation_Send_descriptor, + new java.lang.String[] { + "Queue", "Key", "DeliverTime", "Payload", + }); + internal_static_google_spanner_v1_Mutation_Ack_descriptor = + internal_static_google_spanner_v1_Mutation_descriptor.getNestedTypes().get(3); + internal_static_google_spanner_v1_Mutation_Ack_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_Mutation_Ack_descriptor, + new java.lang.String[] { + "Queue", "Key", "IgnoreNotFound", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); @@ -111,6 +150,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); com.google.spanner.v1.KeysProto.getDescriptor(); } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java index 1f13ad6aeb5..b8ec0fb94c9 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java @@ -780,6 +780,80 @@ public boolean getLast() { return last_; } + public static final int CACHE_UPDATE_FIELD_NUMBER = 10; + private com.google.spanner.v1.CacheUpdate cacheUpdate_; + + /** + * + * + *
+   * Optional. A cache update expresses a set of changes the client should
+   * incorporate into its location cache. The client should discard the changes
+   * if they are older than the data it already has. This data can be obtained
+   * in response to requests that included a `RoutingHint` field, but may also
+   * be obtained by explicit location-fetching RPCs which may be added in the
+   * future.
+   * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cacheUpdate field is set. + */ + @java.lang.Override + public boolean hasCacheUpdate() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. A cache update expresses a set of changes the client should
+   * incorporate into its location cache. The client should discard the changes
+   * if they are older than the data it already has. This data can be obtained
+   * in response to requests that included a `RoutingHint` field, but may also
+   * be obtained by explicit location-fetching RPCs which may be added in the
+   * future.
+   * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cacheUpdate. + */ + @java.lang.Override + public com.google.spanner.v1.CacheUpdate getCacheUpdate() { + return cacheUpdate_ == null + ? com.google.spanner.v1.CacheUpdate.getDefaultInstance() + : cacheUpdate_; + } + + /** + * + * + *
+   * Optional. A cache update expresses a set of changes the client should
+   * incorporate into its location cache. The client should discard the changes
+   * if they are older than the data it already has. This data can be obtained
+   * in response to requests that included a `RoutingHint` field, but may also
+   * be obtained by explicit location-fetching RPCs which may be added in the
+   * future.
+   * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.v1.CacheUpdateOrBuilder getCacheUpdateOrBuilder() { + return cacheUpdate_ == null + ? com.google.spanner.v1.CacheUpdate.getDefaultInstance() + : cacheUpdate_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -815,6 +889,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (last_ != false) { output.writeBool(9, last_); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getCacheUpdate()); + } getUnknownFields().writeTo(output); } @@ -845,6 +922,9 @@ public int getSerializedSize() { if (last_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, last_); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCacheUpdate()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -876,6 +956,10 @@ public boolean equals(final java.lang.Object obj) { if (!getPrecommitToken().equals(other.getPrecommitToken())) return false; } if (getLast() != other.getLast()) return false; + if (hasCacheUpdate() != other.hasCacheUpdate()) return false; + if (hasCacheUpdate()) { + if (!getCacheUpdate().equals(other.getCacheUpdate())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -909,6 +993,10 @@ public int hashCode() { } hash = (37 * hash) + LAST_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLast()); + if (hasCacheUpdate()) { + hash = (37 * hash) + CACHE_UPDATE_FIELD_NUMBER; + hash = (53 * hash) + getCacheUpdate().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1056,6 +1144,7 @@ private void maybeForceBuilderInitialization() { getValuesFieldBuilder(); getStatsFieldBuilder(); getPrecommitTokenFieldBuilder(); + getCacheUpdateFieldBuilder(); } } @@ -1088,6 +1177,11 @@ public Builder clear() { precommitTokenBuilder_ = null; } last_ = false; + cacheUpdate_ = null; + if (cacheUpdateBuilder_ != null) { + cacheUpdateBuilder_.dispose(); + cacheUpdateBuilder_ = null; + } return this; } @@ -1160,6 +1254,11 @@ private void buildPartial0(com.google.spanner.v1.PartialResultSet result) { if (((from_bitField0_ & 0x00000040) != 0)) { result.last_ = last_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.cacheUpdate_ = + cacheUpdateBuilder_ == null ? cacheUpdate_ : cacheUpdateBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -1253,6 +1352,9 @@ public Builder mergeFrom(com.google.spanner.v1.PartialResultSet other) { if (other.getLast() != false) { setLast(other.getLast()); } + if (other.hasCacheUpdate()) { + mergeCacheUpdate(other.getCacheUpdate()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1327,6 +1429,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000040; break; } // case 72 + case 82: + { + input.readMessage(getCacheUpdateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3961,6 +4069,263 @@ public Builder clearLast() { return this; } + private com.google.spanner.v1.CacheUpdate cacheUpdate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.CacheUpdate, + com.google.spanner.v1.CacheUpdate.Builder, + com.google.spanner.v1.CacheUpdateOrBuilder> + cacheUpdateBuilder_; + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cacheUpdate field is set. + */ + public boolean hasCacheUpdate() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cacheUpdate. + */ + public com.google.spanner.v1.CacheUpdate getCacheUpdate() { + if (cacheUpdateBuilder_ == null) { + return cacheUpdate_ == null + ? com.google.spanner.v1.CacheUpdate.getDefaultInstance() + : cacheUpdate_; + } else { + return cacheUpdateBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCacheUpdate(com.google.spanner.v1.CacheUpdate value) { + if (cacheUpdateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cacheUpdate_ = value; + } else { + cacheUpdateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCacheUpdate(com.google.spanner.v1.CacheUpdate.Builder builderForValue) { + if (cacheUpdateBuilder_ == null) { + cacheUpdate_ = builderForValue.build(); + } else { + cacheUpdateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCacheUpdate(com.google.spanner.v1.CacheUpdate value) { + if (cacheUpdateBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && cacheUpdate_ != null + && cacheUpdate_ != com.google.spanner.v1.CacheUpdate.getDefaultInstance()) { + getCacheUpdateBuilder().mergeFrom(value); + } else { + cacheUpdate_ = value; + } + } else { + cacheUpdateBuilder_.mergeFrom(value); + } + if (cacheUpdate_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCacheUpdate() { + bitField0_ = (bitField0_ & ~0x00000080); + cacheUpdate_ = null; + if (cacheUpdateBuilder_ != null) { + cacheUpdateBuilder_.dispose(); + cacheUpdateBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.CacheUpdate.Builder getCacheUpdateBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCacheUpdateFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.CacheUpdateOrBuilder getCacheUpdateOrBuilder() { + if (cacheUpdateBuilder_ != null) { + return cacheUpdateBuilder_.getMessageOrBuilder(); + } else { + return cacheUpdate_ == null + ? com.google.spanner.v1.CacheUpdate.getDefaultInstance() + : cacheUpdate_; + } + } + + /** + * + * + *
+     * Optional. A cache update expresses a set of changes the client should
+     * incorporate into its location cache. The client should discard the changes
+     * if they are older than the data it already has. This data can be obtained
+     * in response to requests that included a `RoutingHint` field, but may also
+     * be obtained by explicit location-fetching RPCs which may be added in the
+     * future.
+     * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.CacheUpdate, + com.google.spanner.v1.CacheUpdate.Builder, + com.google.spanner.v1.CacheUpdateOrBuilder> + getCacheUpdateFieldBuilder() { + if (cacheUpdateBuilder_ == null) { + cacheUpdateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.CacheUpdate, + com.google.spanner.v1.CacheUpdate.Builder, + com.google.spanner.v1.CacheUpdateOrBuilder>( + getCacheUpdate(), getParentForChildren(), isClean()); + cacheUpdate_ = null; + } + return cacheUpdateBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java index 547b2008ad1..63b40e3c31b 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java @@ -652,4 +652,62 @@ public interface PartialResultSetOrBuilder * @return The last. */ boolean getLast(); + + /** + * + * + *
+   * Optional. A cache update expresses a set of changes the client should
+   * incorporate into its location cache. The client should discard the changes
+   * if they are older than the data it already has. This data can be obtained
+   * in response to requests that included a `RoutingHint` field, but may also
+   * be obtained by explicit location-fetching RPCs which may be added in the
+   * future.
+   * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the cacheUpdate field is set. + */ + boolean hasCacheUpdate(); + + /** + * + * + *
+   * Optional. A cache update expresses a set of changes the client should
+   * incorporate into its location cache. The client should discard the changes
+   * if they are older than the data it already has. This data can be obtained
+   * in response to requests that included a `RoutingHint` field, but may also
+   * be obtained by explicit location-fetching RPCs which may be added in the
+   * future.
+   * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The cacheUpdate. + */ + com.google.spanner.v1.CacheUpdate getCacheUpdate(); + + /** + * + * + *
+   * Optional. A cache update expresses a set of changes the client should
+   * incorporate into its location cache. The client should discard the changes
+   * if they are older than the data it already has. This data can be obtained
+   * in response to requests that included a `RoutingHint` field, but may also
+   * be obtained by explicit location-fetching RPCs which may be added in the
+   * future.
+   * 
+ * + * + * .google.spanner.v1.CacheUpdate cache_update = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.v1.CacheUpdateOrBuilder getCacheUpdateOrBuilder(); } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryAdvisorResult.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryAdvisorResult.java new file mode 100644 index 00000000000..8cafe2fd02d --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryAdvisorResult.java @@ -0,0 +1,1967 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/query_plan.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +/** + * + * + *
+ * Output of query advisor analysis.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.QueryAdvisorResult} + */ +public final class QueryAdvisorResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.QueryAdvisorResult) + QueryAdvisorResultOrBuilder { + private static final long serialVersionUID = 0L; + + // Use QueryAdvisorResult.newBuilder() to construct. + private QueryAdvisorResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryAdvisorResult() { + indexAdvice_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryAdvisorResult(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.QueryAdvisorResult.class, + com.google.spanner.v1.QueryAdvisorResult.Builder.class); + } + + public interface IndexAdviceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.QueryAdvisorResult.IndexAdvice) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the ddl. + */ + java.util.List getDdlList(); + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of ddl. + */ + int getDdlCount(); + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The ddl at the given index. + */ + java.lang.String getDdl(int index); + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the ddl at the given index. + */ + com.google.protobuf.ByteString getDdlBytes(int index); + + /** + * + * + *
+     * Optional. Estimated latency improvement factor. For example if the query
+     * currently takes 500 ms to run and the estimated latency with new indexes
+     * is 100 ms this field will be 5.
+     * 
+ * + * double improvement_factor = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The improvementFactor. + */ + double getImprovementFactor(); + } + + /** + * + * + *
+   * Recommendation to add new indexes to run queries more efficiently.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.QueryAdvisorResult.IndexAdvice} + */ + public static final class IndexAdvice extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.QueryAdvisorResult.IndexAdvice) + IndexAdviceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use IndexAdvice.newBuilder() to construct. + private IndexAdvice(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndexAdvice() { + ddl_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IndexAdvice(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.class, + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder.class); + } + + public static final int DDL_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList ddl_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the ddl. + */ + public com.google.protobuf.ProtocolStringList getDdlList() { + return ddl_; + } + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of ddl. + */ + public int getDdlCount() { + return ddl_.size(); + } + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The ddl at the given index. + */ + public java.lang.String getDdl(int index) { + return ddl_.get(index); + } + + /** + * + * + *
+     * Optional. DDL statements to add new indexes that will improve the query.
+     * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the ddl at the given index. + */ + public com.google.protobuf.ByteString getDdlBytes(int index) { + return ddl_.getByteString(index); + } + + public static final int IMPROVEMENT_FACTOR_FIELD_NUMBER = 2; + private double improvementFactor_ = 0D; + + /** + * + * + *
+     * Optional. Estimated latency improvement factor. For example if the query
+     * currently takes 500 ms to run and the estimated latency with new indexes
+     * is 100 ms this field will be 5.
+     * 
+ * + * double improvement_factor = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The improvementFactor. + */ + @java.lang.Override + public double getImprovementFactor() { + return improvementFactor_; + } + + 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 < ddl_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ddl_.getRaw(i)); + } + if (java.lang.Double.doubleToRawLongBits(improvementFactor_) != 0) { + output.writeDouble(2, improvementFactor_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < ddl_.size(); i++) { + dataSize += computeStringSizeNoTag(ddl_.getRaw(i)); + } + size += dataSize; + size += 1 * getDdlList().size(); + } + if (java.lang.Double.doubleToRawLongBits(improvementFactor_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, improvementFactor_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.QueryAdvisorResult.IndexAdvice)) { + return super.equals(obj); + } + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice other = + (com.google.spanner.v1.QueryAdvisorResult.IndexAdvice) obj; + + if (!getDdlList().equals(other.getDdlList())) return false; + if (java.lang.Double.doubleToLongBits(getImprovementFactor()) + != java.lang.Double.doubleToLongBits(other.getImprovementFactor())) 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 (getDdlCount() > 0) { + hash = (37 * hash) + DDL_FIELD_NUMBER; + hash = (53 * hash) + getDdlList().hashCode(); + } + hash = (37 * hash) + IMPROVEMENT_FACTOR_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getImprovementFactor())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice 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; + } + + /** + * + * + *
+     * Recommendation to add new indexes to run queries more efficiently.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.QueryAdvisorResult.IndexAdvice} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.QueryAdvisorResult.IndexAdvice) + com.google.spanner.v1.QueryAdvisorResult.IndexAdviceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.class, + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder.class); + } + + // Construct using com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ddl_ = com.google.protobuf.LazyStringArrayList.emptyList(); + improvementFactor_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice getDefaultInstanceForType() { + return com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice build() { + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice buildPartial() { + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice result = + new com.google.spanner.v1.QueryAdvisorResult.IndexAdvice(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.QueryAdvisorResult.IndexAdvice result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + ddl_.makeImmutable(); + result.ddl_ = ddl_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.improvementFactor_ = improvementFactor_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.QueryAdvisorResult.IndexAdvice) { + return mergeFrom((com.google.spanner.v1.QueryAdvisorResult.IndexAdvice) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.QueryAdvisorResult.IndexAdvice other) { + if (other == com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.getDefaultInstance()) + return this; + if (!other.ddl_.isEmpty()) { + if (ddl_.isEmpty()) { + ddl_ = other.ddl_; + bitField0_ |= 0x00000001; + } else { + ensureDdlIsMutable(); + ddl_.addAll(other.ddl_); + } + onChanged(); + } + if (other.getImprovementFactor() != 0D) { + setImprovementFactor(other.getImprovementFactor()); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDdlIsMutable(); + ddl_.add(s); + break; + } // case 10 + case 17: + { + improvementFactor_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList ddl_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDdlIsMutable() { + if (!ddl_.isModifiable()) { + ddl_ = new com.google.protobuf.LazyStringArrayList(ddl_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the ddl. + */ + public com.google.protobuf.ProtocolStringList getDdlList() { + ddl_.makeImmutable(); + return ddl_; + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of ddl. + */ + public int getDdlCount() { + return ddl_.size(); + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The ddl at the given index. + */ + public java.lang.String getDdl(int index) { + return ddl_.get(index); + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the ddl at the given index. + */ + public com.google.protobuf.ByteString getDdlBytes(int index) { + return ddl_.getByteString(index); + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The ddl to set. + * @return This builder for chaining. + */ + public Builder setDdl(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDdlIsMutable(); + ddl_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ddl to add. + * @return This builder for chaining. + */ + public Builder addDdl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDdlIsMutable(); + ddl_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The ddl to add. + * @return This builder for chaining. + */ + public Builder addAllDdl(java.lang.Iterable values) { + ensureDdlIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ddl_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDdl() { + ddl_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. DDL statements to add new indexes that will improve the query.
+       * 
+ * + * repeated string ddl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the ddl to add. + * @return This builder for chaining. + */ + public Builder addDdlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDdlIsMutable(); + ddl_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private double improvementFactor_; + + /** + * + * + *
+       * Optional. Estimated latency improvement factor. For example if the query
+       * currently takes 500 ms to run and the estimated latency with new indexes
+       * is 100 ms this field will be 5.
+       * 
+ * + * double improvement_factor = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The improvementFactor. + */ + @java.lang.Override + public double getImprovementFactor() { + return improvementFactor_; + } + + /** + * + * + *
+       * Optional. Estimated latency improvement factor. For example if the query
+       * currently takes 500 ms to run and the estimated latency with new indexes
+       * is 100 ms this field will be 5.
+       * 
+ * + * double improvement_factor = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The improvementFactor to set. + * @return This builder for chaining. + */ + public Builder setImprovementFactor(double value) { + + improvementFactor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Estimated latency improvement factor. For example if the query
+       * currently takes 500 ms to run and the estimated latency with new indexes
+       * is 100 ms this field will be 5.
+       * 
+ * + * double improvement_factor = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearImprovementFactor() { + bitField0_ = (bitField0_ & ~0x00000002); + improvementFactor_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.QueryAdvisorResult.IndexAdvice) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.QueryAdvisorResult.IndexAdvice) + private static final com.google.spanner.v1.QueryAdvisorResult.IndexAdvice DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.QueryAdvisorResult.IndexAdvice(); + } + + public static com.google.spanner.v1.QueryAdvisorResult.IndexAdvice getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexAdvice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INDEX_ADVICE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List indexAdvice_; + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getIndexAdviceList() { + return indexAdvice_; + } + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getIndexAdviceOrBuilderList() { + return indexAdvice_; + } + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getIndexAdviceCount() { + return indexAdvice_.size(); + } + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice getIndexAdvice(int index) { + return indexAdvice_.get(index); + } + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult.IndexAdviceOrBuilder getIndexAdviceOrBuilder( + int index) { + return indexAdvice_.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 < indexAdvice_.size(); i++) { + output.writeMessage(1, indexAdvice_.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 < indexAdvice_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, indexAdvice_.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.spanner.v1.QueryAdvisorResult)) { + return super.equals(obj); + } + com.google.spanner.v1.QueryAdvisorResult other = (com.google.spanner.v1.QueryAdvisorResult) obj; + + if (!getIndexAdviceList().equals(other.getIndexAdviceList())) 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 (getIndexAdviceCount() > 0) { + hash = (37 * hash) + INDEX_ADVICE_FIELD_NUMBER; + hash = (53 * hash) + getIndexAdviceList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.QueryAdvisorResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.QueryAdvisorResult 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; + } + + /** + * + * + *
+   * Output of query advisor analysis.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.QueryAdvisorResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.QueryAdvisorResult) + com.google.spanner.v1.QueryAdvisorResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.QueryAdvisorResult.class, + com.google.spanner.v1.QueryAdvisorResult.Builder.class); + } + + // Construct using com.google.spanner.v1.QueryAdvisorResult.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (indexAdviceBuilder_ == null) { + indexAdvice_ = java.util.Collections.emptyList(); + } else { + indexAdvice_ = null; + indexAdviceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.QueryPlanProto + .internal_static_google_spanner_v1_QueryAdvisorResult_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult getDefaultInstanceForType() { + return com.google.spanner.v1.QueryAdvisorResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult build() { + com.google.spanner.v1.QueryAdvisorResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult buildPartial() { + com.google.spanner.v1.QueryAdvisorResult result = + new com.google.spanner.v1.QueryAdvisorResult(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.spanner.v1.QueryAdvisorResult result) { + if (indexAdviceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + indexAdvice_ = java.util.Collections.unmodifiableList(indexAdvice_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.indexAdvice_ = indexAdvice_; + } else { + result.indexAdvice_ = indexAdviceBuilder_.build(); + } + } + + private void buildPartial0(com.google.spanner.v1.QueryAdvisorResult 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.spanner.v1.QueryAdvisorResult) { + return mergeFrom((com.google.spanner.v1.QueryAdvisorResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.QueryAdvisorResult other) { + if (other == com.google.spanner.v1.QueryAdvisorResult.getDefaultInstance()) return this; + if (indexAdviceBuilder_ == null) { + if (!other.indexAdvice_.isEmpty()) { + if (indexAdvice_.isEmpty()) { + indexAdvice_ = other.indexAdvice_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIndexAdviceIsMutable(); + indexAdvice_.addAll(other.indexAdvice_); + } + onChanged(); + } + } else { + if (!other.indexAdvice_.isEmpty()) { + if (indexAdviceBuilder_.isEmpty()) { + indexAdviceBuilder_.dispose(); + indexAdviceBuilder_ = null; + indexAdvice_ = other.indexAdvice_; + bitField0_ = (bitField0_ & ~0x00000001); + indexAdviceBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndexAdviceFieldBuilder() + : null; + } else { + indexAdviceBuilder_.addAllMessages(other.indexAdvice_); + } + } + } + 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.spanner.v1.QueryAdvisorResult.IndexAdvice m = + input.readMessage( + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.parser(), + extensionRegistry); + if (indexAdviceBuilder_ == null) { + ensureIndexAdviceIsMutable(); + indexAdvice_.add(m); + } else { + indexAdviceBuilder_.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 indexAdvice_ = + java.util.Collections.emptyList(); + + private void ensureIndexAdviceIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + indexAdvice_ = + new java.util.ArrayList( + indexAdvice_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice, + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder, + com.google.spanner.v1.QueryAdvisorResult.IndexAdviceOrBuilder> + indexAdviceBuilder_; + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getIndexAdviceList() { + if (indexAdviceBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexAdvice_); + } else { + return indexAdviceBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getIndexAdviceCount() { + if (indexAdviceBuilder_ == null) { + return indexAdvice_.size(); + } else { + return indexAdviceBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice getIndexAdvice(int index) { + if (indexAdviceBuilder_ == null) { + return indexAdvice_.get(index); + } else { + return indexAdviceBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIndexAdvice( + int index, com.google.spanner.v1.QueryAdvisorResult.IndexAdvice value) { + if (indexAdviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexAdviceIsMutable(); + indexAdvice_.set(index, value); + onChanged(); + } else { + indexAdviceBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setIndexAdvice( + int index, com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder builderForValue) { + if (indexAdviceBuilder_ == null) { + ensureIndexAdviceIsMutable(); + indexAdvice_.set(index, builderForValue.build()); + onChanged(); + } else { + indexAdviceBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIndexAdvice(com.google.spanner.v1.QueryAdvisorResult.IndexAdvice value) { + if (indexAdviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexAdviceIsMutable(); + indexAdvice_.add(value); + onChanged(); + } else { + indexAdviceBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIndexAdvice( + int index, com.google.spanner.v1.QueryAdvisorResult.IndexAdvice value) { + if (indexAdviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexAdviceIsMutable(); + indexAdvice_.add(index, value); + onChanged(); + } else { + indexAdviceBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIndexAdvice( + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder builderForValue) { + if (indexAdviceBuilder_ == null) { + ensureIndexAdviceIsMutable(); + indexAdvice_.add(builderForValue.build()); + onChanged(); + } else { + indexAdviceBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addIndexAdvice( + int index, com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder builderForValue) { + if (indexAdviceBuilder_ == null) { + ensureIndexAdviceIsMutable(); + indexAdvice_.add(index, builderForValue.build()); + onChanged(); + } else { + indexAdviceBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllIndexAdvice( + java.lang.Iterable values) { + if (indexAdviceBuilder_ == null) { + ensureIndexAdviceIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexAdvice_); + onChanged(); + } else { + indexAdviceBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearIndexAdvice() { + if (indexAdviceBuilder_ == null) { + indexAdvice_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + indexAdviceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeIndexAdvice(int index) { + if (indexAdviceBuilder_ == null) { + ensureIndexAdviceIsMutable(); + indexAdvice_.remove(index); + onChanged(); + } else { + indexAdviceBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder getIndexAdviceBuilder( + int index) { + return getIndexAdviceFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.QueryAdvisorResult.IndexAdviceOrBuilder getIndexAdviceOrBuilder( + int index) { + if (indexAdviceBuilder_ == null) { + return indexAdvice_.get(index); + } else { + return indexAdviceBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getIndexAdviceOrBuilderList() { + if (indexAdviceBuilder_ != null) { + return indexAdviceBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexAdvice_); + } + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder addIndexAdviceBuilder() { + return getIndexAdviceFieldBuilder() + .addBuilder(com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder addIndexAdviceBuilder( + int index) { + return getIndexAdviceFieldBuilder() + .addBuilder( + index, com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Index Recommendation for a query. This is an optional field and
+     * the recommendation will only be available when the recommendation
+     * guarantees significant improvement in query performance.
+     * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getIndexAdviceBuilderList() { + return getIndexAdviceFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice, + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder, + com.google.spanner.v1.QueryAdvisorResult.IndexAdviceOrBuilder> + getIndexAdviceFieldBuilder() { + if (indexAdviceBuilder_ == null) { + indexAdviceBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice, + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice.Builder, + com.google.spanner.v1.QueryAdvisorResult.IndexAdviceOrBuilder>( + indexAdvice_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + indexAdvice_ = null; + } + return indexAdviceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.QueryAdvisorResult) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.QueryAdvisorResult) + private static final com.google.spanner.v1.QueryAdvisorResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.QueryAdvisorResult(); + } + + public static com.google.spanner.v1.QueryAdvisorResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryAdvisorResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryAdvisorResultOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryAdvisorResultOrBuilder.java new file mode 100644 index 00000000000..fb09b759285 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryAdvisorResultOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/query_plan.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface QueryAdvisorResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.QueryAdvisorResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getIndexAdviceList(); + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.v1.QueryAdvisorResult.IndexAdvice getIndexAdvice(int index); + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getIndexAdviceCount(); + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getIndexAdviceOrBuilderList(); + + /** + * + * + *
+   * Optional. Index Recommendation for a query. This is an optional field and
+   * the recommendation will only be available when the recommendation
+   * guarantees significant improvement in query performance.
+   * 
+ * + * + * repeated .google.spanner.v1.QueryAdvisorResult.IndexAdvice index_advice = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.v1.QueryAdvisorResult.IndexAdviceOrBuilder getIndexAdviceOrBuilder(int index); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlan.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlan.java index 30f4a95bf4e..cd2666d1214 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlan.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlan.java @@ -63,6 +63,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.spanner.v1.QueryPlan.class, com.google.spanner.v1.QueryPlan.Builder.class); } + private int bitField0_; public static final int PLAN_NODES_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -149,6 +150,68 @@ public com.google.spanner.v1.PlanNodeOrBuilder getPlanNodesOrBuilder(int index) return planNodes_.get(index); } + public static final int QUERY_ADVICE_FIELD_NUMBER = 2; + private com.google.spanner.v1.QueryAdvisorResult queryAdvice_; + + /** + * + * + *
+   * Optional. The advise/recommendations for a query. Currently this field will
+   * be serving index recommendations for a query.
+   * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the queryAdvice field is set. + */ + @java.lang.Override + public boolean hasQueryAdvice() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. The advise/recommendations for a query. Currently this field will
+   * be serving index recommendations for a query.
+   * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The queryAdvice. + */ + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResult getQueryAdvice() { + return queryAdvice_ == null + ? com.google.spanner.v1.QueryAdvisorResult.getDefaultInstance() + : queryAdvice_; + } + + /** + * + * + *
+   * Optional. The advise/recommendations for a query. Currently this field will
+   * be serving index recommendations for a query.
+   * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.v1.QueryAdvisorResultOrBuilder getQueryAdviceOrBuilder() { + return queryAdvice_ == null + ? com.google.spanner.v1.QueryAdvisorResult.getDefaultInstance() + : queryAdvice_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -166,6 +229,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < planNodes_.size(); i++) { output.writeMessage(1, planNodes_.get(i)); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getQueryAdvice()); + } getUnknownFields().writeTo(output); } @@ -178,6 +244,9 @@ public int getSerializedSize() { for (int i = 0; i < planNodes_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, planNodes_.get(i)); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryAdvice()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -194,6 +263,10 @@ public boolean equals(final java.lang.Object obj) { com.google.spanner.v1.QueryPlan other = (com.google.spanner.v1.QueryPlan) obj; if (!getPlanNodesList().equals(other.getPlanNodesList())) return false; + if (hasQueryAdvice() != other.hasQueryAdvice()) return false; + if (hasQueryAdvice()) { + if (!getQueryAdvice().equals(other.getQueryAdvice())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -209,6 +282,10 @@ public int hashCode() { hash = (37 * hash) + PLAN_NODES_FIELD_NUMBER; hash = (53 * hash) + getPlanNodesList().hashCode(); } + if (hasQueryAdvice()) { + hash = (37 * hash) + QUERY_ADVICE_FIELD_NUMBER; + hash = (53 * hash) + getQueryAdvice().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -337,10 +414,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.spanner.v1.QueryPlan.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPlanNodesFieldBuilder(); + getQueryAdviceFieldBuilder(); + } } @java.lang.Override @@ -354,6 +441,11 @@ public Builder clear() { planNodesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); + queryAdvice_ = null; + if (queryAdviceBuilder_ != null) { + queryAdviceBuilder_.dispose(); + queryAdviceBuilder_ = null; + } return this; } @@ -402,6 +494,13 @@ private void buildPartialRepeatedFields(com.google.spanner.v1.QueryPlan result) private void buildPartial0(com.google.spanner.v1.QueryPlan result) { int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.queryAdvice_ = + queryAdviceBuilder_ == null ? queryAdvice_ : queryAdviceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -476,6 +575,9 @@ public Builder mergeFrom(com.google.spanner.v1.QueryPlan other) { } } } + if (other.hasQueryAdvice()) { + mergeQueryAdvice(other.getQueryAdvice()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -514,6 +616,12 @@ public Builder mergeFrom( } break; } // case 10 + case 18: + { + input.readMessage(getQueryAdviceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -932,6 +1040,228 @@ public java.util.List getPlanNodesBuilde return planNodesBuilder_; } + private com.google.spanner.v1.QueryAdvisorResult queryAdvice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.QueryAdvisorResult, + com.google.spanner.v1.QueryAdvisorResult.Builder, + com.google.spanner.v1.QueryAdvisorResultOrBuilder> + queryAdviceBuilder_; + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the queryAdvice field is set. + */ + public boolean hasQueryAdvice() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The queryAdvice. + */ + public com.google.spanner.v1.QueryAdvisorResult getQueryAdvice() { + if (queryAdviceBuilder_ == null) { + return queryAdvice_ == null + ? com.google.spanner.v1.QueryAdvisorResult.getDefaultInstance() + : queryAdvice_; + } else { + return queryAdviceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setQueryAdvice(com.google.spanner.v1.QueryAdvisorResult value) { + if (queryAdviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryAdvice_ = value; + } else { + queryAdviceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setQueryAdvice( + com.google.spanner.v1.QueryAdvisorResult.Builder builderForValue) { + if (queryAdviceBuilder_ == null) { + queryAdvice_ = builderForValue.build(); + } else { + queryAdviceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeQueryAdvice(com.google.spanner.v1.QueryAdvisorResult value) { + if (queryAdviceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && queryAdvice_ != null + && queryAdvice_ != com.google.spanner.v1.QueryAdvisorResult.getDefaultInstance()) { + getQueryAdviceBuilder().mergeFrom(value); + } else { + queryAdvice_ = value; + } + } else { + queryAdviceBuilder_.mergeFrom(value); + } + if (queryAdvice_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearQueryAdvice() { + bitField0_ = (bitField0_ & ~0x00000002); + queryAdvice_ = null; + if (queryAdviceBuilder_ != null) { + queryAdviceBuilder_.dispose(); + queryAdviceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.QueryAdvisorResult.Builder getQueryAdviceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getQueryAdviceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.QueryAdvisorResultOrBuilder getQueryAdviceOrBuilder() { + if (queryAdviceBuilder_ != null) { + return queryAdviceBuilder_.getMessageOrBuilder(); + } else { + return queryAdvice_ == null + ? com.google.spanner.v1.QueryAdvisorResult.getDefaultInstance() + : queryAdvice_; + } + } + + /** + * + * + *
+     * Optional. The advise/recommendations for a query. Currently this field will
+     * be serving index recommendations for a query.
+     * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.QueryAdvisorResult, + com.google.spanner.v1.QueryAdvisorResult.Builder, + com.google.spanner.v1.QueryAdvisorResultOrBuilder> + getQueryAdviceFieldBuilder() { + if (queryAdviceBuilder_ == null) { + queryAdviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.QueryAdvisorResult, + com.google.spanner.v1.QueryAdvisorResult.Builder, + com.google.spanner.v1.QueryAdvisorResultOrBuilder>( + getQueryAdvice(), getParentForChildren(), isClean()); + queryAdvice_ = null; + } + return queryAdviceBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanOrBuilder.java index 7b09d935bbb..0fe34698c65 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanOrBuilder.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanOrBuilder.java @@ -88,4 +88,50 @@ public interface QueryPlanOrBuilder * repeated .google.spanner.v1.PlanNode plan_nodes = 1; */ com.google.spanner.v1.PlanNodeOrBuilder getPlanNodesOrBuilder(int index); + + /** + * + * + *
+   * Optional. The advise/recommendations for a query. Currently this field will
+   * be serving index recommendations for a query.
+   * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the queryAdvice field is set. + */ + boolean hasQueryAdvice(); + + /** + * + * + *
+   * Optional. The advise/recommendations for a query. Currently this field will
+   * be serving index recommendations for a query.
+   * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The queryAdvice. + */ + com.google.spanner.v1.QueryAdvisorResult getQueryAdvice(); + + /** + * + * + *
+   * Optional. The advise/recommendations for a query. Currently this field will
+   * be serving index recommendations for a query.
+   * 
+ * + * + * .google.spanner.v1.QueryAdvisorResult query_advice = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.v1.QueryAdvisorResultOrBuilder getQueryAdviceOrBuilder(); } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanProto.java index e252525aec6..91f6078d05f 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanProto.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/QueryPlanProto.java @@ -44,6 +44,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_spanner_v1_PlanNode_ShortRepresentation_SubqueriesEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_spanner_v1_PlanNode_ShortRepresentation_SubqueriesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_QueryAdvisorResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_QueryAdvisorResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_spanner_v1_QueryPlan_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -59,14 +67,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n" + "\"google/spanner/v1/query_plan.proto\022\021go" - + "ogle.spanner.v1\032\034google/protobuf/struct.proto\"\370\004\n" + + "ogle.spanner.v1\032\037google/api/field_behavi" + + "or.proto\032\034google/protobuf/struct.proto\"\370\004\n" + "\010PlanNode\022\r\n" + "\005index\030\001 \001(\005\022.\n" + "\004kind\030\002 \001(\0162 .google.spanner.v1.PlanNode.Kind\022\024\n" + "\014display_name\030\003 \001(\t\022:\n" + "\013child_links\030\004 \003(\0132%.google.spanner.v1.PlanNode.ChildLink\022M\n" - + "\024short_representation\030\005 \001(\0132/.goog" - + "le.spanner.v1.PlanNode.ShortRepresentation\022)\n" + + "\024short_representation\030\005" + + " \001(\0132/.google.spanner.v1.PlanNode.ShortRepresentation\022)\n" + "\010metadata\030\006 \001(\0132\027.google.protobuf.Struct\0220\n" + "\017execution_stats\030\007 \001(\0132\027.google.protobuf.Struct\032@\n" + "\tChildLink\022\023\n" @@ -75,26 +84,35 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\010variable\030\003 \001(\t\032\262\001\n" + "\023ShortRepresentation\022\023\n" + "\013description\030\001 \001(\t\022S\n\n" - + "subqueries\030\002 \003(\0132?.google.span" - + "ner.v1.PlanNode.ShortRepresentation.SubqueriesEntry\0321\n" + + "subqueries\030\002 \003(\0132?.google.spanner.v1." + + "PlanNode.ShortRepresentation.SubqueriesEntry\0321\n" + "\017SubqueriesEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" + "\005value\030\002 \001(\005:\0028\001\"8\n" + "\004Kind\022\024\n" + "\020KIND_UNSPECIFIED\020\000\022\016\n\n" + "RELATIONAL\020\001\022\n\n" - + "\006SCALAR\020\002\"<\n" + + "\006SCALAR\020\002\"\244\001\n" + + "\022QueryAdvisorResult\022L\n" + + "\014index_advice\030\001 \003(\01321" + + ".google.spanner.v1.QueryAdvisorResult.IndexAdviceB\003\340A\001\032@\n" + + "\013IndexAdvice\022\020\n" + + "\003ddl\030\001 \003(\tB\003\340A\001\022\037\n" + + "\022improvement_factor\030\002 \001(\001B\003\340A\001\"~\n" + "\tQueryPlan\022/\n\n" - + "plan_nodes\030\001 \003(\0132\033.google.spanner.v1.PlanNodeB\261\001\n" - + "\025com.google.spanner.v1B\016QueryPlanProtoP\001Z5cloud.google" - + ".com/go/spanner/apiv1/spannerpb;spannerp" - + "b\252\002\027Google.Cloud.Spanner.V1\312\002\027Google\\Clo" - + "ud\\Spanner\\V1\352\002\032Google::Cloud::Spanner::V1b\006proto3" + + "plan_nodes\030\001 \003(\0132\033.google.spanner.v1.PlanNode\022@\n" + + "\014query_advice\030\002" + + " \001(\0132%.google.spanner.v1.QueryAdvisorResultB\003\340A\001B\261\001\n" + + "\025com.google.spanner.v1B\016QueryPlanProtoP\001Z5cloud.google.com/go/spanne" + + "r/apiv1/spannerpb;spannerpb\252\002\027Google.Clo" + + "ud.Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1\352" + + "\002\032Google::Cloud::Spanner::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), }); internal_static_google_spanner_v1_PlanNode_descriptor = @@ -137,14 +155,36 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); - internal_static_google_spanner_v1_QueryPlan_descriptor = + internal_static_google_spanner_v1_QueryAdvisorResult_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_spanner_v1_QueryAdvisorResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_QueryAdvisorResult_descriptor, + new java.lang.String[] { + "IndexAdvice", + }); + internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_descriptor = + internal_static_google_spanner_v1_QueryAdvisorResult_descriptor.getNestedTypes().get(0); + internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_QueryAdvisorResult_IndexAdvice_descriptor, + new java.lang.String[] { + "Ddl", "ImprovementFactor", + }); + internal_static_google_spanner_v1_QueryPlan_descriptor = + getDescriptor().getMessageTypes().get(2); internal_static_google_spanner_v1_QueryPlan_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_v1_QueryPlan_descriptor, new java.lang.String[] { - "PlanNodes", + "PlanNodes", "QueryAdvice", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Range.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Range.java new file mode 100644 index 00000000000..9b88e5025b9 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Range.java @@ -0,0 +1,982 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +/** + * + * + *
+ * A `Range` represents a range of keys in a database. The keys themselves
+ * are encoded in "sortable string format", also known as ssformat. Consult
+ * Spanner's open source client libraries for details on the encoding.
+ *
+ * Each range represents a contiguous range of rows, possibly from multiple
+ * tables/indexes. Each range is associated with a single paxos group (known as
+ * a "group" throughout this API), a split (which names the exact range within
+ * the group), and a generation that can be used to determine whether a given
+ * `Range` represents a newer or older location for the key range.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.Range} + */ +public final class Range extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.Range) + RangeOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Range.newBuilder() to construct. + private Range(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Range() { + startKey_ = com.google.protobuf.ByteString.EMPTY; + limitKey_ = com.google.protobuf.ByteString.EMPTY; + generation_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Range(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto.internal_static_google_spanner_v1_Range_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Range.class, com.google.spanner.v1.Range.Builder.class); + } + + public static final int START_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString startKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The start key of the range, inclusive. Encoded in "sortable string format"
+   * (ssformat).
+   * 
+ * + * bytes start_key = 1; + * + * @return The startKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartKey() { + return startKey_; + } + + public static final int LIMIT_KEY_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString limitKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The limit key of the range, exclusive. Encoded in "sortable string format"
+   * (ssformat).
+   * 
+ * + * bytes limit_key = 2; + * + * @return The limitKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLimitKey() { + return limitKey_; + } + + public static final int GROUP_UID_FIELD_NUMBER = 3; + private long groupUid_ = 0L; + + /** + * + * + *
+   * The UID of the paxos group where this range is stored. UIDs are unique
+   * within the database. References `Group.group_uid`.
+   * 
+ * + * uint64 group_uid = 3; + * + * @return The groupUid. + */ + @java.lang.Override + public long getGroupUid() { + return groupUid_; + } + + public static final int SPLIT_ID_FIELD_NUMBER = 4; + private long splitId_ = 0L; + + /** + * + * + *
+   * A group can store multiple ranges of keys. Each key range is named by an
+   * ID (the split ID). Within a group, split IDs are unique. The `split_id`
+   * names the exact split in `group_uid` where this range is stored.
+   * 
+ * + * uint64 split_id = 4; + * + * @return The splitId. + */ + @java.lang.Override + public long getSplitId() { + return splitId_; + } + + public static final int GENERATION_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString generation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * `generation` indicates the freshness of the range information contained
+   * in this proto. Generations can be compared lexicographically; if generation
+   * A is greater than generation B, then the `Range` corresponding to A is
+   * newer than the `Range` corresponding to B, and should be used
+   * preferentially.
+   * 
+ * + * bytes generation = 5; + * + * @return The generation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGeneration() { + return generation_; + } + + 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 (!startKey_.isEmpty()) { + output.writeBytes(1, startKey_); + } + if (!limitKey_.isEmpty()) { + output.writeBytes(2, limitKey_); + } + if (groupUid_ != 0L) { + output.writeUInt64(3, groupUid_); + } + if (splitId_ != 0L) { + output.writeUInt64(4, splitId_); + } + if (!generation_.isEmpty()) { + output.writeBytes(5, generation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!startKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, startKey_); + } + if (!limitKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, limitKey_); + } + if (groupUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(3, groupUid_); + } + if (splitId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(4, splitId_); + } + if (!generation_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, generation_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.Range)) { + return super.equals(obj); + } + com.google.spanner.v1.Range other = (com.google.spanner.v1.Range) obj; + + if (!getStartKey().equals(other.getStartKey())) return false; + if (!getLimitKey().equals(other.getLimitKey())) return false; + if (getGroupUid() != other.getGroupUid()) return false; + if (getSplitId() != other.getSplitId()) return false; + if (!getGeneration().equals(other.getGeneration())) 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) + START_KEY_FIELD_NUMBER; + hash = (53 * hash) + getStartKey().hashCode(); + hash = (37 * hash) + LIMIT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getLimitKey().hashCode(); + hash = (37 * hash) + GROUP_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGroupUid()); + hash = (37 * hash) + SPLIT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSplitId()); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + getGeneration().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.Range parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Range parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Range parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Range parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Range parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Range parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Range parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Range parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Range parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Range parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Range parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Range parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.Range 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; + } + + /** + * + * + *
+   * A `Range` represents a range of keys in a database. The keys themselves
+   * are encoded in "sortable string format", also known as ssformat. Consult
+   * Spanner's open source client libraries for details on the encoding.
+   *
+   * Each range represents a contiguous range of rows, possibly from multiple
+   * tables/indexes. Each range is associated with a single paxos group (known as
+   * a "group" throughout this API), a split (which names the exact range within
+   * the group), and a generation that can be used to determine whether a given
+   * `Range` represents a newer or older location for the key range.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.Range} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.Range) + com.google.spanner.v1.RangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto.internal_static_google_spanner_v1_Range_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Range.class, com.google.spanner.v1.Range.Builder.class); + } + + // Construct using com.google.spanner.v1.Range.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startKey_ = com.google.protobuf.ByteString.EMPTY; + limitKey_ = com.google.protobuf.ByteString.EMPTY; + groupUid_ = 0L; + splitId_ = 0L; + generation_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto.internal_static_google_spanner_v1_Range_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.Range getDefaultInstanceForType() { + return com.google.spanner.v1.Range.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.Range build() { + com.google.spanner.v1.Range result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.Range buildPartial() { + com.google.spanner.v1.Range result = new com.google.spanner.v1.Range(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.Range result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startKey_ = startKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.limitKey_ = limitKey_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.groupUid_ = groupUid_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.splitId_ = splitId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.generation_ = generation_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.Range) { + return mergeFrom((com.google.spanner.v1.Range) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.Range other) { + if (other == com.google.spanner.v1.Range.getDefaultInstance()) return this; + if (other.getStartKey() != com.google.protobuf.ByteString.EMPTY) { + setStartKey(other.getStartKey()); + } + if (other.getLimitKey() != com.google.protobuf.ByteString.EMPTY) { + setLimitKey(other.getLimitKey()); + } + if (other.getGroupUid() != 0L) { + setGroupUid(other.getGroupUid()); + } + if (other.getSplitId() != 0L) { + setSplitId(other.getSplitId()); + } + if (other.getGeneration() != com.google.protobuf.ByteString.EMPTY) { + setGeneration(other.getGeneration()); + } + 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: + { + startKey_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + limitKey_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + groupUid_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + splitId_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + generation_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString startKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The start key of the range, inclusive. Encoded in "sortable string format"
+     * (ssformat).
+     * 
+ * + * bytes start_key = 1; + * + * @return The startKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStartKey() { + return startKey_; + } + + /** + * + * + *
+     * The start key of the range, inclusive. Encoded in "sortable string format"
+     * (ssformat).
+     * 
+ * + * bytes start_key = 1; + * + * @param value The startKey to set. + * @return This builder for chaining. + */ + public Builder setStartKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + startKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start key of the range, inclusive. Encoded in "sortable string format"
+     * (ssformat).
+     * 
+ * + * bytes start_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartKey() { + bitField0_ = (bitField0_ & ~0x00000001); + startKey_ = getDefaultInstance().getStartKey(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString limitKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The limit key of the range, exclusive. Encoded in "sortable string format"
+     * (ssformat).
+     * 
+ * + * bytes limit_key = 2; + * + * @return The limitKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLimitKey() { + return limitKey_; + } + + /** + * + * + *
+     * The limit key of the range, exclusive. Encoded in "sortable string format"
+     * (ssformat).
+     * 
+ * + * bytes limit_key = 2; + * + * @param value The limitKey to set. + * @return This builder for chaining. + */ + public Builder setLimitKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + limitKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The limit key of the range, exclusive. Encoded in "sortable string format"
+     * (ssformat).
+     * 
+ * + * bytes limit_key = 2; + * + * @return This builder for chaining. + */ + public Builder clearLimitKey() { + bitField0_ = (bitField0_ & ~0x00000002); + limitKey_ = getDefaultInstance().getLimitKey(); + onChanged(); + return this; + } + + private long groupUid_; + + /** + * + * + *
+     * The UID of the paxos group where this range is stored. UIDs are unique
+     * within the database. References `Group.group_uid`.
+     * 
+ * + * uint64 group_uid = 3; + * + * @return The groupUid. + */ + @java.lang.Override + public long getGroupUid() { + return groupUid_; + } + + /** + * + * + *
+     * The UID of the paxos group where this range is stored. UIDs are unique
+     * within the database. References `Group.group_uid`.
+     * 
+ * + * uint64 group_uid = 3; + * + * @param value The groupUid to set. + * @return This builder for chaining. + */ + public Builder setGroupUid(long value) { + + groupUid_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The UID of the paxos group where this range is stored. UIDs are unique
+     * within the database. References `Group.group_uid`.
+     * 
+ * + * uint64 group_uid = 3; + * + * @return This builder for chaining. + */ + public Builder clearGroupUid() { + bitField0_ = (bitField0_ & ~0x00000004); + groupUid_ = 0L; + onChanged(); + return this; + } + + private long splitId_; + + /** + * + * + *
+     * A group can store multiple ranges of keys. Each key range is named by an
+     * ID (the split ID). Within a group, split IDs are unique. The `split_id`
+     * names the exact split in `group_uid` where this range is stored.
+     * 
+ * + * uint64 split_id = 4; + * + * @return The splitId. + */ + @java.lang.Override + public long getSplitId() { + return splitId_; + } + + /** + * + * + *
+     * A group can store multiple ranges of keys. Each key range is named by an
+     * ID (the split ID). Within a group, split IDs are unique. The `split_id`
+     * names the exact split in `group_uid` where this range is stored.
+     * 
+ * + * uint64 split_id = 4; + * + * @param value The splitId to set. + * @return This builder for chaining. + */ + public Builder setSplitId(long value) { + + splitId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * A group can store multiple ranges of keys. Each key range is named by an
+     * ID (the split ID). Within a group, split IDs are unique. The `split_id`
+     * names the exact split in `group_uid` where this range is stored.
+     * 
+ * + * uint64 split_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearSplitId() { + bitField0_ = (bitField0_ & ~0x00000008); + splitId_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString generation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * `generation` indicates the freshness of the range information contained
+     * in this proto. Generations can be compared lexicographically; if generation
+     * A is greater than generation B, then the `Range` corresponding to A is
+     * newer than the `Range` corresponding to B, and should be used
+     * preferentially.
+     * 
+ * + * bytes generation = 5; + * + * @return The generation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGeneration() { + return generation_; + } + + /** + * + * + *
+     * `generation` indicates the freshness of the range information contained
+     * in this proto. Generations can be compared lexicographically; if generation
+     * A is greater than generation B, then the `Range` corresponding to A is
+     * newer than the `Range` corresponding to B, and should be used
+     * preferentially.
+     * 
+ * + * bytes generation = 5; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + generation_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * `generation` indicates the freshness of the range information contained
+     * in this proto. Generations can be compared lexicographically; if generation
+     * A is greater than generation B, then the `Range` corresponding to A is
+     * newer than the `Range` corresponding to B, and should be used
+     * preferentially.
+     * 
+ * + * bytes generation = 5; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + bitField0_ = (bitField0_ & ~0x00000010); + generation_ = getDefaultInstance().getGeneration(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.Range) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.Range) + private static final com.google.spanner.v1.Range DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.Range(); + } + + public static com.google.spanner.v1.Range getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Range parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.Range getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RangeOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RangeOrBuilder.java new file mode 100644 index 00000000000..baa84dfd049 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RangeOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface RangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.Range) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The start key of the range, inclusive. Encoded in "sortable string format"
+   * (ssformat).
+   * 
+ * + * bytes start_key = 1; + * + * @return The startKey. + */ + com.google.protobuf.ByteString getStartKey(); + + /** + * + * + *
+   * The limit key of the range, exclusive. Encoded in "sortable string format"
+   * (ssformat).
+   * 
+ * + * bytes limit_key = 2; + * + * @return The limitKey. + */ + com.google.protobuf.ByteString getLimitKey(); + + /** + * + * + *
+   * The UID of the paxos group where this range is stored. UIDs are unique
+   * within the database. References `Group.group_uid`.
+   * 
+ * + * uint64 group_uid = 3; + * + * @return The groupUid. + */ + long getGroupUid(); + + /** + * + * + *
+   * A group can store multiple ranges of keys. Each key range is named by an
+   * ID (the split ID). Within a group, split IDs are unique. The `split_id`
+   * names the exact split in `group_uid` where this range is stored.
+   * 
+ * + * uint64 split_id = 4; + * + * @return The splitId. + */ + long getSplitId(); + + /** + * + * + *
+   * `generation` indicates the freshness of the range information contained
+   * in this proto. Generations can be compared lexicographically; if generation
+   * A is greater than generation B, then the `Range` corresponding to A is
+   * newer than the `Range` corresponding to B, and should be used
+   * preferentially.
+   * 
+ * + * bytes generation = 5; + * + * @return The generation. + */ + com.google.protobuf.ByteString getGeneration(); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequest.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequest.java index 2ae6e5b964a..7330c517915 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequest.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequest.java @@ -1162,6 +1162,80 @@ public com.google.spanner.v1.ReadRequest.LockHint getLockHint() { return result == null ? com.google.spanner.v1.ReadRequest.LockHint.UNRECOGNIZED : result; } + public static final int ROUTING_HINT_FIELD_NUMBER = 18; + private com.google.spanner.v1.RoutingHint routingHint_; + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingHint field is set. + */ + @java.lang.Override + public boolean hasRoutingHint() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingHint. + */ + @java.lang.Override + public com.google.spanner.v1.RoutingHint getRoutingHint() { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.spanner.v1.RoutingHintOrBuilder getRoutingHintOrBuilder() { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1218,6 +1292,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (lockHint_ != com.google.spanner.v1.ReadRequest.LockHint.LOCK_HINT_UNSPECIFIED.getNumber()) { output.writeEnum(17, lockHint_); } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(18, getRoutingHint()); + } getUnknownFields().writeTo(output); } @@ -1275,6 +1352,9 @@ public int getSerializedSize() { if (lockHint_ != com.google.spanner.v1.ReadRequest.LockHint.LOCK_HINT_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(17, lockHint_); } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getRoutingHint()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1316,6 +1396,10 @@ public boolean equals(final java.lang.Object obj) { if (getDataBoostEnabled() != other.getDataBoostEnabled()) return false; if (orderBy_ != other.orderBy_) return false; if (lockHint_ != other.lockHint_) return false; + if (hasRoutingHint() != other.hasRoutingHint()) return false; + if (hasRoutingHint()) { + if (!getRoutingHint().equals(other.getRoutingHint())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1365,6 +1449,10 @@ public int hashCode() { hash = (53 * hash) + orderBy_; hash = (37 * hash) + LOCK_HINT_FIELD_NUMBER; hash = (53 * hash) + lockHint_; + if (hasRoutingHint()) { + hash = (37 * hash) + ROUTING_HINT_FIELD_NUMBER; + hash = (53 * hash) + getRoutingHint().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1510,6 +1598,7 @@ private void maybeForceBuilderInitialization() { getKeySetFieldBuilder(); getRequestOptionsFieldBuilder(); getDirectedReadOptionsFieldBuilder(); + getRoutingHintFieldBuilder(); } } @@ -1547,6 +1636,11 @@ public Builder clear() { dataBoostEnabled_ = false; orderBy_ = 0; lockHint_ = 0; + routingHint_ = null; + if (routingHintBuilder_ != null) { + routingHintBuilder_.dispose(); + routingHintBuilder_ = null; + } return this; } @@ -1635,6 +1729,11 @@ private void buildPartial0(com.google.spanner.v1.ReadRequest result) { if (((from_bitField0_ & 0x00002000) != 0)) { result.lockHint_ = lockHint_; } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.routingHint_ = + routingHintBuilder_ == null ? routingHint_ : routingHintBuilder_.build(); + to_bitField0_ |= 0x00000010; + } result.bitField0_ |= to_bitField0_; } @@ -1738,6 +1837,9 @@ public Builder mergeFrom(com.google.spanner.v1.ReadRequest other) { if (other.lockHint_ != 0) { setLockHintValue(other.getLockHintValue()); } + if (other.hasRoutingHint()) { + mergeRoutingHint(other.getRoutingHint()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1850,6 +1952,12 @@ public Builder mergeFrom( bitField0_ |= 0x00002000; break; } // case 136 + case 146: + { + input.readMessage(getRoutingHintFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 146 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3868,6 +3976,263 @@ public Builder clearLockHint() { return this; } + private com.google.spanner.v1.RoutingHint routingHint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RoutingHint, + com.google.spanner.v1.RoutingHint.Builder, + com.google.spanner.v1.RoutingHintOrBuilder> + routingHintBuilder_; + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingHint field is set. + */ + public boolean hasRoutingHint() { + return ((bitField0_ & 0x00004000) != 0); + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingHint. + */ + public com.google.spanner.v1.RoutingHint getRoutingHint() { + if (routingHintBuilder_ == null) { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } else { + return routingHintBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRoutingHint(com.google.spanner.v1.RoutingHint value) { + if (routingHintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingHint_ = value; + } else { + routingHintBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRoutingHint(com.google.spanner.v1.RoutingHint.Builder builderForValue) { + if (routingHintBuilder_ == null) { + routingHint_ = builderForValue.build(); + } else { + routingHintBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRoutingHint(com.google.spanner.v1.RoutingHint value) { + if (routingHintBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && routingHint_ != null + && routingHint_ != com.google.spanner.v1.RoutingHint.getDefaultInstance()) { + getRoutingHintBuilder().mergeFrom(value); + } else { + routingHint_ = value; + } + } else { + routingHintBuilder_.mergeFrom(value); + } + if (routingHint_ != null) { + bitField0_ |= 0x00004000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRoutingHint() { + bitField0_ = (bitField0_ & ~0x00004000); + routingHint_ = null; + if (routingHintBuilder_ != null) { + routingHintBuilder_.dispose(); + routingHintBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.RoutingHint.Builder getRoutingHintBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getRoutingHintFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.spanner.v1.RoutingHintOrBuilder getRoutingHintOrBuilder() { + if (routingHintBuilder_ != null) { + return routingHintBuilder_.getMessageOrBuilder(); + } else { + return routingHint_ == null + ? com.google.spanner.v1.RoutingHint.getDefaultInstance() + : routingHint_; + } + } + + /** + * + * + *
+     * Optional. If present, it makes the Spanner requests location-aware.
+     *
+     * It gives the server hints that can be used to route the request
+     * to an appropriate server, potentially significantly decreasing latency and
+     * improving throughput. To achieve improved performance, most fields must be
+     * filled in with accurate values.
+     * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RoutingHint, + com.google.spanner.v1.RoutingHint.Builder, + com.google.spanner.v1.RoutingHintOrBuilder> + getRoutingHintFieldBuilder() { + if (routingHintBuilder_ == null) { + routingHintBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.RoutingHint, + com.google.spanner.v1.RoutingHint.Builder, + com.google.spanner.v1.RoutingHintOrBuilder>( + getRoutingHint(), getParentForChildren(), isClean()); + routingHint_ = null; + } + return routingHintBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequestOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequestOrBuilder.java index 3cf4fa6a43a..ef42373022e 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequestOrBuilder.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ReadRequestOrBuilder.java @@ -511,4 +511,62 @@ public interface ReadRequestOrBuilder * @return The lockHint. */ com.google.spanner.v1.ReadRequest.LockHint getLockHint(); + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingHint field is set. + */ + boolean hasRoutingHint(); + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingHint. + */ + com.google.spanner.v1.RoutingHint getRoutingHint(); + + /** + * + * + *
+   * Optional. If present, it makes the Spanner requests location-aware.
+   *
+   * It gives the server hints that can be used to route the request
+   * to an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   * 
+ * + * + * .google.spanner.v1.RoutingHint routing_hint = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.spanner.v1.RoutingHintOrBuilder getRoutingHintOrBuilder(); } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RecipeList.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RecipeList.java new file mode 100644 index 00000000000..705f57b0cfd --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RecipeList.java @@ -0,0 +1,1072 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +/** + * + * + *
+ * A `RecipeList` contains a list of `KeyRecipe`s, which share the same
+ * schema generation.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.RecipeList} + */ +public final class RecipeList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.RecipeList) + RecipeListOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RecipeList.newBuilder() to construct. + private RecipeList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecipeList() { + schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + recipe_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecipeList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RecipeList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RecipeList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.RecipeList.class, com.google.spanner.v1.RecipeList.Builder.class); + } + + public static final int SCHEMA_GENERATION_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The schema generation of the recipes. To be sent to the server in
+   * `RoutingHint.schema_generation` whenever one of the recipes is used.
+   * `schema_generation` values are comparable with each other; if generation A
+   * compares greater than generation B, then A is a more recent schema than B.
+   * Clients should in general aim to cache only the latest schema generation,
+   * and discard more stale recipes.
+   * 
+ * + * bytes schema_generation = 1; + * + * @return The schemaGeneration. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaGeneration() { + return schemaGeneration_; + } + + public static final int RECIPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List recipe_; + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + @java.lang.Override + public java.util.List getRecipeList() { + return recipe_; + } + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + @java.lang.Override + public java.util.List + getRecipeOrBuilderList() { + return recipe_; + } + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + @java.lang.Override + public int getRecipeCount() { + return recipe_.size(); + } + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipe getRecipe(int index) { + return recipe_.get(index); + } + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + @java.lang.Override + public com.google.spanner.v1.KeyRecipeOrBuilder getRecipeOrBuilder(int index) { + return recipe_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!schemaGeneration_.isEmpty()) { + output.writeBytes(1, schemaGeneration_); + } + for (int i = 0; i < recipe_.size(); i++) { + output.writeMessage(3, recipe_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!schemaGeneration_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, schemaGeneration_); + } + for (int i = 0; i < recipe_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, recipe_.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.spanner.v1.RecipeList)) { + return super.equals(obj); + } + com.google.spanner.v1.RecipeList other = (com.google.spanner.v1.RecipeList) obj; + + if (!getSchemaGeneration().equals(other.getSchemaGeneration())) return false; + if (!getRecipeList().equals(other.getRecipeList())) 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) + SCHEMA_GENERATION_FIELD_NUMBER; + hash = (53 * hash) + getSchemaGeneration().hashCode(); + if (getRecipeCount() > 0) { + hash = (37 * hash) + RECIPE_FIELD_NUMBER; + hash = (53 * hash) + getRecipeList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.RecipeList parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RecipeList parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RecipeList parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RecipeList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RecipeList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RecipeList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RecipeList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RecipeList parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.RecipeList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RecipeList parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.RecipeList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RecipeList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.RecipeList 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; + } + + /** + * + * + *
+   * A `RecipeList` contains a list of `KeyRecipe`s, which share the same
+   * schema generation.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.RecipeList} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.RecipeList) + com.google.spanner.v1.RecipeListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RecipeList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RecipeList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.RecipeList.class, + com.google.spanner.v1.RecipeList.Builder.class); + } + + // Construct using com.google.spanner.v1.RecipeList.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + if (recipeBuilder_ == null) { + recipe_ = java.util.Collections.emptyList(); + } else { + recipe_ = null; + recipeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RecipeList_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.RecipeList getDefaultInstanceForType() { + return com.google.spanner.v1.RecipeList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.RecipeList build() { + com.google.spanner.v1.RecipeList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.RecipeList buildPartial() { + com.google.spanner.v1.RecipeList result = new com.google.spanner.v1.RecipeList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.spanner.v1.RecipeList result) { + if (recipeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + recipe_ = java.util.Collections.unmodifiableList(recipe_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.recipe_ = recipe_; + } else { + result.recipe_ = recipeBuilder_.build(); + } + } + + private void buildPartial0(com.google.spanner.v1.RecipeList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schemaGeneration_ = schemaGeneration_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.RecipeList) { + return mergeFrom((com.google.spanner.v1.RecipeList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.RecipeList other) { + if (other == com.google.spanner.v1.RecipeList.getDefaultInstance()) return this; + if (other.getSchemaGeneration() != com.google.protobuf.ByteString.EMPTY) { + setSchemaGeneration(other.getSchemaGeneration()); + } + if (recipeBuilder_ == null) { + if (!other.recipe_.isEmpty()) { + if (recipe_.isEmpty()) { + recipe_ = other.recipe_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRecipeIsMutable(); + recipe_.addAll(other.recipe_); + } + onChanged(); + } + } else { + if (!other.recipe_.isEmpty()) { + if (recipeBuilder_.isEmpty()) { + recipeBuilder_.dispose(); + recipeBuilder_ = null; + recipe_ = other.recipe_; + bitField0_ = (bitField0_ & ~0x00000002); + recipeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRecipeFieldBuilder() + : null; + } else { + recipeBuilder_.addAllMessages(other.recipe_); + } + } + } + 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: + { + schemaGeneration_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + com.google.spanner.v1.KeyRecipe m = + input.readMessage(com.google.spanner.v1.KeyRecipe.parser(), extensionRegistry); + if (recipeBuilder_ == null) { + ensureRecipeIsMutable(); + recipe_.add(m); + } else { + recipeBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The schema generation of the recipes. To be sent to the server in
+     * `RoutingHint.schema_generation` whenever one of the recipes is used.
+     * `schema_generation` values are comparable with each other; if generation A
+     * compares greater than generation B, then A is a more recent schema than B.
+     * Clients should in general aim to cache only the latest schema generation,
+     * and discard more stale recipes.
+     * 
+ * + * bytes schema_generation = 1; + * + * @return The schemaGeneration. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaGeneration() { + return schemaGeneration_; + } + + /** + * + * + *
+     * The schema generation of the recipes. To be sent to the server in
+     * `RoutingHint.schema_generation` whenever one of the recipes is used.
+     * `schema_generation` values are comparable with each other; if generation A
+     * compares greater than generation B, then A is a more recent schema than B.
+     * Clients should in general aim to cache only the latest schema generation,
+     * and discard more stale recipes.
+     * 
+ * + * bytes schema_generation = 1; + * + * @param value The schemaGeneration to set. + * @return This builder for chaining. + */ + public Builder setSchemaGeneration(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + schemaGeneration_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The schema generation of the recipes. To be sent to the server in
+     * `RoutingHint.schema_generation` whenever one of the recipes is used.
+     * `schema_generation` values are comparable with each other; if generation A
+     * compares greater than generation B, then A is a more recent schema than B.
+     * Clients should in general aim to cache only the latest schema generation,
+     * and discard more stale recipes.
+     * 
+ * + * bytes schema_generation = 1; + * + * @return This builder for chaining. + */ + public Builder clearSchemaGeneration() { + bitField0_ = (bitField0_ & ~0x00000001); + schemaGeneration_ = getDefaultInstance().getSchemaGeneration(); + onChanged(); + return this; + } + + private java.util.List recipe_ = + java.util.Collections.emptyList(); + + private void ensureRecipeIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + recipe_ = new java.util.ArrayList(recipe_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.KeyRecipe, + com.google.spanner.v1.KeyRecipe.Builder, + com.google.spanner.v1.KeyRecipeOrBuilder> + recipeBuilder_; + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public java.util.List getRecipeList() { + if (recipeBuilder_ == null) { + return java.util.Collections.unmodifiableList(recipe_); + } else { + return recipeBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public int getRecipeCount() { + if (recipeBuilder_ == null) { + return recipe_.size(); + } else { + return recipeBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public com.google.spanner.v1.KeyRecipe getRecipe(int index) { + if (recipeBuilder_ == null) { + return recipe_.get(index); + } else { + return recipeBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder setRecipe(int index, com.google.spanner.v1.KeyRecipe value) { + if (recipeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecipeIsMutable(); + recipe_.set(index, value); + onChanged(); + } else { + recipeBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder setRecipe(int index, com.google.spanner.v1.KeyRecipe.Builder builderForValue) { + if (recipeBuilder_ == null) { + ensureRecipeIsMutable(); + recipe_.set(index, builderForValue.build()); + onChanged(); + } else { + recipeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder addRecipe(com.google.spanner.v1.KeyRecipe value) { + if (recipeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecipeIsMutable(); + recipe_.add(value); + onChanged(); + } else { + recipeBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder addRecipe(int index, com.google.spanner.v1.KeyRecipe value) { + if (recipeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRecipeIsMutable(); + recipe_.add(index, value); + onChanged(); + } else { + recipeBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder addRecipe(com.google.spanner.v1.KeyRecipe.Builder builderForValue) { + if (recipeBuilder_ == null) { + ensureRecipeIsMutable(); + recipe_.add(builderForValue.build()); + onChanged(); + } else { + recipeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder addRecipe(int index, com.google.spanner.v1.KeyRecipe.Builder builderForValue) { + if (recipeBuilder_ == null) { + ensureRecipeIsMutable(); + recipe_.add(index, builderForValue.build()); + onChanged(); + } else { + recipeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder addAllRecipe( + java.lang.Iterable values) { + if (recipeBuilder_ == null) { + ensureRecipeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, recipe_); + onChanged(); + } else { + recipeBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder clearRecipe() { + if (recipeBuilder_ == null) { + recipe_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + recipeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public Builder removeRecipe(int index) { + if (recipeBuilder_ == null) { + ensureRecipeIsMutable(); + recipe_.remove(index); + onChanged(); + } else { + recipeBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public com.google.spanner.v1.KeyRecipe.Builder getRecipeBuilder(int index) { + return getRecipeFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public com.google.spanner.v1.KeyRecipeOrBuilder getRecipeOrBuilder(int index) { + if (recipeBuilder_ == null) { + return recipe_.get(index); + } else { + return recipeBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public java.util.List + getRecipeOrBuilderList() { + if (recipeBuilder_ != null) { + return recipeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(recipe_); + } + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public com.google.spanner.v1.KeyRecipe.Builder addRecipeBuilder() { + return getRecipeFieldBuilder() + .addBuilder(com.google.spanner.v1.KeyRecipe.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public com.google.spanner.v1.KeyRecipe.Builder addRecipeBuilder(int index) { + return getRecipeFieldBuilder() + .addBuilder(index, com.google.spanner.v1.KeyRecipe.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of recipes to be cached.
+     * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + public java.util.List getRecipeBuilderList() { + return getRecipeFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.KeyRecipe, + com.google.spanner.v1.KeyRecipe.Builder, + com.google.spanner.v1.KeyRecipeOrBuilder> + getRecipeFieldBuilder() { + if (recipeBuilder_ == null) { + recipeBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.KeyRecipe, + com.google.spanner.v1.KeyRecipe.Builder, + com.google.spanner.v1.KeyRecipeOrBuilder>( + recipe_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + recipe_ = null; + } + return recipeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.RecipeList) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.RecipeList) + private static final com.google.spanner.v1.RecipeList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.RecipeList(); + } + + public static com.google.spanner.v1.RecipeList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecipeList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.RecipeList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RecipeListOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RecipeListOrBuilder.java new file mode 100644 index 00000000000..b4217ff2227 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RecipeListOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface RecipeListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.RecipeList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The schema generation of the recipes. To be sent to the server in
+   * `RoutingHint.schema_generation` whenever one of the recipes is used.
+   * `schema_generation` values are comparable with each other; if generation A
+   * compares greater than generation B, then A is a more recent schema than B.
+   * Clients should in general aim to cache only the latest schema generation,
+   * and discard more stale recipes.
+   * 
+ * + * bytes schema_generation = 1; + * + * @return The schemaGeneration. + */ + com.google.protobuf.ByteString getSchemaGeneration(); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + java.util.List getRecipeList(); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + com.google.spanner.v1.KeyRecipe getRecipe(int index); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + int getRecipeCount(); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + java.util.List getRecipeOrBuilderList(); + + /** + * + * + *
+   * A list of recipes to be cached.
+   * 
+ * + * repeated .google.spanner.v1.KeyRecipe recipe = 3; + */ + com.google.spanner.v1.KeyRecipeOrBuilder getRecipeOrBuilder(int index); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java index 291fd570667..6d6cb821c23 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java @@ -53,42 +53,42 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n" - + "\"google/spanner/v1/result_set.proto\022\021go" + "\n\"google/spanner/v1/result_set.proto\022\021go" + "ogle.spanner.v1\032\037google/api/field_behavi" - + "or.proto\032\034google/protobuf/struct.proto\032\"" - + "google/spanner/v1/query_plan.proto\032#goog" - + "le/spanner/v1/transaction.proto\032\034google/spanner/v1/type.proto\"\362\001\n" - + "\tResultSet\0226\n" - + "\010metadata\030\001 \001(\0132$.google.spanner.v1.ResultSetMetadata\022(\n" - + "\004rows\030\002 \003(\0132\032.google.protobuf.ListValue\0220\n" - + "\005stats\030\003 \001(\0132!.google.spanner.v1.ResultSetStats\022Q\n" - + "\017precommit_token\030\005" - + " \001(\01323.google.spanner.v1.MultiplexedSessionPrecommitTokenB\003\340A\001\"\267\002\n" - + "\020PartialResultSet\0226\n" - + "\010metadata\030\001 \001(\0132$.google.spanner.v1.ResultSetMetadata\022&\n" - + "\006values\030\002 \003(\0132\026.google.protobuf.Value\022\025\n\r" - + "chunked_value\030\003 \001(\010\022\024\n" - + "\014resume_token\030\004 \001(\014\0220\n" - + "\005stats\030\005 \001(\0132!.google.spanner.v1.ResultSetStats\022Q\n" - + "\017precommit_token\030\010 \001(\01323.google.spanner" - + ".v1.MultiplexedSessionPrecommitTokenB\003\340A\001\022\021\n" - + "\004last\030\t \001(\010B\003\340A\001\"\267\001\n" - + "\021ResultSetMetadata\022/\n" - + "\010row_type\030\001 \001(\0132\035.google.spanner.v1.StructType\0223\n" - + "\013transaction\030\002 \001(\0132\036.google.spanner.v1.Transaction\022<\n" - + "\025undeclared_parameters\030\003" - + " \001(\0132\035.google.spanner.v1.StructType\"\271\001\n" - + "\016ResultSetStats\0220\n\n" - + "query_plan\030\001 \001(\0132\034.google.spanner.v1.QueryPlan\022,\n" - + "\013query_stats\030\002 \001(\0132\027.google.protobuf.Struct\022\031\n" - + "\017row_count_exact\030\003 \001(\003H\000\022\037\n" - + "\025row_count_lower_bound\030\004 \001(\003H\000B\013\n" - + "\trow_countB\261\001\n" - + "\025com.google.spanner.v1B\016ResultSetProtoP\001Z5" - + "cloud.google.com/go/spanner/apiv1/spanne" - + "rpb;spannerpb\252\002\027Google.Cloud.Spanner.V1\312" - + "\002\027Google\\Cloud\\Spanner\\V1\352\002\032Google::Cloud::Spanner::V1b\006proto3" + + "or.proto\032\034google/protobuf/struct.proto\032 " + + "google/spanner/v1/location.proto\032\"google" + + "/spanner/v1/query_plan.proto\032#google/spa" + + "nner/v1/transaction.proto\032\034google/spanne" + + "r/v1/type.proto\"\362\001\n\tResultSet\0226\n\010metadat" + + "a\030\001 \001(\0132$.google.spanner.v1.ResultSetMet" + + "adata\022(\n\004rows\030\002 \003(\0132\032.google.protobuf.Li" + + "stValue\0220\n\005stats\030\003 \001(\0132!.google.spanner." + + "v1.ResultSetStats\022Q\n\017precommit_token\030\005 \001" + + "(\01323.google.spanner.v1.MultiplexedSessio" + + "nPrecommitTokenB\003\340A\001\"\362\002\n\020PartialResultSe" + + "t\0226\n\010metadata\030\001 \001(\0132$.google.spanner.v1." + + "ResultSetMetadata\022&\n\006values\030\002 \003(\0132\026.goog" + + "le.protobuf.Value\022\025\n\rchunked_value\030\003 \001(\010" + + "\022\024\n\014resume_token\030\004 \001(\014\0220\n\005stats\030\005 \001(\0132!." + + "google.spanner.v1.ResultSetStats\022Q\n\017prec" + + "ommit_token\030\010 \001(\01323.google.spanner.v1.Mu" + + "ltiplexedSessionPrecommitTokenB\003\340A\001\022\021\n\004l" + + "ast\030\t \001(\010B\003\340A\001\0229\n\014cache_update\030\n \001(\0132\036.g" + + "oogle.spanner.v1.CacheUpdateB\003\340A\001\"\267\001\n\021Re" + + "sultSetMetadata\022/\n\010row_type\030\001 \001(\0132\035.goog" + + "le.spanner.v1.StructType\0223\n\013transaction\030" + + "\002 \001(\0132\036.google.spanner.v1.Transaction\022<\n" + + "\025undeclared_parameters\030\003 \001(\0132\035.google.sp" + + "anner.v1.StructType\"\271\001\n\016ResultSetStats\0220" + + "\n\nquery_plan\030\001 \001(\0132\034.google.spanner.v1.Q" + + "ueryPlan\022,\n\013query_stats\030\002 \001(\0132\027.google.p" + + "rotobuf.Struct\022\031\n\017row_count_exact\030\003 \001(\003H" + + "\000\022\037\n\025row_count_lower_bound\030\004 \001(\003H\000B\013\n\tro" + + "w_countB\261\001\n\025com.google.spanner.v1B\016Resul" + + "tSetProtoP\001Z5cloud.google.com/go/spanner" + + "/apiv1/spannerpb;spannerpb\252\002\027Google.Clou" + + "d.Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1\352\002" + + "\032Google::Cloud::Spanner::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -96,6 +96,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), + com.google.spanner.v1.LocationProto.getDescriptor(), com.google.spanner.v1.QueryPlanProto.getDescriptor(), com.google.spanner.v1.TransactionProto.getDescriptor(), com.google.spanner.v1.TypeProto.getDescriptor(), @@ -121,6 +122,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Stats", "PrecommitToken", "Last", + "CacheUpdate", }); internal_static_google_spanner_v1_ResultSetMetadata_descriptor = getDescriptor().getMessageTypes().get(2); @@ -145,6 +147,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); + com.google.spanner.v1.LocationProto.getDescriptor(); com.google.spanner.v1.QueryPlanProto.getDescriptor(); com.google.spanner.v1.TransactionProto.getDescriptor(); com.google.spanner.v1.TypeProto.getDescriptor(); diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RoutingHint.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RoutingHint.java new file mode 100644 index 00000000000..22e56f98897 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RoutingHint.java @@ -0,0 +1,2874 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +/** + * + * + *
+ * `RoutingHint` can be optionally added to location-aware Spanner
+ * requests. It gives the server hints that can be used to route the request to
+ * an appropriate server, potentially significantly decreasing latency and
+ * improving throughput. To achieve improved performance, most fields must be
+ * filled in with accurate values.
+ *
+ * The presence of a valid `RoutingHint` tells the server that the client
+ * is location-aware.
+ *
+ * `RoutingHint` does not change the semantics of the request; it is
+ * purely a performance hint; the request will perform the same actions on the
+ * database's data as if `RoutingHint` were not present. However, if
+ * the `RoutingHint` is incomplete or incorrect, the response may include
+ * a `CacheUpdate` the client can use to correct its location cache.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.RoutingHint} + */ +public final class RoutingHint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.RoutingHint) + RoutingHintOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RoutingHint.newBuilder() to construct. + private RoutingHint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RoutingHint() { + schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + key_ = com.google.protobuf.ByteString.EMPTY; + limitKey_ = com.google.protobuf.ByteString.EMPTY; + skippedTabletUid_ = java.util.Collections.emptyList(); + clientLocation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RoutingHint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.RoutingHint.class, + com.google.spanner.v1.RoutingHint.Builder.class); + } + + public interface SkippedTabletOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.RoutingHint.SkippedTablet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`.
+     * 
+ * + * uint64 tablet_uid = 1; + * + * @return The tabletUid. + */ + long getTabletUid(); + + /** + * + * + *
+     * The incarnation of the tablet that was skipped. See `Tablet.incarnation`.
+     * 
+ * + * bytes incarnation = 2; + * + * @return The incarnation. + */ + com.google.protobuf.ByteString getIncarnation(); + } + + /** + * + * + *
+   * A tablet that was skipped by the client. See `Tablet.tablet_uid` and
+   * `Tablet.incarnation`.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.RoutingHint.SkippedTablet} + */ + public static final class SkippedTablet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.RoutingHint.SkippedTablet) + SkippedTabletOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SkippedTablet.newBuilder() to construct. + private SkippedTablet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SkippedTablet() { + incarnation_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SkippedTablet(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_SkippedTablet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_SkippedTablet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.RoutingHint.SkippedTablet.class, + com.google.spanner.v1.RoutingHint.SkippedTablet.Builder.class); + } + + public static final int TABLET_UID_FIELD_NUMBER = 1; + private long tabletUid_ = 0L; + + /** + * + * + *
+     * The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`.
+     * 
+ * + * uint64 tablet_uid = 1; + * + * @return The tabletUid. + */ + @java.lang.Override + public long getTabletUid() { + return tabletUid_; + } + + public static final int INCARNATION_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString incarnation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The incarnation of the tablet that was skipped. See `Tablet.incarnation`.
+     * 
+ * + * bytes incarnation = 2; + * + * @return The incarnation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIncarnation() { + return incarnation_; + } + + 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 (tabletUid_ != 0L) { + output.writeUInt64(1, tabletUid_); + } + if (!incarnation_.isEmpty()) { + output.writeBytes(2, incarnation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tabletUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(1, tabletUid_); + } + if (!incarnation_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, incarnation_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.RoutingHint.SkippedTablet)) { + return super.equals(obj); + } + com.google.spanner.v1.RoutingHint.SkippedTablet other = + (com.google.spanner.v1.RoutingHint.SkippedTablet) obj; + + if (getTabletUid() != other.getTabletUid()) return false; + if (!getIncarnation().equals(other.getIncarnation())) 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) + TABLET_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTabletUid()); + hash = (37 * hash) + INCARNATION_FIELD_NUMBER; + hash = (53 * hash) + getIncarnation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.RoutingHint.SkippedTablet 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; + } + + /** + * + * + *
+     * A tablet that was skipped by the client. See `Tablet.tablet_uid` and
+     * `Tablet.incarnation`.
+     * 
+ * + * Protobuf type {@code google.spanner.v1.RoutingHint.SkippedTablet} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.RoutingHint.SkippedTablet) + com.google.spanner.v1.RoutingHint.SkippedTabletOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_SkippedTablet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_SkippedTablet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.RoutingHint.SkippedTablet.class, + com.google.spanner.v1.RoutingHint.SkippedTablet.Builder.class); + } + + // Construct using com.google.spanner.v1.RoutingHint.SkippedTablet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tabletUid_ = 0L; + incarnation_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_SkippedTablet_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint.SkippedTablet getDefaultInstanceForType() { + return com.google.spanner.v1.RoutingHint.SkippedTablet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint.SkippedTablet build() { + com.google.spanner.v1.RoutingHint.SkippedTablet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint.SkippedTablet buildPartial() { + com.google.spanner.v1.RoutingHint.SkippedTablet result = + new com.google.spanner.v1.RoutingHint.SkippedTablet(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.RoutingHint.SkippedTablet result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tabletUid_ = tabletUid_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.incarnation_ = incarnation_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.RoutingHint.SkippedTablet) { + return mergeFrom((com.google.spanner.v1.RoutingHint.SkippedTablet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.RoutingHint.SkippedTablet other) { + if (other == com.google.spanner.v1.RoutingHint.SkippedTablet.getDefaultInstance()) + return this; + if (other.getTabletUid() != 0L) { + setTabletUid(other.getTabletUid()); + } + if (other.getIncarnation() != com.google.protobuf.ByteString.EMPTY) { + setIncarnation(other.getIncarnation()); + } + 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: + { + tabletUid_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + incarnation_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long tabletUid_; + + /** + * + * + *
+       * The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`.
+       * 
+ * + * uint64 tablet_uid = 1; + * + * @return The tabletUid. + */ + @java.lang.Override + public long getTabletUid() { + return tabletUid_; + } + + /** + * + * + *
+       * The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`.
+       * 
+ * + * uint64 tablet_uid = 1; + * + * @param value The tabletUid to set. + * @return This builder for chaining. + */ + public Builder setTabletUid(long value) { + + tabletUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`.
+       * 
+ * + * uint64 tablet_uid = 1; + * + * @return This builder for chaining. + */ + public Builder clearTabletUid() { + bitField0_ = (bitField0_ & ~0x00000001); + tabletUid_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString incarnation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+       * The incarnation of the tablet that was skipped. See `Tablet.incarnation`.
+       * 
+ * + * bytes incarnation = 2; + * + * @return The incarnation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIncarnation() { + return incarnation_; + } + + /** + * + * + *
+       * The incarnation of the tablet that was skipped. See `Tablet.incarnation`.
+       * 
+ * + * bytes incarnation = 2; + * + * @param value The incarnation to set. + * @return This builder for chaining. + */ + public Builder setIncarnation(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + incarnation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The incarnation of the tablet that was skipped. See `Tablet.incarnation`.
+       * 
+ * + * bytes incarnation = 2; + * + * @return This builder for chaining. + */ + public Builder clearIncarnation() { + bitField0_ = (bitField0_ & ~0x00000002); + incarnation_ = getDefaultInstance().getIncarnation(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.RoutingHint.SkippedTablet) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.RoutingHint.SkippedTablet) + private static final com.google.spanner.v1.RoutingHint.SkippedTablet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.RoutingHint.SkippedTablet(); + } + + public static com.google.spanner.v1.RoutingHint.SkippedTablet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SkippedTablet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint.SkippedTablet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int OPERATION_UID_FIELD_NUMBER = 1; + private long operationUid_ = 0L; + + /** + * + * + *
+   * A session-scoped unique ID for the operation, computed client-side.
+   * Requests with the same `operation_uid` should have a shared 'shape',
+   * meaning that some fields are expected to be the same, such as the SQL
+   * query, the target table/columns (for reads) etc. Requests with the same
+   * `operation_uid` are meant to differ only in fields like keys/key
+   * ranges/query parameters, transaction IDs, etc.
+   *
+   * `operation_uid` must be non-zero for `RoutingHint` to be valid.
+   * 
+ * + * uint64 operation_uid = 1; + * + * @return The operationUid. + */ + @java.lang.Override + public long getOperationUid() { + return operationUid_; + } + + public static final int DATABASE_ID_FIELD_NUMBER = 2; + private long databaseId_ = 0L; + + /** + * + * + *
+   * The database ID of the database being accessed, see
+   * `CacheUpdate.database_id`. Should match the cache entries that were used
+   * to generate the rest of the fields in this `RoutingHint`.
+   * 
+ * + * uint64 database_id = 2; + * + * @return The databaseId. + */ + @java.lang.Override + public long getDatabaseId() { + return databaseId_; + } + + public static final int SCHEMA_GENERATION_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The schema generation of the recipe that was used to generate `key` and
+   * `limit_key`. See also `RecipeList.schema_generation`.
+   * 
+ * + * bytes schema_generation = 3; + * + * @return The schemaGeneration. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaGeneration() { + return schemaGeneration_; + } + + public static final int KEY_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * The key / key range that this request accesses. For operations that
+   * access a single key, `key` should be set and `limit_key` should be empty.
+   * For operations that access a key range, `key` and `limit_key` should both
+   * be set, to the inclusive start and exclusive end of the range respectively.
+   *
+   * The keys are encoded in "sortable string format" (ssformat), using a
+   * `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more
+   * details.
+   * 
+ * + * bytes key = 4; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + public static final int LIMIT_KEY_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString limitKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * If this request targets a key range, this is the exclusive end of the
+   * range. See `key` for more details.
+   * 
+ * + * bytes limit_key = 5; + * + * @return The limitKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLimitKey() { + return limitKey_; + } + + public static final int GROUP_UID_FIELD_NUMBER = 6; + private long groupUid_ = 0L; + + /** + * + * + *
+   * The group UID of the group that the client believes serves the range
+   * defined by `key` and `limit_key`. See `Range.group_uid` for more details.
+   * 
+ * + * uint64 group_uid = 6; + * + * @return The groupUid. + */ + @java.lang.Override + public long getGroupUid() { + return groupUid_; + } + + public static final int SPLIT_ID_FIELD_NUMBER = 7; + private long splitId_ = 0L; + + /** + * + * + *
+   * The split ID of the split that the client believes contains the range
+   * defined by `key` and `limit_key`. See `Range.split_id` for more details.
+   * 
+ * + * uint64 split_id = 7; + * + * @return The splitId. + */ + @java.lang.Override + public long getSplitId() { + return splitId_; + } + + public static final int TABLET_UID_FIELD_NUMBER = 8; + private long tabletUid_ = 0L; + + /** + * + * + *
+   * The tablet UID of the tablet from group `group_uid` that the client
+   * believes is best to serve this request. See `Group.local_tablet_uids` and
+   * `Group.leader_tablet_uid`.
+   * 
+ * + * uint64 tablet_uid = 8; + * + * @return The tabletUid. + */ + @java.lang.Override + public long getTabletUid() { + return tabletUid_; + } + + public static final int SKIPPED_TABLET_UID_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List skippedTabletUid_; + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + @java.lang.Override + public java.util.List getSkippedTabletUidList() { + return skippedTabletUid_; + } + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + @java.lang.Override + public java.util.List + getSkippedTabletUidOrBuilderList() { + return skippedTabletUid_; + } + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + @java.lang.Override + public int getSkippedTabletUidCount() { + return skippedTabletUid_.size(); + } + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + @java.lang.Override + public com.google.spanner.v1.RoutingHint.SkippedTablet getSkippedTabletUid(int index) { + return skippedTabletUid_.get(index); + } + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + @java.lang.Override + public com.google.spanner.v1.RoutingHint.SkippedTabletOrBuilder getSkippedTabletUidOrBuilder( + int index) { + return skippedTabletUid_.get(index); + } + + public static final int CLIENT_LOCATION_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientLocation_ = ""; + + /** + * + * + *
+   * If present, the client's current location. In the Spanner managed service,
+   * this should be the name of a Google Cloud zone or region, such as
+   * "us-central1". In Spanner Omni, this should correspond to a previously
+   * created location.
+   *
+   * If absent, the client's location will be assumed to be the same as the
+   * location of the server the client ends up connected to.
+   *
+   * Locations are primarily valuable for clients that connect from regions
+   * other than the ones that contain the Spanner database.
+   * 
+ * + * string client_location = 10; + * + * @return The clientLocation. + */ + @java.lang.Override + public java.lang.String getClientLocation() { + java.lang.Object ref = clientLocation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientLocation_ = s; + return s; + } + } + + /** + * + * + *
+   * If present, the client's current location. In the Spanner managed service,
+   * this should be the name of a Google Cloud zone or region, such as
+   * "us-central1". In Spanner Omni, this should correspond to a previously
+   * created location.
+   *
+   * If absent, the client's location will be assumed to be the same as the
+   * location of the server the client ends up connected to.
+   *
+   * Locations are primarily valuable for clients that connect from regions
+   * other than the ones that contain the Spanner database.
+   * 
+ * + * string client_location = 10; + * + * @return The bytes for clientLocation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientLocationBytes() { + java.lang.Object ref = clientLocation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientLocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (operationUid_ != 0L) { + output.writeUInt64(1, operationUid_); + } + if (databaseId_ != 0L) { + output.writeUInt64(2, databaseId_); + } + if (!schemaGeneration_.isEmpty()) { + output.writeBytes(3, schemaGeneration_); + } + if (!key_.isEmpty()) { + output.writeBytes(4, key_); + } + if (!limitKey_.isEmpty()) { + output.writeBytes(5, limitKey_); + } + if (groupUid_ != 0L) { + output.writeUInt64(6, groupUid_); + } + if (splitId_ != 0L) { + output.writeUInt64(7, splitId_); + } + if (tabletUid_ != 0L) { + output.writeUInt64(8, tabletUid_); + } + for (int i = 0; i < skippedTabletUid_.size(); i++) { + output.writeMessage(9, skippedTabletUid_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientLocation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, clientLocation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (operationUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(1, operationUid_); + } + if (databaseId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(2, databaseId_); + } + if (!schemaGeneration_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, schemaGeneration_); + } + if (!key_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, key_); + } + if (!limitKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, limitKey_); + } + if (groupUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(6, groupUid_); + } + if (splitId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(7, splitId_); + } + if (tabletUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(8, tabletUid_); + } + for (int i = 0; i < skippedTabletUid_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, skippedTabletUid_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientLocation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, clientLocation_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.RoutingHint)) { + return super.equals(obj); + } + com.google.spanner.v1.RoutingHint other = (com.google.spanner.v1.RoutingHint) obj; + + if (getOperationUid() != other.getOperationUid()) return false; + if (getDatabaseId() != other.getDatabaseId()) return false; + if (!getSchemaGeneration().equals(other.getSchemaGeneration())) return false; + if (!getKey().equals(other.getKey())) return false; + if (!getLimitKey().equals(other.getLimitKey())) return false; + if (getGroupUid() != other.getGroupUid()) return false; + if (getSplitId() != other.getSplitId()) return false; + if (getTabletUid() != other.getTabletUid()) return false; + if (!getSkippedTabletUidList().equals(other.getSkippedTabletUidList())) return false; + if (!getClientLocation().equals(other.getClientLocation())) 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) + OPERATION_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOperationUid()); + hash = (37 * hash) + DATABASE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDatabaseId()); + hash = (37 * hash) + SCHEMA_GENERATION_FIELD_NUMBER; + hash = (53 * hash) + getSchemaGeneration().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + LIMIT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getLimitKey().hashCode(); + hash = (37 * hash) + GROUP_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGroupUid()); + hash = (37 * hash) + SPLIT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSplitId()); + hash = (37 * hash) + TABLET_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTabletUid()); + if (getSkippedTabletUidCount() > 0) { + hash = (37 * hash) + SKIPPED_TABLET_UID_FIELD_NUMBER; + hash = (53 * hash) + getSkippedTabletUidList().hashCode(); + } + hash = (37 * hash) + CLIENT_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getClientLocation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.RoutingHint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RoutingHint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RoutingHint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.RoutingHint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RoutingHint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RoutingHint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.RoutingHint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.RoutingHint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.RoutingHint 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; + } + + /** + * + * + *
+   * `RoutingHint` can be optionally added to location-aware Spanner
+   * requests. It gives the server hints that can be used to route the request to
+   * an appropriate server, potentially significantly decreasing latency and
+   * improving throughput. To achieve improved performance, most fields must be
+   * filled in with accurate values.
+   *
+   * The presence of a valid `RoutingHint` tells the server that the client
+   * is location-aware.
+   *
+   * `RoutingHint` does not change the semantics of the request; it is
+   * purely a performance hint; the request will perform the same actions on the
+   * database's data as if `RoutingHint` were not present. However, if
+   * the `RoutingHint` is incomplete or incorrect, the response may include
+   * a `CacheUpdate` the client can use to correct its location cache.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.RoutingHint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.RoutingHint) + com.google.spanner.v1.RoutingHintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.RoutingHint.class, + com.google.spanner.v1.RoutingHint.Builder.class); + } + + // Construct using com.google.spanner.v1.RoutingHint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operationUid_ = 0L; + databaseId_ = 0L; + schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + key_ = com.google.protobuf.ByteString.EMPTY; + limitKey_ = com.google.protobuf.ByteString.EMPTY; + groupUid_ = 0L; + splitId_ = 0L; + tabletUid_ = 0L; + if (skippedTabletUidBuilder_ == null) { + skippedTabletUid_ = java.util.Collections.emptyList(); + } else { + skippedTabletUid_ = null; + skippedTabletUidBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + clientLocation_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_RoutingHint_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint getDefaultInstanceForType() { + return com.google.spanner.v1.RoutingHint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint build() { + com.google.spanner.v1.RoutingHint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint buildPartial() { + com.google.spanner.v1.RoutingHint result = new com.google.spanner.v1.RoutingHint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.spanner.v1.RoutingHint result) { + if (skippedTabletUidBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + skippedTabletUid_ = java.util.Collections.unmodifiableList(skippedTabletUid_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.skippedTabletUid_ = skippedTabletUid_; + } else { + result.skippedTabletUid_ = skippedTabletUidBuilder_.build(); + } + } + + private void buildPartial0(com.google.spanner.v1.RoutingHint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operationUid_ = operationUid_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.databaseId_ = databaseId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.schemaGeneration_ = schemaGeneration_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.limitKey_ = limitKey_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.groupUid_ = groupUid_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.splitId_ = splitId_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.tabletUid_ = tabletUid_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.clientLocation_ = clientLocation_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.RoutingHint) { + return mergeFrom((com.google.spanner.v1.RoutingHint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.RoutingHint other) { + if (other == com.google.spanner.v1.RoutingHint.getDefaultInstance()) return this; + if (other.getOperationUid() != 0L) { + setOperationUid(other.getOperationUid()); + } + if (other.getDatabaseId() != 0L) { + setDatabaseId(other.getDatabaseId()); + } + if (other.getSchemaGeneration() != com.google.protobuf.ByteString.EMPTY) { + setSchemaGeneration(other.getSchemaGeneration()); + } + if (other.getKey() != com.google.protobuf.ByteString.EMPTY) { + setKey(other.getKey()); + } + if (other.getLimitKey() != com.google.protobuf.ByteString.EMPTY) { + setLimitKey(other.getLimitKey()); + } + if (other.getGroupUid() != 0L) { + setGroupUid(other.getGroupUid()); + } + if (other.getSplitId() != 0L) { + setSplitId(other.getSplitId()); + } + if (other.getTabletUid() != 0L) { + setTabletUid(other.getTabletUid()); + } + if (skippedTabletUidBuilder_ == null) { + if (!other.skippedTabletUid_.isEmpty()) { + if (skippedTabletUid_.isEmpty()) { + skippedTabletUid_ = other.skippedTabletUid_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.addAll(other.skippedTabletUid_); + } + onChanged(); + } + } else { + if (!other.skippedTabletUid_.isEmpty()) { + if (skippedTabletUidBuilder_.isEmpty()) { + skippedTabletUidBuilder_.dispose(); + skippedTabletUidBuilder_ = null; + skippedTabletUid_ = other.skippedTabletUid_; + bitField0_ = (bitField0_ & ~0x00000100); + skippedTabletUidBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSkippedTabletUidFieldBuilder() + : null; + } else { + skippedTabletUidBuilder_.addAllMessages(other.skippedTabletUid_); + } + } + } + if (!other.getClientLocation().isEmpty()) { + clientLocation_ = other.clientLocation_; + bitField0_ |= 0x00000200; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + operationUid_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + databaseId_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + schemaGeneration_ = input.readBytes(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + key_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + limitKey_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + groupUid_ = input.readUInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + splitId_ = input.readUInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + tabletUid_ = input.readUInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + com.google.spanner.v1.RoutingHint.SkippedTablet m = + input.readMessage( + com.google.spanner.v1.RoutingHint.SkippedTablet.parser(), + extensionRegistry); + if (skippedTabletUidBuilder_ == null) { + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.add(m); + } else { + skippedTabletUidBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: + { + clientLocation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 82 + 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 operationUid_; + + /** + * + * + *
+     * A session-scoped unique ID for the operation, computed client-side.
+     * Requests with the same `operation_uid` should have a shared 'shape',
+     * meaning that some fields are expected to be the same, such as the SQL
+     * query, the target table/columns (for reads) etc. Requests with the same
+     * `operation_uid` are meant to differ only in fields like keys/key
+     * ranges/query parameters, transaction IDs, etc.
+     *
+     * `operation_uid` must be non-zero for `RoutingHint` to be valid.
+     * 
+ * + * uint64 operation_uid = 1; + * + * @return The operationUid. + */ + @java.lang.Override + public long getOperationUid() { + return operationUid_; + } + + /** + * + * + *
+     * A session-scoped unique ID for the operation, computed client-side.
+     * Requests with the same `operation_uid` should have a shared 'shape',
+     * meaning that some fields are expected to be the same, such as the SQL
+     * query, the target table/columns (for reads) etc. Requests with the same
+     * `operation_uid` are meant to differ only in fields like keys/key
+     * ranges/query parameters, transaction IDs, etc.
+     *
+     * `operation_uid` must be non-zero for `RoutingHint` to be valid.
+     * 
+ * + * uint64 operation_uid = 1; + * + * @param value The operationUid to set. + * @return This builder for chaining. + */ + public Builder setOperationUid(long value) { + + operationUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A session-scoped unique ID for the operation, computed client-side.
+     * Requests with the same `operation_uid` should have a shared 'shape',
+     * meaning that some fields are expected to be the same, such as the SQL
+     * query, the target table/columns (for reads) etc. Requests with the same
+     * `operation_uid` are meant to differ only in fields like keys/key
+     * ranges/query parameters, transaction IDs, etc.
+     *
+     * `operation_uid` must be non-zero for `RoutingHint` to be valid.
+     * 
+ * + * uint64 operation_uid = 1; + * + * @return This builder for chaining. + */ + public Builder clearOperationUid() { + bitField0_ = (bitField0_ & ~0x00000001); + operationUid_ = 0L; + onChanged(); + return this; + } + + private long databaseId_; + + /** + * + * + *
+     * The database ID of the database being accessed, see
+     * `CacheUpdate.database_id`. Should match the cache entries that were used
+     * to generate the rest of the fields in this `RoutingHint`.
+     * 
+ * + * uint64 database_id = 2; + * + * @return The databaseId. + */ + @java.lang.Override + public long getDatabaseId() { + return databaseId_; + } + + /** + * + * + *
+     * The database ID of the database being accessed, see
+     * `CacheUpdate.database_id`. Should match the cache entries that were used
+     * to generate the rest of the fields in this `RoutingHint`.
+     * 
+ * + * uint64 database_id = 2; + * + * @param value The databaseId to set. + * @return This builder for chaining. + */ + public Builder setDatabaseId(long value) { + + databaseId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The database ID of the database being accessed, see
+     * `CacheUpdate.database_id`. Should match the cache entries that were used
+     * to generate the rest of the fields in this `RoutingHint`.
+     * 
+ * + * uint64 database_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabaseId() { + bitField0_ = (bitField0_ & ~0x00000002); + databaseId_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString schemaGeneration_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The schema generation of the recipe that was used to generate `key` and
+     * `limit_key`. See also `RecipeList.schema_generation`.
+     * 
+ * + * bytes schema_generation = 3; + * + * @return The schemaGeneration. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaGeneration() { + return schemaGeneration_; + } + + /** + * + * + *
+     * The schema generation of the recipe that was used to generate `key` and
+     * `limit_key`. See also `RecipeList.schema_generation`.
+     * 
+ * + * bytes schema_generation = 3; + * + * @param value The schemaGeneration to set. + * @return This builder for chaining. + */ + public Builder setSchemaGeneration(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + schemaGeneration_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The schema generation of the recipe that was used to generate `key` and
+     * `limit_key`. See also `RecipeList.schema_generation`.
+     * 
+ * + * bytes schema_generation = 3; + * + * @return This builder for chaining. + */ + public Builder clearSchemaGeneration() { + bitField0_ = (bitField0_ & ~0x00000004); + schemaGeneration_ = getDefaultInstance().getSchemaGeneration(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * The key / key range that this request accesses. For operations that
+     * access a single key, `key` should be set and `limit_key` should be empty.
+     * For operations that access a key range, `key` and `limit_key` should both
+     * be set, to the inclusive start and exclusive end of the range respectively.
+     *
+     * The keys are encoded in "sortable string format" (ssformat), using a
+     * `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more
+     * details.
+     * 
+ * + * bytes key = 4; + * + * @return The key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKey() { + return key_; + } + + /** + * + * + *
+     * The key / key range that this request accesses. For operations that
+     * access a single key, `key` should be set and `limit_key` should be empty.
+     * For operations that access a key range, `key` and `limit_key` should both
+     * be set, to the inclusive start and exclusive end of the range respectively.
+     *
+     * The keys are encoded in "sortable string format" (ssformat), using a
+     * `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more
+     * details.
+     * 
+ * + * bytes key = 4; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The key / key range that this request accesses. For operations that
+     * access a single key, `key` should be set and `limit_key` should be empty.
+     * For operations that access a key range, `key` and `limit_key` should both
+     * be set, to the inclusive start and exclusive end of the range respectively.
+     *
+     * The keys are encoded in "sortable string format" (ssformat), using a
+     * `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more
+     * details.
+     * 
+ * + * bytes key = 4; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000008); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString limitKey_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * If this request targets a key range, this is the exclusive end of the
+     * range. See `key` for more details.
+     * 
+ * + * bytes limit_key = 5; + * + * @return The limitKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLimitKey() { + return limitKey_; + } + + /** + * + * + *
+     * If this request targets a key range, this is the exclusive end of the
+     * range. See `key` for more details.
+     * 
+ * + * bytes limit_key = 5; + * + * @param value The limitKey to set. + * @return This builder for chaining. + */ + public Builder setLimitKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + limitKey_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * If this request targets a key range, this is the exclusive end of the
+     * range. See `key` for more details.
+     * 
+ * + * bytes limit_key = 5; + * + * @return This builder for chaining. + */ + public Builder clearLimitKey() { + bitField0_ = (bitField0_ & ~0x00000010); + limitKey_ = getDefaultInstance().getLimitKey(); + onChanged(); + return this; + } + + private long groupUid_; + + /** + * + * + *
+     * The group UID of the group that the client believes serves the range
+     * defined by `key` and `limit_key`. See `Range.group_uid` for more details.
+     * 
+ * + * uint64 group_uid = 6; + * + * @return The groupUid. + */ + @java.lang.Override + public long getGroupUid() { + return groupUid_; + } + + /** + * + * + *
+     * The group UID of the group that the client believes serves the range
+     * defined by `key` and `limit_key`. See `Range.group_uid` for more details.
+     * 
+ * + * uint64 group_uid = 6; + * + * @param value The groupUid to set. + * @return This builder for chaining. + */ + public Builder setGroupUid(long value) { + + groupUid_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * The group UID of the group that the client believes serves the range
+     * defined by `key` and `limit_key`. See `Range.group_uid` for more details.
+     * 
+ * + * uint64 group_uid = 6; + * + * @return This builder for chaining. + */ + public Builder clearGroupUid() { + bitField0_ = (bitField0_ & ~0x00000020); + groupUid_ = 0L; + onChanged(); + return this; + } + + private long splitId_; + + /** + * + * + *
+     * The split ID of the split that the client believes contains the range
+     * defined by `key` and `limit_key`. See `Range.split_id` for more details.
+     * 
+ * + * uint64 split_id = 7; + * + * @return The splitId. + */ + @java.lang.Override + public long getSplitId() { + return splitId_; + } + + /** + * + * + *
+     * The split ID of the split that the client believes contains the range
+     * defined by `key` and `limit_key`. See `Range.split_id` for more details.
+     * 
+ * + * uint64 split_id = 7; + * + * @param value The splitId to set. + * @return This builder for chaining. + */ + public Builder setSplitId(long value) { + + splitId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The split ID of the split that the client believes contains the range
+     * defined by `key` and `limit_key`. See `Range.split_id` for more details.
+     * 
+ * + * uint64 split_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearSplitId() { + bitField0_ = (bitField0_ & ~0x00000040); + splitId_ = 0L; + onChanged(); + return this; + } + + private long tabletUid_; + + /** + * + * + *
+     * The tablet UID of the tablet from group `group_uid` that the client
+     * believes is best to serve this request. See `Group.local_tablet_uids` and
+     * `Group.leader_tablet_uid`.
+     * 
+ * + * uint64 tablet_uid = 8; + * + * @return The tabletUid. + */ + @java.lang.Override + public long getTabletUid() { + return tabletUid_; + } + + /** + * + * + *
+     * The tablet UID of the tablet from group `group_uid` that the client
+     * believes is best to serve this request. See `Group.local_tablet_uids` and
+     * `Group.leader_tablet_uid`.
+     * 
+ * + * uint64 tablet_uid = 8; + * + * @param value The tabletUid to set. + * @return This builder for chaining. + */ + public Builder setTabletUid(long value) { + + tabletUid_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * The tablet UID of the tablet from group `group_uid` that the client
+     * believes is best to serve this request. See `Group.local_tablet_uids` and
+     * `Group.leader_tablet_uid`.
+     * 
+ * + * uint64 tablet_uid = 8; + * + * @return This builder for chaining. + */ + public Builder clearTabletUid() { + bitField0_ = (bitField0_ & ~0x00000080); + tabletUid_ = 0L; + onChanged(); + return this; + } + + private java.util.List skippedTabletUid_ = + java.util.Collections.emptyList(); + + private void ensureSkippedTabletUidIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + skippedTabletUid_ = + new java.util.ArrayList( + skippedTabletUid_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.RoutingHint.SkippedTablet, + com.google.spanner.v1.RoutingHint.SkippedTablet.Builder, + com.google.spanner.v1.RoutingHint.SkippedTabletOrBuilder> + skippedTabletUidBuilder_; + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public java.util.List + getSkippedTabletUidList() { + if (skippedTabletUidBuilder_ == null) { + return java.util.Collections.unmodifiableList(skippedTabletUid_); + } else { + return skippedTabletUidBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public int getSkippedTabletUidCount() { + if (skippedTabletUidBuilder_ == null) { + return skippedTabletUid_.size(); + } else { + return skippedTabletUidBuilder_.getCount(); + } + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public com.google.spanner.v1.RoutingHint.SkippedTablet getSkippedTabletUid(int index) { + if (skippedTabletUidBuilder_ == null) { + return skippedTabletUid_.get(index); + } else { + return skippedTabletUidBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder setSkippedTabletUid( + int index, com.google.spanner.v1.RoutingHint.SkippedTablet value) { + if (skippedTabletUidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.set(index, value); + onChanged(); + } else { + skippedTabletUidBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder setSkippedTabletUid( + int index, com.google.spanner.v1.RoutingHint.SkippedTablet.Builder builderForValue) { + if (skippedTabletUidBuilder_ == null) { + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.set(index, builderForValue.build()); + onChanged(); + } else { + skippedTabletUidBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder addSkippedTabletUid(com.google.spanner.v1.RoutingHint.SkippedTablet value) { + if (skippedTabletUidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.add(value); + onChanged(); + } else { + skippedTabletUidBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder addSkippedTabletUid( + int index, com.google.spanner.v1.RoutingHint.SkippedTablet value) { + if (skippedTabletUidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.add(index, value); + onChanged(); + } else { + skippedTabletUidBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder addSkippedTabletUid( + com.google.spanner.v1.RoutingHint.SkippedTablet.Builder builderForValue) { + if (skippedTabletUidBuilder_ == null) { + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.add(builderForValue.build()); + onChanged(); + } else { + skippedTabletUidBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder addSkippedTabletUid( + int index, com.google.spanner.v1.RoutingHint.SkippedTablet.Builder builderForValue) { + if (skippedTabletUidBuilder_ == null) { + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.add(index, builderForValue.build()); + onChanged(); + } else { + skippedTabletUidBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder addAllSkippedTabletUid( + java.lang.Iterable values) { + if (skippedTabletUidBuilder_ == null) { + ensureSkippedTabletUidIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, skippedTabletUid_); + onChanged(); + } else { + skippedTabletUidBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder clearSkippedTabletUid() { + if (skippedTabletUidBuilder_ == null) { + skippedTabletUid_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + skippedTabletUidBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public Builder removeSkippedTabletUid(int index) { + if (skippedTabletUidBuilder_ == null) { + ensureSkippedTabletUidIsMutable(); + skippedTabletUid_.remove(index); + onChanged(); + } else { + skippedTabletUidBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public com.google.spanner.v1.RoutingHint.SkippedTablet.Builder getSkippedTabletUidBuilder( + int index) { + return getSkippedTabletUidFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public com.google.spanner.v1.RoutingHint.SkippedTabletOrBuilder getSkippedTabletUidOrBuilder( + int index) { + if (skippedTabletUidBuilder_ == null) { + return skippedTabletUid_.get(index); + } else { + return skippedTabletUidBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public java.util.List + getSkippedTabletUidOrBuilderList() { + if (skippedTabletUidBuilder_ != null) { + return skippedTabletUidBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(skippedTabletUid_); + } + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public com.google.spanner.v1.RoutingHint.SkippedTablet.Builder addSkippedTabletUidBuilder() { + return getSkippedTabletUidFieldBuilder() + .addBuilder(com.google.spanner.v1.RoutingHint.SkippedTablet.getDefaultInstance()); + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public com.google.spanner.v1.RoutingHint.SkippedTablet.Builder addSkippedTabletUidBuilder( + int index) { + return getSkippedTabletUidFieldBuilder() + .addBuilder(index, com.google.spanner.v1.RoutingHint.SkippedTablet.getDefaultInstance()); + } + + /** + * + * + *
+     * If the client had multiple options for tablet selection, and some of its
+     * first choices were unhealthy (e.g., the server is unreachable, or
+     * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+     * tablets, with their incarnations. The server may include a `CacheUpdate`
+     * with new locations for those tablets.
+     * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + public java.util.List + getSkippedTabletUidBuilderList() { + return getSkippedTabletUidFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.RoutingHint.SkippedTablet, + com.google.spanner.v1.RoutingHint.SkippedTablet.Builder, + com.google.spanner.v1.RoutingHint.SkippedTabletOrBuilder> + getSkippedTabletUidFieldBuilder() { + if (skippedTabletUidBuilder_ == null) { + skippedTabletUidBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.spanner.v1.RoutingHint.SkippedTablet, + com.google.spanner.v1.RoutingHint.SkippedTablet.Builder, + com.google.spanner.v1.RoutingHint.SkippedTabletOrBuilder>( + skippedTabletUid_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + skippedTabletUid_ = null; + } + return skippedTabletUidBuilder_; + } + + private java.lang.Object clientLocation_ = ""; + + /** + * + * + *
+     * If present, the client's current location. In the Spanner managed service,
+     * this should be the name of a Google Cloud zone or region, such as
+     * "us-central1". In Spanner Omni, this should correspond to a previously
+     * created location.
+     *
+     * If absent, the client's location will be assumed to be the same as the
+     * location of the server the client ends up connected to.
+     *
+     * Locations are primarily valuable for clients that connect from regions
+     * other than the ones that contain the Spanner database.
+     * 
+ * + * string client_location = 10; + * + * @return The clientLocation. + */ + public java.lang.String getClientLocation() { + java.lang.Object ref = clientLocation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientLocation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If present, the client's current location. In the Spanner managed service,
+     * this should be the name of a Google Cloud zone or region, such as
+     * "us-central1". In Spanner Omni, this should correspond to a previously
+     * created location.
+     *
+     * If absent, the client's location will be assumed to be the same as the
+     * location of the server the client ends up connected to.
+     *
+     * Locations are primarily valuable for clients that connect from regions
+     * other than the ones that contain the Spanner database.
+     * 
+ * + * string client_location = 10; + * + * @return The bytes for clientLocation. + */ + public com.google.protobuf.ByteString getClientLocationBytes() { + java.lang.Object ref = clientLocation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientLocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If present, the client's current location. In the Spanner managed service,
+     * this should be the name of a Google Cloud zone or region, such as
+     * "us-central1". In Spanner Omni, this should correspond to a previously
+     * created location.
+     *
+     * If absent, the client's location will be assumed to be the same as the
+     * location of the server the client ends up connected to.
+     *
+     * Locations are primarily valuable for clients that connect from regions
+     * other than the ones that contain the Spanner database.
+     * 
+ * + * string client_location = 10; + * + * @param value The clientLocation to set. + * @return This builder for chaining. + */ + public Builder setClientLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientLocation_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * If present, the client's current location. In the Spanner managed service,
+     * this should be the name of a Google Cloud zone or region, such as
+     * "us-central1". In Spanner Omni, this should correspond to a previously
+     * created location.
+     *
+     * If absent, the client's location will be assumed to be the same as the
+     * location of the server the client ends up connected to.
+     *
+     * Locations are primarily valuable for clients that connect from regions
+     * other than the ones that contain the Spanner database.
+     * 
+ * + * string client_location = 10; + * + * @return This builder for chaining. + */ + public Builder clearClientLocation() { + clientLocation_ = getDefaultInstance().getClientLocation(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * If present, the client's current location. In the Spanner managed service,
+     * this should be the name of a Google Cloud zone or region, such as
+     * "us-central1". In Spanner Omni, this should correspond to a previously
+     * created location.
+     *
+     * If absent, the client's location will be assumed to be the same as the
+     * location of the server the client ends up connected to.
+     *
+     * Locations are primarily valuable for clients that connect from regions
+     * other than the ones that contain the Spanner database.
+     * 
+ * + * string client_location = 10; + * + * @param value The bytes for clientLocation to set. + * @return This builder for chaining. + */ + public Builder setClientLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientLocation_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.spanner.v1.RoutingHint) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.RoutingHint) + private static final com.google.spanner.v1.RoutingHint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.RoutingHint(); + } + + public static com.google.spanner.v1.RoutingHint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RoutingHint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.RoutingHint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RoutingHintOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RoutingHintOrBuilder.java new file mode 100644 index 00000000000..5fcf19606cc --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RoutingHintOrBuilder.java @@ -0,0 +1,272 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface RoutingHintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.RoutingHint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A session-scoped unique ID for the operation, computed client-side.
+   * Requests with the same `operation_uid` should have a shared 'shape',
+   * meaning that some fields are expected to be the same, such as the SQL
+   * query, the target table/columns (for reads) etc. Requests with the same
+   * `operation_uid` are meant to differ only in fields like keys/key
+   * ranges/query parameters, transaction IDs, etc.
+   *
+   * `operation_uid` must be non-zero for `RoutingHint` to be valid.
+   * 
+ * + * uint64 operation_uid = 1; + * + * @return The operationUid. + */ + long getOperationUid(); + + /** + * + * + *
+   * The database ID of the database being accessed, see
+   * `CacheUpdate.database_id`. Should match the cache entries that were used
+   * to generate the rest of the fields in this `RoutingHint`.
+   * 
+ * + * uint64 database_id = 2; + * + * @return The databaseId. + */ + long getDatabaseId(); + + /** + * + * + *
+   * The schema generation of the recipe that was used to generate `key` and
+   * `limit_key`. See also `RecipeList.schema_generation`.
+   * 
+ * + * bytes schema_generation = 3; + * + * @return The schemaGeneration. + */ + com.google.protobuf.ByteString getSchemaGeneration(); + + /** + * + * + *
+   * The key / key range that this request accesses. For operations that
+   * access a single key, `key` should be set and `limit_key` should be empty.
+   * For operations that access a key range, `key` and `limit_key` should both
+   * be set, to the inclusive start and exclusive end of the range respectively.
+   *
+   * The keys are encoded in "sortable string format" (ssformat), using a
+   * `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more
+   * details.
+   * 
+ * + * bytes key = 4; + * + * @return The key. + */ + com.google.protobuf.ByteString getKey(); + + /** + * + * + *
+   * If this request targets a key range, this is the exclusive end of the
+   * range. See `key` for more details.
+   * 
+ * + * bytes limit_key = 5; + * + * @return The limitKey. + */ + com.google.protobuf.ByteString getLimitKey(); + + /** + * + * + *
+   * The group UID of the group that the client believes serves the range
+   * defined by `key` and `limit_key`. See `Range.group_uid` for more details.
+   * 
+ * + * uint64 group_uid = 6; + * + * @return The groupUid. + */ + long getGroupUid(); + + /** + * + * + *
+   * The split ID of the split that the client believes contains the range
+   * defined by `key` and `limit_key`. See `Range.split_id` for more details.
+   * 
+ * + * uint64 split_id = 7; + * + * @return The splitId. + */ + long getSplitId(); + + /** + * + * + *
+   * The tablet UID of the tablet from group `group_uid` that the client
+   * believes is best to serve this request. See `Group.local_tablet_uids` and
+   * `Group.leader_tablet_uid`.
+   * 
+ * + * uint64 tablet_uid = 8; + * + * @return The tabletUid. + */ + long getTabletUid(); + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + java.util.List getSkippedTabletUidList(); + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + com.google.spanner.v1.RoutingHint.SkippedTablet getSkippedTabletUid(int index); + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + int getSkippedTabletUidCount(); + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + java.util.List + getSkippedTabletUidOrBuilderList(); + + /** + * + * + *
+   * If the client had multiple options for tablet selection, and some of its
+   * first choices were unhealthy (e.g., the server is unreachable, or
+   * `Tablet.skip` is true), this field will contain the tablet UIDs of those
+   * tablets, with their incarnations. The server may include a `CacheUpdate`
+   * with new locations for those tablets.
+   * 
+ * + * repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9; + */ + com.google.spanner.v1.RoutingHint.SkippedTabletOrBuilder getSkippedTabletUidOrBuilder(int index); + + /** + * + * + *
+   * If present, the client's current location. In the Spanner managed service,
+   * this should be the name of a Google Cloud zone or region, such as
+   * "us-central1". In Spanner Omni, this should correspond to a previously
+   * created location.
+   *
+   * If absent, the client's location will be assumed to be the same as the
+   * location of the server the client ends up connected to.
+   *
+   * Locations are primarily valuable for clients that connect from regions
+   * other than the ones that contain the Spanner database.
+   * 
+ * + * string client_location = 10; + * + * @return The clientLocation. + */ + java.lang.String getClientLocation(); + + /** + * + * + *
+   * If present, the client's current location. In the Spanner managed service,
+   * this should be the name of a Google Cloud zone or region, such as
+   * "us-central1". In Spanner Omni, this should correspond to a previously
+   * created location.
+   *
+   * If absent, the client's location will be assumed to be the same as the
+   * location of the server the client ends up connected to.
+   *
+   * Locations are primarily valuable for clients that connect from regions
+   * other than the ones that contain the Spanner database.
+   * 
+ * + * string client_location = 10; + * + * @return The bytes for clientLocation. + */ + com.google.protobuf.ByteString getClientLocationBytes(); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java index c4c2be7437a..323ded9dc30 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/Session.java @@ -443,8 +443,8 @@ public com.google.protobuf.ByteString getCreatorRoleBytes() { * *
    * Optional. If `true`, specifies a multiplexed session. Use a multiplexed
-   * session for multiple, concurrent read-only operations. Don't use them for
-   * read-write transactions, partitioned reads, or partitioned queries. Use
+   * session for multiple, concurrent operations including any combination of
+   * read-only and read-write transactions. Use
    * [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create
    * multiplexed sessions. Don't use
    * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to
@@ -1875,8 +1875,8 @@ public Builder setCreatorRoleBytes(com.google.protobuf.ByteString value) {
      *
      * 
      * Optional. If `true`, specifies a multiplexed session. Use a multiplexed
-     * session for multiple, concurrent read-only operations. Don't use them for
-     * read-write transactions, partitioned reads, or partitioned queries. Use
+     * session for multiple, concurrent operations including any combination of
+     * read-only and read-write transactions. Use
      * [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create
      * multiplexed sessions. Don't use
      * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to
@@ -1898,8 +1898,8 @@ public boolean getMultiplexed() {
      *
      * 
      * Optional. If `true`, specifies a multiplexed session. Use a multiplexed
-     * session for multiple, concurrent read-only operations. Don't use them for
-     * read-write transactions, partitioned reads, or partitioned queries. Use
+     * session for multiple, concurrent operations including any combination of
+     * read-only and read-write transactions. Use
      * [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create
      * multiplexed sessions. Don't use
      * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to
@@ -1925,8 +1925,8 @@ public Builder setMultiplexed(boolean value) {
      *
      * 
      * Optional. If `true`, specifies a multiplexed session. Use a multiplexed
-     * session for multiple, concurrent read-only operations. Don't use them for
-     * read-write transactions, partitioned reads, or partitioned queries. Use
+     * session for multiple, concurrent operations including any combination of
+     * read-only and read-write transactions. Use
      * [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create
      * multiplexed sessions. Don't use
      * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java
index 127dea4f253..ff83de0f3d5 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SessionOrBuilder.java
@@ -270,8 +270,8 @@ java.lang.String getLabelsOrDefault(
    *
    * 
    * Optional. If `true`, specifies a multiplexed session. Use a multiplexed
-   * session for multiple, concurrent read-only operations. Don't use them for
-   * read-write transactions, partitioned reads, or partitioned queries. Use
+   * session for multiple, concurrent operations including any combination of
+   * read-only and read-write transactions. Use
    * [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create
    * multiplexed sessions. Don't use
    * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to
diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
index 2774c37b023..69c0ea211d5 100644
--- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
+++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
@@ -183,9 +183,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\032\033google/protobuf/empty.proto\032\034google/pr"
           + "otobuf/struct.proto\032\037google/protobuf/tim"
           + "estamp.proto\032\027google/rpc/status.proto\032\034google/spanner/v1/keys.proto\032"
-          + " google/spanner/v1/mutation.proto\032\"google/spanner/v1"
-          + "/result_set.proto\032#google/spanner/v1/tra"
-          + "nsaction.proto\032\034google/spanner/v1/type.proto\"\203\001\n"
+          + " google/spanner/v1/location.proto\032 google/spanner/v1"
+          + "/mutation.proto\032\"google/spanner/v1/resul"
+          + "t_set.proto\032#google/spanner/v1/transacti"
+          + "on.proto\032\034google/spanner/v1/type.proto\"\203\001\n"
           + "\024CreateSessionRequest\0229\n"
           + "\010database\030\001 \001(\tB\'\340A\002\372A!\n"
           + "\037spanner.googleapis.com/Database\0220\n"
@@ -208,8 +209,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\013LabelsEntry\022\013\n"
           + "\003key\030\001 \001(\t\022\r\n"
           + "\005value\030\002 \001(\t:\0028\001:\210\001\352A\204\001\n"
-          + "\036spanner.googleapis.com/Session\022Oprojects/{project}/instances/"
-          + "{instance}/databases/{database}/sessions/{session}*\010sessions2\007session\"I\n"
+          + "\036spanner.googleapis.com/Session\022Oprojects/{project}/instances/{insta"
+          + "nce}/databases/{database}/sessions/{session}*\010sessions2\007session\"I\n"
           + "\021GetSessionRequest\0224\n"
           + "\004name\030\001 \001(\tB&\340A\002\372A \n"
           + "\036spanner.googleapis.com/Session\"\207\001\n"
@@ -235,14 +236,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\017PRIORITY_MEDIUM\020\002\022\021\n\r"
           + "PRIORITY_HIGH\020\003\"\352\004\n"
           + "\023DirectedReadOptions\022R\n"
-          + "\020include_replicas\030\001"
-          + " \001(\01326.google.spanner.v1.DirectedReadOptions.IncludeReplicasH\000\022R\n"
+          + "\020include_replicas\030\001 \001"
+          + "(\01326.google.spanner.v1.DirectedReadOptions.IncludeReplicasH\000\022R\n"
           + "\020exclude_replicas\030\002"
           + " \001(\01326.google.spanner.v1.DirectedReadOptions.ExcludeReplicasH\000\032\255\001\n"
           + "\020ReplicaSelection\022\020\n"
           + "\010location\030\001 \001(\t\022J\n"
-          + "\004type\030\002 "
-          + "\001(\0162<.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type\";\n"
+          + "\004type\030\002 \001(\0162<."
+          + "google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type\";\n"
           + "\004Type\022\024\n"
           + "\020TYPE_UNSPECIFIED\020\000\022\016\n\n"
           + "READ_WRITE\020\001\022\r\n"
@@ -252,17 +253,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + " \003(\01327.google.spanner.v1.DirectedReadOptions.ReplicaSelection\022\036\n"
           + "\026auto_failover_disabled\030\002 \001(\010\032f\n"
           + "\017ExcludeReplicas\022S\n"
-          + "\022replica_selections\030\001 \003(\01327.google."
-          + "spanner.v1.DirectedReadOptions.ReplicaSelectionB\n\n"
-          + "\010replicas\"\215\007\n"
+          + "\022replica_selections\030\001 \003(\01327.google.spanne"
+          + "r.v1.DirectedReadOptions.ReplicaSelectionB\n\n"
+          + "\010replicas\"\310\007\n"
           + "\021ExecuteSqlRequest\0227\n"
           + "\007session\030\001 \001(\tB&\340A\002\372A \n"
           + "\036spanner.googleapis.com/Session\022;\n"
           + "\013transaction\030\002 \001(\0132&.google.spanner.v1.TransactionSelector\022\020\n"
           + "\003sql\030\003 \001(\tB\003\340A\002\022\'\n"
           + "\006params\030\004 \001(\0132\027.google.protobuf.Struct\022I\n"
-          + "\013param_types\030\005 \003(\0132"
-          + "4.google.spanner.v1.ExecuteSqlRequest.ParamTypesEntry\022\024\n"
+          + "\013param_types\030\005 \003(\01324.goog"
+          + "le.spanner.v1.ExecuteSqlRequest.ParamTypesEntry\022\024\n"
           + "\014resume_token\030\006 \001(\014\022B\n\n"
           + "query_mode\030\007 \001(\0162..google.spanner.v1.ExecuteSqlRequest.QueryMode\022\027\n"
           + "\017partition_token\030\010 \001(\014\022\r\n"
@@ -273,7 +274,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\025directed_read_options\030\017"
           + " \001(\0132&.google.spanner.v1.DirectedReadOptions\022\032\n"
           + "\022data_boost_enabled\030\020 \001(\010\022\033\n"
-          + "\016last_statement\030\021 \001(\010B\003\340A\001\032O\n"
+          + "\016last_statement\030\021 \001(\010B\003\340A\001\0229\n"
+          + "\014routing_hint\030\022"
+          + " \001(\0132\036.google.spanner.v1.RoutingHintB\003\340A\001\032O\n"
           + "\014QueryOptions\022\031\n"
           + "\021optimizer_version\030\001 \001(\t\022$\n"
           + "\034optimizer_statistics_package\030\002 \001(\t\032J\n"
@@ -289,26 +292,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\026ExecuteBatchDmlRequest\0227\n"
           + "\007session\030\001 \001(\tB&\340A\002\372A \n"
           + "\036spanner.googleapis.com/Session\022@\n"
-          + "\013transaction\030\002 \001(\0132&.g"
-          + "oogle.spanner.v1.TransactionSelectorB\003\340A\002\022L\n\n"
-          + "statements\030\003 \003(\01323.google.spanner.v"
-          + "1.ExecuteBatchDmlRequest.StatementB\003\340A\002\022\022\n"
+          + "\013transaction\030\002"
+          + " \001(\0132&.google.spanner.v1.TransactionSelectorB\003\340A\002\022L\n\n"
+          + "statements\030\003 \003(\01323.goo"
+          + "gle.spanner.v1.ExecuteBatchDmlRequest.StatementB\003\340A\002\022\022\n"
           + "\005seqno\030\004 \001(\003B\003\340A\002\022:\n"
           + "\017request_options\030\005 \001(\0132!.google.spanner.v1.RequestOptions\022\034\n"
           + "\017last_statements\030\006 \001(\010B\003\340A\001\032\354\001\n"
           + "\tStatement\022\020\n"
           + "\003sql\030\001 \001(\tB\003\340A\002\022\'\n"
           + "\006params\030\002 \001(\0132\027.google.protobuf.Struct\022X\n"
-          + "\013param_types\030\003 "
-          + "\003(\0132C.google.spanner.v1.ExecuteBatchDmlRequest.Statement.ParamTypesEntry\032J\n"
+          + "\013param_types\030\003 \003(\0132C.google.spanner.v1.Exe"
+          + "cuteBatchDmlRequest.Statement.ParamTypesEntry\032J\n"
           + "\017ParamTypesEntry\022\013\n"
           + "\003key\030\001 \001(\t\022&\n"
           + "\005value\030\002 \001(\0132\027.google.spanner.v1.Type:\0028\001\"\303\001\n"
           + "\027ExecuteBatchDmlResponse\0221\n"
           + "\013result_sets\030\001 \003(\0132\034.google.spanner.v1.ResultSet\022\"\n"
           + "\006status\030\002 \001(\0132\022.google.rpc.Status\022Q\n"
-          + "\017precommit_token\030\003"
-          + " \001(\01323.google.spanner.v1.MultiplexedSessionPrecommitTokenB\003\340A\001\"H\n"
+          + "\017precommit_token\030\003 \001(\01323.google.spanner.v"
+          + "1.MultiplexedSessionPrecommitTokenB\003\340A\001\"H\n"
           + "\020PartitionOptions\022\034\n"
           + "\024partition_size_bytes\030\001 \001(\003\022\026\n"
           + "\016max_partitions\030\002 \001(\003\"\243\003\n"
@@ -337,7 +340,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\017partition_token\030\001 \001(\014\"z\n"
           + "\021PartitionResponse\0220\n\n"
           + "partitions\030\001 \003(\0132\034.google.spanner.v1.Partition\0223\n"
-          + "\013transaction\030\002 \001(\0132\036.google.spanner.v1.Transaction\"\366\005\n"
+          + "\013transaction\030\002 \001(\0132\036.google.spanner.v1.Transaction\"\261\006\n"
           + "\013ReadRequest\0227\n"
           + "\007session\030\001 \001(\tB&\340A\002\372A \n"
           + "\036spanner.googleapis.com/Session\022;\n"
@@ -351,13 +354,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\017partition_token\030\n"
           + " \001(\014\022:\n"
           + "\017request_options\030\013 \001(\0132!.google.spanner.v1.RequestOptions\022E\n"
-          + "\025directed_read_options\030\016"
-          + " \001(\0132&.google.spanner.v1.DirectedReadOptions\022\032\n"
+          + "\025directed_read_options\030\016 \001(\0132&"
+          + ".google.spanner.v1.DirectedReadOptions\022\032\n"
           + "\022data_boost_enabled\030\017 \001(\010\022=\n"
           + "\010order_by\030\020"
           + " \001(\0162&.google.spanner.v1.ReadRequest.OrderByB\003\340A\001\022?\n"
           + "\tlock_hint\030\021"
-          + " \001(\0162\'.google.spanner.v1.ReadRequest.LockHintB\003\340A\001\"T\n"
+          + " \001(\0162\'.google.spanner.v1.ReadRequest.LockHintB\003\340A\001\0229\n"
+          + "\014routing_hint\030\022"
+          + " \001(\0132\036.google.spanner.v1.RoutingHintB\003\340A\001\"T\n"
           + "\007OrderBy\022\030\n"
           + "\024ORDER_BY_UNSPECIFIED\020\000\022\030\n"
           + "\024ORDER_BY_PRIMARY_KEY\020\001\022\025\n"
@@ -385,8 +390,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\020max_commit_delay\030\010"
           + " \001(\0132\031.google.protobuf.DurationB\003\340A\001\022:\n"
           + "\017request_options\030\006 \001(\0132!.google.spanner.v1.RequestOptions\022Q\n"
-          + "\017precommit_token\030\t"
-          + " \001(\01323.google.spanner.v1.MultiplexedSessionPrecommitTokenB\003\340A\001B\r\n"
+          + "\017precommit_token\030\t \001("
+          + "\01323.google.spanner.v1.MultiplexedSessionPrecommitTokenB\003\340A\001B\r\n"
           + "\013transaction\"g\n"
           + "\017RollbackRequest\0227\n"
           + "\007session\030\001 \001(\tB&\340A\002\372A \n"
@@ -396,8 +401,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\007session\030\001 \001(\tB&\340A\002\372A \n"
           + "\036spanner.googleapis.com/Session\022:\n"
           + "\017request_options\030\003 \001(\0132!.google.spanner.v1.RequestOptions\022P\n"
-          + "\017mutation_groups\030\004 \003(\01322.google"
-          + ".spanner.v1.BatchWriteRequest.MutationGroupB\003\340A\002\022,\n"
+          + "\017mutation_groups\030\004 \003(\01322.google.spanner"
+          + ".v1.BatchWriteRequest.MutationGroupB\003\340A\002\022,\n"
           + "\037exclude_txn_from_change_streams\030\005 \001(\010B\003\340A\001\032D\n\r"
           + "MutationGroup\0223\n"
           + "\tmutations\030\001 \003(\0132\033.google.spanner.v1.MutationB\003\340A\002\"\177\n"
@@ -406,73 +411,73 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "\006status\030\002 \001(\0132\022.google.rpc.Status\0224\n"
           + "\020commit_timestamp\030\003 \001(\0132\032.google.protobuf.Timestamp2\213\030\n"
           + "\007Spanner\022\246\001\n\r"
-          + "CreateSession\022\'.google.spanner.v1.CreateSessionReq"
-          + "uest\032\032.google.spanner.v1.Session\"P\332A\010dat"
-          + "abase\202\323\344\223\002?\":/v1/{database=projects/*/instances/*/databases/*}/sessions:\001*\022\340\001\n"
-          + "\023BatchCreateSessions\022-.google.spanner.v1.B"
-          + "atchCreateSessionsRequest\032..google.spann"
-          + "er.v1.BatchCreateSessionsResponse\"j\332A\026da"
-          + "tabase,session_count\202\323\344\223\002K\"F/v1/{databas"
-          + "e=projects/*/instances/*/databases/*}/sessions:batchCreate:\001*\022\227\001\n\n"
-          + "GetSession\022$.google.spanner.v1.GetSessionRequest\032\032.goo"
-          + "gle.spanner.v1.Session\"G\332A\004name\202\323\344\223\002:\0228/"
-          + "v1/{name=projects/*/instances/*/databases/*/sessions/*}\022\256\001\n"
-          + "\014ListSessions\022&.google.spanner.v1.ListSessionsRequest\032\'.googl"
-          + "e.spanner.v1.ListSessionsResponse\"M\332A\010da"
-          + "tabase\202\323\344\223\002<\022:/v1/{database=projects/*/instances/*/databases/*}/sessions\022\231\001\n\r"
-          + "DeleteSession\022\'.google.spanner.v1.DeleteSes"
-          + "sionRequest\032\026.google.protobuf.Empty\"G\332A\004"
-          + "name\202\323\344\223\002:*8/v1/{name=projects/*/instances/*/databases/*/sessions/*}\022\243\001\n\n"
-          + "ExecuteSql\022$.google.spanner.v1.ExecuteSqlReques"
-          + "t\032\034.google.spanner.v1.ResultSet\"Q\202\323\344\223\002K\""
-          + "F/v1/{session=projects/*/instances/*/databases/*/sessions/*}:executeSql:\001*\022\276\001\n"
-          + "\023ExecuteStreamingSql\022$.google.spanner.v1.E"
-          + "xecuteSqlRequest\032#.google.spanner.v1.Par"
-          + "tialResultSet\"Z\202\323\344\223\002T\"O/v1/{session=proj"
-          + "ects/*/instances/*/databases/*/sessions/*}:executeStreamingSql:\001*0\001\022\300\001\n"
-          + "\017ExecuteBatchDml\022).google.spanner.v1.ExecuteBatch"
-          + "DmlRequest\032*.google.spanner.v1.ExecuteBa"
-          + "tchDmlResponse\"V\202\323\344\223\002P\"K/v1/{session=pro"
-          + "jects/*/instances/*/databases/*/sessions/*}:executeBatchDml:\001*\022\221\001\n"
-          + "\004Read\022\036.google.spanner.v1.ReadRequest\032\034.google.spanner"
-          + ".v1.ResultSet\"K\202\323\344\223\002E\"@/v1/{session=proj"
-          + "ects/*/instances/*/databases/*/sessions/*}:read:\001*\022\254\001\n\r"
-          + "StreamingRead\022\036.google.spanner.v1.ReadRequest\032#.google.spanner.v1"
-          + ".PartialResultSet\"T\202\323\344\223\002N\"I/v1/{session="
-          + "projects/*/instances/*/databases/*/sessions/*}:streamingRead:\001*0\001\022\311\001\n"
-          + "\020BeginTransaction\022*.google.spanner.v1.BeginTransact"
-          + "ionRequest\032\036.google.spanner.v1.Transacti"
-          + "on\"i\332A\017session,options\202\323\344\223\002Q\"L/v1/{sessi"
-          + "on=projects/*/instances/*/databases/*/sessions/*}:beginTransaction:\001*\022\353\001\n"
-          + "\006Commit\022"
-          + " .google.spanner.v1.CommitRequest\032!.google.spanner.v1.CommitResponse\"\233\001\332A"
-          + " session,transaction_id,mutations\332A(session,si"
-          + "ngle_use_transaction,mutations\202\323\344\223\002G\"B/v"
-          + "1/{session=projects/*/instances/*/databases/*/sessions/*}:commit:\001*\022\260\001\n"
-          + "\010Rollback\022\".google.spanner.v1.RollbackRequest\032\026.g"
-          + "oogle.protobuf.Empty\"h\332A\026session,transac"
-          + "tion_id\202\323\344\223\002I\"D/v1/{session=projects/*/i"
-          + "nstances/*/databases/*/sessions/*}:rollback:\001*\022\267\001\n"
-          + "\016PartitionQuery\022(.google.spanner.v1.PartitionQueryRequest\032$.google.spa"
-          + "nner.v1.PartitionResponse\"U\202\323\344\223\002O\"J/v1/{"
-          + "session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery:\001*\022\264\001\n\r"
-          + "PartitionRead\022\'.google.spanner.v1.Partition"
-          + "ReadRequest\032$.google.spanner.v1.Partitio"
-          + "nResponse\"T\202\323\344\223\002N\"I/v1/{session=projects"
-          + "/*/instances/*/databases/*/sessions/*}:partitionRead:\001*\022\310\001\n\n"
-          + "BatchWrite\022$.google.spanner.v1.BatchWriteRequest\032%.google.sp"
-          + "anner.v1.BatchWriteResponse\"k\332A\027session,"
-          + "mutation_groups\202\323\344\223\002K\"F/v1/{session=proj"
-          + "ects/*/instances/*/databases/*/sessions/"
-          + "*}:batchWrite:\001*0\001\032w\312A\026spanner.googleapi"
-          + "s.com\322A[https://www.googleapis.com/auth/"
-          + "cloud-platform,https://www.googleapis.com/auth/spanner.dataB\221\002\n"
-          + "\025com.google.spanner.v1B\014SpannerProtoP\001Z5cloud.google.com/"
-          + "go/spanner/apiv1/spannerpb;spannerpb\252\002\027G"
-          + "oogle.Cloud.Spanner.V1\312\002\027Google\\Cloud\\Sp"
-          + "anner\\V1\352\002\032Google::Cloud::Spanner::V1\352A_\n"
-          + "\037spanner.googleapis.com/Database\022
+ * A `Tablet` represents a single replica of a `Group`. A tablet is served by a
+ * single server at a time, and can move between servers due to server death or
+ * simply load balancing.
+ * 
+ * + * Protobuf type {@code google.spanner.v1.Tablet} + */ +public final class Tablet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.Tablet) + TabletOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Tablet.newBuilder() to construct. + private Tablet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Tablet() { + serverAddress_ = ""; + location_ = ""; + role_ = 0; + incarnation_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Tablet(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto.internal_static_google_spanner_v1_Tablet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Tablet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Tablet.class, com.google.spanner.v1.Tablet.Builder.class); + } + + /** + * + * + *
+   * Indicates the role of the tablet.
+   * 
+ * + * Protobuf enum {@code google.spanner.v1.Tablet.Role} + */ + public enum Role implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * ROLE_UNSPECIFIED = 0; + */ + ROLE_UNSPECIFIED(0), + /** + * + * + *
+     * The tablet can perform reads and (if elected leader) writes.
+     * 
+ * + * READ_WRITE = 1; + */ + READ_WRITE(1), + /** + * + * + *
+     * The tablet can only perform reads.
+     * 
+ * + * READ_ONLY = 2; + */ + READ_ONLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * ROLE_UNSPECIFIED = 0; + */ + public static final int ROLE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The tablet can perform reads and (if elected leader) writes.
+     * 
+ * + * READ_WRITE = 1; + */ + public static final int READ_WRITE_VALUE = 1; + + /** + * + * + *
+     * The tablet can only perform reads.
+     * 
+ * + * READ_ONLY = 2; + */ + public static final int READ_ONLY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Role valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Role forNumber(int value) { + switch (value) { + case 0: + return ROLE_UNSPECIFIED; + case 1: + return READ_WRITE; + case 2: + return READ_ONLY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Role findValueByNumber(int number) { + return Role.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.spanner.v1.Tablet.getDescriptor().getEnumTypes().get(0); + } + + private static final Role[] VALUES = values(); + + public static Role valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Role(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.spanner.v1.Tablet.Role) + } + + public static final int TABLET_UID_FIELD_NUMBER = 1; + private long tabletUid_ = 0L; + + /** + * + * + *
+   * The UID of the tablet, unique within the database. Matches the
+   * `tablet_uids` and `leader_tablet_uid` fields in `Group`.
+   * 
+ * + * uint64 tablet_uid = 1; + * + * @return The tabletUid. + */ + @java.lang.Override + public long getTabletUid() { + return tabletUid_; + } + + public static final int SERVER_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object serverAddress_ = ""; + + /** + * + * + *
+   * The address of the server that is serving this tablet -- either an IP
+   * address or DNS hostname and a port number.
+   * 
+ * + * string server_address = 2; + * + * @return The serverAddress. + */ + @java.lang.Override + public java.lang.String getServerAddress() { + java.lang.Object ref = serverAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverAddress_ = s; + return s; + } + } + + /** + * + * + *
+   * The address of the server that is serving this tablet -- either an IP
+   * address or DNS hostname and a port number.
+   * 
+ * + * string server_address = 2; + * + * @return The bytes for serverAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerAddressBytes() { + java.lang.Object ref = serverAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+   * Where this tablet is located. In the Spanner managed service, this is the
+   * name of a region, such as "us-central1". In Spanner Omni, this is a
+   * previously created location.
+   * 
+ * + * string location = 3; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+   * Where this tablet is located. In the Spanner managed service, this is the
+   * name of a region, such as "us-central1". In Spanner Omni, this is a
+   * previously created location.
+   * 
+ * + * string location = 3; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ROLE_FIELD_NUMBER = 4; + private int role_ = 0; + + /** + * + * + *
+   * The role of the tablet.
+   * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override + public int getRoleValue() { + return role_; + } + + /** + * + * + *
+   * The role of the tablet.
+   * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @return The role. + */ + @java.lang.Override + public com.google.spanner.v1.Tablet.Role getRole() { + com.google.spanner.v1.Tablet.Role result = com.google.spanner.v1.Tablet.Role.forNumber(role_); + return result == null ? com.google.spanner.v1.Tablet.Role.UNRECOGNIZED : result; + } + + public static final int INCARNATION_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString incarnation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+   * `incarnation` indicates the freshness of the tablet information contained
+   * in this proto. Incarnations can be compared lexicographically; if
+   * incarnation A is greater than incarnation B, then the `Tablet`
+   * corresponding to A is newer than the `Tablet` corresponding to B, and
+   * should be used preferentially.
+   * 
+ * + * bytes incarnation = 5; + * + * @return The incarnation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIncarnation() { + return incarnation_; + } + + public static final int DISTANCE_FIELD_NUMBER = 6; + private int distance_ = 0; + + /** + * + * + *
+   * Distances help the client pick the closest tablet out of the list of
+   * tablets for a given request. Tablets with lower distances should generally
+   * be preferred. Tablets with the same distance are approximately equally
+   * close; the client can choose arbitrarily.
+   *
+   * Distances do not correspond precisely to expected latency, geographical
+   * distance, or anything else. Distances should be compared only between
+   * tablets of the same group; they are not meaningful between different
+   * groups.
+   *
+   * A value of zero indicates that the tablet may be in the same zone as
+   * the client, and have minimum network latency. A value less than or equal to
+   * five indicates that the tablet is thought to be in the same region as the
+   * client, and may have a few milliseconds of network latency. Values greater
+   * than five are most likely in a different region, with non-trivial network
+   * latency.
+   *
+   * Clients should use the following algorithm:
+   *   * If the request is using a directed read, eliminate any tablets that
+   *     do not match the directed read's target zone and/or replica type.
+   *   * (Read-write transactions only) Choose leader tablet if it has an
+   *     distance <=5.
+   *   * Group and sort tablets by distance. Choose a random
+   *     tablet with the lowest distance. If the request
+   *     is not a directed read, only consider replicas with distances <=5.
+   *   * Send the request to the fallback endpoint.
+   *
+   * The tablet picked by this algorithm may be skipped, either because it is
+   * marked as `skip` by the server or because the corresponding server is
+   * unreachable, flow controlled, etc. Skipped tablets should be added to the
+   * `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should
+   * then be re-run without including the skipped tablet(s) to pick the next
+   * best tablet.
+   * 
+ * + * uint32 distance = 6; + * + * @return The distance. + */ + @java.lang.Override + public int getDistance() { + return distance_; + } + + public static final int SKIP_FIELD_NUMBER = 7; + private boolean skip_ = false; + + /** + * + * + *
+   * If true, the tablet should not be chosen by the client. Typically, this
+   * signals that the tablet is unhealthy in some way. Tablets with `skip`
+   * set to true should be reported back to the server in
+   * `RoutingHint.skipped_tablet_uid`; this cues the server to send updated
+   * information for this tablet should it become usable again.
+   * 
+ * + * bool skip = 7; + * + * @return The skip. + */ + @java.lang.Override + public boolean getSkip() { + return skip_; + } + + 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 (tabletUid_ != 0L) { + output.writeUInt64(1, tabletUid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serverAddress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, location_); + } + if (role_ != com.google.spanner.v1.Tablet.Role.ROLE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, role_); + } + if (!incarnation_.isEmpty()) { + output.writeBytes(5, incarnation_); + } + if (distance_ != 0) { + output.writeUInt32(6, distance_); + } + if (skip_ != false) { + output.writeBool(7, skip_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tabletUid_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(1, tabletUid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serverAddress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, location_); + } + if (role_ != com.google.spanner.v1.Tablet.Role.ROLE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, role_); + } + if (!incarnation_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, incarnation_); + } + if (distance_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(6, distance_); + } + if (skip_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, skip_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.spanner.v1.Tablet)) { + return super.equals(obj); + } + com.google.spanner.v1.Tablet other = (com.google.spanner.v1.Tablet) obj; + + if (getTabletUid() != other.getTabletUid()) return false; + if (!getServerAddress().equals(other.getServerAddress())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (role_ != other.role_) return false; + if (!getIncarnation().equals(other.getIncarnation())) return false; + if (getDistance() != other.getDistance()) return false; + if (getSkip() != other.getSkip()) 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) + TABLET_UID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTabletUid()); + hash = (37 * hash) + SERVER_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getServerAddress().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + ROLE_FIELD_NUMBER; + hash = (53 * hash) + role_; + hash = (37 * hash) + INCARNATION_FIELD_NUMBER; + hash = (53 * hash) + getIncarnation().hashCode(); + hash = (37 * hash) + DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + getDistance(); + hash = (37 * hash) + SKIP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkip()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.Tablet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Tablet parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Tablet parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Tablet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Tablet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.spanner.v1.Tablet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.spanner.v1.Tablet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Tablet parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Tablet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Tablet parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.spanner.v1.Tablet parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.spanner.v1.Tablet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.spanner.v1.Tablet 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; + } + + /** + * + * + *
+   * A `Tablet` represents a single replica of a `Group`. A tablet is served by a
+   * single server at a time, and can move between servers due to server death or
+   * simply load balancing.
+   * 
+ * + * Protobuf type {@code google.spanner.v1.Tablet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.spanner.v1.Tablet) + com.google.spanner.v1.TabletOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Tablet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Tablet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.Tablet.class, com.google.spanner.v1.Tablet.Builder.class); + } + + // Construct using com.google.spanner.v1.Tablet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tabletUid_ = 0L; + serverAddress_ = ""; + location_ = ""; + role_ = 0; + incarnation_ = com.google.protobuf.ByteString.EMPTY; + distance_ = 0; + skip_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.spanner.v1.LocationProto + .internal_static_google_spanner_v1_Tablet_descriptor; + } + + @java.lang.Override + public com.google.spanner.v1.Tablet getDefaultInstanceForType() { + return com.google.spanner.v1.Tablet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.spanner.v1.Tablet build() { + com.google.spanner.v1.Tablet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.spanner.v1.Tablet buildPartial() { + com.google.spanner.v1.Tablet result = new com.google.spanner.v1.Tablet(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.spanner.v1.Tablet result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tabletUid_ = tabletUid_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serverAddress_ = serverAddress_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.role_ = role_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.incarnation_ = incarnation_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.distance_ = distance_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.skip_ = skip_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.spanner.v1.Tablet) { + return mergeFrom((com.google.spanner.v1.Tablet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.spanner.v1.Tablet other) { + if (other == com.google.spanner.v1.Tablet.getDefaultInstance()) return this; + if (other.getTabletUid() != 0L) { + setTabletUid(other.getTabletUid()); + } + if (!other.getServerAddress().isEmpty()) { + serverAddress_ = other.serverAddress_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.role_ != 0) { + setRoleValue(other.getRoleValue()); + } + if (other.getIncarnation() != com.google.protobuf.ByteString.EMPTY) { + setIncarnation(other.getIncarnation()); + } + if (other.getDistance() != 0) { + setDistance(other.getDistance()); + } + if (other.getSkip() != false) { + setSkip(other.getSkip()); + } + 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: + { + tabletUid_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + serverAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + role_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + incarnation_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + distance_ = input.readUInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + skip_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + 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 tabletUid_; + + /** + * + * + *
+     * The UID of the tablet, unique within the database. Matches the
+     * `tablet_uids` and `leader_tablet_uid` fields in `Group`.
+     * 
+ * + * uint64 tablet_uid = 1; + * + * @return The tabletUid. + */ + @java.lang.Override + public long getTabletUid() { + return tabletUid_; + } + + /** + * + * + *
+     * The UID of the tablet, unique within the database. Matches the
+     * `tablet_uids` and `leader_tablet_uid` fields in `Group`.
+     * 
+ * + * uint64 tablet_uid = 1; + * + * @param value The tabletUid to set. + * @return This builder for chaining. + */ + public Builder setTabletUid(long value) { + + tabletUid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The UID of the tablet, unique within the database. Matches the
+     * `tablet_uids` and `leader_tablet_uid` fields in `Group`.
+     * 
+ * + * uint64 tablet_uid = 1; + * + * @return This builder for chaining. + */ + public Builder clearTabletUid() { + bitField0_ = (bitField0_ & ~0x00000001); + tabletUid_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object serverAddress_ = ""; + + /** + * + * + *
+     * The address of the server that is serving this tablet -- either an IP
+     * address or DNS hostname and a port number.
+     * 
+ * + * string server_address = 2; + * + * @return The serverAddress. + */ + public java.lang.String getServerAddress() { + java.lang.Object ref = serverAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The address of the server that is serving this tablet -- either an IP
+     * address or DNS hostname and a port number.
+     * 
+ * + * string server_address = 2; + * + * @return The bytes for serverAddress. + */ + public com.google.protobuf.ByteString getServerAddressBytes() { + java.lang.Object ref = serverAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The address of the server that is serving this tablet -- either an IP
+     * address or DNS hostname and a port number.
+     * 
+ * + * string server_address = 2; + * + * @param value The serverAddress to set. + * @return This builder for chaining. + */ + public Builder setServerAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serverAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The address of the server that is serving this tablet -- either an IP
+     * address or DNS hostname and a port number.
+     * 
+ * + * string server_address = 2; + * + * @return This builder for chaining. + */ + public Builder clearServerAddress() { + serverAddress_ = getDefaultInstance().getServerAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The address of the server that is serving this tablet -- either an IP
+     * address or DNS hostname and a port number.
+     * 
+ * + * string server_address = 2; + * + * @param value The bytes for serverAddress to set. + * @return This builder for chaining. + */ + public Builder setServerAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serverAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+     * Where this tablet is located. In the Spanner managed service, this is the
+     * name of a region, such as "us-central1". In Spanner Omni, this is a
+     * previously created location.
+     * 
+ * + * string location = 3; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Where this tablet is located. In the Spanner managed service, this is the
+     * name of a region, such as "us-central1". In Spanner Omni, this is a
+     * previously created location.
+     * 
+ * + * string location = 3; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Where this tablet is located. In the Spanner managed service, this is the
+     * name of a region, such as "us-central1". In Spanner Omni, this is a
+     * previously created location.
+     * 
+ * + * string location = 3; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Where this tablet is located. In the Spanner managed service, this is the
+     * name of a region, such as "us-central1". In Spanner Omni, this is a
+     * previously created location.
+     * 
+ * + * string location = 3; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Where this tablet is located. In the Spanner managed service, this is the
+     * name of a region, such as "us-central1". In Spanner Omni, this is a
+     * previously created location.
+     * 
+ * + * string location = 3; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int role_ = 0; + + /** + * + * + *
+     * The role of the tablet.
+     * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override + public int getRoleValue() { + return role_; + } + + /** + * + * + *
+     * The role of the tablet.
+     * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @param value The enum numeric value on the wire for role to set. + * @return This builder for chaining. + */ + public Builder setRoleValue(int value) { + role_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The role of the tablet.
+     * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @return The role. + */ + @java.lang.Override + public com.google.spanner.v1.Tablet.Role getRole() { + com.google.spanner.v1.Tablet.Role result = com.google.spanner.v1.Tablet.Role.forNumber(role_); + return result == null ? com.google.spanner.v1.Tablet.Role.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * The role of the tablet.
+     * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(com.google.spanner.v1.Tablet.Role value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + role_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The role of the tablet.
+     * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @return This builder for chaining. + */ + public Builder clearRole() { + bitField0_ = (bitField0_ & ~0x00000008); + role_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString incarnation_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
+     * `incarnation` indicates the freshness of the tablet information contained
+     * in this proto. Incarnations can be compared lexicographically; if
+     * incarnation A is greater than incarnation B, then the `Tablet`
+     * corresponding to A is newer than the `Tablet` corresponding to B, and
+     * should be used preferentially.
+     * 
+ * + * bytes incarnation = 5; + * + * @return The incarnation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIncarnation() { + return incarnation_; + } + + /** + * + * + *
+     * `incarnation` indicates the freshness of the tablet information contained
+     * in this proto. Incarnations can be compared lexicographically; if
+     * incarnation A is greater than incarnation B, then the `Tablet`
+     * corresponding to A is newer than the `Tablet` corresponding to B, and
+     * should be used preferentially.
+     * 
+ * + * bytes incarnation = 5; + * + * @param value The incarnation to set. + * @return This builder for chaining. + */ + public Builder setIncarnation(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + incarnation_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * `incarnation` indicates the freshness of the tablet information contained
+     * in this proto. Incarnations can be compared lexicographically; if
+     * incarnation A is greater than incarnation B, then the `Tablet`
+     * corresponding to A is newer than the `Tablet` corresponding to B, and
+     * should be used preferentially.
+     * 
+ * + * bytes incarnation = 5; + * + * @return This builder for chaining. + */ + public Builder clearIncarnation() { + bitField0_ = (bitField0_ & ~0x00000010); + incarnation_ = getDefaultInstance().getIncarnation(); + onChanged(); + return this; + } + + private int distance_; + + /** + * + * + *
+     * Distances help the client pick the closest tablet out of the list of
+     * tablets for a given request. Tablets with lower distances should generally
+     * be preferred. Tablets with the same distance are approximately equally
+     * close; the client can choose arbitrarily.
+     *
+     * Distances do not correspond precisely to expected latency, geographical
+     * distance, or anything else. Distances should be compared only between
+     * tablets of the same group; they are not meaningful between different
+     * groups.
+     *
+     * A value of zero indicates that the tablet may be in the same zone as
+     * the client, and have minimum network latency. A value less than or equal to
+     * five indicates that the tablet is thought to be in the same region as the
+     * client, and may have a few milliseconds of network latency. Values greater
+     * than five are most likely in a different region, with non-trivial network
+     * latency.
+     *
+     * Clients should use the following algorithm:
+     *   * If the request is using a directed read, eliminate any tablets that
+     *     do not match the directed read's target zone and/or replica type.
+     *   * (Read-write transactions only) Choose leader tablet if it has an
+     *     distance <=5.
+     *   * Group and sort tablets by distance. Choose a random
+     *     tablet with the lowest distance. If the request
+     *     is not a directed read, only consider replicas with distances <=5.
+     *   * Send the request to the fallback endpoint.
+     *
+     * The tablet picked by this algorithm may be skipped, either because it is
+     * marked as `skip` by the server or because the corresponding server is
+     * unreachable, flow controlled, etc. Skipped tablets should be added to the
+     * `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should
+     * then be re-run without including the skipped tablet(s) to pick the next
+     * best tablet.
+     * 
+ * + * uint32 distance = 6; + * + * @return The distance. + */ + @java.lang.Override + public int getDistance() { + return distance_; + } + + /** + * + * + *
+     * Distances help the client pick the closest tablet out of the list of
+     * tablets for a given request. Tablets with lower distances should generally
+     * be preferred. Tablets with the same distance are approximately equally
+     * close; the client can choose arbitrarily.
+     *
+     * Distances do not correspond precisely to expected latency, geographical
+     * distance, or anything else. Distances should be compared only between
+     * tablets of the same group; they are not meaningful between different
+     * groups.
+     *
+     * A value of zero indicates that the tablet may be in the same zone as
+     * the client, and have minimum network latency. A value less than or equal to
+     * five indicates that the tablet is thought to be in the same region as the
+     * client, and may have a few milliseconds of network latency. Values greater
+     * than five are most likely in a different region, with non-trivial network
+     * latency.
+     *
+     * Clients should use the following algorithm:
+     *   * If the request is using a directed read, eliminate any tablets that
+     *     do not match the directed read's target zone and/or replica type.
+     *   * (Read-write transactions only) Choose leader tablet if it has an
+     *     distance <=5.
+     *   * Group and sort tablets by distance. Choose a random
+     *     tablet with the lowest distance. If the request
+     *     is not a directed read, only consider replicas with distances <=5.
+     *   * Send the request to the fallback endpoint.
+     *
+     * The tablet picked by this algorithm may be skipped, either because it is
+     * marked as `skip` by the server or because the corresponding server is
+     * unreachable, flow controlled, etc. Skipped tablets should be added to the
+     * `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should
+     * then be re-run without including the skipped tablet(s) to pick the next
+     * best tablet.
+     * 
+ * + * uint32 distance = 6; + * + * @param value The distance to set. + * @return This builder for chaining. + */ + public Builder setDistance(int value) { + + distance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Distances help the client pick the closest tablet out of the list of
+     * tablets for a given request. Tablets with lower distances should generally
+     * be preferred. Tablets with the same distance are approximately equally
+     * close; the client can choose arbitrarily.
+     *
+     * Distances do not correspond precisely to expected latency, geographical
+     * distance, or anything else. Distances should be compared only between
+     * tablets of the same group; they are not meaningful between different
+     * groups.
+     *
+     * A value of zero indicates that the tablet may be in the same zone as
+     * the client, and have minimum network latency. A value less than or equal to
+     * five indicates that the tablet is thought to be in the same region as the
+     * client, and may have a few milliseconds of network latency. Values greater
+     * than five are most likely in a different region, with non-trivial network
+     * latency.
+     *
+     * Clients should use the following algorithm:
+     *   * If the request is using a directed read, eliminate any tablets that
+     *     do not match the directed read's target zone and/or replica type.
+     *   * (Read-write transactions only) Choose leader tablet if it has an
+     *     distance <=5.
+     *   * Group and sort tablets by distance. Choose a random
+     *     tablet with the lowest distance. If the request
+     *     is not a directed read, only consider replicas with distances <=5.
+     *   * Send the request to the fallback endpoint.
+     *
+     * The tablet picked by this algorithm may be skipped, either because it is
+     * marked as `skip` by the server or because the corresponding server is
+     * unreachable, flow controlled, etc. Skipped tablets should be added to the
+     * `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should
+     * then be re-run without including the skipped tablet(s) to pick the next
+     * best tablet.
+     * 
+ * + * uint32 distance = 6; + * + * @return This builder for chaining. + */ + public Builder clearDistance() { + bitField0_ = (bitField0_ & ~0x00000020); + distance_ = 0; + onChanged(); + return this; + } + + private boolean skip_; + + /** + * + * + *
+     * If true, the tablet should not be chosen by the client. Typically, this
+     * signals that the tablet is unhealthy in some way. Tablets with `skip`
+     * set to true should be reported back to the server in
+     * `RoutingHint.skipped_tablet_uid`; this cues the server to send updated
+     * information for this tablet should it become usable again.
+     * 
+ * + * bool skip = 7; + * + * @return The skip. + */ + @java.lang.Override + public boolean getSkip() { + return skip_; + } + + /** + * + * + *
+     * If true, the tablet should not be chosen by the client. Typically, this
+     * signals that the tablet is unhealthy in some way. Tablets with `skip`
+     * set to true should be reported back to the server in
+     * `RoutingHint.skipped_tablet_uid`; this cues the server to send updated
+     * information for this tablet should it become usable again.
+     * 
+ * + * bool skip = 7; + * + * @param value The skip to set. + * @return This builder for chaining. + */ + public Builder setSkip(boolean value) { + + skip_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, the tablet should not be chosen by the client. Typically, this
+     * signals that the tablet is unhealthy in some way. Tablets with `skip`
+     * set to true should be reported back to the server in
+     * `RoutingHint.skipped_tablet_uid`; this cues the server to send updated
+     * information for this tablet should it become usable again.
+     * 
+ * + * bool skip = 7; + * + * @return This builder for chaining. + */ + public Builder clearSkip() { + bitField0_ = (bitField0_ & ~0x00000040); + skip_ = 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.spanner.v1.Tablet) + } + + // @@protoc_insertion_point(class_scope:google.spanner.v1.Tablet) + private static final com.google.spanner.v1.Tablet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.spanner.v1.Tablet(); + } + + public static com.google.spanner.v1.Tablet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Tablet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.spanner.v1.Tablet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TabletOrBuilder.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TabletOrBuilder.java new file mode 100644 index 00000000000..2eb1f5ad693 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TabletOrBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/spanner/v1/location.proto + +// Protobuf Java Version: 3.25.8 +package com.google.spanner.v1; + +public interface TabletOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.spanner.v1.Tablet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The UID of the tablet, unique within the database. Matches the
+   * `tablet_uids` and `leader_tablet_uid` fields in `Group`.
+   * 
+ * + * uint64 tablet_uid = 1; + * + * @return The tabletUid. + */ + long getTabletUid(); + + /** + * + * + *
+   * The address of the server that is serving this tablet -- either an IP
+   * address or DNS hostname and a port number.
+   * 
+ * + * string server_address = 2; + * + * @return The serverAddress. + */ + java.lang.String getServerAddress(); + + /** + * + * + *
+   * The address of the server that is serving this tablet -- either an IP
+   * address or DNS hostname and a port number.
+   * 
+ * + * string server_address = 2; + * + * @return The bytes for serverAddress. + */ + com.google.protobuf.ByteString getServerAddressBytes(); + + /** + * + * + *
+   * Where this tablet is located. In the Spanner managed service, this is the
+   * name of a region, such as "us-central1". In Spanner Omni, this is a
+   * previously created location.
+   * 
+ * + * string location = 3; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+   * Where this tablet is located. In the Spanner managed service, this is the
+   * name of a region, such as "us-central1". In Spanner Omni, this is a
+   * previously created location.
+   * 
+ * + * string location = 3; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * The role of the tablet.
+   * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @return The enum numeric value on the wire for role. + */ + int getRoleValue(); + + /** + * + * + *
+   * The role of the tablet.
+   * 
+ * + * .google.spanner.v1.Tablet.Role role = 4; + * + * @return The role. + */ + com.google.spanner.v1.Tablet.Role getRole(); + + /** + * + * + *
+   * `incarnation` indicates the freshness of the tablet information contained
+   * in this proto. Incarnations can be compared lexicographically; if
+   * incarnation A is greater than incarnation B, then the `Tablet`
+   * corresponding to A is newer than the `Tablet` corresponding to B, and
+   * should be used preferentially.
+   * 
+ * + * bytes incarnation = 5; + * + * @return The incarnation. + */ + com.google.protobuf.ByteString getIncarnation(); + + /** + * + * + *
+   * Distances help the client pick the closest tablet out of the list of
+   * tablets for a given request. Tablets with lower distances should generally
+   * be preferred. Tablets with the same distance are approximately equally
+   * close; the client can choose arbitrarily.
+   *
+   * Distances do not correspond precisely to expected latency, geographical
+   * distance, or anything else. Distances should be compared only between
+   * tablets of the same group; they are not meaningful between different
+   * groups.
+   *
+   * A value of zero indicates that the tablet may be in the same zone as
+   * the client, and have minimum network latency. A value less than or equal to
+   * five indicates that the tablet is thought to be in the same region as the
+   * client, and may have a few milliseconds of network latency. Values greater
+   * than five are most likely in a different region, with non-trivial network
+   * latency.
+   *
+   * Clients should use the following algorithm:
+   *   * If the request is using a directed read, eliminate any tablets that
+   *     do not match the directed read's target zone and/or replica type.
+   *   * (Read-write transactions only) Choose leader tablet if it has an
+   *     distance <=5.
+   *   * Group and sort tablets by distance. Choose a random
+   *     tablet with the lowest distance. If the request
+   *     is not a directed read, only consider replicas with distances <=5.
+   *   * Send the request to the fallback endpoint.
+   *
+   * The tablet picked by this algorithm may be skipped, either because it is
+   * marked as `skip` by the server or because the corresponding server is
+   * unreachable, flow controlled, etc. Skipped tablets should be added to the
+   * `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should
+   * then be re-run without including the skipped tablet(s) to pick the next
+   * best tablet.
+   * 
+ * + * uint32 distance = 6; + * + * @return The distance. + */ + int getDistance(); + + /** + * + * + *
+   * If true, the tablet should not be chosen by the client. Typically, this
+   * signals that the tablet is unhealthy in some way. Tablets with `skip`
+   * set to true should be reported back to the server in
+   * `RoutingHint.skipped_tablet_uid`; this cues the server to send updated
+   * information for this tablet should it become usable again.
+   * 
+ * + * bool skip = 7; + * + * @return The skip. + */ + boolean getSkip(); +} diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java index a95462e8391..bb6e0adb3df 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java @@ -68,7 +68,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * `IsolationLevel` is used when setting `isolation_level` for a transaction.
+   * `IsolationLevel` is used when setting the [isolation
+   * level](https://cloud.google.com/spanner/docs/isolation-levels) for a
+   * transaction.
    * 
* * Protobuf enum {@code google.spanner.v1.TransactionOptions.IsolationLevel} @@ -115,7 +117,7 @@ public enum IsolationLevel implements com.google.protobuf.ProtocolMessageEnum { * `SERIALIZABLE` transactions, only write-write conflicts are detected in * snapshot transactions. * - * This isolation level does not support Read-only and Partitioned DML + * This isolation level does not support read-only and partitioned DML * transactions. * * When `REPEATABLE_READ` is specified on a read-write transaction, the @@ -171,7 +173,7 @@ public enum IsolationLevel implements com.google.protobuf.ProtocolMessageEnum { * `SERIALIZABLE` transactions, only write-write conflicts are detected in * snapshot transactions. * - * This isolation level does not support Read-only and Partitioned DML + * This isolation level does not support read-only and partitioned DML * transactions. * * When `REPEATABLE_READ` is specified on a read-write transaction, the diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/location.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/location.proto new file mode 100644 index 00000000000..09364281919 --- /dev/null +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/location.proto @@ -0,0 +1,391 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.spanner.v1; + +import "google/protobuf/struct.proto"; +import "google/spanner/v1/type.proto"; + +option csharp_namespace = "Google.Cloud.Spanner.V1"; +option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.spanner.v1"; +option php_namespace = "Google\\Cloud\\Spanner\\V1"; +option ruby_package = "Google::Cloud::Spanner::V1"; + +// A `Range` represents a range of keys in a database. The keys themselves +// are encoded in "sortable string format", also known as ssformat. Consult +// Spanner's open source client libraries for details on the encoding. +// +// Each range represents a contiguous range of rows, possibly from multiple +// tables/indexes. Each range is associated with a single paxos group (known as +// a "group" throughout this API), a split (which names the exact range within +// the group), and a generation that can be used to determine whether a given +// `Range` represents a newer or older location for the key range. +message Range { + // The start key of the range, inclusive. Encoded in "sortable string format" + // (ssformat). + bytes start_key = 1; + + // The limit key of the range, exclusive. Encoded in "sortable string format" + // (ssformat). + bytes limit_key = 2; + + // The UID of the paxos group where this range is stored. UIDs are unique + // within the database. References `Group.group_uid`. + uint64 group_uid = 3; + + // A group can store multiple ranges of keys. Each key range is named by an + // ID (the split ID). Within a group, split IDs are unique. The `split_id` + // names the exact split in `group_uid` where this range is stored. + uint64 split_id = 4; + + // `generation` indicates the freshness of the range information contained + // in this proto. Generations can be compared lexicographically; if generation + // A is greater than generation B, then the `Range` corresponding to A is + // newer than the `Range` corresponding to B, and should be used + // preferentially. + bytes generation = 5; +} + +// A `Tablet` represents a single replica of a `Group`. A tablet is served by a +// single server at a time, and can move between servers due to server death or +// simply load balancing. +message Tablet { + // Indicates the role of the tablet. + enum Role { + // Not specified. + ROLE_UNSPECIFIED = 0; + + // The tablet can perform reads and (if elected leader) writes. + READ_WRITE = 1; + + // The tablet can only perform reads. + READ_ONLY = 2; + } + + // The UID of the tablet, unique within the database. Matches the + // `tablet_uids` and `leader_tablet_uid` fields in `Group`. + uint64 tablet_uid = 1; + + // The address of the server that is serving this tablet -- either an IP + // address or DNS hostname and a port number. + string server_address = 2; + + // Where this tablet is located. In the Spanner managed service, this is the + // name of a region, such as "us-central1". In Spanner Omni, this is a + // previously created location. + string location = 3; + + // The role of the tablet. + Role role = 4; + + // `incarnation` indicates the freshness of the tablet information contained + // in this proto. Incarnations can be compared lexicographically; if + // incarnation A is greater than incarnation B, then the `Tablet` + // corresponding to A is newer than the `Tablet` corresponding to B, and + // should be used preferentially. + bytes incarnation = 5; + + // Distances help the client pick the closest tablet out of the list of + // tablets for a given request. Tablets with lower distances should generally + // be preferred. Tablets with the same distance are approximately equally + // close; the client can choose arbitrarily. + // + // Distances do not correspond precisely to expected latency, geographical + // distance, or anything else. Distances should be compared only between + // tablets of the same group; they are not meaningful between different + // groups. + // + // A value of zero indicates that the tablet may be in the same zone as + // the client, and have minimum network latency. A value less than or equal to + // five indicates that the tablet is thought to be in the same region as the + // client, and may have a few milliseconds of network latency. Values greater + // than five are most likely in a different region, with non-trivial network + // latency. + // + // Clients should use the following algorithm: + // * If the request is using a directed read, eliminate any tablets that + // do not match the directed read's target zone and/or replica type. + // * (Read-write transactions only) Choose leader tablet if it has an + // distance <=5. + // * Group and sort tablets by distance. Choose a random + // tablet with the lowest distance. If the request + // is not a directed read, only consider replicas with distances <=5. + // * Send the request to the fallback endpoint. + // + // The tablet picked by this algorithm may be skipped, either because it is + // marked as `skip` by the server or because the corresponding server is + // unreachable, flow controlled, etc. Skipped tablets should be added to the + // `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should + // then be re-run without including the skipped tablet(s) to pick the next + // best tablet. + uint32 distance = 6; + + // If true, the tablet should not be chosen by the client. Typically, this + // signals that the tablet is unhealthy in some way. Tablets with `skip` + // set to true should be reported back to the server in + // `RoutingHint.skipped_tablet_uid`; this cues the server to send updated + // information for this tablet should it become usable again. + bool skip = 7; +} + +// A `Group` represents a paxos group in a database. A group is a set of +// tablets that are replicated across multiple servers. Groups may have a leader +// tablet. Groups store one (or sometimes more) ranges of keys. +message Group { + // The UID of the paxos group, unique within the database. Matches the + // `group_uid` field in `Range`. + uint64 group_uid = 1; + + // A list of tablets that are part of the group. Note that this list may not + // be exhaustive; it will only include tablets the server considers useful + // to the client. The returned list is ordered ascending by distance. + // + // Tablet UIDs reference `Tablet.tablet_uid`. + repeated Tablet tablets = 2; + + // The last known leader tablet of the group as an index into `tablets`. May + // be negative if the group has no known leader. + int32 leader_index = 3; + + // `generation` indicates the freshness of the group information (including + // leader information) contained in this proto. Generations can be compared + // lexicographically; if generation A is greater than generation B, then the + // `Group` corresponding to A is newer than the `Group` corresponding to B, + // and should be used preferentially. + bytes generation = 4; +} + +// A `KeyRecipe` provides the metadata required to translate reads, mutations, +// and queries into a byte array in "sortable string format" (ssformat)that can +// be used with `Range`s to route requests. Note that the client *must* tolerate +// `KeyRecipe`s that appear to be invalid, since the `KeyRecipe` format may +// change over time. Requests with invalid `KeyRecipe`s should be routed to a +// default server. +message KeyRecipe { + // An ssformat key is composed of a sequence of tag numbers and key column + // values. `Part` represents a single tag or key column value. + message Part { + // The remaining fields encode column values. + enum Order { + // Default value, equivalent to `ASCENDING`. + ORDER_UNSPECIFIED = 0; + + // The key is ascending - corresponds to `ASC` in the schema definition. + ASCENDING = 1; + + // The key is descending - corresponds to `DESC` in the schema definition. + DESCENDING = 2; + } + + // The null order of the key column. This dictates where NULL values sort + // in the sorted order. Note that columns which are `NOT NULL` can have a + // special encoding. + enum NullOrder { + // Default value. This value is unused. + NULL_ORDER_UNSPECIFIED = 0; + + // NULL values sort before any non-NULL values. + NULLS_FIRST = 1; + + // NULL values sort after any non-NULL values. + NULLS_LAST = 2; + + // The column does not support NULL values. + NOT_NULL = 3; + } + + // If non-zero, `tag` is the only field present in this `Part`. The part + // is encoded by appending `tag` to the ssformat key. + uint32 tag = 1; + + // Whether the key column is sorted ascending or descending. Only present + // if `tag` is zero. + Order order = 2; + + // How NULLs are represented in the encoded key part. Only present if `tag` + // is zero. + NullOrder null_order = 3; + + // The type of the key part. Only present if `tag` is zero. + Type type = 4; + + // Only present if `tag` is zero. + oneof value_type { + // `identifier` is the name of the column or query parameter. + string identifier = 5; + + // The constant value of the key part. + // It is present when query uses a constant as a part of the key. + google.protobuf.Value value = 6; + + // If true, the client is responsible to fill in the value randomly. + // It's relevant only for the INT64 type. + bool random = 8; + } + + // It is a repeated field to support fetching key columns from nested + // structs, such as `STRUCT` query parameters. + repeated int32 struct_identifiers = 7; + } + + // A recipe can be associated with a table, index, or query. Tables recipes + // are used to encode read and write keys; index recipes are used for index + // reads, and query recipes are used only for SQL queries. + oneof target { + // A table name, matching the name from the database schema. + string table_name = 1; + + // An index name, matching the name from the database schema. + string index_name = 2; + + // The UID of a query, matching the UID from `RoutingHint`. + uint64 operation_uid = 3; + } + + // Parts are in the order they should appear in the encoded key. + repeated Part part = 4; +} + +// A `RecipeList` contains a list of `KeyRecipe`s, which share the same +// schema generation. +message RecipeList { + // The schema generation of the recipes. To be sent to the server in + // `RoutingHint.schema_generation` whenever one of the recipes is used. + // `schema_generation` values are comparable with each other; if generation A + // compares greater than generation B, then A is a more recent schema than B. + // Clients should in general aim to cache only the latest schema generation, + // and discard more stale recipes. + bytes schema_generation = 1; + + // A list of recipes to be cached. + repeated KeyRecipe recipe = 3; +} + +// A `CacheUpdate` expresses a set of changes the client should incorporate into +// its location cache. These changes may or may not be newer than what the +// client has in its cache, and should be discarded if necessary. `CacheUpdate`s +// can be obtained in response to requests that included a `RoutingHint` +// field, but may also be obtained by explicit location-fetching RPCs which may +// be added in the future. +message CacheUpdate { + // An internal ID for the database. Database names can be reused if a database + // is deleted and re-created. Each time the database is re-created, it will + // get a new database ID, which will never be re-used for any other database. + uint64 database_id = 1; + + // A list of ranges to be cached. + repeated Range range = 2; + + // A list of groups to be cached. + repeated Group group = 3; + + // A list of recipes to be cached. + RecipeList key_recipes = 5; +} + +// `RoutingHint` can be optionally added to location-aware Spanner +// requests. It gives the server hints that can be used to route the request to +// an appropriate server, potentially significantly decreasing latency and +// improving throughput. To achieve improved performance, most fields must be +// filled in with accurate values. +// +// The presence of a valid `RoutingHint` tells the server that the client +// is location-aware. +// +// `RoutingHint` does not change the semantics of the request; it is +// purely a performance hint; the request will perform the same actions on the +// database's data as if `RoutingHint` were not present. However, if +// the `RoutingHint` is incomplete or incorrect, the response may include +// a `CacheUpdate` the client can use to correct its location cache. +message RoutingHint { + // A tablet that was skipped by the client. See `Tablet.tablet_uid` and + // `Tablet.incarnation`. + message SkippedTablet { + // The tablet UID of the tablet that was skipped. See `Tablet.tablet_uid`. + uint64 tablet_uid = 1; + + // The incarnation of the tablet that was skipped. See `Tablet.incarnation`. + bytes incarnation = 2; + } + + // A session-scoped unique ID for the operation, computed client-side. + // Requests with the same `operation_uid` should have a shared 'shape', + // meaning that some fields are expected to be the same, such as the SQL + // query, the target table/columns (for reads) etc. Requests with the same + // `operation_uid` are meant to differ only in fields like keys/key + // ranges/query parameters, transaction IDs, etc. + // + // `operation_uid` must be non-zero for `RoutingHint` to be valid. + uint64 operation_uid = 1; + + // The database ID of the database being accessed, see + // `CacheUpdate.database_id`. Should match the cache entries that were used + // to generate the rest of the fields in this `RoutingHint`. + uint64 database_id = 2; + + // The schema generation of the recipe that was used to generate `key` and + // `limit_key`. See also `RecipeList.schema_generation`. + bytes schema_generation = 3; + + // The key / key range that this request accesses. For operations that + // access a single key, `key` should be set and `limit_key` should be empty. + // For operations that access a key range, `key` and `limit_key` should both + // be set, to the inclusive start and exclusive end of the range respectively. + // + // The keys are encoded in "sortable string format" (ssformat), using a + // `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more + // details. + bytes key = 4; + + // If this request targets a key range, this is the exclusive end of the + // range. See `key` for more details. + bytes limit_key = 5; + + // The group UID of the group that the client believes serves the range + // defined by `key` and `limit_key`. See `Range.group_uid` for more details. + uint64 group_uid = 6; + + // The split ID of the split that the client believes contains the range + // defined by `key` and `limit_key`. See `Range.split_id` for more details. + uint64 split_id = 7; + + // The tablet UID of the tablet from group `group_uid` that the client + // believes is best to serve this request. See `Group.local_tablet_uids` and + // `Group.leader_tablet_uid`. + uint64 tablet_uid = 8; + + // If the client had multiple options for tablet selection, and some of its + // first choices were unhealthy (e.g., the server is unreachable, or + // `Tablet.skip` is true), this field will contain the tablet UIDs of those + // tablets, with their incarnations. The server may include a `CacheUpdate` + // with new locations for those tablets. + repeated SkippedTablet skipped_tablet_uid = 9; + + // If present, the client's current location. In the Spanner managed service, + // this should be the name of a Google Cloud zone or region, such as + // "us-central1". In Spanner Omni, this should correspond to a previously + // created location. + // + // If absent, the client's location will be assumed to be the same as the + // location of the server the client ends up connected to. + // + // Locations are primarily valuable for clients that connect from regions + // other than the ones that contain the Spanner database. + string client_location = 10; +} diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.proto index 41f032b9695..99641cea90c 100644 --- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.proto +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.proto @@ -18,6 +18,7 @@ package google.spanner.v1; import "google/api/field_behavior.proto"; import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; import "google/spanner/v1/keys.proto"; option csharp_namespace = "Google.Cloud.Spanner.V1"; @@ -75,6 +76,40 @@ message Mutation { KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED]; } + // Arguments to [send][google.spanner.v1.Mutation.send] operations. + message Send { + // Required. The queue to which the message will be sent. + string queue = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary key of the message to be sent. + google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; + + // The time at which Spanner will begin attempting to deliver the message. + // If `deliver_time` is not set, Spanner will deliver the message + // immediately. If `deliver_time` is in the past, Spanner will replace it + // with a value closer to the current time. + google.protobuf.Timestamp deliver_time = 3; + + // The payload of the message. + google.protobuf.Value payload = 4; + } + + // Arguments to [ack][google.spanner.v1.Mutation.ack] operations. + message Ack { + // Required. The queue where the message to be acked is stored. + string queue = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary key of the message to be acked. + google.protobuf.ListValue key = 2 [(google.api.field_behavior) = REQUIRED]; + + // By default, an attempt to ack a message that does not exist will fail + // with a `NOT_FOUND` error. With `ignore_not_found` set to true, the ack + // will succeed even if the message does not exist. This is useful for + // unconditionally acking a message, even if it is missing or has already + // been acked. + bool ignore_not_found = 3; + } + // Required. The operation to perform. oneof operation { // Insert new rows in a table. If any of the rows already exist, @@ -111,5 +146,11 @@ message Mutation { // Delete rows from a table. Succeeds whether or not the named // rows were present. Delete delete = 5; + + // Send a message to a queue. + Send send = 6; + + // Ack a message from a queue. + Ack ack = 7; } } diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.proto index cc7ff5ab684..8e8e587b000 100644 --- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.proto +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.spanner.v1; +import "google/api/field_behavior.proto"; import "google/protobuf/struct.proto"; option csharp_namespace = "Google.Cloud.Spanner.V1"; @@ -122,10 +123,34 @@ message PlanNode { google.protobuf.Struct execution_stats = 7; } +// Output of query advisor analysis. +message QueryAdvisorResult { + // Recommendation to add new indexes to run queries more efficiently. + message IndexAdvice { + // Optional. DDL statements to add new indexes that will improve the query. + repeated string ddl = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Estimated latency improvement factor. For example if the query + // currently takes 500 ms to run and the estimated latency with new indexes + // is 100 ms this field will be 5. + double improvement_factor = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Index Recommendation for a query. This is an optional field and + // the recommendation will only be available when the recommendation + // guarantees significant improvement in query performance. + repeated IndexAdvice index_advice = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + // Contains an ordered list of nodes appearing in the query plan. message QueryPlan { // The nodes in the query plan. Plan nodes are returned in pre-order starting // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` // corresponds to its index in `plan_nodes`. repeated PlanNode plan_nodes = 1; + + // Optional. The advise/recommendations for a query. Currently this field will + // be serving index recommendations for a query. + QueryAdvisorResult query_advice = 2 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.proto index c80bff2ae7f..4d446709b90 100644 --- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.proto +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.proto @@ -18,6 +18,7 @@ package google.spanner.v1; import "google/api/field_behavior.proto"; import "google/protobuf/struct.proto"; +import "google/spanner/v1/location.proto"; import "google/spanner/v1/query_plan.proto"; import "google/spanner/v1/transaction.proto"; import "google/spanner/v1/type.proto"; @@ -181,6 +182,14 @@ message PartialResultSet { // stream. The server might optionally set this field. Clients shouldn't rely // on this field being set in all cases. bool last = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A cache update expresses a set of changes the client should + // incorporate into its location cache. The client should discard the changes + // if they are older than the data it already has. This data can be obtained + // in response to requests that included a `RoutingHint` field, but may also + // be obtained by explicit location-fetching RPCs which may be added in the + // future. + CacheUpdate cache_update = 10 [(google.api.field_behavior) = OPTIONAL]; } // Metadata about a [ResultSet][google.spanner.v1.ResultSet] or diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto index e4ce605ec4f..1f797e940f2 100644 --- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto @@ -28,6 +28,7 @@ import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/spanner/v1/keys.proto"; +import "google/spanner/v1/location.proto"; import "google/spanner/v1/mutation.proto"; import "google/spanner/v1/result_set.proto"; import "google/spanner/v1/transaction.proto"; @@ -360,10 +361,10 @@ message BatchCreateSessionsRequest { // Parameters to apply to each created session. Session session_template = 2; - // Required. The number of sessions to be created in this batch call. - // The API can return fewer than the requested number of sessions. If a - // specific number of sessions are desired, the client can make additional - // calls to `BatchCreateSessions` (adjusting + // Required. The number of sessions to be created in this batch call. At least + // one session is created. The API can return fewer than the requested number + // of sessions. If a specific number of sessions are desired, the client can + // make additional calls to `BatchCreateSessions` (adjusting // [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] // as necessary). int32 session_count = 3 [(google.api.field_behavior) = REQUIRED]; @@ -412,8 +413,8 @@ message Session { string creator_role = 5; // Optional. If `true`, specifies a multiplexed session. Use a multiplexed - // session for multiple, concurrent read-only operations. Don't use them for - // read-write transactions, partitioned reads, or partitioned queries. Use + // session for multiple, concurrent operations including any combination of + // read-only and read-write transactions. Use // [`sessions.create`][google.spanner.v1.Spanner.CreateSession] to create // multiplexed sessions. Don't use // [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] to @@ -812,6 +813,14 @@ message ExecuteSqlRequest { // constraints). Given this, successful execution of a DML statement shouldn't // be assumed until a subsequent `Commit` call completes successfully. bool last_statement = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, it makes the Spanner requests location-aware. + // + // It gives the server hints that can be used to route the request + // to an appropriate server, potentially significantly decreasing latency and + // improving throughput. To achieve improved performance, most fields must be + // filled in with accurate values. + RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; } // The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. @@ -1244,6 +1253,14 @@ message ReadRequest { // Optional. Lock Hint for the request, it can only be used with read-write // transactions. LockHint lock_hint = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, it makes the Spanner requests location-aware. + // + // It gives the server hints that can be used to route the request + // to an appropriate server, potentially significantly decreasing latency and + // improving throughput. To achieve improved performance, most fields must be + // filled in with accurate values. + RoutingHint routing_hint = 18 [(google.api.field_behavior) = OPTIONAL]; } // The request for diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto index d3ad6e86903..4d2a54202ae 100644 --- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto @@ -153,7 +153,9 @@ message TransactionOptions { bool return_read_timestamp = 6; } - // `IsolationLevel` is used when setting `isolation_level` for a transaction. + // `IsolationLevel` is used when setting the [isolation + // level](https://cloud.google.com/spanner/docs/isolation-levels) for a + // transaction. enum IsolationLevel { // Default value. // @@ -178,7 +180,7 @@ message TransactionOptions { // `SERIALIZABLE` transactions, only write-write conflicts are detected in // snapshot transactions. // - // This isolation level does not support Read-only and Partitioned DML + // This isolation level does not support read-only and partitioned DML // transactions. // // When `REPEATABLE_READ` is specified on a read-write transaction, the