Flink的Graph有4层:Stream Graph - Job Graph - Execution Graph - 物理执行图
如图所示,Stream Graph中主要包含了:StreamNode 和 StreamEdge
实例代码:
// get input data by connecting to the socket
DataStream<String> source = env.socketTextStream(hostname, port, "\n").name("source");
// parse the data, group it, window it, and aggregate the counts
source.flatMap(
new FlatMapFunction<String, WordWithCount>() {
@Override
public void flatMap(
String value, Collector<WordWithCount> out) {
for (String word : value.split("\\s")) {
out.collect(new W