From 72bc1ab8c38f68f319f20e2834dac800a19d27d8 Mon Sep 17 00:00:00 2001 From: Rahul Kesharwani Date: Wed, 22 Jan 2020 03:11:55 +0530 Subject: [PATCH 1/4] chore:add javadoc about being called within single thread --- gax/src/main/java/com/google/api/gax/batching/Batcher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gax/src/main/java/com/google/api/gax/batching/Batcher.java b/gax/src/main/java/com/google/api/gax/batching/Batcher.java index 58aa863e5..dbf35b78e 100644 --- a/gax/src/main/java/com/google/api/gax/batching/Batcher.java +++ b/gax/src/main/java/com/google/api/gax/batching/Batcher.java @@ -38,6 +38,8 @@ * when triggered by an internal threshold. This is intended to be used for high throughput * scenarios at the cost of latency. * + *

This interface can only be used from a single thread. + * * @param The type of each individual element to be batched. * @param The type of the result for each individual element. */ From 57d61f1e619081c295182e23b3f5899b3d4766c1 Mon Sep 17 00:00:00 2001 From: Rahul Kesharwani Date: Wed, 22 Jan 2020 03:17:58 +0530 Subject: [PATCH 2/4] rephrased the words --- gax/src/main/java/com/google/api/gax/batching/Batcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gax/src/main/java/com/google/api/gax/batching/Batcher.java b/gax/src/main/java/com/google/api/gax/batching/Batcher.java index dbf35b78e..8a89565c5 100644 --- a/gax/src/main/java/com/google/api/gax/batching/Batcher.java +++ b/gax/src/main/java/com/google/api/gax/batching/Batcher.java @@ -38,7 +38,7 @@ * when triggered by an internal threshold. This is intended to be used for high throughput * scenarios at the cost of latency. * - *

This interface can only be used from a single thread. + *

This instance can only be used from a single thread. * * @param The type of each individual element to be batched. * @param The type of the result for each individual element. From 19dac7c83a3bcf027dfa1fa75c093f742c1aa42a Mon Sep 17 00:00:00 2001 From: Rahul Kesharwani Date: Wed, 22 Jan 2020 12:41:36 +0530 Subject: [PATCH 3/4] Updated with feedback comment --- gax/src/main/java/com/google/api/gax/batching/Batcher.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gax/src/main/java/com/google/api/gax/batching/Batcher.java b/gax/src/main/java/com/google/api/gax/batching/Batcher.java index 8a89565c5..2d7239153 100644 --- a/gax/src/main/java/com/google/api/gax/batching/Batcher.java +++ b/gax/src/main/java/com/google/api/gax/batching/Batcher.java @@ -38,12 +38,13 @@ * when triggered by an internal threshold. This is intended to be used for high throughput * scenarios at the cost of latency. * - *

This instance can only be used from a single thread. + *

Batcher instances are not thread safe. To use across different threads, create a new Batcher + * instance per thread. * * @param The type of each individual element to be batched. * @param The type of the result for each individual element. */ -@BetaApi("The surface for batching is not stable yet and may change in the future.") +@BetaApi("The surface for batching is not stable yet and may change in the future.") public interface Batcher extends AutoCloseable { /** From 386bdfc1f48fc31e83830fcee31bdb278f866bf2 Mon Sep 17 00:00:00 2001 From: Rahul Kesharwani Date: Sat, 1 Feb 2020 03:08:08 +0530 Subject: [PATCH 4/4] removed extra whitespace --- gax/src/main/java/com/google/api/gax/batching/Batcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gax/src/main/java/com/google/api/gax/batching/Batcher.java b/gax/src/main/java/com/google/api/gax/batching/Batcher.java index 2d7239153..f8d136650 100644 --- a/gax/src/main/java/com/google/api/gax/batching/Batcher.java +++ b/gax/src/main/java/com/google/api/gax/batching/Batcher.java @@ -44,7 +44,7 @@ * @param The type of each individual element to be batched. * @param The type of the result for each individual element. */ -@BetaApi("The surface for batching is not stable yet and may change in the future.") +@BetaApi("The surface for batching is not stable yet and may change in the future.") public interface Batcher extends AutoCloseable { /**