@Test public void testMutateRowAsync() throws Exception { RowMutation rowMutation = RowMutation.create(TABLE_ID, "key"); MutateRowRequest request = rowMutation.toProto(REQUEST_CONTEXT); ListenableFuture<MutateRowResponse> response = Futures.immediateFuture(MutateRowResponse.getDefaultInstance()); when(delegate.mutateRowAsync(request)).thenReturn(response); dataClientWrapper.mutateRowAsync(rowMutation).get(); verify(delegate).mutateRowAsync(request); }
@Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt( response, new Function<MutateRowResponse, Void>() { @Nullable @Override public Void apply(@Nullable MutateRowResponse mutateRowResponse) { return null; } }); }
DataClientClassicApi implements DataClientWrapper { @Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt( response, new Function<MutateRowResponse, Void>() { @Nullable @Override public Void apply(@Nullable MutateRowResponse mutateRowResponse) { return null; } }); } }
DataClientClassicApi implements DataClientWrapper { @Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt( response, new Function<MutateRowResponse, Void>() { @Nullable @Override public Void apply(@Nullable MutateRowResponse mutateRowResponse) { return null; } }); } DataClientClassicApi(BigtableSession session, RequestContext requestContext); }
DataClientClassicApi implements DataClientWrapper { @Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt( response, new Function<MutateRowResponse, Void>() { @Nullable @Override public Void apply(@Nullable MutateRowResponse mutateRowResponse) { return null; } }); } DataClientClassicApi(BigtableSession session, RequestContext requestContext); @Override BulkMutationWrapper createBulkMutation(String tableId); @Override BulkReadWrapper createBulkRead(String tableId); @Override ApiFuture<Void> mutateRowAsync(RowMutation rowMutation); @Override ApiFuture<Result> readModifyWriteRowAsync(ReadModifyWriteRow readModifyWriteRow); @Override ApiFuture<Boolean> checkAndMutateRowAsync(ConditionalRowMutation conditionalRowMutation); @Override ApiFuture<List<KeyOffset>> sampleRowKeysAsync(String tableId); @Override ApiFuture<Result> readRowAsync(String tableId, ByteString rowKey, Filters.Filter filter); @Override org.apache.hadoop.hbase.client.ResultScanner readRows(Query request); @Override ApiFuture<List<Result>> readRowsAsync(Query request); @Override void readRowsAsync(Query request, final StreamObserver<Result> observer); @Override void close(); }
DataClientClassicApi implements DataClientWrapper { @Override public ApiFuture<Void> mutateRowAsync(RowMutation rowMutation) { ListenableFuture<MutateRowResponse> response = delegate.mutateRowAsync(rowMutation.toProto(requestContext)); return ApiFutureUtil.transformAndAdapt( response, new Function<MutateRowResponse, Void>() { @Nullable @Override public Void apply(@Nullable MutateRowResponse mutateRowResponse) { return null; } }); } DataClientClassicApi(BigtableSession session, RequestContext requestContext); @Override BulkMutationWrapper createBulkMutation(String tableId); @Override BulkReadWrapper createBulkRead(String tableId); @Override ApiFuture<Void> mutateRowAsync(RowMutation rowMutation); @Override ApiFuture<Result> readModifyWriteRowAsync(ReadModifyWriteRow readModifyWriteRow); @Override ApiFuture<Boolean> checkAndMutateRowAsync(ConditionalRowMutation conditionalRowMutation); @Override ApiFuture<List<KeyOffset>> sampleRowKeysAsync(String tableId); @Override ApiFuture<Result> readRowAsync(String tableId, ByteString rowKey, Filters.Filter filter); @Override org.apache.hadoop.hbase.client.ResultScanner readRows(Query request); @Override ApiFuture<List<Result>> readRowsAsync(Query request); @Override void readRowsAsync(Query request, final StreamObserver<Result> observer); @Override void close();  }