|
17 | 17 | package com.google.cloud.spanner;
|
18 | 18 |
|
19 | 19 | import com.google.cloud.Timestamp;
|
| 20 | +import com.google.cloud.spanner.Options.RpcPriority; |
20 | 21 | import com.google.cloud.spanner.Options.TransactionOption;
|
21 | 22 | import com.google.cloud.spanner.Options.UpdateOption;
|
22 | 23 |
|
@@ -75,9 +76,21 @@ public interface DatabaseClient {
|
75 | 76 | * .set("LastName")
|
76 | 77 | * .to("Joel")
|
77 | 78 | * .build();
|
78 |
| -* dbClient.writeWithOptions(Collections.singletonList(mutation)); |
| 79 | +* dbClient.writeWithOptions( |
| 80 | +* Collections.singletonList(mutation), |
| 81 | +* Options.priority(RpcPriority.HIGH)); |
79 | 82 | * }</pre>
|
80 | 83 | *
|
| 84 | +* Options for a transaction can include: |
| 85 | +* |
| 86 | +* <ul> |
| 87 | +* <li>{@link Options#priority(com.google.cloud.spanner.Options.RpcPriority)}: The {@link |
| 88 | +* RpcPriority} to use for the commit request of the transaction. The priority will not be |
| 89 | +* applied to any other requests on the transaction. |
| 90 | +* <li>{@link Options#commitStats()}: Request that the server includes commit statistics in the |
| 91 | +* {@link CommitResponse}. |
| 92 | +* </ul> |
| 93 | +* |
81 | 94 | * @return a response with the timestamp at which the write was committed
|
82 | 95 | */
|
83 | 96 | CommitResponse writeWithOptions(Iterable<Mutation> mutations, TransactionOption... options)
|
@@ -138,9 +151,21 @@ CommitResponse writeWithOptions(Iterable<Mutation> mutations, TransactionOption.
|
138 | 151 | * .set("LastName")
|
139 | 152 | * .to("Joel")
|
140 | 153 | * .build();
|
141 |
| -* dbClient.writeAtLeastOnce(Collections.singletonList(mutation)); |
| 154 | +* dbClient.writeAtLeastOnceWithOptions( |
| 155 | +* Collections.singletonList(mutation), |
| 156 | +* Options.priority(RpcPriority.LOW)); |
142 | 157 | * }</pre>
|
143 | 158 | *
|
| 159 | +* Options for a transaction can include: |
| 160 | +* |
| 161 | +* <ul> |
| 162 | +* <li>{@link Options#priority(com.google.cloud.spanner.Options.RpcPriority)}: The {@link |
| 163 | +* RpcPriority} to use for the commit request of the transaction. The priority will not be |
| 164 | +* applied to any other requests on the transaction. |
| 165 | +* <li>{@link Options#commitStats()}: Request that the server includes commit statistics in the |
| 166 | +* {@link CommitResponse}. |
| 167 | +* </ul> |
| 168 | +* |
144 | 169 | * @return a response with the timestamp at which the write was committed
|
145 | 170 | */
|
146 | 171 | CommitResponse writeAtLeastOnceWithOptions(
|
@@ -308,6 +333,16 @@ CommitResponse writeAtLeastOnceWithOptions(
|
308 | 333 | * }
|
309 | 334 | * });
|
310 | 335 | * </code></pre>
|
| 336 | +* |
| 337 | +* Options for a transaction can include: |
| 338 | +* |
| 339 | +* <ul> |
| 340 | +* <li>{@link Options#priority(com.google.cloud.spanner.Options.RpcPriority)}: The {@link |
| 341 | +* RpcPriority} to use for the commit request of the transaction. The priority will not be |
| 342 | +* applied to any other requests on the transaction. |
| 343 | +* <li>{@link Options#commitStats()}: Request that the server includes commit statistics in the |
| 344 | +* {@link CommitResponse}. |
| 345 | +* </ul> |
311 | 346 | */
|
312 | 347 | TransactionRunner readWriteTransaction(TransactionOption... options);
|
313 | 348 |
|
@@ -338,6 +373,16 @@ CommitResponse writeAtLeastOnceWithOptions(
|
338 | 373 | * }
|
339 | 374 | * }
|
340 | 375 | * }</pre>
|
| 376 | +* |
| 377 | +* Options for a transaction can include: |
| 378 | +* |
| 379 | +* <ul> |
| 380 | +* <li>{@link Options#priority(com.google.cloud.spanner.Options.RpcPriority)}: The {@link |
| 381 | +* RpcPriority} to use for the commit request of the transaction. The priority will not be |
| 382 | +* applied to any other requests on the transaction. |
| 383 | +* <li>{@link Options#commitStats()}: Request that the server includes commit statistics in the |
| 384 | +* {@link CommitResponse}. |
| 385 | +* </ul> |
341 | 386 | */
|
342 | 387 | TransactionManager transactionManager(TransactionOption... options);
|
343 | 388 |
|
@@ -371,6 +416,16 @@ CommitResponse writeAtLeastOnceWithOptions(
|
371 | 416 | * },
|
372 | 417 | * executor);
|
373 | 418 | * </code></pre>
|
| 419 | +* |
| 420 | +* Options for a transaction can include: |
| 421 | +* |
| 422 | +* <ul> |
| 423 | +* <li>{@link Options#priority(com.google.cloud.spanner.Options.RpcPriority)}: The {@link |
| 424 | +* RpcPriority} to use for the commit request of the transaction. The priority will not be |
| 425 | +* applied to any other requests on the transaction. |
| 426 | +* <li>{@link Options#commitStats()}: Request that the server includes commit statistics in the |
| 427 | +* {@link CommitResponse}. |
| 428 | +* </ul> |
374 | 429 | */
|
375 | 430 | AsyncRunner runAsync(TransactionOption... options);
|
376 | 431 |
|
@@ -459,6 +514,18 @@ CommitResponse writeAtLeastOnceWithOptions(
|
459 | 514 | * }
|
460 | 515 | * }
|
461 | 516 | * }</pre>
|
| 517 | +* |
| 518 | +* Options for a transaction can include: |
| 519 | +* |
| 520 | +* <p>Options for a transaction can include: |
| 521 | +* |
| 522 | +* <ul> |
| 523 | +* <li>{@link Options#priority(com.google.cloud.spanner.Options.RpcPriority)}: The {@link |
| 524 | +* RpcPriority} to use for the commit request of the transaction. The priority will not be |
| 525 | +* applied to any other requests on the transaction. |
| 526 | +* <li>{@link Options#commitStats()}: Request that the server includes commit statistics in the |
| 527 | +* {@link CommitResponse}. |
| 528 | +* </ul> |
462 | 529 | */
|
463 | 530 | AsyncTransactionManager transactionManagerAsync(TransactionOption... options);
|
464 | 531 |
|
|
0 commit comments