From 525886cf8bee5fbf31983b39550fc45663ac8b8b Mon Sep 17 00:00:00 2001 From: Rahul Kesharwani <42969463+rahulKQL@users.noreply.github.com> Date: Tue, 25 Feb 2020 01:56:58 +0530 Subject: [PATCH] chore: java doc update to for returned data instances (#165) * chore: java doc update to for returned data instances To let the user know about Batcher instance returned from Bulk operations are not threadsafe. * chore: addressing feedback comments Added JavaDocs for `BigtableDataClient`. * Adding comments for BigtableDataClient#readRows() --- .../bigtable/data/v2/BigtableDataClient.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java index 40d9f70cac..e249684244 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java @@ -69,6 +69,9 @@ * an application. However, close() needs to be called on the client object to clean up resources * such as threads during application shutdown. * + *
This client can be safely shared across multiple threads except for the Batcher instances + * returned from bulk operations, eg. `newBulkMutationBatcher()`, `newBulkReadRowsBatcher()`. + * *
The surface of this class includes several types of Java methods for each of the API's
* methods:
*
@@ -651,7 +654,8 @@ public Sample code:
*
@@ -1045,7 +1049,8 @@ public void bulkMutateRows(BulkMutation mutation) {
/**
* Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow,
- * but the entire batch is not executed atomically.
+ * but the entire batch is not executed atomically. The returned Batcher instance is not
+ * threadsafe, it can only be used from single thread.
*
* Sample Code:
*
@@ -1073,7 +1078,8 @@ public Batcher Sample Code:
*
@@ -1107,7 +1113,8 @@ public Batcher Sample Code:
*