use of com.google.bigtable.v2.ReadModifyWriteRowResponse in project java-bigtable by googleapis.
the class EnhancedBigtableStub method createReadModifyWriteRowCallable.
/**
* Creates a callable chain to handle ReadModifyWriteRow RPCs. The chain will:
*
* <ul>
* <li>Convert {@link ReadModifyWriteRow}s into {@link
* com.google.bigtable.v2.ReadModifyWriteRowRequest}s.
* <li>Convert the responses into {@link Row}.
* <li>Add tracing & metrics.
* </ul>
*/
private UnaryCallable<ReadModifyWriteRow, Row> createReadModifyWriteRowCallable() {
UnaryCallable<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse> base = GrpcRawCallableFactory.createUnaryCallable(GrpcCallSettings.<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse>newBuilder().setMethodDescriptor(BigtableGrpc.getReadModifyWriteRowMethod()).setParamsExtractor(new RequestParamsExtractor<ReadModifyWriteRowRequest>() {
@Override
public Map<String, String> extract(ReadModifyWriteRowRequest request) {
return ImmutableMap.of("table_name", request.getTableName(), "app_profile_id", request.getAppProfileId());
}
}).build(), settings.readModifyWriteRowSettings().getRetryableCodes());
UnaryCallable<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse> withStatsHeaders = new StatsHeadersUnaryCallable<>(base);
String methodName = "ReadModifyWriteRow";
UnaryCallable<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse> withHeaderTracer = new HeaderTracerUnaryCallable<>(withStatsHeaders);
UnaryCallable<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse> retrying = Callables.retrying(withHeaderTracer, settings.readModifyWriteRowSettings(), clientContext);
return createUserFacingUnaryCallable(methodName, new ReadModifyWriteRowCallable(retrying, requestContext));
}
Aggregations