Skip to content

Commit

Permalink
chore(deps): upgrade gapic-generator-java to 2.6.1 and update gax-jav…
Browse files Browse the repository at this point in the history
…a to 2.12.2 (googleapis#1176)

* chore(deps): upgrade gapic-generator-java to 2.6.1 and update gax-java to 2.12.2

PiperOrigin-RevId: 428569213

Source-Link: googleapis/googleapis@3ec9414

Source-Link: googleapis/googleapis-gen@92ccb61
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTJjY2I2MTU5NzVlMjExNTg4MmZlMWVkMzczN2IzNDZkZDRjZDkwNiJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and mutianf committed Mar 18, 2022
1 parent e1a5a80 commit 531e6bb
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.api.pathtemplate.PathTemplate;
import com.google.bigtable.v2.CheckAndMutateRowRequest;
import com.google.bigtable.v2.CheckAndMutateRowResponse;
import com.google.bigtable.v2.MutateRowRequest;
Expand All @@ -36,7 +38,6 @@
import com.google.bigtable.v2.ReadRowsResponse;
import com.google.bigtable.v2.SampleRowKeysRequest;
import com.google.bigtable.v2.SampleRowKeysResponse;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.stub.GrpcOperationsStub;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
Expand Down Expand Up @@ -123,6 +124,31 @@ public class GrpcBigtableStub extends BigtableStub {
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;

private static final PathTemplate READ_ROWS_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate READ_ROWS_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate SAMPLE_ROW_KEYS_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate SAMPLE_ROW_KEYS_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate MUTATE_ROW_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate MUTATE_ROW_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate MUTATE_ROWS_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate MUTATE_ROWS_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate CHECK_AND_MUTATE_ROW_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate READ_MODIFY_WRITE_ROW_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");

public static final GrpcBigtableStub create(BigtableStubSettings settings) throws IOException {
return new GrpcBigtableStub(settings, ClientContext.create(settings));
}
Expand Down Expand Up @@ -163,39 +189,48 @@ protected GrpcBigtableStub(
.setMethodDescriptor(readRowsMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("table_name", String.valueOf(request.getTableName()));
return params.build();
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(request.getTableName(), "table_name", READ_ROWS_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", READ_ROWS_1_PATH_TEMPLATE);
return builder.build();
})
.build();
GrpcCallSettings<SampleRowKeysRequest, SampleRowKeysResponse> sampleRowKeysTransportSettings =
GrpcCallSettings.<SampleRowKeysRequest, SampleRowKeysResponse>newBuilder()
.setMethodDescriptor(sampleRowKeysMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("table_name", String.valueOf(request.getTableName()));
return params.build();
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
request.getTableName(), "table_name", SAMPLE_ROW_KEYS_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", SAMPLE_ROW_KEYS_1_PATH_TEMPLATE);
return builder.build();
})
.build();
GrpcCallSettings<MutateRowRequest, MutateRowResponse> mutateRowTransportSettings =
GrpcCallSettings.<MutateRowRequest, MutateRowResponse>newBuilder()
.setMethodDescriptor(mutateRowMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("table_name", String.valueOf(request.getTableName()));
return params.build();
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(request.getTableName(), "table_name", MUTATE_ROW_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", MUTATE_ROW_1_PATH_TEMPLATE);
return builder.build();
})
.build();
GrpcCallSettings<MutateRowsRequest, MutateRowsResponse> mutateRowsTransportSettings =
GrpcCallSettings.<MutateRowsRequest, MutateRowsResponse>newBuilder()
.setMethodDescriptor(mutateRowsMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("table_name", String.valueOf(request.getTableName()));
return params.build();
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(request.getTableName(), "table_name", MUTATE_ROWS_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", MUTATE_ROWS_1_PATH_TEMPLATE);
return builder.build();
})
.build();
GrpcCallSettings<CheckAndMutateRowRequest, CheckAndMutateRowResponse>
Expand All @@ -204,9 +239,16 @@ protected GrpcBigtableStub(
.setMethodDescriptor(checkAndMutateRowMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("table_name", String.valueOf(request.getTableName()));
return params.build();
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
request.getTableName(),
"table_name",
CHECK_AND_MUTATE_ROW_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(),
"app_profile_id",
CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE);
return builder.build();
})
.build();
GrpcCallSettings<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse>
Expand All @@ -215,9 +257,16 @@ protected GrpcBigtableStub(
.setMethodDescriptor(readModifyWriteRowMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("table_name", String.valueOf(request.getTableName()));
return params.build();
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
request.getTableName(),
"table_name",
READ_MODIFY_WRITE_ROW_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(),
"app_profile_id",
READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE);
return builder.build();
})
.build();

Expand Down
Loading

0 comments on commit 531e6bb

Please sign in to comment.