BigtableDataClientWrapper implements IBigtableDataClient { @Override public ApiFuture<Row> readModifyWriteRowAsync(ReadModifyWriteRow readModifyWriteRow) { ListenableFuture<ReadModifyWriteRowResponse> response = delegate.readModifyWriteRowAsync(readModifyWriteRow.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt( response, new Function<ReadModifyWriteRowResponse, Row>() { @Override public Row apply(ReadModifyWriteRowResponse response) { return new DefaultRowAdapter().createRowFromProto(response.getRow()); } }); } BigtableDataClientWrapper(
      BigtableDataClient bigtableDataClient, RequestContext requestContext); @Override void mutateRow(RowMutation rowMutation); @Override ApiFuture<Void> mutateRowAsync(RowMutation rowMutation); @Override Row readModifyWriteRow(ReadModifyWriteRow readModifyWriteRow); @Override ApiFuture<Row> readModifyWriteRowAsync(ReadModifyWriteRow readModifyWriteRow); @Override IBulkMutation createBulkMutationBatcher(String tableId); @Override ApiFuture<Boolean> checkAndMutateRowAsync(ConditionalRowMutation conditionalRowMutation); @Override Boolean checkAndMutateRow(ConditionalRowMutation conditionalRowMutation); @Override List<KeyOffset> sampleRowKeys(String tableId); @Override ApiFuture<List<KeyOffset>> sampleRowKeysAsync(String tableId); @Override ResultScanner<Row> readRows(Query request); @Override ApiFuture<List<Row>> readRowsAsync(Query request); @Override List<FlatRow> readFlatRowsList(Query request); @Override ResultScanner<FlatRow> readFlatRows(Query request); @Override ApiFuture<List<FlatRow>> readFlatRowsAsync(Query request); @Override void readFlatRowsAsync(Query request, StreamObserver<FlatRow> observer);  }
@Test public void testReadModifyWriteAsync() throws Exception { ReadModifyWriteRow readModify = ReadModifyWriteRow.create(TABLE_ID, "test-key"); ReadModifyWriteRowRequest request = readModify.toProto(REQUEST_CONTEXT); Row expectedRow = buildRow(); ReadModifyWriteRowResponse response = ReadModifyWriteRowResponse.newBuilder().setRow(expectedRow).build(); ListenableFuture<ReadModifyWriteRowResponse> listenableResponse = Futures.immediateFuture(response); RowCell rowCell = RowCell.create("firstFamily", QUALIFIER_1, TIMESTAMP, LABEL_LIST, VALUE); com.google.cloud.bigtable.data.v2.models.Row modelRow = com.google.cloud.bigtable.data.v2.models.Row.create( ROW_KEY, Collections.singletonList(rowCell)); when(client.readModifyWriteRowAsync(request)).thenReturn(listenableResponse); Future<com.google.cloud.bigtable.data.v2.models.Row> output = clientWrapper.readModifyWriteRowAsync(readModify); assertEquals(modelRow, output.get()); verify(client).readModifyWriteRowAsync(request); }