in grpc-gcp-benchmarks/src/benchmarkTest/java/SpannerTestCases.java [286:311]
void testPartitionQuery() throws InterruptedException {
System.out.println("\nTestPartitionQuery");
ManagedChannel channel = getChannel();
SpannerBlockingStub stub = getBlockingStub(channel);
Session session =
stub.createSession(CreateSessionRequest.newBuilder().setDatabase(database).build());
TransactionOptions options =
TransactionOptions.newBuilder()
.setReadOnly(TransactionOptions.ReadOnly.getDefaultInstance())
.build();
TransactionSelector selector = TransactionSelector.newBuilder().setBegin(options).build();
PartitionQueryRequest request =
PartitionQueryRequest.newBuilder()
.setSession(session.getName())
.setSql("select * FROM " + LARGE_TABLE)
.setTransaction(selector)
.build();
BlockingCall<PartitionQueryRequest, PartitionResponse> blockingCall =
(PartitionQueryRequest req) -> stub.partitionQuery(req);
doTestBlocking(channel, request, blockingCall);
stub.deleteSession(DeleteSessionRequest.newBuilder().setName(session.getName()).build());
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
}