You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/03 16:11:33 UTC

[GitHub] [beam] kennknowles opened a new issue, #18049: Update Read PTransform to implicitly use maxNumRecords and maxReadTime

kennknowles opened a new issue, #18049:
URL: https://github.com/apache/beam/issues/18049

   Today, almost all IOs `Read` `PTransform`, when using an `UnboundedSource`, do the following in the `apply()`:
   ```
   
         org.apache.beam.sdk.io.Read.Unbounded<byte[]> unbounded =
             org.apache.beam.sdk.io.Read.from(getSource());
   
   
        PTransform<PBegin, PCollection<byte[]>> transform = unbounded;
   
         if (maxNumRecords() < Long.MAX_VALUE
   || maxReadTime() != null) {
           transform = unbounded.withMaxReadTime(maxReadTime()).withMaxNumRecords(maxNumRecords());
   
        }
   
         return input.getPipeline().apply(transform);
   
   ```
   
   To avoid to duplicate this code bunch of time, it would make sense to do it by default in `org.apache.beam.sdk.io.Read`.
   
   Imported from Jira [BEAM-671](https://issues.apache.org/jira/browse/BEAM-671). Original Jira may contain additional context.
   Reported by: jbonofre.


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org