// 执行计划
// println(env.getExecutionPlan)
// StreamGraph
// println(env.getStreamGraph.getStreamingPlanAsJSON)
mvn archetype : generate \
- DarchetypeGroupId = org . apache . flink \
- DarchetypeArtifactId = flink - quickstart - java \
- DarchetypeVersion = 1.7.1
- DgroupId = com . opensourceteams \
- DartifactId = flink - maven - java \
- Dversion = 0.0.1 \
- Dpackage = com . opensourceteams . module . bigdata . flink \
- DinteractiveMode = false
mvn archetype : generate \
- DarchetypeGroupId = org . apache . flink \
- DarchetypeArtifactId = flink - quickstart - scala \
- DarchetypeVersion = 1.7.1
- DgroupId = com . opensourceteams \
- DartifactId = flink - maven - scala - 2 \
- Dversion = 0.0.1 \
- Dpackage = com . opensourceteams . module . bigdata . flink \
- DinteractiveMode = false
mvn exec : java - Dexec . mainClass = wikiedits . WikipediaAnalysis
flink run - c com . opensourceteams . module . bigdata . flink . example . stream . worldcount . nc . SocketWindowWordCount . / flink - maven - scala - 2 - 0.0.1 . jar
scala 版Flink WordCount单词统计
{ " nodes " :[{ " id " : 1 , " type " : " Source: Socket Stream " , " pact " : " Data Source " , " contents " : " Source: Socket Stream " , " parallelism " : 1 },{ " id " : 2 , " type " : " Flat Map " , " pact " : " Operator " , " contents " : " Flat Map " , " parallelism " : 1 , " predecessors " :[{ " id " : 1 , " ship_strategy " : " FORWARD " , " side " : " second " }] },{ " id " : 3 , " type " : " Map " , " pact " : " Operator " , " contents " : " Map " , " parallelism " : 1 , " predecessors " :[{ " id " : 2 , " ship_strategy " : " FORWARD " , " side " : " second " }] },{ " id " : 5 , " type " : " Window(TumblingProcessingTimeWindows(3000), ProcessingTimeTrigger, SumAggregator, PassThroughWindowFunction) " , " pact " : " Operator " , " contents " : " Window(TumblingProcessingTimeWindows(3000), ProcessingTimeTrigger, SumAggregator, PassThroughWindowFunction) " , " parallelism " : 1 , " predecessors " :[{ " id " : 3 , " ship_strategy " : " HASH " , " side " : " second " }] },{ " id " : 6 , " type " : " Sink: Print to Std. Out " , " pact " : " Data Sink " , " contents " : " Sink: Print to Std. Out " , " parallelism " : 1 , " predecessors " :[{ " id " : 5 , " ship_strategy " : " FORWARD " , " side " : " second " }] }] }
{ " nodes " :[{ " id " : 1 , " type " : " Source: Socket Stream " , " pact " : " Data Source " , " contents " : " Source: Socket Stream " , " parallelism " : 1 },{ " id " : 2 , " type " : " Flat Map " , " pact " : " Operator " , " contents " : " Flat Map " , " parallelism " : 1 , " predecessors " :[{ " id " : 1 , " ship_strategy " : " FORWARD " , " side " : " second " }] },{ " id " : 3 , " type " : " Map " , " pact " : " Operator " , " contents " : " Map " , " parallelism " : 1 , " predecessors " :[{ " id " : 2 , " ship_strategy " : " FORWARD " , " side " : " second " }] },{ " id " : 5 , " type " : " Window(TumblingProcessingTimeWindows(3000), ProcessingTimeTrigger, SumAggregator, PassThroughWindowFunction) " , " pact " : " Operator " , " contents " : " Window(TumblingProcessingTimeWindows(3000), ProcessingTimeTrigger, SumAggregator, PassThroughWindowFunction) " , " parallelism " : 1 , " predecessors " :[{ " id " : 3 , " ship_strategy " : " HASH " , " side " : " second " }] },{ " id " : 6 , " type " : " Sink: Print to Std. Out " , " pact " : " Data Sink " , " contents " : " Sink: Print to Std. Out " , " parallelism " : 1 , " predecessors " :[{ " id " : 5 , " ship_strategy " : " FORWARD " , " side " : " second " }] }] }