Skip to content

Commit 525886c

Browse files
authored
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()
1 parent 0485db2 commit 525886c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
* an application. However, close() needs to be called on the client object to clean up resources
7070
* such as threads during application shutdown.
7171
*
72+
* <p>This client can be safely shared across multiple threads except for the Batcher instances
73+
* returned from bulk operations, eg. `newBulkMutationBatcher()`, `newBulkReadRowsBatcher()`.
74+
*
7275
* <p>The surface of this class includes several types of Java methods for each of the API's
7376
* methods:
7477
*
@@ -651,7 +654,8 @@ public <RowT> UnaryCallable<Query, RowT> readRowCallable(RowAdapter<RowT> rowAda
651654
}
652655

653656
/**
654-
* Convenience method for synchronously streaming the results of a {@link Query}.
657+
* Convenience method for synchronously streaming the results of a {@link Query}. The returned
658+
* ServerStream instance is not threadsafe, it can only be used from single thread.
655659
*
656660
* <p>Sample code:
657661
*
@@ -1045,7 +1049,8 @@ public void bulkMutateRows(BulkMutation mutation) {
10451049

10461050
/**
10471051
* Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow,
1048-
* but the entire batch is not executed atomically.
1052+
* but the entire batch is not executed atomically. The returned Batcher instance is not
1053+
* threadsafe, it can only be used from single thread.
10491054
*
10501055
* <p>Sample Code:
10511056
*
@@ -1073,7 +1078,8 @@ public Batcher<RowMutationEntry, Void> newBulkMutationBatcher(@Nonnull String ta
10731078

10741079
/**
10751080
* Reads rows for given tableId in a batch. If the row does not exist, the value will be null.
1076-
* This operation should be called with in a single thread.
1081+
* This operation should be called with in a single thread. The returned Batcher instance is not
1082+
* threadsafe, it can only be used from single thread.
10771083
*
10781084
* <p>Sample Code:
10791085
*
@@ -1107,7 +1113,8 @@ public Batcher<ByteString, Row> newBulkReadRowsBatcher(String tableId) {
11071113

11081114
/**
11091115
* Reads rows for given tableId and filter criteria in a batch. If the row does not exist, the
1110-
* value will be null. This operation should be called with in a single thread.
1116+
* value will be null. This operation should be called with in a single thread. The returned
1117+
* Batcher instance is not threadsafe, it can only be used from single thread.
11111118
*
11121119
* <p>Sample Code:
11131120
*

0 commit comments

Comments
 (0)