[ 
https://issues.apache.org/jira/browse/BEAM-10137?focusedWorklogId=463179&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-463179
 ]

ASF GitHub Bot logged work on BEAM-10137:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Jul/20 00:38
            Start Date: 25/Jul/20 00:38
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on a change in pull request 
#12297:
URL: https://github.com/apache/beam/pull/12297#discussion_r460341068



##########
File path: 
sdks/java/io/kinesis/src/main/java/org/apache/beam/sdk/io/kinesis/KinesisIO.java
##########
@@ -305,6 +306,10 @@ public static Read read() {
         .build();
   }
 
+  public static ReadData readData(Read read) {
+    return new ReadData(read);
+  }
+

Review comment:
       I think this is an atypical API for an IO. If we add something like 
`readData` to `KinesisIO` (instead of just hiding it in the 
ExternalTransformBuilder) it would be preferable to make Read generic and have 
two methods like this:
   
   ```java
   public static Read<KinesisRecord> read() {
     return new Read<KinesisRecord>();
   }
   
   public static Read<byte[]> readData() {
     return new Read<byte[]>((record) -> record.getDataAsBytes());
   }
   ```
   
   That way they can both be configured in the same way:
   ```
   PCollection<KinesisRecord> records = 
p.apply(KinesisIO.read().withStreamName("streamName").with...)
   PCollection<byte[]> data = 
p.apply(KinesisIO.readData().withStreamName("streamName").with...)
   ```
   
   This is what PubsubIO does:
   
https://github.com/apache/beam/blob/ecedd3e654352f1b51ab2caae0fd4665403bd0eb/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java#L439-L444
   
https://github.com/apache/beam/blob/ecedd3e654352f1b51ab2caae0fd4665403bd0eb/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java#L464-L469
   




----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 463179)
    Time Spent: 2.5h  (was: 2h 20m)

> Add cross-language wrapper for Java's KinesisIO Read
> ----------------------------------------------------
>
>                 Key: BEAM-10137
>                 URL: https://issues.apache.org/jira/browse/BEAM-10137
>             Project: Beam
>          Issue Type: Sub-task
>          Components: cross-language, io-java-kinesis, io-py-aws
>    Affects Versions: Not applicable
>            Reporter: Piotr Szuberski
>            Assignee: Piotr Szuberski
>            Priority: P2
>              Labels: portability
>             Fix For: Not applicable
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> Add cross-language wrapper for Java's KinesisIO Read



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to