From 57c4987fc285458f30c49e83a2576218915525c9 Mon Sep 17 00:00:00 2001 From: dmitry-fa Date: Tue, 8 Sep 2020 18:25:00 +0300 Subject: [PATCH 1/3] fix: Add documentation to bulkReadRows that each batch will process the keys sequentially --- .../bigtable/admin/v2/BigtableTableAdminClient.java | 2 +- .../cloud/bigtable/data/v2/BigtableDataClient.java | 13 +++++++------ 2 files changed, 8 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 0fffcc54fe..5d0350b9cf 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 e249684244..cdd36e72e7 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,9 @@ 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 + * keys are processed sequentially one by one in the order they are passed to the Batcher. The + * returned Batcher instance is not threadsafe, it can only be used from a single thread. * *

Sample Code: * @@ -1113,8 +1113,9 @@ 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 keys are processed sequentially one by one in the order they are passed + * to the Batcher. The returned Batcher instance is not threadsafe, it can only be used from a + * single thread. * *

Sample Code: * From d06b02a4b1e4183e2609685e78af99807671df0b Mon Sep 17 00:00:00 2001 From: dmitry-fa Date: Wed, 9 Sep 2020 12:37:43 +0300 Subject: [PATCH 2/3] fix: Add documentation to bulkReadRows that each batch will process the keys sequentially --- .../cloud/bigtable/data/v2/BigtableDataClient.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 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 cdd36e72e7..c4d9bdb3bf 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 @@ -1078,9 +1078,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. The - * keys are processed sequentially one by one in the order they are passed to the Batcher. 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. Low latency might be achieved if send smaller + * requests concurrently. + * *

Sample Code: * *

{@code
@@ -1113,10 +1117,14 @@ 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. The keys are processed sequentially one by one in the order they are passed
-   * to the Batcher. The returned Batcher instance is not threadsafe, it can only be used from a
+   * 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. Low latency might be achieved if send smaller + * requests concurrently. + * *

Sample Code: * *

{@code

From 8c9a077c2f3bbe44a5b7e9a9f9fdc47263af6495 Mon Sep 17 00:00:00 2001
From: dmitry-fa 
Date: Mon, 14 Sep 2020 11:59:34 +0300
Subject: [PATCH 3/3] fix: Add documentation to bulkReadRows that each batch
 will process the keys sequentially

---
 .../com/google/cloud/bigtable/data/v2/BigtableDataClient.java | 4 ++--
 1 file changed, 2 insertions(+), 2 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 c4d9bdb3bf..04e1b15987 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
@@ -1082,7 +1082,7 @@ public Batcher newBulkMutationBatcher(@Nonnull String ta
    *
    * 

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. Low latency might be achieved if send smaller + * allows improving throughput but not latency. Lower latencies can be achieved by sending smaller * requests concurrently. * *

Sample Code: @@ -1122,7 +1122,7 @@ public Batcher newBulkReadRowsBatcher(String tableId) { * *

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. Low latency might be achieved if send smaller + * allows improving throughput but not latency. Lower latencies can be achieved by sending smaller * requests concurrently. * *

Sample Code: