You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by rm...@apache.org on 2020/03/11 19:51:46 UTC

[flink] branch master updated: [hotfix] Fix some typos in flink-examples-streaming

This is an automated email from the ASF dual-hosted git repository.

rmetzger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 5132375  [hotfix] Fix some typos in flink-examples-streaming
5132375 is described below

commit 51323757b6b5e1c7fe3bb7333bf297871ae8890c
Author: wangxianghu <wx...@126.com>
AuthorDate: Thu Feb 13 11:27:46 2020 +0800

    [hotfix] Fix some typos in flink-examples-streaming
---
 .../org/apache/flink/streaming/examples/async/AsyncIOExample.java  | 7 +++----
 .../apache/flink/streaming/examples/iteration/IterateExample.java  | 2 +-
 .../java/org/apache/flink/streaming/examples/join/WindowJoin.java  | 2 --
 .../flink/streaming/examples/sideoutput/SideOutputExample.java     | 2 +-
 .../examples/statemachine/generator/EventsGeneratorSource.java     | 2 +-
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/async/AsyncIOExample.java b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/async/AsyncIOExample.java
index b9f92fe..97de5fc 100644
--- a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/async/AsyncIOExample.java
+++ b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/async/AsyncIOExample.java
@@ -108,7 +108,7 @@ public class AsyncIOExample {
 
 
 	/**
-	 * An sample of {@link AsyncFunction} using a thread pool and executing working threads
+	 * An example of {@link AsyncFunction} using a thread pool and executing working threads
 	 * to simulate multiple async operations.
 	 *
 	 * <p>For the real use case in production environment, the thread pool may stay in the
@@ -142,7 +142,6 @@ public class AsyncIOExample {
 		@Override
 		public void open(Configuration parameters) throws Exception {
 			super.open(parameters);
-
 			executorService = Executors.newFixedThreadPool(30);
 		}
 
@@ -258,10 +257,10 @@ public class AsyncIOExample {
 			env.setStreamTimeCharacteristic(TimeCharacteristic.IngestionTime);
 		}
 
-		// create input stream of an single integer
+		// create input stream of a single integer
 		DataStream<Integer> inputStream = env.addSource(new SimpleSource(maxCount));
 
-		// create async function, which will *wait* for a while to simulate the process of async i/o
+		// create async function, which will "wait" for a while to simulate the process of async i/o
 		AsyncFunction<Integer, String> function =
 				new SampleAsyncFunction(sleepFactor, failRatio, shutdownWaitTS);
 
diff --git a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/iteration/IterateExample.java b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/iteration/IterateExample.java
index 13db58a..ecf57ee 100644
--- a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/iteration/IterateExample.java
+++ b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/iteration/IterateExample.java
@@ -81,7 +81,7 @@ public class IterateExample {
 
 		// create an iterative data stream from the input with 5 second timeout
 		IterativeStream<Tuple5<Integer, Integer, Integer, Integer, Integer>> it = inputStream.map(new InputMap())
-				.iterate(5000);
+				.iterate(5000L);
 
 		// apply the step function to get the next Fibonacci number
 		// increment the counter and split the output with the output selector
diff --git a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/join/WindowJoin.java b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/join/WindowJoin.java
index 01effd1..d2b1794 100644
--- a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/join/WindowJoin.java
+++ b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/join/WindowJoin.java
@@ -85,9 +85,7 @@ public class WindowJoin {
 		return grades.join(salaries)
 				.where(new NameKeySelector())
 				.equalTo(new NameKeySelector())
-
 				.window(TumblingEventTimeWindows.of(Time.milliseconds(windowSize)))
-
 				.apply(new JoinFunction<Tuple2<String, Integer>, Tuple2<String, Integer>, Tuple3<String, Integer, Integer>>() {
 
 					@Override
diff --git a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/sideoutput/SideOutputExample.java b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/sideoutput/SideOutputExample.java
index dca7389..f7fcf55 100644
--- a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/sideoutput/SideOutputExample.java
+++ b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/sideoutput/SideOutputExample.java
@@ -33,7 +33,7 @@ import org.apache.flink.util.Collector;
 import org.apache.flink.util.OutputTag;
 
 /**
- * An example that illustrates the use of side outputs.
+ * An example that illustrates the use of side output.
  *
  * <p>This is a modified version of {@link org.apache.flink.streaming.examples.windowing.WindowWordCount}
  * that has a filter in the tokenizer and only emits some words for counting
diff --git a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/generator/EventsGeneratorSource.java b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/generator/EventsGeneratorSource.java
index 74fa9ed..22f675c 100644
--- a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/generator/EventsGeneratorSource.java
+++ b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/generator/EventsGeneratorSource.java
@@ -38,7 +38,7 @@ public class EventsGeneratorSource extends RichParallelSourceFunction<Event> {
 
 	public EventsGeneratorSource(double errorProbability, int delayPerRecordMillis) {
 		checkArgument(errorProbability >= 0.0 && errorProbability <= 1.0, "error probability must be in [0.0, 1.0]");
-		checkArgument(delayPerRecordMillis >= 0, "deplay must be >= 0");
+		checkArgument(delayPerRecordMillis >= 0, "delay must be >= 0");
 
 		this.errorProbability = errorProbability;
 		this.delayPerRecordMillis = delayPerRecordMillis;