1.需求
/**
* 需求:每两个元素输出一次
*/
2.代码
package com.nx.streaming.lesson03;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
/**
* 需求:每两个元素输出一次
*/
public class TestOperatorStateMain {
public static void main(String[] args) throws Exception{
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
DataStreamSource<Tuple2<String, Integer>> dataStreamSource =
env.fromElements(
Tuple2.of("Spark", 3),
Tuple2.of("Flink", 5),