@Test public void testReadModifyWriteWithOneCell() { ReadModifyWriteRow readModify = ReadModifyWriteRow.create(TABLE_ID, "test-key"); ReadModifyWriteRowRequest request = readModify.toProto(REQUEST_CONTEXT); Row expectedRow = buildRow(); ReadModifyWriteRowResponse response = ReadModifyWriteRowResponse.newBuilder().setRow(expectedRow).build(); 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.readModifyWriteRow(request)).thenReturn(response); com.google.cloud.bigtable.data.v2.models.Row actualRow = clientWrapper.readModifyWriteRow(readModify); assertEquals(modelRow, actualRow); verify(client).readModifyWriteRow(request); }
@Override public Row readModifyWriteRow(ReadModifyWriteRow readModifyWriteRow) { ReadModifyWriteRowResponse response = delegate.readModifyWriteRow(readModifyWriteRow.toProto(requestContext)); return new DefaultRowAdapter().createRowFromProto(response.getRow()); }
BigtableDataClientWrapper implements IBigtableDataClient { @Override public Row readModifyWriteRow(ReadModifyWriteRow readModifyWriteRow) { ReadModifyWriteRowResponse response = delegate.readModifyWriteRow(readModifyWriteRow.toProto(requestContext)); return new DefaultRowAdapter().createRowFromProto(response.getRow()); } }
BigtableDataClientWrapper implements IBigtableDataClient { @Override public Row readModifyWriteRow(ReadModifyWriteRow readModifyWriteRow) { ReadModifyWriteRowResponse response = delegate.readModifyWriteRow(readModifyWriteRow.toProto(requestContext)); return new DefaultRowAdapter().createRowFromProto(response.getRow()); } BigtableDataClientWrapper(
      BigtableDataClient bigtableDataClient, RequestContext requestContext); }
BigtableDataClientWrapper implements IBigtableDataClient { @Override public Row readModifyWriteRow(ReadModifyWriteRow readModifyWriteRow) { ReadModifyWriteRowResponse response = delegate.readModifyWriteRow(readModifyWriteRow.toProto(requestContext)); 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); }
BigtableDataClientWrapper implements IBigtableDataClient { @Override public Row readModifyWriteRow(ReadModifyWriteRow readModifyWriteRow) { ReadModifyWriteRowResponse response = delegate.readModifyWriteRow(readModifyWriteRow.toProto(requestContext)); 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);  }