use of com.google.bigtable.v2.BigtableGrpc.BigtableBlockingStub in project grpc-gcp-java by GoogleCloudPlatform.
the class BigtableIntegrationTest method getBigtableBlockingStub.
private BigtableBlockingStub getBigtableBlockingStub() {
GoogleCredentials creds = getCreds();
BigtableBlockingStub stub = BigtableGrpc.newBlockingStub(gcpChannel).withCallCredentials(MoreCallCredentials.from(creds));
return stub;
}
use of com.google.bigtable.v2.BigtableGrpc.BigtableBlockingStub in project grpc-gcp-java by GoogleCloudPlatform.
the class BigtableIntegrationTest method testReadRows.
@Test
public void testReadRows() throws Exception {
BigtableBlockingStub stub = getBigtableBlockingStub();
ReadRowsRequest request = ReadRowsRequest.newBuilder().setTableName(TABLE_NAME).setRows(RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("test-row"))).build();
Iterator<ReadRowsResponse> response = stub.readRows(request);
assertEquals(1, gcpChannel.channelRefs.size());
}
use of com.google.bigtable.v2.BigtableGrpc.BigtableBlockingStub in project grpc-gcp-java by GoogleCloudPlatform.
the class BigtableIntegrationTest method testMutateRowReuse.
@Test
public void testMutateRowReuse() throws Exception {
BigtableBlockingStub stub = getBigtableBlockingStub();
MutateRowRequest request = getMutateRequest("test-mutation", 100, "test-row");
for (int i = 0; i < DEFAULT_MAX_CHANNEL + 1; i++) {
MutateRowResponse response = stub.mutateRow(request);
assertThat(response).isNotEqualTo(null);
assertEquals(1, gcpChannel.channelRefs.size());
}
}
use of com.google.bigtable.v2.BigtableGrpc.BigtableBlockingStub in project grpc-gcp-java by GoogleCloudPlatform.
the class BigtableLoadTest method getReadRowsResponses.
private static List<Iterator<ReadRowsResponse>> getReadRowsResponses(ManagedChannel channel) {
GoogleCredentials creds = getCreds();
BigtableBlockingStub stub = BigtableGrpc.newBlockingStub(channel).withCallCredentials(MoreCallCredentials.from(creds));
List<Iterator<ReadRowsResponse>> res = new ArrayList<>();
ReadRowsRequest request = ReadRowsRequest.newBuilder().setTableName(LARGE_TABLE_NAME).build();
for (int i = 0; i < DEFAULT_MAX_STREAM + 5; i++) {
Iterator<ReadRowsResponse> iter = stub.readRows(request);
res.add(iter);
}
return res;
}
Aggregations