Class WordCount
java.lang.Object
org.apache.flink.streaming.examples.wordcount.WordCount
Implements the "WordCount" program that computes a simple word occurrence histogram over text
files. This Job can be executed in both streaming and batch execution modes.
The input is a [list of] plain text file[s] with lines separated by a newline character.
Usage:
--input <path>A list of input files and / or directories to read. If no input is provided, the program is run with default data fromWordCountData.--discovery-interval <duration>Turns the file reader into a continuous source that will monitor the provided input directories every interval and read any new files.--output <path>The output directory where the Job will write the results. If no output path is provided, the Job will print the results tostdout.--execution-mode <mode>The execution mode (BATCH, STREAMING, or AUTOMATIC) of this pipeline.--async-stateWhether enable async state.
This example shows how to:
- Write a simple Flink DataStream program
- Use tuple data types
- Write and use a user-defined function
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImplements the string tokenizer that splits sentences into words as a user-defined FlatMapFunction. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
WordCount
public WordCount()
-
-
Method Details
-
main
- Throws:
Exception
-