[ https://issues.apache.org/jira/browse/BEAM-2898?focusedWorklogId=86825&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-86825 ]
ASF GitHub Bot logged work on BEAM-2898: ---------------------------------------- Author: ASF GitHub Bot Created on: 02/Apr/18 22:44 Start Date: 02/Apr/18 22:44 Worklog Time Spent: 10m Work Description: bsidhom commented on a change in pull request #4783: [BEAM-2898] Support Impulse transforms in Flink batch runner URL: https://github.com/apache/beam/pull/4783#discussion_r178669947 ########## File path: runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/JavaReadViaImpulseTest.java ########## @@ -89,14 +96,50 @@ public void testSplitSourceFn() { public void testReadFromSourceFn() { BoundedSource<Long> source = CountingSource.upTo(10L); PCollection<BoundedSource<Long>> sourcePC = - (PCollection) - p.apply(Create.of(source).withCoder(SerializableCoder.of((Class) BoundedSource.class))); - PCollection<Long> elems = sourcePC.apply(ParDo.of(new ReadFromBoundedSourceFn<>())); + p.apply(Create.of(source) + .withCoder(new JavaReadViaImpulse.BoundedSourceCoder<>())); + PCollection<Long> elems = sourcePC.apply(ParDo.of(new ReadFromBoundedSourceFn<>())) + .setCoder(VarLongCoder.of()); PAssert.that(elems).containsInAnyOrder(0L, 9L, 8L, 1L, 2L, 7L, 6L, 3L, 4L, 5L); p.run(); } + @Test + @Category(NeedsRunner.class) + public void testReadToImpulseOverride() { + BoundedSource<Long> source = CountingSource.upTo(10L); + // Use an explicit read transform to ensure the override is exercised. + PCollection<Long> input = p.apply(Read.from(source)); + PAssert.that(input).containsInAnyOrder(0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L); + p.replaceAll(Collections.singletonList(JavaReadViaImpulse.boundedOverride())); + p.traverseTopologically(new Pipeline.PipelineVisitor() { Review comment: This is actually already in master and was just one of the dependent changes. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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: 86825) Time Spent: 3h 50m (was: 3h 40m) > Flink supports chaining/fusion of single-SDK stages > --------------------------------------------------- > > Key: BEAM-2898 > URL: https://issues.apache.org/jira/browse/BEAM-2898 > Project: Beam > Issue Type: Sub-task > Components: runner-flink > Reporter: Henning Rohde > Priority: Major > Labels: portability > Time Spent: 3h 50m > Remaining Estimate: 0h > > The Fn API supports fused stages, which avoids unnecessarily round-tripping > the data over the Fn API between stages. The Flink runner should use that > capability for better performance. -- This message was sent by Atlassian JIRA (v7.6.3#76005)