[
https://issues.apache.org/jira/browse/BEAM-2898?focusedWorklogId=80942&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80942
]
ASF GitHub Bot logged work on BEAM-2898:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Mar/18 19:01
Start Date: 15/Mar/18 19:01
Worklog Time Spent: 10m
Work Description: tgroh 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_r174895596
##########
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:
extend PipelineVisitor.Defaults, and get rid of `enterPipeline`,
`visitValue`, and `leave*`
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 80942)
Time Spent: 2h 50m (was: 2h 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: 2h 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)