You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2021/04/01 21:03:58 UTC
[beam] branch master updated: fix: variables names in test-stream.md
This is an automated email from the ASF dual-hosted git repository.
pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 37a1b12 fix: variables names in test-stream.md
new 6fc8bbc Merge pull request #14399 from NicholasAzar/patch-1
37a1b12 is described below
commit 37a1b128621a2dc1f0a3755febcf59d394b737b8
Author: Nicholas Azar <Ni...@users.noreply.github.com>
AuthorDate: Wed Mar 31 21:00:41 2021 -0400
fix: variables names in test-stream.md
---
website/www/site/content/en/blog/test-stream.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/website/www/site/content/en/blog/test-stream.md b/website/www/site/content/en/blog/test-stream.md
index c21fb2f..845dcb8 100644
--- a/website/www/site/content/en/blog/test-stream.md
+++ b/website/www/site/content/en/blog/test-stream.md
@@ -126,7 +126,7 @@ watermark and provide the result PCollection as input to the CalculateTeamScores
PTransform:
{{< highlight java >}}
-TestStream<GameActionInfo> infos = TestStream.create(AvroCoder.of(GameActionInfo.class))
+TestStream<GameActionInfo> createEvents = TestStream.create(AvroCoder.of(GameActionInfo.class))
.addElements(new GameActionInfo("sky", "blue", 12, new Instant(0L)),
new GameActionInfo("navy", "blue", 3, new Instant(0L)),
new GameActionInfo("navy", "blue", 3, new Instant(0L).plus(Duration.standardMinutes(3))))
@@ -160,7 +160,7 @@ the system to be on time, as it arrives before the watermark passes the end of
the window
{{< highlight java >}}
-TestStream<GameActionInfo> infos = TestStream.create(AvroCoder.of(GameActionInfo.class))
+TestStream<GameActionInfo> createEvents = TestStream.create(AvroCoder.of(GameActionInfo.class))
.addElements(new GameActionInfo("sky", "blue", 3, new Instant(0L)),
new GameActionInfo("navy", "blue", 3, new Instant(0L).plus(Duration.standardMinutes(3))))
// Move the watermark up to "near" the end of the window
@@ -190,7 +190,7 @@ demonstrate the triggering behavior that causes the system to emit an on-time
pane, and then after the late data arrives, a pane that refines the result.
{{< highlight java >}}
-TestStream<GameActionInfo> infos = TestStream.create(AvroCoder.of(GameActionInfo.class))
+TestStream<GameActionInfo> createEvents = TestStream.create(AvroCoder.of(GameActionInfo.class))
.addElements(new GameActionInfo("sky", "blue", 3, new Instant(0L)),
new GameActionInfo("navy", "blue", 3, new Instant(0L).plus(Duration.standardMinutes(3))))
// Move the watermark up to "near" the end of the window
@@ -224,7 +224,7 @@ configured allowed lateness, we can demonstrate that the late element is dropped
by the system.
{{< highlight java >}}
-TestStream<GameActionInfo> infos = TestStream.create(AvroCoder.of(GameActionInfo.class))
+TestStream<GameActionInfo> createEvents = TestStream.create(AvroCoder.of(GameActionInfo.class))
.addElements(new GameActionInfo("sky", "blue", 3, Duration.ZERO),
new GameActionInfo("navy", "blue", 3, Duration.standardMinutes(3)))
// Move the watermark up to "near" the end of the window
@@ -260,7 +260,7 @@ to an input PCollection, occasionally advancing the processing time clock, and
apply `CalculateUserScores`
{{< highlight java >}}
-TestStream.create(AvroCoder.of(GameActionInfo.class))
+TestStream<GameActionInfo> createEvents = TestStream.create(AvroCoder.of(GameActionInfo.class))
.addElements(new GameActionInfo("scarlet", "red", 3, new Instant(0L)),
new GameActionInfo("scarlet", "red", 2, new Instant(0L).plus(Duration.standardMinutes(1))))
.advanceProcessingTime(Duration.standardMinutes(12))
@@ -270,7 +270,7 @@ TestStream.create(AvroCoder.of(GameActionInfo.class))
.advanceWatermarkToInfinity();
PCollection<KV<String, Integer>> userScores =
- p.apply(infos).apply(new CalculateUserScores(ALLOWED_LATENESS));
+ p.apply(createEvents).apply(new CalculateUserScores(ALLOWED_LATENESS));
{{< /highlight >}}
<img class="center-block" src="/images/blog/test-stream/elements-processing-speculative.png" alt="Elements all arrive before the watermark, and are produced in the on-time pane" width="442">