Skip to content

Commit

Permalink
[hotfix] Fix some typos in flink-examples-streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxianghu authored and rmetzger committed Mar 11, 2020
1 parent 81c48e5 commit 5132375
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void cancel() {


/**
* 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
Expand Down Expand Up @@ -142,7 +142,6 @@ private static class SampleAsyncFunction extends RichAsyncFunction<Integer, Stri
@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);

executorService = Executors.newFixedThreadPool(30);
}

Expand Down Expand Up @@ -258,10 +257,10 @@ else if (INGESTION_TIME.equals(timeType)) {
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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static void main(String[] args) throws Exception {

// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ public static DataStream<Tuple3<String, Integer, Integer>> runWindowJoin(
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5132375

Please sign in to comment.