tysonjh commented on a change in pull request #11331:
URL: https://github.com/apache/beam/pull/11331#discussion_r433316842



##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/AnnotateImages.java
##########
@@ -58,24 +58,24 @@
   protected final PCollectionView<Map<T, ImageContext>> contextSideInput;
   protected final List<Feature> featureList;
   private final long batchSize;
-  protected final int numKeys;
+  protected final int desiredRequestParallelism;
 
   /**
    * @param contextSideInput Side input optionally containting a map of 
elements to {@link
    *     ImageContext} objects with metadata for the analysis.
    * @param featureList list of features to be extracted from the image.
    * @param batchSize desired size of request batches sent to Cloud Vision 
API. At least 1, at most
    *     16.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.

Review comment:
       ```suggestion
      * @param desiredRequestParallelism desired number of concurrent batched 
requests.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -54,15 +55,34 @@
    *     can
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.

Review comment:
       ```suggestion
      * @param desiredRequestParallelism desired number of concurrent batched 
requests.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/AnnotateImages.java
##########
@@ -86,10 +86,10 @@ public AnnotateImages(
    * @param featureList list of features to be extracted from the image.
    * @param batchSize desired size of request batches sent to Cloud Vision 
API. At least 1, at most
    *     16.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.

Review comment:
       ```suggestion
      * @param desiredRequestParallelism desired number of concurrent batched 
requests.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -54,15 +55,34 @@
    *     can
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.
    * @return the PTransform.
    */
   public static AnnotateImagesFromGcsUri annotateImagesFromGcsUri(
       PCollectionView<Map<String, ImageContext>> contextSideInput,
       List<Feature> features,
       long batchSize,
-      int numKeys) {
-    return new AnnotateImagesFromGcsUri(contextSideInput, features, batchSize, 
numKeys);
+      int desiredRequestParallelism) {
+    return new AnnotateImagesFromGcsUri(
+        contextSideInput, features, batchSize, desiredRequestParallelism);
+  }
+
+  /**
+   * Creates a {@link org.apache.beam.sdk.transforms.PTransform} that 
annotates images from their
+   * GCS addresses. Uses default parallelism of 5.

Review comment:
       ```suggestion
      * GCS addresses. Uses a default value 5 for desiredRequestParallelism.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -89,12 +126,26 @@ public static AnnotateImagesFromBytes 
annotateImagesFromBytes(
    *
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.

Review comment:
       ```suggestion
      * @param desiredRequestParallelism desired number of concurrent batched 
requests.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -103,12 +154,26 @@ public static AnnotateImagesFromBytesWithContext 
annotateImagesFromBytesWithCont
    *
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.

Review comment:
       ```suggestion
      * @param desiredRequestParallelism desired number of concurrent batched 
requests.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -89,12 +126,26 @@ public static AnnotateImagesFromBytes 
annotateImagesFromBytes(
    *
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.
+   * @return the PTransform.
+   */
+  public static AnnotateImagesFromBytesWithContext 
annotateImagesFromBytesWithContext(
+      List<Feature> features, long batchSize, int desiredRequestParallelism) {
+    return new AnnotateImagesFromBytesWithContext(features, batchSize, 
desiredRequestParallelism);
+  }
+
+  /**
+   * Creates a {@link org.apache.beam.sdk.transforms.PTransform} that 
annotates images from KVs of
+   * their GCS addresses in Strings and {@link ImageContext} for each image. 
Uses default
+   * parallelism of 5.

Review comment:
       ```suggestion
      * their GCS addresses in Strings and {@link ImageContext} for each image. 
Uses a default 
      * value of 5 for desiredRequestParallelism.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -72,15 +92,32 @@ public static AnnotateImagesFromGcsUri 
annotateImagesFromGcsUri(
    * @param contextSideInput optional side input with contexts for select 
images.
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.
    * @return the PTransform.
    */
   public static AnnotateImagesFromBytes annotateImagesFromBytes(
       PCollectionView<Map<ByteString, ImageContext>> contextSideInput,
       List<Feature> features,
       long batchSize,
-      int numKeys) {
-    return new AnnotateImagesFromBytes(contextSideInput, features, batchSize, 
numKeys);
+      int desiredRequestParallelism) {
+    return new AnnotateImagesFromBytes(
+        contextSideInput, features, batchSize, desiredRequestParallelism);
+  }
+
+  /**
+   * Creates a {@link org.apache.beam.sdk.transforms.PTransform} that 
annotates images from their
+   * contents encoded in {@link ByteString}s. Uses default parallelism of 5.

Review comment:
       ```suggestion
      * contents encoded in {@link ByteString}s. Uses a default value 5 for 
desiredRequestParallelism.
   ```

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -54,15 +55,34 @@
    *     can
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.
    * @return the PTransform.
    */
   public static AnnotateImagesFromGcsUri annotateImagesFromGcsUri(
       PCollectionView<Map<String, ImageContext>> contextSideInput,
       List<Feature> features,
       long batchSize,
-      int numKeys) {
-    return new AnnotateImagesFromGcsUri(contextSideInput, features, batchSize, 
numKeys);
+      int desiredRequestParallelism) {
+    return new AnnotateImagesFromGcsUri(
+        contextSideInput, features, batchSize, desiredRequestParallelism);
+  }
+
+  /**
+   * Creates a {@link org.apache.beam.sdk.transforms.PTransform} that 
annotates images from their
+   * GCS addresses. Uses default parallelism of 5.
+   *
+   * @param contextSideInput optional side input with contexts for select 
images. The {@link
+   *     ImageContext} objects provide additional metadata for the annotation 
API. This way users
+   *     can

Review comment:
       This comment is incomplete... 'This way users can' ....

##########
File path: 
sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/CloudVision.java
##########
@@ -72,15 +92,32 @@ public static AnnotateImagesFromGcsUri 
annotateImagesFromGcsUri(
    * @param contextSideInput optional side input with contexts for select 
images.
    * @param features annotation features that should be passed to the API
    * @param batchSize request batch size to be sent to API. Max 16, at least 1.
-   * @param numKeys number of keys to map the requests into for batching.
+   * @param desiredRequestParallelism number of keys to map the requests into 
for batching.

Review comment:
       ```suggestion
      * @param desiredRequestParallelism desired number of concurrent batched 
requests.
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to