use of com.google.bigtable.v2.CheckAndMutateRowResponse in project java-bigtable by googleapis.
the class EnhancedBigtableStub method createCheckAndMutateRowCallable.
/**
* Creates a callable chain to handle CheckAndMutateRow RPCs. THe chain will:
*
* <ul>
* <li>Convert {@link ConditionalRowMutation}s into {@link
* com.google.bigtable.v2.CheckAndMutateRowRequest}s.
* <li>Add tracing & metrics.
* </ul>
*/
private UnaryCallable<ConditionalRowMutation, Boolean> createCheckAndMutateRowCallable() {
String methodName = "CheckAndMutateRow";
UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> base = GrpcRawCallableFactory.createUnaryCallable(GrpcCallSettings.<CheckAndMutateRowRequest, CheckAndMutateRowResponse>newBuilder().setMethodDescriptor(BigtableGrpc.getCheckAndMutateRowMethod()).setParamsExtractor(new RequestParamsExtractor<CheckAndMutateRowRequest>() {
@Override
public Map<String, String> extract(CheckAndMutateRowRequest checkAndMutateRowRequest) {
return ImmutableMap.of("table_name", checkAndMutateRowRequest.getTableName(), "app_profile_id", checkAndMutateRowRequest.getAppProfileId());
}
}).build(), settings.checkAndMutateRowSettings().getRetryableCodes());
UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> withStatsHeaders = new StatsHeadersUnaryCallable<>(base);
UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> withHeaderTracer = new HeaderTracerUnaryCallable<>(withStatsHeaders);
UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> retrying = Callables.retrying(withHeaderTracer, settings.checkAndMutateRowSettings(), clientContext);
return createUserFacingUnaryCallable(methodName, new CheckAndMutateRowCallable(retrying, requestContext));
}
Aggregations