From 71dc8e3419fbb49d48bb7a3fd984d24e24661c81 Mon Sep 17 00:00:00 2001 From: Dmitry <58846611+dmitry-fa@users.noreply.github.com> Date: Mon, 14 Sep 2020 16:38:48 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20Add=20documentation=20to=20bulkReadRows?= =?UTF-8?q?=20that=20each=20batch=20will=20process=20t=E2=80=A6=20(#410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Add documentation to bulkReadRows that each batch will process the keys sequentially * fix: Add documentation to bulkReadRows that each batch will process the keys sequentially * fix: Add documentation to bulkReadRows that each batch will process the keys sequentially --- .../admin/v2/BigtableTableAdminClient.java | 2 +- .../bigtable/data/v2/BigtableDataClient.java | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java index 0fffcc54f..5d0350b9c 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java @@ -76,7 +76,7 @@ * // One instance per application. * BigtableTableAdminClient client = BigtableTableAdminClient.create("[PROJECT]", "[INSTANCE]"); * - * CreateTable request = + * CreateTableRequest request = * CreateTableRequest.of("my-table") * .addFamily("cf1") * .addFamily("cf2", GCRULES.maxVersions(10)) 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 e24968424..04e1b1598 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 @@ -57,7 +57,7 @@ * // One instance per application. * BigtableDataClient client = BigtableDataClient.create("[PROJECT]", "[INSTANCE]") * - * for(Row row : client.readRows(Query.create("[TABLE]")) { + * for(Row row : client.readRows(Query.create("[TABLE]"))) { * // Do something with row * } * @@ -1077,9 +1077,13 @@ public Batcher newBulkMutationBatcher(@Nonnull String ta } /** - * Reads rows for given tableId in a batch. If the row does not exist, the value will be null. - * This operation should be called with in a single thread. The returned Batcher instance is not - * threadsafe, it can only be used from single thread. + * Reads rows for given tableId in a batch. If the row does not exist, the value will be null. The + * returned Batcher instance is not threadsafe, it can only be used from a single thread. + * + *

Performance notice: The ReadRows protocol requires that rows are sent in ascending key + * order, which means that the keys are processed sequentially on the server-side, so batching + * allows improving throughput but not latency. Lower latencies can be achieved by sending smaller + * requests concurrently. * *

Sample Code: * @@ -1113,8 +1117,13 @@ public Batcher newBulkReadRowsBatcher(String tableId) { /** * Reads rows for given tableId and filter criteria in a batch. If the row does not exist, the - * value will be null. This operation should be called with in a single thread. The returned - * Batcher instance is not threadsafe, it can only be used from single thread. + * value will be null. The returned Batcher instance is not threadsafe, it can only be used from a + * single thread. + * + *

Performance notice: The ReadRows protocol requires that rows are sent in ascending key + * order, which means that the keys are processed sequentially on the server-side, so batching + * allows improving throughput but not latency. Lower latencies can be achieved by sending smaller + * requests concurrently. * *

Sample Code: *