@@ -319,15 +319,39 @@ Session createSession(
319
319
ApiFuture <Empty > asyncDeleteSession (String sessionName , @ Nullable Map <Option , ?> options )
320
320
throws SpannerException ;
321
321
322
+ /**
323
+ * Performs a streaming read.
324
+ *
325
+ * @param routeToLeader Set to true to route the request to the leader region, and false to route
326
+ * the request to any region. When leader aware routing is enabled, RW/PDML requests are
327
+ * preferred to be routed to the leader region, and RO requests (except for
328
+ * PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
329
+ */
322
330
StreamingCall read (
323
331
ReadRequest request ,
324
332
ResultStreamConsumer consumer ,
325
333
@ Nullable Map <Option , ?> options ,
326
334
boolean routeToLeader );
327
335
336
+ /**
337
+ * Executes a query.
338
+ *
339
+ * @param routeToLeader Set to true to route the request to the leader region, and false to route
340
+ * the request to any region. When leader aware routing is enabled, RW/PDML requests are
341
+ * preferred to be routed to the leader region, and RO requests (except for
342
+ * PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
343
+ */
328
344
ResultSet executeQuery (
329
345
ExecuteSqlRequest request , @ Nullable Map <Option , ?> options , boolean routeToLeader );
330
346
347
+ /**
348
+ * Executes a query asynchronously.
349
+ *
350
+ * @param routeToLeader Set to true to route the request to the leader region, and false to route
351
+ * the request to any region. When leader aware routing is enabled, RW/PDML requests are
352
+ * preferred to be routed to the leader region, and RO requests (except for
353
+ * PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
354
+ */
331
355
ApiFuture <ResultSet > executeQueryAsync (
332
356
ExecuteSqlRequest request , @ Nullable Map <Option , ?> options , boolean routeToLeader );
333
357
@@ -338,6 +362,14 @@ ApiFuture<ResultSet> executeQueryAsync(
338
362
ServerStream <PartialResultSet > executeStreamingPartitionedDml (
339
363
ExecuteSqlRequest request , @ Nullable Map <Option , ?> options , Duration timeout );
340
364
365
+ /**
366
+ * Executes a query with streaming result.
367
+ *
368
+ * @param routeToLeader Set to true to route the request to the leader region, and false to route
369
+ * the request to any region. When leader aware routing is enabled, RW/PDML requests are
370
+ * preferred to be routed to the leader region, and RO requests (except for
371
+ * PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
372
+ */
341
373
StreamingCall executeQuery (
342
374
ExecuteSqlRequest request ,
343
375
ResultStreamConsumer consumer ,
@@ -349,10 +381,26 @@ StreamingCall executeQuery(
349
381
ApiFuture <ExecuteBatchDmlResponse > executeBatchDmlAsync (
350
382
ExecuteBatchDmlRequest build , Map <Option , ?> options );
351
383
384
+ /**
385
+ * Begins a transaction.
386
+ *
387
+ * @param routeToLeader Set to true to route the request to the leader region, and false to route
388
+ * the request to any region. When leader aware routing is enabled, RW/PDML requests are
389
+ * preferred to be routed to the leader region, and RO requests (except for
390
+ * PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
391
+ */
352
392
Transaction beginTransaction (
353
393
BeginTransactionRequest request , @ Nullable Map <Option , ?> options , boolean routeToLeader )
354
394
throws SpannerException ;
355
395
396
+ /**
397
+ * Begins a transaction asynchronously.
398
+ *
399
+ * @param routeToLeader Set to true to route the request to the leader region, and false to route
400
+ * the request to any region. When leader aware routing is enabled, RW/PDML requests are
401
+ * preferred to be routed to the leader region, and RO requests (except for
402
+ * PartitionRead/PartitionQuery) are preferred to be routed to any region for optimal latency.
403
+ */
356
404
ApiFuture <Transaction > beginTransactionAsync (
357
405
BeginTransactionRequest request , @ Nullable Map <Option , ?> options , boolean routeToLeader );
358
406
0 commit comments