Flink Streaming Source Code Trace Introduction
Flink Official Streaming Example
- 參考Flink Local Setup Tutorial可以將SocketWindowWordCount示例運行起來
Flink Bash Script
- 根據Flink bash script最後一行1exec $JAVA_RUN $JVM_ARGS "${log_setting[@]}" -classpath "`manglePathList "$CC_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`" org.apache.flink.client.cli.CliFrontend "$@"
當執行Flink bash script時,會使用Java(及為$JAVA_RUN)調用org.apache.flink.client.cli.CliFrontend,並將使用者的輸入(及為$@)傳遞給前者,示例中的使用者輸入為run examples/streaming/SocketWindowWordCount.jar –port 9000
SocketWindowWordCount.jar
Anatomy of a Flink Program中提到,每個Flink程式都包含幾個相同的基礎部分
- Obtain an execution environment
- Load/create the initial data
- Specify transformations on this data
- Specify where to put the results of your computations
- Trigger the program execution
SocketWindowWordCount.java @org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java 示例中便很好的體現的這幾個部分