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

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

                Author: ASF GitHub Bot
            Created on: 27/Feb/20 01:40
            Start Date: 27/Feb/20 01:40
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on pull request #10897: [BEAM-2939] 
Java UnboundedSource SDF wrapper
URL: https://github.com/apache/beam/pull/10897#discussion_r384867042
 
 

 ##########
 File path: sdks/java/core/src/main/java/org/apache/beam/sdk/io/Read.java
 ##########
 @@ -185,6 +200,37 @@ private Unbounded(@Nullable String name, 
UnboundedSource<T, ?> source) {
     @Override
     public final PCollection<T> expand(PBegin input) {
       source.validate();
+
+      if (ExperimentalOptions.hasExperiment(input.getPipeline().getOptions(), 
"beam_fn_api")
+          && !ExperimentalOptions.hasExperiment(
+              input.getPipeline().getOptions(), 
"beam_fn_api_use_deprecated_read")) {
+        // We don't use Create here since Create is defined as a BoundedSource 
and using it would
+        // cause an infinite expansion loop. We can reconsider this if Create 
is implemented
+        // directly as a SplittableDoFn.
+        PCollection<ValueWithRecordId<T>> outputWithIds =
+            input
+                .getPipeline()
+                .apply(Impulse.create())
+                .apply(
+                    MapElements.into(new TypeDescriptor<UnboundedSource<T, 
CheckpointMark>>() {})
+                        .via(element -> (UnboundedSource<T, CheckpointMark>) 
source))
+                .setCoder(
+                    SerializableCoder.of(
+                        new TypeDescriptor<UnboundedSource<T, 
CheckpointMark>>() {}))
+                .apply(
+                    ParDo.of(
+                        new UnboundedSourceAsSDFWrapperFn<>(
+                            (Coder<CheckpointMark>) 
source.getCheckpointMarkCoder())))
+                .setCoder(ValueWithRecordIdCoder.of(source.getOutputCoder()));
+        if (source.requiresDeduping()) {
+          outputWithIds.apply(
+              Distinct.<ValueWithRecordId<T>, byte[]>withRepresentativeValueFn(
 
 Review comment:
   No it won't, this was for some testing of mine.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 393895)
    Time Spent: 21h 20m  (was: 21h 10m)

> Fn API SDF support
> ------------------
>
>                 Key: BEAM-2939
>                 URL: https://issues.apache.org/jira/browse/BEAM-2939
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model
>            Reporter: Henning Rohde
>            Assignee: Luke Cwik
>            Priority: Major
>              Labels: portability
>          Time Spent: 21h 20m
>  Remaining Estimate: 0h
>
> The Fn API should support streaming SDF. Detailed design TBD.
> Once design is ready, expand subtasks similarly to BEAM-2822.



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

Reply via email to